A video anomaly detection method based on multi-path attention sequence

Through the multi-path attention timing method, using cyclic residual convolution units and skip attention gates, the problem of insufficient contextual information integration capabilities in the existing technology is solved, and more efficient video anomaly detection performance is achieved, especially in complex scenes. Abnormal event detection in .

CN114973102BActive Publication Date: 2024-09-27HANGZHOU YUANKUN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210692871.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-17
Publication Date
2024-09-27
Estimated Expiration
2042-06-17

AI Technical Summary

Technical Problem

Existing video anomaly detection methods are difficult to effectively detect abnormal events in complex and crowded scenes, and have limited manual features, making it difficult to capture the motion patterns of complex videos. Loop mechanisms are placed in the model between layers, resulting in insufficient contextual information integration capabilities.

Method used

A video anomaly detection method based on multi-path attention timing is adopted, multi-scale feature extraction and timing information modeling are performed through the cyclic residual convolution unit, combined with the jump attention gate to convert the salient low-level feature information into a decoding feature map, and normalization is used The attention coefficient is used to improve regional correlation, and the prediction results are output through regularity scores.

Benefits of technology

It enhances the model's ability to integrate contextual information, can better capture complex features and spatio-temporal information, and improves the performance and accuracy of video anomaly detection, especially the performance on UCSD Ped2, CUHKAvenue and ShanghaiTech data sets is slightly better.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114973102B
    Figure CN114973102B
Patent Text Reader

Abstract

The present invention belongs to the field of computer vision technology, specifically a video anomaly detection method based on multi-path attention timing, including step one, cyclic residual convolution unit; step two, jump attention gate; step three, regularity score. In the present invention, the activity of each RRCU is not only regulated by the activity of its adjacent units, but also can set different time steps according to different networks and tasks. This property enhances the model's ability to integrate contextual information; at the same time, considering that image compression in the encoding stage will cause information loss, the jump attention gate is used to aggregate information from multiple feature scales, which can automatically learn and pay attention to target objects of different shapes and sizes, and better highlight significant local features; as an end-to-end learning framework, the model can capture more normal distribution information using multi-scale spatiotemporal features.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision technology, and in particular to a video anomaly detection method based on multi-path attention timing. Background Art

[0002] The rapid development of artificial intelligence and computer hardware has greatly promoted the development of intelligent surveillance video, but a fundamental challenge it still faces is to automatically detect abnormal events in complex and crowded scenes. Anomaly detection in video refers to the identification of events that do not conform to expected behavior. It plays an important role in discovering various violations and other unusual events. In recent years, many methods for video anomaly detection have been proposed and achieved great success. However, due to the rarity and ambiguity of abnormal events, it remains a challenging problem.

[0003] In addition, an abnormal event in one scene can be regarded as a normal event in another scene. Therefore, solving the temporal context and capturing the dependencies between consecutive video frames have also become one of the difficulties in video anomaly detection. To solve this problem, most of the early work obtained prior knowledge about the context from complex hand-crafted features, but these hand-crafted features have limited representation capabilities and are difficult to capture the motion patterns of complex videos. To alleviate these shortcomings, many deep learning-based methods have been proposed to solve the timing problem and have brought huge performance improvements. For example, Zhou et al. trained a recurrent neural network with features extracted by a patch-based sparse autoencoder; Yong et al. used a combined model of a convolutional autoencoder and long short-term memory to learn spatiotemporal features. However, these models have a common feature that their recurrence mechanism is placed between layers. Summary of the invention

[0004] The purpose of this section is to summarize some aspects of the embodiments of the present invention and briefly introduce some preferred embodiments. Some simplifications or omissions may be made in this section and the specification abstract and the invention title of this application to avoid blurring the purpose of this section, the specification abstract and the invention title, and such simplifications or omissions cannot be used to limit the scope of the present invention.

[0005] In view of the above-mentioned and / or existing problems in computer vision, the present invention is proposed.

[0006] Therefore, the purpose of the present invention is to provide a video anomaly detection method based on multi-path attention timing, which can enhance the model's ability to integrate contextual information.

[0007] To solve the above technical problems, according to one aspect of the present invention, the present invention provides the following technical solutions:

[0008] A video anomaly detection method based on multi-path attention timing, comprising:

