摘要
视频异常事件检测与定位旨在检测视频中发生的异常事件,并锁定其在视频中发生的位置。但是视频场景复杂多样,并且异常发生的位置随机多变,导致发生的异常事件难以被精准定位。本文提出了一种基于卷积自编码器分块学习的视频异常事件检测与定位方法,首先将视频帧进行均匀划分,提取视频帧中每一块的光流和方向梯度直方图(Histogram of oriented gradient, HOG)特征,然后为视频中的不同图块分别设计卷积自编码器以学习正常运动模式特征,最后在异常事件检测过程中利用卷积自编码器的重构误差大小进行异常判断。该方法可以有效地针对视频不同区域进行特征学习,提升了异常事件定位的准确度。所提方法在UCSD Ped1、UCSD Ped2、CUHK Avenue三个公开数据集上进行实验,结果表明该方法能够准确定位异常事件,并且帧级别AUC(Area under the curve)平均提升了5.61%。
视频异常事件检测是计算机视觉的重要应用之一,它可以将潜在的危险事件检测出来,并发出警报,从而提高有关部门和机构的响应效率。目前视频异常事件检测得到了广泛的研究,人们提出了针对各种场景和检测要求的异常事件检测方法,其中的关键问题就是视频前景中运动物体的特征表示。由于视频场景具有多样性,且异常的定义具有主观不确定性,异常事件检测任务存在一定的挑战。例如,为了发现跌倒或打架斗殴等指定异常动作,研究者通常以视频中的行人交互问题为中心,重点提取行人的姿态特征和运动特
异常事件在现实场景中不常发生,因此正常样本的数量远大于异常样本的数量。针对正负样本数量不均的问题,本文采用卷积自编码器进行特征学习,仅用正常视频样本训练模型,无需对训练集和测试集进行重新划分。通过学习正常的行为模式,将与正常运动模式不匹配的情况设定为异常,可检测所有的非正常事件。异常检测的常用方法是将视频帧的特征提取出来之后,直接放入异常检测模型中进行特征学习。而本文考虑到在视频的不同区域,视觉信息和移动物体的运动状态差异较大,首先将视频帧均匀划分成互不重叠的图块,再对每一个图块进行特征提取。让卷积自编码器针对视频不同区域中的特征进行学习,在检测时判断视频某一位置上的图块是否存在异常事件,不仅使模型的学习内容更有针对性,同时能实现异常事件定位。
视频异常事件检测可分为两个部分:视频特征的提取和异常事件检测模型的建立。视频特征提取对于异常事件检测的精确度起到关键作用,常用的特征主要分为手工设计的特征和深度模型提取的特征。Mahadevan
根据不同的建模角度,视频异常事件检测模型可以分为基于传统概率推断的模型和基于深度学习的模型。混合概率主元分析(Mixture of probabilistic principal component analysis, MPPCA)是基于概率推断的一种经典模型,Kim
本文提出的视频异常事件检测与定位方法处理流程如

图1 视频异常事件检测与定位方法处理流程
Fig.1 Pipeline of video anomaly event detection and localization method
在提取运动特征时,将第t个视频帧中某一位置的图块patch(t,i)和第t+1个视频帧中对应位置的图块patch(t+1,i)共同输入到FlowNet2.
对于训练样本和测试样本先进行视频帧的划分和视频帧图块的特征提取;对于某一图块的光流和HOG特征,分别设置一个异常检测卷积自编码器(Anomaly detection convolutional auto⁃encoders,AD⁃ConvAE)进行训练和测试。一个位置图块上的AD⁃ConvAE仅关注该视频位置区域里的人群运动情况,利用分块学习的方式可以更有效地学习局部特征。在训练过程中视频仅包含正常样本,AD⁃ConvAE通过视频帧图块的光流和HOG特征学习某一区域的正常运动模式。在测试时,将测试视频中该区域图块的光流和HOG特征放入AD⁃ConvAE中进行重构,根据光流的重构误差和HOG特征的重构误差计算加权重构误差,若重构误差大,则说明该图块内存在异常事件。
在特征学习的过程中使用卷积自编码器作为特征学习模型,设计的异常检测卷积自编码器AD⁃ConvAE网络结构如

