Unsupervised abnormal behavior detection method based on background suppression
By constructing an unsupervised abnormal behavior detection network model of background suppression and background suppression constraint modules in intelligent monitoring equipment, the problem of environmental illumination and background information interference is solved, the detection accuracy and robustness are improved, and the need for manual annotation of data is reduced. set of dependencies.
Patent Information
- Application Number
- CN202210252961.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-15
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2042-03-15
AI Technical Summary
Existing intelligent monitoring equipment is susceptible to interference from ambient lighting and background information when detecting abnormal behaviors of passers-by, and supervised learning algorithms rely on manually labeled data sets, resulting in low detection accuracy and weak robustness.
An unsupervised abnormal behavior detection method based on background suppression is adopted. By constructing an abnormal behavior detection network model including a background suppression module and a background suppression constraint module, the spatial encoder, convolutional long short-term memory module and decoder are used for feature extraction and processing. Combined with the context memory module, unsupervised learning methods are used to reduce reliance on manual annotation.
It effectively improves the accuracy and robustness of detection, reduces the impact of background information interference, enhances the detection ability of foreground target information, and overcomes the impact of the accuracy of manually labeled data sets on the detection algorithm.
Smart Images

Figure CN114612936B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of computer vision and relates to an abnormal behavior detection method, and in particular to an unsupervised road monitoring video abnormal behavior detection method based on background suppression. Background Art
[0002] Road monitoring is the most convenient and direct way to observe pedestrian behavior. With the increasing number of traffic accidents caused by pedestrians not using sidewalks according to traffic regulations, there is an urgent need to detect abnormal pedestrian behavior.
[0003] In recent years, with the rapid development of deep learning and open source data sets, intelligent monitoring equipment has also developed accordingly. Abnormal behavior detection is the most widely used function of intelligent monitoring equipment in daily life, which provides reliable security for people's daily work and life. However, in the process of detecting passers-by, the intelligent monitoring equipment with built-in detection algorithms is easily affected by factors such as ambient lighting, background targets, and background similarity features. In addition, if a supervised abnormal behavior detection algorithm is used, the accuracy of the manually labeled data set used will also affect the algorithm, and ultimately inevitably introduce interference, reduce the accuracy of abnormal behavior detection, and weaken the robustness of the algorithm. Therefore, the accuracy of abnormal behavior detection and the robustness of the algorithm are important indicators for evaluating the performance of abnormal behavior detection algorithms.
[0004] Nanjing University of Technology disclosed a method for detecting abnormal behavior based on deep learning in its patent document "A method for detecting abnormal behavior based on deep learning" (patent application number: CN202110611720.1; application publication number: CN113361370A). The method first uses a camera to obtain an RGB image of the actual scene, then uses the YOLOv5 algorithm to detect pedestrians in the current video frame, outputs the location information, confidence and category of the detection frame, and uses the constructed appearance feature network to cascade match the adjacent frame targets to obtain the matched trajectory. Finally, the Kalman prediction method is used to delete, create and track the trajectory results to obtain the final trajectory and match it with the next frame, and this cycle is repeated. The shortcomings of this method are that, first of all, the method does not consider the impact of the background features of the video frame on the algorithm perception, so that the accuracy of the abnormal behavior detection algorithm will be affected under the interference of background information. Secondly, the YOLOv5 algorithm used in this method is a supervised algorithm. When training the YOLOv5 algorithm, the appropriateness of the pedestrian annotation in the manually annotated data set will also affect the accuracy of the detection algorithm.
[0005] Harbin University of Science and Technology proposed a method for detecting violent abnormal behavior in its patent document "A method for detecting violent abnormal behavior based on deep learning" (patent application number: CN202110224967.8; application publication number: CN113191182A). This method first performs frame processing on the video in the data set to obtain video frames, and then stacks multiple continuous frames to form a cube. A three-dimensional convolutional neural network is used in the cube to extract three-dimensional features and perform feature fusion. The YOLO algorithm is used to determine whether there are features of prohibited items such as knives, guns, sticks, and clubs in the extracted features. There are two shortcomings in this method. First, this method does not fully consider the interference of similar background information features on foreground information in actual life scenes. Secondly, the YOLO algorithm used in this method is a supervised algorithm. When training the YOLO algorithm, the accuracy of pedestrian annotation in the manually annotated data set will also affect the accuracy of the detection algorithm. Summary of the invention
[0006] The purpose of the present invention is to address the deficiencies of the above-mentioned prior art and propose an unsupervised abnormal behavior detection method based on background suppression to solve the technical problem of low detection accuracy caused by ignoring the background information of the video being tested and manually dividing the data set in the prior art.
[0007] To achieve the above object, the technical solution adopted by the present invention includes the following steps:
[0008] (1) Obtain training sample set and test sample set:
[0009] (1a) Randomly select M pedestrian surveillance videos and decompose them to obtain a set of M frame sequences. in Indicates that the mth contains K m A frame sequence of image frames, v k express The kth frame image in, M ≥ 200, K m ≥100;
[0010] (1b) From the frame sequence set S v1 Each frame sequence contains The N that only contain pedestrian walking events are filtered out m frame images constitute a normal behavior frame sequence All normal behavior frame sequences contained in the M frame sequences form a training sample set B train , then The remaining P m Frame images form an abnormal behavior frame sequence Then all abnormal behavior frame sequences are combined into a test sample set Btest , where N m ≥P m , P m =K m -N m ;
[0011] (2) Constructing an unsupervised abnormal behavior detection network model H:
[0012] (2a) An unsupervised abnormal behavior detection network model H is constructed, which includes a background suppression module, a prediction module, and a background suppression constraint module connected in sequence. The output end of the background suppression module is also connected to a context memory module; wherein:
[0013] The prediction module includes a spatial encoder, a convolutional long short-term memory module and a decoder connected in sequence. The spatial encoder adopts a feature extraction network including multiple two-dimensional convolutional layers and multiple activation function layers; the convolutional long short-term memory module adopts a memory convolutional neural network including multiple two-dimensional convolutional layers, multiple tensor decomposition layers and multiple activation function layers; the decoder adopts a transposed convolutional neural network including multiple two-dimensional transposed convolutional layers and multiple activation function layers;
[0014] The context memory module includes a motion matching encoder and a memory module connected in sequence, wherein the motion matching encoder adopts a three-dimensional convolutional neural network including multiple three-dimensional convolutional layers, multiple activation function layers, multiple three-dimensional maximum pooling layers and one three-dimensional average pooling layer;
[0015] The output end of the memory module in the context memory module is connected to the input end of the decoder in the prediction module;
[0016] (2b) Define the background suppression loss function L of the background suppression constraint module BGS , background constraint loss function L restrain , minimum square error L2, minimum absolute deviation L1:
[0017]
[0018]
[0019]
[0020] L restrain =L BGS +L2+L1
[0021] Among them, ||·||1 means to find the 1 norm, Binary(·) means the binarization operation, express The prediction results, express The nth frame image;
[0022] (3) Iteratively train the unsupervised abnormal behavior detection network model H:
[0023] (3a) The number of initial iterations is t, the maximum number of iterations is T, T ≥ 80, and the network parameters for feature extraction at the tth iteration are θ G1_t , the memory convolutional neural network parameter is θ G2_t , the transposed convolutional neural network parameters are θ G3_t , the parameters of the three-dimensional convolutional neural network are θ G4_t , and let t = 1;
[0024] (3b) The training sample set B train As the input of the unsupervised abnormal behavior detection network model H, the frame sequence at the tth iteration is obtained The prediction results
[0025] (3b1) Background suppression module for training sample set B train Each normal behavior frame sequence Each normal behavior frame image in Perform background information suppression to obtain M background suppressed frame sequences;
[0026] (3b2) The spatial encoder in the prediction module is a frame sequence after background suppression Each frame image in the image is feature extracted, and the convolutional long short-term memory module is used to extract the features of the image. The feature tensor composed of all the extracted features Decompose it and get Feature information And store, c∈[2,M-1];
[0027] (3b3) Context memory module for frame sequence Each frame image in the other M-1 normal behavior frame sequences except The features of all previous frame images constitute the above information and store it. The features of all subsequent frame images constitute the following information and store;
[0028] (3b4) The decoder in the prediction module uses the feature information obtained in step (3b2) and the above information obtained in step (3b3) And the following information Decode and get the frame sequence at the tth iteration The prediction results
[0029] (3c) Background suppression constraint module for prediction results and normal behavior frame sequence Normal behavior frame image in Perform binarization processing to obtain the prediction result at time t Binarized image The nth normal behavior frame image Binarized image
[0030] (3d) Using the background suppression loss function L BGS ,pass and Calculate H t The background suppression loss value L BGS , and adopt the background constraint loss function L restrain , through L BGS , L2 and L1 calculate H t The background constraint loss value L restrain ;
[0031] (3e) Using the back propagation method, and through L restrain Calculate H t The network parameter gradient is then calculated by stochastic gradient descent through H t The network parameter gradient is proportional to the network parameter θ G1_t ,θ G2_t ,θ G3_t ,θ G4_t Update to obtain the unsupervised abnormal behavior detection network model H for this iteration t ;
[0032] (3f) Determine whether t ≥ T is true. If so, obtain the trained unsupervised abnormal behavior detection network model H * , otherwise let t=t+1, H t =H, and execute step (3b);
[0033] (4) Obtain abnormal behavior detection results:
[0034] (4a) The test sample set B test The cth abnormal behavior frame sequence in As the trained unsupervised abnormal behavior detection network model H * The input is forward propagated to obtain The predicted frame image
[0035] (4b) Use the anomaly score function score and predict the frame image and frame images calculate The anomaly score F is obtained, and it is determined whether F and the preset anomaly score detection threshold I satisfy F≥I. If so, then There is abnormal behavior, otherwise there is no abnormal behavior, where:
[0036]
[0037]
[0038] Compared with the prior art, the present invention has the following advantages:
[0039] First, since the abnormal behavior detection network model constructed by the present invention includes a background suppression module and a background suppression constraint module, in the process of training the model and obtaining detection results, the abnormal behavior detection network model first weakens the static background information with the help of the background suppression module, and then suppresses the dynamic background information with the help of the background suppression constraint module, and finally strengthens the foreground target information, avoiding the false detection defects caused by only considering the foreground information and ignoring the background information in the prior art, and effectively improving the detection accuracy.
[0040] Secondly, since the prediction module contained in the constructed abnormal behavior detection network model adopts a structure of sequentially connecting the spatial encoder, the convolutional long short-term memory module and the decoder, the spatial encoder and the decoder are used to realize unsupervised abnormal behavior detection, thereby overcoming the influence of the accuracy of the manually labeled data set on the supervised learning, so that the present invention has the advantage of strong robustness under different data sets. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 It is an implementation flow chart of the present invention.
[0042] Figure 2 It is a structural schematic diagram of the abnormal behavior detection network model constructed by the present invention. DETAILED DESCRIPTION
[0043] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0044] Reference Figure 1 , the present invention comprises the following steps:
[0045] Step 1) Obtain training sample set and test sample set:
[0046] (1a) Randomly select M pedestrian surveillance videos and decompose them to obtain a set of M frame sequences. in Indicates that the mth contains K m A frame sequence of image frames, v k express The kth frame image in, M ≥ 200, K m ≥100;
[0047] In this example, experiments show that when M=200, the training speed is faster and the detection effect of the model is better.
[0048] (1b) From the frame sequence set S v1 Each frame sequence contains The N that only contain pedestrian walking events are filtered out m frame images constitute a normal behavior frame sequence All normal behavior frame sequences contained in the M frame sequences form a training sample set B train , then The remaining P m Frame images form an abnormal behavior frame sequence Then all abnormal behavior frame sequences are combined into a test sample set B test , where N m ≥P m , P m =K m -N m ;
[0049] In this example, pedestrians walking in the sidewalk surveillance video are defined as normal behavior, and bicycle riding and skateboarding are defined as abnormal behavior.
[0050] Step 2) Construct an unsupervised abnormal behavior detection network model H:
[0051] (2a) constructing an unsupervised abnormal behavior detection network model H of a background suppression module, a prediction module and a background suppression constraint module connected in sequence, wherein the output end of the background suppression module is also connected to a context memory module; wherein the prediction module comprises a spatial encoder, a convolutional long short-term memory module and a decoder connected in sequence, and the spatial encoder adopts a feature extraction network comprising multiple two-dimensional convolutional layers and multiple activation function layers; the convolutional long short-term memory module adopts a memory convolutional neural network comprising multiple two-dimensional convolutional layers, multiple tensor decomposition layers and multiple activation function layers; the decoder adopts a transposed convolutional neural network comprising multiple two-dimensional transposed convolutional layers and multiple activation function layers; the context memory module comprises a motion matching encoder and a memory module connected in sequence, and the output end of the memory module is connected to the input end of the decoder in the video prediction module; wherein the motion matching encoder adopts a three-dimensional convolutional neural network comprising multiple three-dimensional convolutional layers, multiple activation function layers, multiple three-dimensional maximum pooling layers and one three-dimensional average pooling layer;
[0052] The spatial encoder contains 4 two-dimensional convolutional layers and 4 activation function layers. The specific structure of the spatial encoder is: the first two-dimensional convolutional layer → the first activation function layer → the second two-dimensional convolutional layer → the second activation function layer → the third two-dimensional convolutional layer → the third activation function layer → the fourth two-dimensional convolutional layer → the fourth activation function layer; the first two-dimensional convolutional layer has an input channel of 1, an output channel of 64, and a step size of 2; the second two-dimensional convolutional layer has an input channel of 64, an output channel of 64, and a step size of 1; the third two-dimensional convolutional layer has an input channel of 64, an output channel of 128, and a step size of 2; the fourth two-dimensional convolutional layer has an input channel of 128, an output channel of 128, and a step size of 1; the convolution kernel size used in the four two-dimensional convolutional layers is the same, all 3×3; the four activation function layers all use the ELU function;
[0053] Since each frame sequence in this example is obtained after video decomposition, there is a strong correlation between the frame image feature information in the frame sequence. Compared with the prior art that only uses ordinary convolutional neural networks to extract frame image feature information, this example uses a spatial encoder to extract the frame image feature information. By performing feature extraction on each frame image in the image, the extracted feature information can also have a strong correlation, and the feature information can obtain a better decoding effect when being decoded in the decoder.
[0054] The convolutional long short-term memory module includes 2 two-dimensional convolutional layers and 2 tensor decomposition layers, and 3 activation function layers. The specific structure is: the first two-dimensional convolutional layer → the second two-dimensional convolutional layer → the first tensor decomposition layer → the second tensor decomposition layer → the first activation function layer → the second activation function layer → the third activation function layer; the first two-dimensional convolutional layer and the second two-dimensional convolutional layer are the same, with 128 input channels and 128 output channels; the three activation function layers all use sigmoid functions;
[0055] The decoder includes 4 two-dimensional transposed convolutional layers and 3 activation function layers, and its specific structure is: the first two-dimensional transposed convolutional layer → the first activation function layer → the second two-dimensional transposed convolutional layer → the second activation function layer → the third two-dimensional transposed convolutional layer → the third activation function layer → the fourth two-dimensional transposed convolutional layer; the first two-dimensional transposed convolutional layer has an input channel of 256, an output channel of 128, and a step size of 1; the second two-dimensional transposed convolutional layer has an input channel of 128, an output channel of 64, and a step size of 2; the third two-dimensional transposed convolutional layer has an input channel of 64, an output channel of 64, and a step size of 1; the fourth two-dimensional transposed convolutional layer has an input channel of 64, an output channel of 1, and a step size of 1; the convolution kernels used in the four two-dimensional transposed convolutional layers are of the same size of 3×3, and the three activation function layers all use the ELU function;
[0056] The motion matching encoder includes 6 three-dimensional convolutional layers and 6 activation function layers, 4 three-dimensional maximum pooling layers, and 1 three-dimensional average pooling layer. The specific structure is: first three-dimensional convolutional layer→first activation function layer→first three-dimensional maximum pooling layer→second three-dimensional convolutional layer→second activation function layer→second three-dimensional maximum pooling layer→third three-dimensional convolutional layer→third activation function layer→fourth three-dimensional convolutional layer→fourth activation function layer→third three-dimensional maximum pooling layer→fifth three-dimensional convolutional layer→fifth activation function layer→sixth three-dimensional convolutional layer→sixth activation function layer→fourth three-dimensional maximum pooling layer→average three-dimensional pooling layer; the first three-dimensional convolutional layer has an input channel of 1 and an output channel of 64; the second three-dimensional convolutional layer has an input channel of 64 and an output channel of 128; the third The input channel of the three-dimensional convolution layer is 128, and the output channel is 256; the input channel of the fourth three-dimensional convolution layer is 256, and the output channel is 256; the input channel of the fifth three-dimensional convolution layer is 256, and the output channel is 512; the input channel of the sixth three-dimensional convolution layer is 512, and the output channel is 512; the step size is the same, all of which are 1; the convolution kernel size used by the 6 three-dimensional convolution layers is the same, all of which are 3×3×3; the pooling kernel size of the first three-dimensional maximum pooling layer is 1×2×2, and the step size is 1×2×2; the pooling kernel size of the second three-dimensional maximum pooling layer, the pooling kernel of the third three-dimensional maximum pooling layer, and the pooling kernel size of the fourth three-dimensional maximum pooling layer is the same, all of which are 2×2×2, and the step size is 2×2×2; the convolution kernel size of the average three-dimensional pooling layer is 1×2×2; the 6 activation function layers all use the ReLU function;
[0057] (2b) Define the background suppression loss function L of the background suppression constraint module BGS , background constraint loss function L restrain , minimum square error L2, minimum absolute deviation L1:
[0058]
[0059]
[0060]
[0061] L restrain =L BGS +L2+L1
[0062] Among them, ||·||1 means to find the 1 norm, Binary(·) means the binarization operation, express The prediction results, express The nth frame image;
[0063] In this example, if the background constraint loss function L restrainOnly the minimum square error L2 and the background suppression loss function L are used BGS Calculate the loss of the unsupervised abnormal behavior detection network model, although the prediction results can be guaranteed and normal behavior frame images pixel similarity, but it is also easy to make the prediction result Blurred, so to reduce To achieve the blurring effect, the minimum absolute value deviation L1 is also added to the background constraint loss function L restrain Compute the loss of the unsupervised anomaly detection network model.
[0064] Step 3) Iteratively train the unsupervised abnormal behavior detection network model H:
[0065] (3a) The number of initial iterations is t, the maximum number of iterations is T, T ≥ 80, and the network parameters for feature extraction at the tth iteration are θ G1_t , the memory convolutional neural network parameter is θ G2_t , the transposed convolutional neural network parameters are θ G3_t , the parameters of the three-dimensional convolutional neural network are θ G4_t , and let t = 1;
[0066] In this example, experiments show that when the maximum number of iterations is T = 100, the trained unsupervised abnormal behavior detection network model has the best detection effect;
[0067] (3b) The training sample set B train As the input of the unsupervised abnormal behavior detection network model H, the frame sequence at the tth iteration is obtained The prediction results
[0068] (3b1) Background suppression module for training sample set B train Each normal behavior frame sequence Each normal behavior frame image in Background information is suppressed, and all frame images after background information suppression are combined into a frame image sequence. The implementation steps are as follows:
[0069] The background suppression module is used to train the sample set B train Each normal behavior frame sequence Each normal behavior frame image in Perform gamma correction to adjust the illumination of the frame image, and then Perform Gaussian filtering to remove noise in the frame image, and then perform Gaussian filtering on the frame image Perform Laplace sharpening to suppress background information and obtain a frame image with background information suppressed
[0070] (3b2) The spatial encoder in the prediction module is a frame sequence after background suppression Each frame image in the image is feature extracted, and the convolutional long short-term memory module is used to extract the features of the image. The feature tensor composed of all the extracted features Decompose it and get Feature information And store, c∈[2,M-1], the process is as follows:
[0071] The spatial encoder uses the convolutional layer and activation function layer in the feature extraction network to transform the frame sequence. Each frame of the image is extracted and stacked to obtain the feature tensor The convolutional long short-term memory module uses convolutional layers, tensor decomposition layers, and activation function layers to Decompose and obtain feature information
[0072] (3b3) Context memory module for frame sequence Each frame image in the other M-1 normal behavior frame sequences except The features of all previous frame images constitute the above information and store it. The features of all subsequent frame images constitute the following information And store, the process is as follows:
[0073] Frame Sequence In addition, each frame image in all frame sequences is feature extracted and encoded with the help of a three-dimensional convolutional neural network. All previous frame sequences The characteristics of the above information And store, frame sequence All subsequent frame sequences The characteristics of and store.
[0074] (3b4) The decoder in the prediction module uses the feature information obtained in step (3b2) and the above information obtained in step (3b3) And the following information Decode and get the frame sequence at the tth iteration The prediction results The process is as follows:
[0075] The decoder uses the transposed convolutional neural network to transform the above information Information below and frame sequence Feature information The tensor composed is transposed and decoded to obtain the frame sequence at the tth iteration The prediction results
[0076] In this example, the decoder in the prediction module also uses the frame sequence extracted by the spatial encoder The feature information of the frame sequence and the motion matching encoder are used to decode the feature information obtained by feature extraction of other frame sequences, making the prediction results more diverse and the model more intelligent.
[0077] (3c) Background suppression constraint module for prediction results and normal behavior frame sequence Normal behavior frame image in Perform binarization processing to obtain the prediction result at time t Binarized image The nth normal behavior frame image Binarized image Prediction results and normal behavior frame sequence Normal behavior frame image in In the background suppression constraint module, binarization processing is performed to change all non-zero pixel values in the frame image to 1.
[0078] Since the foreground and background targets are moving continuously in the video, the pixel values are also changing continuously. Therefore, when the moving target passes through a certain area, the pixel value of that area will change. In the process of feature extraction, the algorithm will also extract the fluctuation of pixel values as potential features, which will cause false detection.
[0079] In this example, the binarization process converts the normal behavior frame image and prediction results All non-0 pixel values in the image are changed to 1, and then the difference frame between the two is used to eliminate the problem of non-0 pixel values in the area where the moving target passes due to target motion, thereby suppressing dynamic background information and improving the accuracy of detection.
[0080] (3d) Using the background suppression loss function L BGS ,pass and Calculate H t The background suppression loss value L BGS , and adopt the background constraint loss function L restrain , through L BGS , L2 and L1 calculate H t The background constraint loss value L restrain ;
[0081] (3e) Using the back propagation method, and through L restrain Calculate H t The network parameter gradient is then calculated by stochastic gradient descent through H t The network parameter gradient is proportional to the network parameter θ G1_t ,θ G2_t ,θ G3_t ,θ G4_t Update to obtain the unsupervised abnormal behavior detection network model H for this iteration t ;
[0082] (3f) Determine whether t ≥ T is true. If so, obtain the trained unsupervised abnormal behavior detection network model H * , otherwise let t=t+1, H t =H, and execute step (3b);
[0083] The stochastic gradient descent algorithm uses H t The network parameter gradient is H t The feature extraction network parameters θ G1_t , memory convolutional neural network parameters θ G2_t , transposed convolutional neural network parameters θ G3_t , 3D convolutional neural network parameters θ G4_t Update, the update formula is:
[0084]
[0085]
[0086] m t =β1·v t-1 +(1-β1)·g t
[0087]
[0088]
[0089]
[0090] Where: g t is the gradient at iteration number t, are the feature extraction network parameters θ G1_t , memory convolutional neural network parameters θ G2_t , transposed convolutional neural network parameters θ G3_t , 3D convolutional neural network parameters θ G4_t After updating the parameters, {f ti (θ)|i=1,2,3,4} is the parameter θ Gi_tThe objective function of , β1, β2 are the exponential decay rates of the first-order moment and the second-order moment, respectively, {m ti |i=1,2,3,4} is H t The first-order moment estimate of the network parameter gradient, {v ti |i=1,2,3,4} is the pair H t The second-order moment estimate of the network parameter gradient, For {m ti |i=1,2,3,4} correction, β i The t power, For {v ti |i=1,2,3,4}, {α i |i=1,2,3,4} is the learning rate, {ε i |i=1,2,3,4} are constants added to maintain numerical stability.
[0091] (3f) Determine whether t ≥ T is true. If so, obtain the trained unsupervised abnormal behavior detection network model H * , otherwise let t=t+1, H t =H, and execute step (3b);
[0092] Step 4) Obtain abnormal behavior detection results:
[0093] (4a) The test sample set B test The cth abnormal behavior frame sequence in As the trained unsupervised abnormal behavior detection network model H * The input is forward propagated to obtain The predicted frame image
[0094] (4b) Use the anomaly score function score and predict the frame image and frame images calculate The anomaly score F is obtained, and it is determined whether F and the preset anomaly score detection threshold I satisfy F≥I. If so, then There is abnormal behavior, otherwise there is no abnormal behavior, where:
[0095]
[0096]
[0097] The effect of the present invention is further described below in conjunction with experiments:
[0098] 1. Experimental conditions:
[0099] The hardware platform of the experiment of the present invention is: 2 NVIDIA GeForce GTX 2080Ti GPUs.
[0100] The software platform of the experiment of the present invention is: Ubuntu 16 operating system, Pytorch 1.7 framework, Python 3.8.
[0101] The dataset used in the experiment is the ShanghaiTech dataset, which contains 437 videos, each with different lighting conditions and camera angles.
[0102] 2. Experimental content and results analysis:
[0103] (1) Evaluation indicators
[0104] The main evaluation indicator in the field of abnormal behavior detection in video surveillance is the area under the receiver operating characteristic (ROC) curve (AUC). ROC uses the false positive rate as the horizontal axis and the true positive rate as the vertical axis. The false positive rate refers to the probability of predicting a positive sample among all negative samples, and the true positive rate refers to the probability of predicting a positive sample among all positive samples. The closer the ROC is to the upper left corner, the larger the AUC value, and the better the performance of the algorithm model. For abnormal behavior detection tasks, the AUC value is calculated based on the image-level anomaly score.
[0105] (3) Experimental results and analysis
[0106] This experiment is mainly to verify the advantages of the present invention and other existing abnormal behavior detection methods in detection accuracy. This experiment uses a variety of abnormal behavior detection methods to train and test on the ShanghaiTech dataset, and finally obtains the evaluation index AUC on this dataset.
[0107] Table 1 Experimental results of different algorithms on the ShanghaiTech dataset
[0108] method AUC Conv-AE 60.9% StackedRNN 68% Liu et al. 72.8% VEC 74.8% <![CDATA[HF2-VED]]> 76.2% The present invention 76.5%
[0109] It can be seen from the experimental results in Table 1 that the present invention has a higher accuracy rate than the prior art.
[0110] In summary, the present invention has a higher detection accuracy rate for abnormal behavior than the prior art, and has important practical significance. The above description is only a specific example of the present invention and does not constitute any limitation to the present invention. Obviously, for professionals in this field, after understanding the content and principle of the present invention, it is possible to make various modifications and changes in form and details without departing from the principle and structure of the present invention, but these modifications and changes based on the idea of the present invention are still within the scope of protection of the claims of the present invention.
Claims
1. An unsupervised abnormal behavior detection method based on background suppression, Features The steps include: (1) Obtain training sample set and test sample set: (1a) Randomly select M pedestrian surveillance videos and decompose them to obtain a set of M frame sequences. in Indicates that the mth contains K m A frame sequence of image frames, v k express The kth frame image in, M ≥ 200, K m ≥100; (1b) From the frame sequence set S v1 Each frame sequence contains The N that only contain pedestrian walking events are filtered out m frame images constitute a normal behavior frame sequence All normal behavior frame sequences contained in the M frame sequences form a training sample set B train , then The remaining P m Frame images form an abnormal behavior frame sequence Then all abnormal behavior frame sequences are combined into a test sample set B test , where N m ≥P m , P m =K m -N m ; (2) Constructing an unsupervised abnormal behavior detection network model H: (2a) An unsupervised abnormal behavior detection network model H is constructed, which includes a background suppression module, a prediction module, and a background suppression constraint module connected in sequence. The output end of the background suppression module is also connected to a context memory module; wherein: The prediction module includes a spatial encoder, a convolutional long short-term memory module and a decoder connected in sequence. The spatial encoder adopts a feature extraction network including multiple two-dimensional convolutional layers and multiple activation function layers; the convolutional long short-term memory module adopts a memory convolutional neural network including multiple two-dimensional convolutional layers, multiple tensor decomposition layers and multiple activation function layers; the decoder adopts a transposed convolutional neural network including multiple two-dimensional transposed convolutional layers and multiple activation function layers; The context memory module includes a motion matching encoder and a memory module connected in sequence, wherein the motion matching encoder adopts a three-dimensional convolutional neural network including multiple three-dimensional convolutional layers, multiple activation function layers, multiple three-dimensional maximum pooling layers and one three-dimensional average pooling layer; The output end of the memory module in the context memory module is connected to the input end of the decoder in the prediction module; (2b) Define the background suppression loss function L of the background suppression constraint module BGS , background constraint loss function L restrain , the minimum square error L 2 , minimum absolute deviation L 1 : L restrain =L BGS +L 2 +L 1 Among them, ||·|| 1 Indicates the 1-norm, Binary(·) indicates the binarization operation, express The prediction results, express The nth frame image; (3) Iteratively train the unsupervised abnormal behavior detection network model H: (3a) The number of initial iterations is t, the maximum number of iterations is T, T ≥ 80, and the network parameters for feature extraction at the tth iteration are θ G1_t , the memory convolutional neural network parameter is θ G2_t , the transposed convolutional neural network parameters are θ G3_t , the parameters of the three-dimensional convolutional neural network are θ G4_t , and let t = 1; (3b) The training sample set B train As the input of the unsupervised abnormal behavior detection network model H, the frame sequence at the tth iteration is obtained The prediction results (3b1) Background suppression module for training sample set B train Each normal behavior frame sequence Each normal behavior frame image in Perform background information suppression, and combine all frame images after background information suppression into a frame image sequence; (3b2) The spatial encoder in the prediction module is a frame sequence after background suppression Each frame image in the image is feature extracted, and the convolutional long short-term memory module is used to extract the features of the image. The feature tensor composed of all the extracted features Decompose it and get Feature information And store, c∈[2,M-1]; (3b3) Context memory module for frame sequence Each frame image in the other M-1 normal behavior frame sequences except The features of all previous frame images constitute the above information and store it. The features of all subsequent frame images constitute the following information and store; (3b4) The decoder in the prediction module uses the feature information obtained in step (3b2) and the above information obtained in step (3b3) And the following information Decode and get the frame sequence at the tth iteration The prediction results (3c) Background suppression constraint module for prediction results and normal behavior frame sequence Normal behavior frame image in Perform binarization processing to obtain the prediction result at time t Binarized image The nth normal behavior frame image Binarized image (3d) Using the background suppression loss function L BGS ,pass and Calculate H t The background suppression loss value L BGS , and adopt the background constraint loss function L restrain , through L BGS , L 2 and L 1 Calculate H t The background constraint loss value L restrain ; (3e) Using the back propagation method, and through L restrain Calculate H t The network parameter gradient is then calculated by stochastic gradient descent through H t The network parameter gradient is proportional to the network parameter θ G1_t ,θ G2_t ,θ G3_t ,θ G4_t Update to obtain the unsupervised abnormal behavior detection network model H for this iteration t ; (3f) Determine whether t≥T holds. If so, obtain the trained unsupervised abnormal behavior detection network model H * , otherwise let t = t + 1, H t =H, and execute step (3b); (4) Obtain abnormal behavior detection results: (4a) The test sample set B test The cth abnormal behavior frame sequence in As the trained unsupervised abnormal behavior detection network model H * The input is forward propagated to obtain The predicted frame image (4b) Use the anomaly score function score and predict the frame image and frame images calculate The anomaly score F is obtained, and it is determined whether F and the preset anomaly score detection threshold I satisfy F≥I. If so, then There is abnormal behavior, otherwise there is no abnormal behavior, where:
2. The unsupervised abnormal behavior detection method based on background suppression according to claim 1, It is characterized in that The unsupervised abnormal behavior detection network model H described in step (2a), wherein: The spatial encoder contains 4 two-dimensional convolutional layers and 4 activation function layers. The specific structure of the spatial encoder is: the first two-dimensional convolutional layer → the first activation function layer → the second two-dimensional convolutional layer → the second activation function layer → the third two-dimensional convolutional layer → the third activation function layer → the fourth two-dimensional convolutional layer → the fourth activation function layer; the first two-dimensional convolutional layer has an input channel of 1, an output channel of 64, and a step size of 2; the second two-dimensional convolutional layer has an input channel of 64, an output channel of 64, and a step size of 1; the third two-dimensional convolutional layer has an input channel of 64, an output channel of 128, and a step size of 2; the fourth two-dimensional convolutional layer has an input channel of 128, an output channel of 128, and a step size of 1; the convolution kernel size used in the four two-dimensional convolutional layers is the same, all 3×3; the four activation function layers all use the ELU function; The convolutional long short-term memory module includes 2 two-dimensional convolutional layers and 2 tensor decomposition layers, and 3 activation function layers. The specific structure is: the first two-dimensional convolutional layer → the second two-dimensional convolutional layer → the first tensor decomposition layer → the second tensor decomposition layer → the first activation function layer → the second activation function layer → the third activation function layer; the first two-dimensional convolutional layer and the second two-dimensional convolutional layer are the same, with 128 input channels and 128 output channels; the three activation function layers all use sigmoid functions; The decoder contains 4 two-dimensional transposed convolutional layers and 3 activation function layers. The specific structure is: the first two-dimensional transposed convolutional layer → the first activation function layer → the second two-dimensional transposed convolutional layer → the second activation function layer → the third two-dimensional transposed convolutional layer → the third activation function layer → the fourth two-dimensional transposed convolutional layer; the first two-dimensional transposed convolutional layer has an input channel of 256, an output channel of 128, and a step size of 1; the second two-dimensional transposed convolutional layer has an input channel of 128, an output channel of 64, and a step size of 2; the third two-dimensional transposed convolutional layer has an input channel of 64, an output channel of 64, and a step size of 1; the fourth two-dimensional transposed convolutional layer has an input channel of 64, an output channel of 1, and a step size of 1; the convolution kernels used in the four two-dimensional transposed convolutional layers are the same size of 3×3, and the three activation function layers all use the ELU function; The motion matching encoder includes 6 three-dimensional convolutional layers and 6 activation function layers, 4 three-dimensional maximum pooling layers, and 1 three-dimensional average pooling layer. The specific structure is: first three-dimensional convolutional layer→first activation function layer→first three-dimensional maximum pooling layer→second three-dimensional convolutional layer→second activation function layer→second three-dimensional maximum pooling layer→third three-dimensional convolutional layer→third activation function layer→fourth three-dimensional convolutional layer→fourth activation function layer→third three-dimensional maximum pooling layer→fifth three-dimensional convolutional layer→fifth activation function layer→sixth three-dimensional convolutional layer→sixth activation function layer→fourth three-dimensional maximum pooling layer→average three-dimensional pooling layer; the first three-dimensional convolutional layer has an input channel of 1 and an output channel of 64; the second three-dimensional convolutional layer has an input channel of 64 and an output channel of 128; the third The input channel of the three-dimensional convolution layer is 128, and the output channel is 256; the input channel of the fourth three-dimensional convolution layer is 256, and the output channel is 256; the input channel of the fifth three-dimensional convolution layer is 256, and the output channel is 512; the input channel of the sixth three-dimensional convolution layer is 512, and the output channel is 512; the step size is the same, all 1; the convolution kernel size used by the 6 three-dimensional convolution layers is the same, all 3×3×3; the pooling kernel size of the first three-dimensional maximum pooling layer is 1×2×2, and the step size is 1×2×2; the pooling kernel size of the second three-dimensional maximum pooling layer, the pooling kernel of the third three-dimensional maximum pooling layer, and the pooling kernel of the fourth three-dimensional maximum pooling layer is the same, all 2×2×2, and the step size is 2×2×2; the convolution kernel size of the average three-dimensional pooling layer is 1×2×2; the 6 activation function layers all use the ReLU function.
3. The unsupervised abnormal behavior detection method based on background suppression according to claim 1, It is characterized in that The background suppression module described in step (3b1) performs the following operations on the training sample set B: train Each normal behavior frame sequence Each normal behavior frame image in To suppress background information, the implementation steps are as follows: The background suppression module is used to train the sample set B train Each normal behavior frame sequence Each normal behavior frame image in Perform gamma correction and correct the frame image Perform Gaussian filtering and then filter the frame image after Gaussian filtering. Perform Laplace sharpening to obtain a frame image with background information suppressed 4. The unsupervised abnormal behavior detection method based on background suppression according to claim 1, Features: The stochastic gradient descent method described in step (3e) is used to pass H t The network parameter gradient is proportional to the network parameter θ G1_t ,θ G2_t ,θ G3_t ,θ G4_t Update; the update formula is: g t =▽ θ f t (i t-1 ) m t =b 1 ·v t-1 +(1-β 1 )·g t Where: g t is the gradient at iteration number t, are the feature extraction network parameters θ G1_t , memory convolutional neural network parameters θ G2_t , transposed convolutional neural network parameters θ G3_t , 3D convolutional neural network parameters θ G4_t After updating the parameters, {f ti (θ)|i=1,2,3,4} is the parameter θ Gi_t The objective function, β 1 , β 2 are the exponential decay rates of the first-order moment and the second-order moment, respectively, {m ti |i=1,2,3,4} is H t The first-order moment estimate of the network parameter gradient, {v ti |i=1,2,3,4} is the pair H t The second-order moment estimate of the network parameter gradient, For {m ti |i=1,2,3,4} correction, β i The t power, For {v ti |i=1,2,3,4}, {α i |i=1,2,3,4} is the learning rate, {ε i |i=1,2,3,4} are constants added to maintain numerical stability.
Citation Information
Patent Citations
Deep learning-based violent abnormal behavior detection method
CN113191182A
Abnormal behavior detection method based on deep learning
CN113361370A
Video behavior identification method based on unsupervised video representation learning
CN111832516A
Semi-supervised network abnormal behavior detection method based on behavior feature coding
CN113032778A
System and Method for Visual Event Description and Event Analysis
US20170103264A1