[0009] Step 1: The cyclic residual convolution unit inputs the continuous T frames into the encoder in sequence for feature extraction and inputs them into the context module to achieve multi-scale feature extraction and modeling of temporal information;

[0010] Step 2: Jump attention gate. Before compressing information at different scales, the significant low-level feature information is directly converted into a decoded feature map. SAG is used to fuse the structural information of the downsampling layer with the texture information of the current layer through jump connections, and the normalized attention coefficient is used to obtain the highly correlated areas. The gated signal of each jump connection aggregates information from multiple feature scales, which improves the grid resolution of the query signal.

[0011] Step 3: Regularity score: Use the feature map of frame T for skip connection, and finally output a frame as the prediction result of frame T+1, and use the actual frame T+1 as the ground truth to complete the prediction task.

[0012] As a preferred solution of the video anomaly detection method based on multi-path attention timing described in the present invention, wherein: the encoder in the step 1 is mainly constructed by RRCU and convolution blocks of different scales, the key of RRCU is the circular convolution layer, and RRCU contains RCL; RCL is executed according to the time step t represented by RRCU; for the pixel located at (m, n) on the kth feature map in RCL, its net input at the time step t is Calculated by the following formula:

[0013]

[0014] in, and Represent the feedforward input and the input of the lth RCL respectively; and denote the vectorized feedforward weight and the loop weight of the kth RCL, respectively, and b l is the deviation; its expression is:

[0015]

[0016] The final output of RRCU passes through the residual unit. Assume that the output of RRCU is u x+1 , which is calculated as follows:

[0017] u x+1 =u x +F(u x ,w l ) (3)

[0018] Among them, u x Represents the input of RRCU.

[0019] As a preferred solution of the video anomaly detection method based on multi-path attention timing described in the present invention, the output of SAG in step 2 is the element-wise multiplication of the input feature map and the attention coefficient, as shown in the following formula:

[0020]

[0021] Among them, the attention coefficient α i ∈[0,1]. Represents each pixel vector, C x corresponds to the number of feature maps in layer x; i and c represent the spatial dimension and channel dimension respectively; the concatenated feature F x and G is linearly mapped to dimensional space; each pixel i uses a gating vector To determine the salient area; the attention formula is as follows:

[0022]

[0023]

[0024] in, and the bias term b ψ ∈R, are the characteristic parameters of SAG att , and these parameters are calculated by convolution using the input tensor as a 1×1×1 channel;

[0025] SAG parameters can be trained via standard back-propagation updates without using sampling-based update methods. The update rule for the x-1th layer parameters can be expressed as Equation (7).

[0026]

[0027] The first gradient term on the right is scaled by Φ x Represents the kernel parameters of the x-th convolutional layer.

[0028] As a preferred solution of the video anomaly detection method based on multi-path attention timing described in the present invention, wherein: in step 3, according to Mathieu, the peak signal-to-noise ratio (PSNR) of the image quality assessment method is used, as shown in formula (8);

[0029]

[0030] Where N is the number of pixels in the video frame; a higher PSNR value is obtained when the video frame is normal, and vice versa;

[0031] In calculating each prediction frame With the real frame I t After the PSNR of each test video is normalized to the range of [0, 1], the regularity score of each frame is calculated using formula (9):

[0032]

[0033] Therefore, whether a frame is normal or abnormal is predicted according to its score S(t).

[0034] As a preferred solution of the video anomaly detection method based on multi-path attention timing described in the present invention, the recurrent connection in RRCU not only ensures that each unit incorporates context information into an arbitrarily large area of ​​the current layer, but also keeps the number of adjustable parameters unchanged through weight sharing while increasing the network depth; the longer path from input to output of RRCU enables the model to learn more complex features, while the shorter path facilitates the back propagation of gradients during training.

[0035] Compared with the prior art, the present invention has the following beneficial effects:

[0036] The present invention is different from the most popular inter-layer recurrent neural networks such as long short-term memory networks and gated recurrent units. It adopts a novel intra-layer recurrent residual convolutional unit with timing function. The activity of each RRCU is not only regulated by the activity of its adjacent units, but also different time steps can be set according to different networks and tasks. This property enhances the model's ability to integrate contextual information. At the same time, considering that image compression in the encoding stage will cause information loss, the jump attention gate is used to aggregate information from multiple feature scales, which can automatically learn and pay attention to target objects of different shapes and sizes, and better highlight significant local features. As an end-to-end learning framework, the model can capture more normally distributed information by using multi-scale spatiotemporal features. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the present invention will be described in detail below in combination with the accompanying drawings and detailed embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. Among them:

[0038] Figure 1 is a flow chart of the method of the present invention;

[0039] Figure 2 It is the overall framework diagram of the present invention;

[0040] Figure 3 Schematic diagram of the circular convolution layer of the present invention;

[0041] Figure 4 This is the overall framework diagram of the cyclic residual convolution unit of the present invention;

[0042] Figure 5 This is a schematic diagram of jumping attention of the present invention;

[0043] Figure 6 Frame-level ROC curves of different methods on UCSD Ped2, CUHKAvenue and ShanghaiTech datasets of the present invention;

[0044] Figure 7 This is the EER comparison diagram of different methods on the UCSD Ped2, CUHKAvenue and ShanghaiTech datasets of the present invention;

[0045] Figure 8 This is the regularity score graph of videos #03 and #08 in the UCSD Ped2 dataset of the present invention;

[0046] Fig. 9 This is the regularity score graph of videos #05 and #08 in the CHUKAvenue dataset of the present invention;

[0047] Fig.10 This is the regularity score graph of videos #01_0029 and #04_0046 in the ShanghaiTech dataset of the present invention;

[0048] Fig.11 The AUC comparison results of different abnormal behaviors of SAG(wo) and SAG(w) of the present invention on the ShanghaiTech dataset;

[0049] Fig.12 The input video frame RRCU and RRCU+SAG processing effect diagram of the present invention;

[0050] Fig.13 Comparison of network performance AUC (%), running speed (fps) and parameter quantity (M) of the present invention at different time steps (t) on the Ped2 dataset;

[0051] Fig.14 This is the time series trajectory diagram of each individual on the UCSD Ped2, CUHK Avenue and ShanghaiTech datasets of the present invention. DETAILED DESCRIPTION

[0052] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0053] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0054] Secondly, the present invention is described in detail with reference to schematic diagrams. When describing the embodiments of the present invention in detail, for the sake of convenience, the cross-sectional diagrams showing the device structure will not be partially enlarged according to the general scale, and the schematic diagrams are only examples, which should not limit the scope of protection of the present invention. In addition, in actual production, the three-dimensional dimensions of length, width and depth should be included.

[0055] In order to make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.

[0056] The present invention provides a video anomaly detection method based on multi-path attention timing, comprising the following steps:

[0057] (1) Introduction to the test dataset

[0058] The models are trained and tested on three well-known video anomaly detection datasets: UCSD Ped2, CUHKAvenue, and ShanghaiTech. UCSD Ped2 contains 16 training videos and 12 test videos. The training videos only contain normal behaviors, and each test video contains at least one abnormal event. Its test video frames are segmented into 120, 150, and 180 frames with a resolution of 360×240. Abnormal behaviors mainly include non-pedestrian objects driving on the sidewalk. CUHKAvenue contains 16 training videos and 21 test videos, of which there are 15328 frames in the training set and 47 abnormal instances in the test set, with a total of 15324 frames, each with a pixel resolution of 640×360. In the Avenue dataset, 14 events (i.e., walking in the wrong direction, running across the sidewalk, throwing paper, and pushing a bicycle, etc.) are considered abnormal behaviors. It contains 330 training videos (274,515 frames in total) and 107 test videos (42,883 frames in total) with a resolution of 480 × 856. It consists of 13 scenes and various abnormal types (i.e., fighting, running, skating, and cycling, etc.), with 130 abnormal events, and different lighting conditions and camera angles. In all datasets, the training set is used for model learning and determining the network structure, while the test set is only used to evaluate the performance of the trained model.

[0059] (2) Parameter settings

[0060] All input video frames are resized to 256×256, the intensity values ​​are normalized to [-1,1], the batch size is 4, and the Adam optimizer with β1=0.9 and β2=0.999 is used. To facilitate fair comparison with other frame prediction-based methods, the length of the input video frame is set to 4. The initial learning rate of the model is set to 2e-4, and the cosine annealing method is used to decay them. According to a large number of experimental analysis, the encoder is mainly composed of RRCU and convolution blocks of different scales. In addition, all models are trained end-to-end using Pytorch, the model is trained on a single NVIDIATiTan RTX GPU, and the training cycles of the UCSD Ped2, CUHKAvenue, and ShanghaiTech datasets are set to 60, 60, 10.