图2 AD-ConvAE的网络结构图
Fig.2 Overview of AD-ConvAE structure
(1) |
式中:x表示重构图像中某一点的像素值,表示输入图像中该点像素值。经
在测试阶段,将第t帧的第(m,n)位置上的视频图块提取出来的光流和HOG特征分别放入已训练完成的AD⁃ConvAE中计算重构误差。重构误差大表示测试样本存在异常,重构误差小表示测试样本正常。根据得到的HOG特征重构误差Loss_hog(m,n,t)和光流重构误差Loss_optical(m,n,t),计算该位置上的总重构误差sumLoss(m,n,t)。第t帧的第(m,n)位置上的总重构误差计算公式为
(2) |
式中:α为HOG特征重构误差的权重,β为光流重构误差的权重,且α+β = 1。
通过设置重构误差阈值θ判断该图像块是否存在异常事件。表示不存在异常事件,表示存在异常事件,判定规则为
(3) |
由于采用视频帧分块的方式,让异常事件检测模型针对视频帧中的某一区域判断是否存在异常,因此在异常事件检测的同时完成了异常事件定位。视频异常事件检测模型的训练过程如
本文在3个公开数据集(UCSD Ped1、UCSD Ped2和CUHK Avenue)上验证算法的有效性。UCSD数据集中包含的异常情况主要为:非行人实体闯入人行道,例如卡车、轮椅、自行车等以及异常的行人运动模式,例如奔跑、玩滑板车、推车等。CUHK Avenue数据集中包含的异常情况有:行人奔跑、行人抛掷物品、行人行走方向错误、出现非行人物体,例如自行车等。本文实验部分使用的数据集中,训练集部分仅包含正常模式,而测试集部分包含正常模式和异常模式。
由于UCSD Ped1和UCSD Ped2两个数据集中的视频帧大小不统一,并且为了方便使用FlowNet2.0进行光流提取,在实验开始时首先对视频帧大小进行调整。在实验中,将UCSD Ped1和UCSD Ped2的视频帧大小统一调整为256像素×192像素,将CUHK Avenue的视频帧大小调整为640像素×384像素。在对视频帧进行均匀分块的步骤中,将UCSD Ped1和UCSD Ped2中的视频帧划分成互不重叠的48个图块,每个图块的大小为32像素×32像素。在CUHK Avenue数据集上,将视频帧划分成60个互不重叠的图块,每个图块的大小为64像素×64像素。
实验中使用的GPU型号为NVIDIA GeForce GTX 1060,在Tensorflow框架下实现。在使用卷积自编码器AD⁃ConvAE进行训练时,根据观察Loss值的下降速度,将迭代次数设置为50次。实验结果使用异常检测任务常用性能评价标准:帧级别AUC(Area under the curve)和等错误率EER(Equal error rate)。
首先对HOG特征的重构误差权重α和光流的重构误差权重β这两个超参数进行调整,

图3 α和β取不同值时的ROC曲线图
Fig.3 ROC curves when α and β take different values
本文所提方法在UCSD Ped1、UCSD Ped2和CUHK Avenue三个公开数据集上,与基于传统手工特征的异常检测方
实验最后将本文提出的异常事件检测与定位方法在3个实验数据集上进行检测结果可视化呈现,在UCSD ped1和UCSD Ped2数据集上的可视化异常事件检测结果如

图4 UCSD Ped1和UCSD Ped2数据集上的可视化异常事件检测结果示例
Fig.4 Visualization of abnormal event detection results on the UCSD Ped1 and UCSD Ped2 datasets

