2018CVPR_Future Frame Prediction for Anomaly Detection – A New Baseline

目录

Abstract

Introduction

3 Future Frame Prediction Based Anomaly Detection Method

3.1. Future Frame Prediction

3.2. The Constraints on Intensity and Gradient

3.3. The Constraint on Motion

3.4. Adversarial Training

3.5. Objective Function

3.6. Anomaly Detection on Testing Data

论文链接:https://arxiv.org/pdf/1712.09867.pdf

代码链接:https://github.com/stevenLiuWen/ano_pred_cvpr2018

Abstract

视频中的异常检测是指识别与预期行为不相符的事件。然而,现有方法都通过最小化训练数据的重构误差来解决问题,这在异常事件检测中并不适用。

本文是第一个利用预测帧和ground truth之间的差别来完成异常事件检测的任务。

为了解决上述问题,除了在intensity和gradient上使用appearance (spatial) 约束,作者在视频预测时,还引入了motion (temporal)约束,即通过光流来约束预测帧和ground truth。

图1.正常和异常事件中的预测帧和ground truth。对于步行区,如果人正常走动,则预测帧会非常清晰;如果是自行车闯入或两人打架,预测帧会模糊不清且带有失真。

Introduction

已有的特征构建方法分类两类:1)基于手工特征。首先,每个视频利用手工特征进行表示,包括外观和运动特征。然后,通过最小重构误差实现正常事件的字典学习。预测帧与异常事件的特征具有较大的重构误差。但是由于字典学习过程中没有使用异常事件训练集,且异常事件过于完整,因此,必不能保证最终的期望。2)基于深度特征。通常使用自编码方法学习深度网络,并通过最小化重构误差来构建正常事件。但是,深度神经网络的容量很高,且不一定会发生针对异常事件的较大重构误差。因此,基于训练集数据重建的方法都不能保证发现异常事件。

论文贡献:1)提出基于预测未来帧的异常事件检测框架。解决思路与异常事件检测的概念一致,即正常事件是可预测的,异常事件是不可预测的。2)对于视频帧预测框架,除了强制预测帧与ground truth在spatial空间一致外,还强制预测帧的光流与ground truth的光流尽量接近。

3 Future Frame Prediction Based Anomaly Detection Method

图2. 视频帧预测网络的流程图。生成器采用U-Net来预测下一帧。为了生成高质量图片,作者采用外观(强度和梯度损失)和运动(光流损失)约束。对于光流的计算,作者采用了预训练网络Flownet。同时,作者使用对抗训练来判别预测的真假。

数学表示:利用给定的连续t帧,来预测第t+1帧,为了使预测的第t+1帧和真实的第t+1帧接近,最小化intensity和gradient的距离。为了保留相邻帧的时序一致性,作者增加了光流约束,即之间的光流应该与之间的光流接近。

3.1. Future Frame Prediction

已有的frame生成或image生成网络通常包含两个模块:1)编码器通过逐渐降低空间分辨率来提取特征;2)解码器通过逐渐增加空间分辨率来恢复帧。然而,这样会导致每层的梯度消失和信息不平衡问题。

为了解决上述问题,U-Net在相同分辨率下的高层和底层增加了shortcut。而作者基于U-Net,并作了简单修改,完成了帧预测任务。

具体来说,在两个卷积层间,保持输出分辨率不变。因此,当增加shortcut时,并不需要crop和resize操作。

3.2. The Constraints on Intensity and Gradient

为了使预测和ground truth接近,借鉴【25】,使用intensity和gradient距离。Intensity损失保证了RGB空间所有像素的相似性,Gradient损失可以使生成的图像更加清晰。

具体来说,在intensity空间中,最小化预测帧和基准图像距离,定义如下:

借鉴【25】,gradient的损失定义如下:

式中,i和j代表视频帧中的空间索引。

3.3. The Constraint on Motion

已有工作【25】只考虑生成的未来帧的intensity和gradient的不同,并不能保证预测帧具有正确的运动。主要原因在于,即便在预测帧中所有像素的intensity发生小的变化,都可能导致光流的很大不同,而光流是运动的一个很好估计指标。尤其对于异常事件而言,运动的一致性对于正常事件的评估是一个非常重要的因素。然而,光流的计算并不容易。作者采用Flownet【8】进行光流的估计。f代表Flownet,光流的损失可以表示为:

f是在合成数据集【8】上预训练的模型,且f的所有参数固定。

3.4. Adversarial Training

基于已有工作【25】的想法,作者使用GAN的变体((Least Square GAN [24])来生成真实帧。对于生成器,预测网络使用U-Net作为预测网络。对于判别器,作者基于【15】,并使用patch判别器,这就意味着判别器的每一个输出标量对应着输入图像的一个patch。具体训练策略如下:

Training D:判别器的目的是将分类为1,将分类为0,其中0和1分别代表伪造标签和真实标签。当训练时,固定的权重。且Mean Square Error(MSE)损失定义如下:

其中,i和j代表空间块的索引,是MSE函数,且定义如下:

其中,取值为{0,1},

:训练的目标是生成帧,且将其分类为1.当训练时,固定的权重。MSE函数定义如下:

3.5. Objective Function

作者将appearance,motion和adversarial training损失结合,且定义如下:

当训练时,损失函数定义如下:

3.6. Anomaly Detection on Testing Data

基于已有工作【25】,使用Peak Signal to Noise Ratio (PSNR)评估生成的图像质量,定义如下:

第t帧的PSNR值越高,也就意味着越像normal帧。

在测试视频中,计算完每一帧的PSNR,基于已有工作【25】,对测试视频中所有帧的PSNR值归一化到【0,1】,并使用如下公式计算每帧的归一化值:

因此,基于s(t)来预测帧是正常还是异常,可以通过设置一个阈值来区别regular和irregular frame。

  • 4
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
Gatys et al. (2016) proposed an algorithm for style transfer, which can generate an image that combines the content of one image and the style of another image. The algorithm is based on the neural style transfer technique, which uses a pre-trained convolutional neural network (CNN) to extract the content and style features from the input images. In this algorithm, the content and style features are extracted from the content and style images respectively using the VGG-19 network. The content features are extracted from the output of one of the convolutional layers in the network, while the style features are extracted from the correlations between the feature maps of different layers. The Gram matrix is used to measure these correlations. The optimization process involves minimizing a loss function that consists of three components: the content loss, the style loss, and the total variation loss. The content loss measures the difference between the content features of the generated image and the content image. The style loss measures the difference between the style features of the generated image and the style image. The total variation loss is used to smooth the image and reduce noise. The optimization is performed using gradient descent, where the gradient of the loss function with respect to the generated image is computed and used to update the image. The process is repeated until the loss function converges. The code for this algorithm is available online, and it is implemented using the TensorFlow library. It involves loading the pre-trained VGG-19 network, extracting the content and style features, computing the loss function, and optimizing the generated image using gradient descent. The code also includes various parameters that can be adjusted, such as the weight of the content and style loss, the number of iterations, and the learning rate.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值