[0061] (3) Evaluation indicators

[0062] The area under the receiver operating characteristic curve (AUC) and the equal error rate are used as evaluation indicators. The ROC curve is obtained by plotting the relationship between the true positive rate and the false positive rate by changing the threshold of the anomaly score. The AUC value is mainly used to evaluate the robustness and effectiveness of the model. The EER is the point where the curve on the ROC curve intersects the unit square diagonal. Higher AUC and lower EER indicate that the model has better video anomaly detection performance. In order to ensure comparability between different methods, the AUC of frame-level detection is calculated. The AUC can be calculated by FPR as the integral of the TPR value:

[0063]

[0064] Where x represents the value of FPR.

[0065] (3) Model framework and schematic diagram of each module

[0066] The overall framework of the model is shown in the figure Figure 2 As shown, the schematic diagram of the circular convolution layer is as follows Figure 3 As shown in the figure, the overall architecture diagram of the cyclic residual convolution unit is as follows Figure 4 As shown, the schematic diagram of jumping attention is as follows Figure 5 shown.

[0067] (4) Model performance comparison

[0068] Table 1 shows the comparison results of this model and other models on the UCSD Ped2, CUHK Avenue, and ShanghaiTech datasets. The average AUC of the method on the UCSD Ped2, CUHKAvenue, and ShanghaiTech test sets reached 96.48%, 86.05%, and 74.37%, respectively, and achieved better results than the advanced methods on the three public datasets. This is mainly because the method designs a deep neural network that uses RRCU to generate frame predictions, and introduces the SAG module to refine the coarse predictions, which is more conducive to extracting appearance information, so its performance on the three datasets is slightly better. Figure 6 The following figure shows the visualization of typical frame-level ROC curves of our method and different methods on three datasets: UCSD Ped2, CUHK Avenue, and ShanghaiTech. It is obvious from the frame-level evaluation that our method outperforms other methods. Figure 7 The equal error rate (EER) of the method on three datasets: UCSD Ped2, CUHK Avenue and ShanghaiTech is shown. It can be found that the method achieves a lower equal error rate. Figure 8-Figure 10 Figure 1 shows the visualization of anomaly examples of the proposed method on three benchmark datasets. In each sub-graph, the regularity score indicates the possibility of normality. The higher the score, the greater the possibility of normality. The red shaded part of the figure indicates the anomaly in the ground truth. When an anomaly occurs, the regularity score decreases significantly, and when the anomaly disappears, the regularity score increases. This shows that the method is able to detect the occurrence of anomalies.

[0069] Table 1 AUC results of different methods on UCSDPed2, CUHKAvenue and ShanghaiTech datasets

[0070]

[0071] (5) Ablation experiment

[0072] Table 2 shows the results of ablation experiments on three datasets: UCSD Ped2, CUHKAvenue, and ShanghaiTech. After adding SAG, the prediction results of the model are much higher than those before adding it, and the average performance is improved by 2.44%, 1.60%, and 3.50%, respectively, which fully proves the effectiveness of SAG. Fig.11 The comparison results of AUC (%) on three data sets with and without SAG are shown. Fig.11 The comparative results of different types of abnormal behavior detection on the most challenging ShanghaiTech dataset are shown. Fig.12The detection results of some samples on the UCSD Ped2 dataset are given. It can be found that after adding SAG, the method can capture anomalies more easily and the color is brighter. Fig.13 The AUC value, detection speed, and model parameter changes of the network are shown as the RRCU time step changes. It can be found that as the time step increases, the network performance will decline after reaching a certain level, the network running speed will gradually decrease, and the number of model parameters will gradually increase as the time step increases. Fig.14 The temporal data visualization of each individual trajectory is shown. It can be found that the trajectories of objects such as cars are relatively continuous, while the trajectories of pedestrians are relatively discrete. This is mainly because the movement speed of objects such as cars is much greater than that of pedestrians.