图5 CUHK Avenue数据集上的可视化异常事件检测结果示例
Fig.5 Visualization of visual abnormal event detection results on the CUHK Avenue dataset
本文提出了一种基于卷积自编码器分块学习的视频异常事件检测与定位方法,将视频帧均匀划分成互不重叠的图块,并提取各个图块的光流和HOG特征。利用分块学习的方式,为视频不同位置上的图块分别设计卷积自编码器进行正常模式的特征学习。在异常事件检测时,根据图块中光流和HOG特征的重构误差大小进行异常判断,并实现异常事件定位功能。实验结果表明本文提出的异常事件检测与定位方法优于其他方法,并且可以准确地检测和定位异常事件。
参 考 文 献
Esen E, Arabaci M A, Soysal M. Fight detection in surveillance videos[C]//Proceedings of the 11th International Workshop on Content-Based Multimedia Indexing. Veszprém, Hungary: Institute of Electrical and Electronics Engineers, 2013: 131-135. [百度学术]
Carneiro S A, Silva G P, Guimarães S J F, et al. Fight detection in video sequences based on multi-stream convolutional neural networks[C]//Proceedings of the 32nd SIBGRAPI Conference on Graphics, Patterns and Images. Rio de Janeiro, Brazil: Institute of Electrical and Electronics Engineers, 2019: 8-15. [百度学术]
Pan Huadong, Yin Jun, KU Haohua, et al. Fighting detection based on pedestrian pose estimation[C]//Proceedings of the 11th International Congress on Image and Signal Processing, BioMedical Engineering and Informatics. Beijing, China: Institute of Electrical and Electronics Engineers, 2018: 1-5. [百度学术]
Akti S, Tataroglu G A, Ekenel H K. Vision-based fight detection from surveillance cameras[C]//Proceedings of the Ninth International Conference on Image Processing Theory, Tools and Applications. Istanbul, Turkey: Institute of Electrical and Electronics Engineers, 2019: 1-6. [百度学术]
Mahadevan V, Li Weixin, Bhalodia V, et al. Anomaly detection in crowded scenes[C]//Proceedings of the Conference on Computer Vision and Pattern Recognition. San Francisco, CA, USA: Institute of Electrical and Electronics Engineers, 2010: 1975-1981. [百度学术]
张俊阳, 谢维信, 植柯霖. 基于运动前景效应图特征的人群异常行为检测[J]. 信号处理, 2018, 34 (3): 296-304. [百度学术]
Zhang Junyang, Xie Weixin, Zhi Kelin. Abnormal crowd behavior detection based on motion effect map features of moving foregrounds[J]. Journal of Signal Processing, 2018,34 (3): 296-304. [百度学术]
Cong Yang, Yuan Junsong, Liu Ji. Sparse reconstruction cost for abnormal event detection[C]//Proceedings of the Conference on Computer Vision and Pattern Recognition. Providence, RI, USA: Institute of Electrical and Electronics Engineers, 2011: 3449-3456. [百度学术]
Colque R V H M, Caetano C, Andrade M T L, et al. Histograms of optical flow orientation and magnitude and entropy to detect anomalous events in videos[J]. IEEE Transactions on Circuits and Systems for Video Technology, 2017, 27 (3): 673-682. [百度学术]
Mehran R, Oyama A, Shah M. Abnormal crowd behavior detection using social force model[C]//Proceedings of the Conference on Computer Vision and Pattern Recognition. Miami, Florida, USA: Institute of Electrical and Electronics Engineers, 2009: 935-942. [百度学术]
黄鑫, 肖世德, 宋波. 监控视频中的车辆异常行为检测[J]. 计算机系统应用, 2018, 27(2): 125-131. [百度学术]
Huang Xin, Xiao Shide, Song Bo. Detection of vehicle's abnormal behaviors in surveillance video[J]. Computer Systems & Application, 2018, 27 (2): 125-131. [百度学术]
Xu Dan, Yan Yan, Ricci E, et al. Detecting anomalous events in videos by learning deep representations of appearance and motion[J]. Computer Vision and Image Understanding, 2017, 156: 117-127. [百度学术]
Sabokrou M, Fayyaz M, Fathy M, et al. Deep-anomaly: Fully convolutional neural network for fast anomaly detection in crowded scenes[J]. Computer Vision and Image Understanding, 2018, 172: 88-97. [百度学术]
Narasimhan M G, Sowmya K S. Dynamic video anomaly detection and localization using sparse denoising autoencoders[J]. Multimedia Tools and Applications, 2018, 77 (11): 13173-13195. [百度学术]
Simonyan K, Zisserman A. Two-stream convolutional networks for action recognition in videos[C]//Proceedings of the Annual Conference on Neural Information Processing Systems. Montreal, Quebec, Canada: Institute of Electrical and Electronics Engineers, 2014: 568-576. [百度学术]
Morais R, Le V, Tran T, et al. Learning regularity in skeleton trajectories for anomaly detection in videos[C]//Proceedings of the Conference on Computer Vision and Pattern Recognition. Long Beach, CA, USA: Institute of Electrical and Electronics Engineers, 2019: 11996-12004. [百度学术]
Kim J, Grauman K. Observe locally, infer globally: A space-time MRF for detecting abnormal activities with incremental updates[C]//Proceedings of the Conference on Computer Vision and Pattern Recognition. Miami, Florida, USA: Institute of Electrical and Electronics Engineers, 2009: 2921-2928. [百度学术]
Sabokrou M, Fathy M, Hosseini M, et al. Real-time anomaly detection and localization in crowded scenes[C]//Proceedings of the Conference on Computer Vision and Pattern Recognition. Boston, MA, USA: Institute of Electrical and Electronics Engineers, 2015: 56-62. [百度学术]
Feng Yachuang, Yuan Yuan, Lu Xiaoqiang. Learning deep event models for crowd anomaly detection[J]. Neurocomputing, 2017, 219: 548-556. [百度学术]
Li Nanjun, Chang Faliang. Video anomaly detection and localization via multivariate gaussian fully convolution adversarial autoencoder[J]. Neurocomputing, 2019, 369: 92-105. [百度学术]
Hasan M, Choi J, Neumann J, et al. Learning temporal regularity in video sequences[C]//Proceedings of the Conference on Computer Vision and Pattern Recognition. Las Vegas, NV, USA: Institute of Electrical and Electronics Engineers, 2016: 733-742. [百度学术]
Chong Y S, Tay Y H. Abnormal event detection in videos using spatiotemporal autoencoder[C]//Proceedings of the International Symposium on Neural Networks. Hokkaido, Japan: Springer, Cham, 2017: 189-196. [百度学术]
袁静, 章毓晋. 融合梯度差信息的稀疏去噪自编码网络在异常行为检测中的应用[J]. 自动化学报, 2017, 43 (4): 604-610. [百度学术]
Yuan Jing, Zhang Yujin. Application of sparse denoising auto encoder network with gradient difierence information for abnormal action detection[J]. Acta Automatica Sinica, 2017, 43 (4): 604-610. [百度学术]
Sultani W, Chen Chen, Shah M. Real-world anomaly detection in surveillance videos[C]//Proceedings of the Computer Vision and Pattern Recognition. Salt Lake City, UT, USA: Institute of Electrical and Electronics Engineers, 2018: 6479-6488. [百度学术]
Nawaratne R, Alahakoon D, Silva D S, et al. Spatiotemporal anomaly detection using deep learning for real-time video surveillance[J]. IEEE Transactions on Industrial Informatics, 2020, 16 (1): 393-402. [百度学术]
Ilg E, Mayer N, Saikia T, et al. FlowNet 2.0: Evolution of optical flow estimation with deep networks[C]//Proceedings of the Conference on Computer Vision and Pattern Recognition. Honolulu, HI, USA: Institute of Electrical and Electronics Engineers, 2017: 1647-1655. [百度学术]