[0073] Table 2 Ablation experiment results on three datasets. Anomaly detection performance is reported in the form of AUC (%). Bold numbers indicate the best results.

[0074]

[0075] (6) Operating speed

[0076] Table 3 shows the methods and the average running time of different video anomaly detection methods.

[0077] Table 3 Average running time of different video anomaly detection methods

[0078]

[0079] Although the present invention has been described above with reference to the embodiments, various modifications may be made thereto and parts thereof may be replaced by equivalents without departing from the scope of the present invention. In particular, as long as there is no structural conflict, the various features in the embodiments disclosed in the present invention may be used in combination with each other in any manner, and the fact that these combinations are not exhaustively described in this specification is only for the sake of omitting space and saving resources. Therefore, the present invention is not limited to the specific embodiments disclosed herein, but includes all technical solutions falling within the scope of the claims.

Claims

1. A video anomaly detection method based on multi-path attention timing, characterized in that: The method comprises: Step 1: The cyclic residual convolution unit RRCU inputs the continuous T frames into the encoder in sequence for feature extraction and inputs them into the context module to achieve multi-scale feature extraction and modeling of temporal information; Step 2: Jump attention gate. Before compressing information at different scales, the significant low-level feature information is directly converted into a decoded feature map. SAG is used to fuse the structural information of the downsampling layer with the texture information of the current layer through jump connections, and the normalized attention coefficient is used to obtain the highly correlated areas. The gated signal of each jump connection aggregates information from multiple feature scales, which improves the grid resolution of the query signal. Step 3: Regularity score: Use the feature map of frame T for skip connection, and finally output a frame as the prediction result of frame T+1, and use the actual frame T+1 as the ground truth to complete the prediction task; In step 1, the encoder is constructed by RRCU and convolution blocks of different scales; the key to RRCU is the recurrent convolution layer RCL, which is included in RRCU; RCL is executed according to the time step t indicated by RRCU; for a pixel located at (m, n) on the kth feature map in RCL, its net input at time step t is Calculated by the following formula: in, and Represent the feedforward input and the input of the lth RCL respectively; and denote the vectorized feedforward weight and the loop weight of the kth RCL, respectively, and b l is the deviation; its expression is: The final output of RRCU passes through the residual unit. Assume that the output of RRCU is u x+1 , which is calculated as follows: u x+1 =u x +F(u x ,w l ) (3) Among them, u x Represents the input of RRCU.

2. According to the video anomaly detection method based on multi-path attention timing according to claim 1, it is characterized in that: The output of SAG in step 2 is the element-wise multiplication of the input feature map and the attention coefficient, as shown in the following formula: Among them, the attention coefficient α i ∈[0,1]; Represents each pixel vector, C x corresponds to the number of feature maps in layer x; i and c represent the spatial dimension and channel dimension respectively; the concatenated feature F x and G is linearly mapped to dimensional space; each pixel i uses a gating vector To determine the salient area; the attention formula is as follows: in, and the bias term b ψ ∈R, are the characteristic parameters of SAG att , and these parameters are calculated by convolution using the input tensor as a 1×1×1 channel; SAG parameters can be trained by standard back-propagation updates without using sampling-based update methods. The update rule for the x-1th layer parameters can be expressed as Equation (7): The first gradient term on the right is scaled by Φ x Represents the kernel parameters of the x-th convolutional layer.

3. According to the video anomaly detection method based on multi-path attention timing according to claim 1, it is characterized in that: In step 3, according to Mathieu, the peak signal-to-noise ratio (PSNR) of the image quality assessment method is used, as shown in formula (8); Where N is the number of pixels in the video frame; a higher PSNR value is obtained when the video frame is normal, and vice versa; In calculating each prediction frame With the real frame I t After the PSNR of each test video is normalized to the range of [0, 1], the regularity score of each frame is calculated using formula (9): Therefore, whether a frame is normal or abnormal is predicted according to its score S(t).

4. The video anomaly detection method based on multi-path attention timing according to claim 1 is characterized in that: The recurrent connections in RRCU not only ensure that each unit incorporates contextual information into an arbitrarily large region of the current layer, but also keep the number of adjustable parameters unchanged through weight sharing while increasing the network depth; The longer path from input to output of RRCU allows the model to learn more complex features, while the shorter path facilitates the back-propagation of gradients during training.