A method for detecting group violence based on individual spatiotemporal relationship reasoning
By using a multi-scale map based on social distance and a recurrent neural network in group violence recognition, a relationship map between multiple pedestrians is constructed, which solves the problem of difficult to capture complex space-time relationships in the existing technology, and achieves a higher level of freedom Awesome and accuracy.
Patent Information
- Application Number
- CN202110933953.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-10
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2041-08-10
AI Technical Summary
The prior art is difficult to effectively capture and express complex spatiotemporal relationships in group violence, especially in the case of multiple individuals participating, resulting in a low robust recognition effect.
采用基于社交距离的多尺度图结合循环神经网络,通过空间关系表达、多尺度组合关系表达和时空关系推理,构建多个行人之间的关系图,表达群体暴力行为,并实现复杂场景中的鲁 Stick identification. Specific steps include human detection, spatial relationship calculation, multi-scale combination, spatial and temporal relationship reasoning and model training.
Effectively expressing and identifying group violence improves robustness in complex scenarios and can more accurately capture and understand complex spatio-temporal relationships between multiple people.
Smart Images

Figure CN113705391B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of behavior recognition, and in particular to a method for detecting group violence based on individual spatiotemporal relationship reasoning. Background Art
[0002] Group violence affects social stability and is very harmful to public order. Timely detection and early warning of group violence have important market prospects. Early methods used probabilistic graphical models to process manually extracted features for group violence identification, which had low robustness. With the success of deep learning in the field of feature learning, deep learning models have promoted the improvement of group violence detection performance.
[0003] There are two directions for the research on group violence detection technology based on deep learning. The first direction is the attention-based method. Researchers combine the attention mechanism with RNN or convolution operations to select key features for violent behavior identification at each time step or convolution process. However, in group violence, the input of the model is irregular portrait data, and there are hidden structural relationships between people. The attention mechanism cannot mine these potential relationships. The second direction is the method based on graph convolution. Graph convolution extends neural networks to the field of graphs and can capture structural relationships in irregular data. This structural relationship is a type of attention weight, which is used to propagate information between nodes and update node features.
[0004] However, the above method does not take into account the hierarchy of structural relationships, that is, the connection between complex relationships and simple relationships. We introduce a multi-scale graph based on social distance to capture this interactive relationship of different degrees, where low-scale graphs correspond to simple interactive relationships and high-scale graphs correspond to complex interactive relationships. In addition, we embed this multi-scale graph module into the recurrent neural network to fully combine spatiotemporal relationships. Previously, this technology was mostly concentrated in the field of skeleton-based behavior recognition. For example, the Chinese patent with patent number: 202011120587.1 discloses "A graph convolution behavior recognition method and device based on skeletal joints". They first use OpenPose to extract the human skeleton, and then dynamically model based on the time series of the skeleton to construct a spatiotemporal topological map. For another example, the Chinese patent with patent number: 201910309644.1 discloses "A method for skeletal behavior recognition based on spatiotemporal attention", using spatiotemporal graph convolution (ST-GCN) to model the video human skeleton series.
[0005] However, the above works all focus on the technical application scenarios of space-time graphs on the construction of skeleton space-time graphs. The skeleton graph is a space-time graph of a person, and its graph structure is relatively simple. Summary of the invention
[0006] The purpose of the present invention is to make up for the defects of the existing technology and provide a method for detecting group violence based on individual spatiotemporal relationship reasoning. The application scenario solved by the present invention is group violence, which involves multiple people, and their spatial relationships are more intensive and their temporal relationships are more complex. Its spatial intensive relationship exists not only between multiple pedestrians, but also between relationships of different scales. Therefore, based on the existing spatiotemporal graph, the present invention focuses on the spatial relationship expression, multi-scale combined relationship expression, and spatiotemporal relationship reasoning expression of group violence, so as to fully study the construction of the relationship graph between multiple pedestrians, effectively express group violence, and realize robust recognition in complex scenes.
[0007] The present invention is achieved through the following technical solutions:
[0008] A method for detecting group violence based on individual spatiotemporal relationship reasoning, specifically comprising the following steps:
[0009] Step 1: Perform human detection of group violence on a video training set of group violence;
[0010] Step 2: expressing the spatial relationship of group violence behavior based on the human body detection results of group violence behavior;
[0011] Step 3: Express the multi-scale combination relationship of group violence behaviors according to the spatial relationship of group violence behaviors;
[0012] Step 4: Based on the human body detection results of the group violence behavior in step 1 and the multi-scale combination relationship of the group violence behavior in step 3, the spatiotemporal relationship of the group violence behavior is inferred and expressed;
[0013] Step 5: Obtaining group violence behavior characteristics according to the spatiotemporal relationship of group violence behavior, and training a group violence behavior detection model to obtain a group violence behavior detection model;
[0014] Step 6: Perform group violence behavior detection according to the group violence behavior detection model to obtain a detection result of group violence behavior.
[0015] The specific contents of step 1 are as follows:
[0016] 1-1 Sampling the video training set of group violence to obtain a set of video frame images;
[0017] 1-2 For each frame of video, use the RCNN model to obtain the pedestrian detection window and calculate the center point of the window as the pedestrian detection position;
[0018] 1-3 Input the behavior detection window, crop the video frame according to the pedestrian detection window, and obtain the pedestrian image block set of the current frame;
[0019] 1-4 Input pedestrian image blocks and use the pre-trained inception-v3 network to extract individual features of pedestrians;
[0020] 1-5 Input individual features in the video frame and use the maximum pooling operation to extract the scene features of the video frame.
[0021] The specific contents of step 2 are as follows:
[0022] 2-1 Input the pedestrian individual features extracted in step 1-4, and use the vector inner product form to calculate the similarity between every two individual features:
[0023]
[0024] where x t is the individual feature matrix extracted in steps 1-4, t represents the tth frame, variables i and j refer to the number of the individual pedestrian, d k is the normalization factor, k represents the kth scale;
[0025] 2-2 Input the detection positions of individuals i and j, and calculate the distance between the two individuals;
[0026] 2-3 For individuals i and j, a distance proximity function is set to determine whether the two individuals are close. The degree of distance proximity is:
[0027]
[0028] where dist i,j is the distance between two individuals, variables i and j refer to the number of pedestrian individuals, width is the width of the image resolution, and λ k is the multi-scale proximity threshold, k represents the kth scale, k = 1, 2, 3, 4 in the model, and the corresponding distance proximity degree r k There are 4;
[0029] 2-4 Input the individual feature similarity s(i,j) calculated in step 2-1 and the distance approximation function r calculated in step 2-3 k (i, j), process the similarity matrix to obtain the similarity matrix A of multiple scales t,k ={A t,k (i,j)}:
[0030]
[0031] Among them, A t,k (i,j) is the matrix A t,k The variables i and j refer to the individual numbers of pedestrians, s(i,j) is the individual feature similarity calculated in step 2-1, and r k(i, j) is the distance approximation function calculated in step 2-3, and finally 4 corresponding similarity matrices A are obtained t,k (k=1,2,3,4);
[0032] 2-5 Input single-scale similarity matrix A t,k , individual characteristics x t , use graph convolution operation to obtain individual features after graph convolution reasoning:
[0033]
[0034] Among them, Relu is the Relu activation function, W k is the graph convolution parameter. The similarity matrix of each scale is inferred by graph convolution to obtain the individual features of the corresponding scale. The individual features after graph convolution inference at scale 1, scale 2, scale 3, and scale 4 are recorded as
[0035] The specific contents of step 3 are as follows:
[0036] 3-1 Individual features after inputting graph convolution inference at 4 scales The distance between the features is r k (k=1,2,3,4);
[0037] 3-2 Convolutional reasoning features of scale 1 graph and scale 2 graph convolutional reasoning features After concatenation, the combined features of the first two scales are obtained;
[0038] 3-3 The features after combining scale 1 and scale 2 are fully connected to obtain the transformed features after combining the first two scales
[0039] 3-4 Transformation features after combining the first two scales Graph convolutional reasoning features with scale 3 Connect them in series to get the features after combining the first three scales;
[0040] 3-5 The features after the combination of the first three scales are fully connected to obtain the transformed features after the combination of the first three scales
[0041] 3-6 Transformation features after combining the first three scales Graph convolutional reasoning features with scale 4 Connect them in series to get the features after combining the first four scales;
[0042] 3-7 The features after the combination of the first four scales are fully connected to obtain the transformed features after the combination of the first four scales
[0043] 3-8 Convolutional inference features of scale 1 graph Transformation features after combining the first two scales Transformation features after combining the first three scales Transformation features after combining the first four scales These four features are connected in series to obtain the individual relationship expression features of the tth frame
[0044] 3-9 Input individual relationship expression features of frame t Use the maximum pooling operation to obtain the scene relationship expression features of the tth frame
[0045] The specific contents of step 4 are as follows:
[0046] 4-1 Input the first frame of video, and obtain the individual feature x1 and scene feature s1 of the first frame according to step 1-4;
[0047] 4-2 According to step 3-8, obtain the individual relationship expression features of the first frame
[0048] 4-3 According to step 3-9, the scene relationship expression feature of the first frame is obtained, which is recorded as
[0049] 4-4 uses random initialization to obtain the initial memory state feature c0 of LSTM;
[0050] 4-5 Use random initialization to obtain the initial hidden state feature h0 of LSTM;
[0051] 4-6 Spatiotemporal fusion features of the first frame:
[0052] 4-6-1 Characterize individual relationships Perform a 1-layer full connection transformation to obtain the transformed individual features
[0053] 4-6-2 Characterizing scene relationships Perform a 1-layer full-connection transformation to obtain the transformed scene features
[0054] 4-6-3 Perform a 1-layer full-connection transformation on the temporal hidden state feature h0 to obtain the transformed temporal hidden state feature h0′;
[0055] 4-6-4 The transformed scene features Sum the transformed temporal hidden state feature h0′ and add it to the transformed individual feature On the top, the spatiotemporal fusion individual features of the first frame are obtained
[0056]
[0057] Among them, Broadcast is a broadcast operation, which uses replication to expand the dimension of features;
[0058] 4-6-5 Input the spatiotemporal fusion individual features of the first frame Execute step 2 to obtain the multi-scale individual features of the first frame;
[0059] 4-6-6 For the multi-scale individual features of the first frame, execute step 3 to obtain the spatiotemporal fusion scene features of the first frame
[0060] 4-7 Input the first frame of spatiotemporal fusion scene features The initial temporal hidden state feature h0, the initial memory state feature c0, use the LSTM formula to calculate the temporal memory state feature c1 and temporal hidden state feature h1 after LSTM inference of the first frame:
[0061]
[0062] Where σ is the Sigmoid function, i1 is the input gate of the first frame, and W i and b i is the weight and bias of the input gate; f1 is the forget gate of the first frame, W f and b f are the weights and biases of the forget gate; is the memory gate of the first frame, W c and b c is the weight and bias of the memory gate; o1 is the output gate, W o and b o are the weight and bias of the output gate;
[0063] 4-8 Input the individual feature x2 of the second frame, the scene feature s2, and the temporal hidden state feature h1 after LSTM inference of the first frame, and execute steps 4-6 to obtain the spatiotemporal fusion scene feature of the second frame
[0064] 4-9 Input the spatiotemporal fusion scene features of the second frame The temporal hidden state feature h1 of the first frame and the memory state feature c1 of the first frame are used to calculate the temporal hidden state feature h2 and the temporal memory state feature c2 after LSTM inference of the second frame using the LSTM formula of steps 4-7;
[0065] 4-10 Input the individual features, scene features, and hidden state features of the subsequent frames, and repeat steps 4-8 and 4-9 to obtain the temporal hidden state feature h of the nth frame. n , where n is the number of the last frame.
[0066] The specific contents of step 5 are as follows:
[0067] 5-1 Sum the scene features of all frames of the video of group violence and the temporal hidden state features of all frames of the video obtained in step 4 to obtain the group violence features of the video;
[0068] 5-2 Perform a full-connection transformation on the group violence behavior features of the group violence behavior video to identify the group violence behavior category:
[0069]
[0070] Among them, s t is the scene feature of the tth frame, h t is the hidden state feature of the t-th frame, W g are the parameters of the fully connected transformation for group identification;
[0071] 5-3 Predict the video frames of the video training set of group violence, obtain the predicted group category, and use the real labeled group category of the training set to design the loss function. The loss function adopts the cross entropy form:
[0072]
[0073] Among them, y G is the predicted category of group violence behavior, It is a category of group violence that is truly labeled;
[0074] 5-4 Use the loss function of 5-3 to train the spatiotemporal relationship reasoning expression model and obtain the model parameters.
[0075] The specific content of step 6 is as follows:
[0076] 6-1 Sample the test video to obtain a set of behavior video frame images;
[0077] 6-2 Input video frames, and use step 1 to obtain individual features and scene features of each frame;
[0078] 6-3 Input individual features and scene features, adopt step 2, use the model parameters trained in step 5 to obtain individual features after graph convolution reasoning;
[0079] 6-4 Input the individual features after graph convolutional reasoning, adopt step 3, use the model parameters obtained by training in step 5 to obtain individual relationship expression features and scene relationship expression features;
[0080] 6-5 Input individual relationship expression features and scene relationship expression features, adopt step 4, use the model parameters obtained by training in step 5, and obtain the temporal hidden state features;
[0081] 6-6 Input the temporal hidden state features and use the model parameters obtained through training in step 5 to obtain the group violence behavior detection results.
[0082] The advantages of the present invention are as follows: the present invention addresses the problem that the existing group relationship graph model is difficult to describe complex spatiotemporal relationships, and focuses on achieving three key tasks: spatial relationship expression, multi-scale combination relationship expression, and spatiotemporal relationship reasoning expression of group violence. For the relationship modeling between group characters, on the basis of considering the similarity of individual characteristics of the characters, the proximity of the characters is considered, and the spatial relationship of pedestrians with different behavioral scopes is provided. At the same time, multi-scale combination operations are introduced to achieve dense spatial relationship modeling. In addition, on the basis of spatial relationships, the temporal hidden state features are integrated to achieve spatiotemporal relationship modeling, which effectively expresses group violence. BRIEF DESCRIPTION OF THE DRAWINGS
[0083] Figure 1 Flowchart of the method for detecting group violence based on reasoning about individual spatiotemporal relationships.
[0084] Figure 2 The process diagram of obtaining the multi-scale relationship diagram of group violence behavior ( Figure 2 a is the pedestrian detection image; Figure 2 b is the distance approach range diagram of pedestrians; Figure 2 c is the pedestrian and relationship graph of scale 1; Figure 2 d is the pedestrian and relationship diagram of scale 2).
[0085] Figure 3 Diagram of the graph convolutional inference process for group violence.
[0086] Figure 4 A multi-scale combined relationship expression diagram of group violence behavior.
[0087] Figure 5 A graph expressing the temporal and spatial relationship reasoning of group violence. DETAILED DESCRIPTION
[0088] like Figure 1 As shown, a method for detecting group violence based on individual spatiotemporal relationship reasoning includes the following steps:
[0089] 1. Human body detection of group violence:
[0090] 1-1 Sampling the video training set of group violence to obtain a video frame image set, the number of video frames in each video is 10 frames, and the sampling interval is about 0.33 seconds;
[0091] 1-2 For each frame of video, use the RCNN model to obtain the pedestrian detection window and calculate the center point of the window as the pedestrian detection position. Figure 2 The pedestrian detection window is given in a;
[0092] 1-3 Input the behavior detection window, crop the video frame according to the pedestrian detection window, and obtain the pedestrian image block set of the current frame;
[0093] 1-4 Input pedestrian image blocks and use the pre-trained inception-v3 network to extract individual features of pedestrians;
[0094] 1-5 Input individual features in the video frame and use the maximum pooling operation to extract the scene features of the video frame.
[0095] 2. Spatial relationship expression of group violence:
[0096] 2-1 Input the pedestrian individual features extracted in step 1-4, and use the vector inner product form to calculate the similarity between every two individual features:
[0097]
[0098] where x t is the individual feature matrix extracted in steps 1-4, t represents the tth frame, variables i and j refer to the number of the individual pedestrian, d k is the normalization factor, and the subscript k represents the kth scale;
[0099] 2-2 Input the detection positions of individuals i and j, and calculate the distance between the two individuals;
[0100] 2-3 For individuals i and j, a distance proximity function is set to determine whether the two individuals are close. The degree of distance proximity is:
[0101]
[0102] where dist i,j is the distance between two individuals, variables i and j refer to the number of pedestrian individuals, width is the width of the image resolution, and λ k is the multi-scale proximity threshold, the subscript k represents the kth scale, k = 1, 2, 3, 4 in the model, and the corresponding distance proximity degree r k There are 4, pedestrians have different distance approach ranges at different scales, Figure 2b shows the distance proximity range between the first scale and the second scale;
[0103] 2-4 Input the individual feature similarity s(i,j) calculated in step 2-1 and the distance approximation function r calculated in step 2-3 k (i, j), process the similarity matrix to obtain the similarity matrix A of multiple scales t,k ={A t,k (i,j)}:
[0104]
[0105] Among them, A t,k (i,j) is the matrix A t,k The variables i and j refer to the numbers of individual pedestrians. Each element describes the relationship between two pedestrians. The similarity matrix describes the relationship between all pedestrians in the graph. Figure 2 c and Figure 2 d gives the relationship diagram between pedestrians at two scales; s(i,j) is the individual feature similarity calculated in step 2-1, r k (i, j) is the distance approximation function calculated in step 2-3; finally, we get 4 corresponding similarity matrices A t,k (k=1,2,3,4);
[0106] 2-5 Input single-scale similarity matrix A t,k , individual characteristics x t , using graph convolution operations (such as Figure 3 As shown), we obtain the individual features after graph convolutional reasoning:
[0107]
[0108] Among them, Relu is the Relu activation function, W k is the graph convolution parameter. The similarity matrix of each scale is inferred by graph convolution to obtain the individual features of the corresponding scale. The individual features after graph convolution inference at scale 1, scale 2, scale 3, and scale 4 are recorded as
[0109] 3. Multi-scale combined relationship expression of group violence:
[0110] 3-1 Individual features after inputting graph convolution inference at 4 scales The distance between the features is r k (k=1,2,3,4), such as Figure 4 ;
[0111] 3-2 Convolutional reasoning features of scale 1 graph and scale 2 graph convolutional reasoning features After concatenation, the combined features of the first two scales are obtained;
[0112] 3-3 The features after combining scale 1 and scale 2 are fully connected to obtain the transformed features after combining the first two scales
[0113] 3-4 Transformation features after combining the first two scales Graph convolutional reasoning features with scale 3 Connect them in series to get the features after combining the first three scales;
[0114] 3-5 The features after the combination of the first three scales are fully connected to obtain the transformed features after the combination of the first three scales
[0115] 3-6 Transformation features after combining the first three scales Graph convolutional reasoning features with scale 4 Connect them in series to get the features after combining the first four scales;
[0116] 3-7 The features after the combination of the first four scales are fully connected to obtain the transformed features after the combination of the first four scales
[0117] 3-8 Convolutional inference features of scale 1 graph Transformation features after combining the first two scales Transformation features after combining the first three scales Transformation features after combining the first four scales These four features are connected in series to obtain the individual relationship expression features of the tth frame
[0118] 3-9 Input individual relationship expression features of frame t Use the maximum pooling operation to obtain the scene relationship expression features of the tth frame
[0119] 4. Reasoning and expression of the spatiotemporal relationship of group violence:
[0120] 4-1 Input the first frame of video, and obtain the individual feature x1 and scene feature s1 of the first frame according to step 1-4;
[0121] 4-2 According to step 3-8, obtain the individual relationship expression features of the first frame
[0122] 4-3 According to step 3-9, the scene relationship expression feature of the first frame is obtained, which is recorded as
[0123] 4-4 uses random initialization to obtain the initial memory state feature c0 of LSTM;
[0124] 4-5 Use random initialization to obtain the initial hidden state feature h0 of LSTM;
[0125] 4-6 Spatiotemporal fusion features of the first frame:
[0126] 4-6-1 Characterize individual relationships Perform a 1-layer full connection transformation to obtain the transformed individual features
[0127] 4-6-2 Characterizing scene relationships Perform a 1-layer full-connection transformation to obtain the transformed scene features
[0128] 4-6-3 Perform a 1-layer full-connection transformation on the temporal hidden state feature h0 to obtain the transformed temporal hidden state feature h0′;
[0129] 4-6-4 The transformed scene features Sum the transformed temporal hidden state feature h0′ and add it to the transformed individual feature On the top, the spatiotemporal fusion individual features of the first frame are obtained
[0130]
[0131] Broadcast is a broadcast operation, which uses replication to expand the dimension of features. The calculation process is as follows: Figure 5 As shown;
[0132] 4-6-5 Input the spatiotemporal fusion individual features of the first frame Execute step 2 to obtain the multi-scale individual features of the first frame;
[0133] 4-6-6 For the multi-scale individual features of the first frame, execute step 3 to obtain the spatiotemporal fusion scene features of the first frame
[0134] 4-7 Input the first frame of spatiotemporal fusion scene features The initial temporal hidden state feature h0, the initial memory state feature c0, use the LSTM formula to calculate the temporal memory state feature c1 and temporal hidden state feature h1 after LSTM inference of the first frame:
[0135]
[0136] Where σ is the Sigmoid function, i1 is the input gate of the first frame, and Wi and b i is the weight and bias of the input gate; f1 is the forget gate of the first frame, W f and b f are the weights and biases of the forget gate; is the memory gate of the first frame, W c and b c is the weight and bias of the memory gate; o1 is the output gate, W o and b o are the weight and bias of the output gate;
[0137] 4-8 Input the individual feature x2 of the second frame, the scene feature s2, and the temporal hidden state feature h1 after LSTM inference of the first frame, and execute steps 4-6 to obtain the spatiotemporal fusion scene feature of the second frame
[0138] 4-9 Input the spatiotemporal fusion scene features of the second frame The temporal hidden state feature h1 of the first frame and the memory state feature c1 of the first frame are used to calculate the temporal hidden state feature h2 and the temporal memory state feature c2 after LSTM inference of the second frame using the LSTM formula of steps 4-7;
[0139] 4-10 Input the individual features, scene features, and hidden state features of the subsequent frames, and repeat steps 4-8 and 4-9 to obtain the temporal hidden state feature h of the nth frame. n , where n is the number of the last frame.
[0140] 5. Group violence detection model training:
[0141] 5-1 Sum the scene features of all frames of the video and the temporal hidden state features of all frames of the video obtained in step 4 to obtain the group violence behavior features of the video;
[0142] 5-2 Perform a full-connection transformation on the group violence behavior features of the video to identify the group violence behavior category:
[0143]
[0144] Among them, s t is the scene feature of the tth frame, h t is the hidden state feature of the t-th frame, W g are the parameters of the fully connected transformation for group identification;
[0145] 5-3 Predict the video frames of the training set, obtain the predicted group categories, and use the real labeled group categories of the training set to design the loss function. The loss function adopts the cross entropy form:
[0146]
[0147] Among them, y G is the predicted category of group violence behavior, It is a category of group violence that is truly labeled;
[0148] 5-4 uses the loss function of 5-3 to train the spatiotemporal relationship reasoning expression model and obtain model parameters, which include the model parameters in steps 2, 3, 4, and 5.
[0149] 6. Group violence detection:
[0150] 6-1 Sample the test video to obtain a set of behavior video frame images;
[0151] 6-2 Input video frames, and use step 1 to obtain individual features and scene features of each frame;
[0152] 6-3 Input individual features and scene features, adopt step 2, use the model parameters trained in step 5 to obtain individual features after graph convolution reasoning;
[0153] 6-4 Input the individual features after graph convolutional reasoning, adopt step 3, use the model parameters obtained by training in step 5 to obtain individual relationship expression features and scene relationship expression features;
[0154] 6-5 Input individual relationship expression features and scene relationship expression features, adopt step 4, use the model parameters obtained by training in step 5, and obtain the temporal hidden state features;
[0155] 6-6 Input the temporal hidden state features, adopt step 5, use the model parameters obtained by training in step 5, and obtain the group violence behavior detection results.
Claims
1. A method for detecting group violence based on individual spatiotemporal relationship reasoning, Features: The specific steps include: Step 1: Perform human detection of group violence on a video training set of group violence; Step 2: expressing the spatial relationship of group violence behavior based on the human body detection results of group violence behavior; Step 3: Express the multi-scale combination relationship of group violence behaviors according to the spatial relationship of group violence behaviors; Step 4: Based on the human body detection results of the group violence behavior in step 1 and the multi-scale combination relationship of the group violence behavior in step 3, the spatiotemporal relationship of the group violence behavior is inferred and expressed; Step 5: Obtaining group violence behavior characteristics according to the spatiotemporal relationship of group violence behavior, and training a group violence behavior detection model to obtain a group violence behavior detection model; Step 6: Perform group violence behavior detection according to the group violence behavior detection model to obtain a detection result of group violence behavior; The specific contents of step 1 are as follows: 1-1 Sampling the video training set of group violence to obtain a set of video frame images; 1-2 For each frame of video, use the RCNN model to obtain the pedestrian detection window and calculate the center point of the window as the pedestrian detection position; 1-3 Input the behavior detection window, crop the video frame according to the pedestrian detection window, and obtain the pedestrian image block set of the current frame; 1-4 Input pedestrian image blocks and use the pre-trained inception-v3 network to extract individual features of pedestrians; 1-5 Input individual features in the video frame and use the maximum pooling operation to extract the scene features of the video frame; The specific contents of step 2 are as follows: 2-1 Input the pedestrian individual features extracted in step 1-4, and use the vector inner product form to calculate the similarity between every two individual features: where x t is the individual feature extracted in steps 1-4, t represents the tth frame, variables i and j refer to the number of the individual pedestrian, d k is the normalization factor, k represents the kth scale; 2-2 Input the detection positions of individuals i and j, and calculate the distance between the two individuals; 2-3 For individuals i and j, a distance proximity function is set to determine whether the two individuals are close. The degree of distance proximity is: where dist i,j is the distance between two individuals, variables i and j refer to the number of pedestrian individuals, width is the width of the image resolution, and λ k is the multi-scale proximity threshold, k represents the kth scale, k = 1, 2, 3, 4 in the model, and the corresponding distance proximity degree r k There are 4; 2-4 Input the individual feature similarity s(i,j) calculated in step 2-1 and the distance approximation function r calculated in step 2-3 k (i, j), process the similarity matrix to obtain the similarity matrix A of multiple scales t,k ={A t,k (i,j)}: Among them, A t,k (i,j) is the matrix A t,k The variables i and j refer to the individual numbers of pedestrians, s(i,j) is the individual feature similarity calculated in step 2-1, and r k (i, j) is the distance approximation function calculated in step 2-3, and finally 4 corresponding similarity matrices A are obtained t,k (k=1,2,3,4); 2-5 Input single-scale similarity matrix A t,k , individual characteristics x t , use graph convolution operation to obtain individual features after graph convolution reasoning: Among them, Relu is the Relu activation function, W k is the graph convolution parameter. The similarity matrix of each scale is inferred by graph convolution to obtain the individual features of the corresponding scale. The individual features after graph convolution inference at scale 1, scale 2, scale 3, and scale 4 are recorded as The specific contents of step 3 are as follows: 3-1 Individual features after inputting graph convolution inference at 4 scales The distance between the features is r k (k=1,2,3,4); 3-2 Convolutional reasoning features of scale 1 graph and scale 2 graph convolutional reasoning features After concatenation, the combined features of the first two scales are obtained; 3-3 The features after combining scale 1 and scale 2 are fully connected to obtain the transformed features after combining the first two scales 3-4 Transformation features after combining the first two scales Graph convolutional reasoning features with scale 3 Connect them in series to get the features after combining the first three scales; 3-5 The features after the combination of the first three scales are fully connected to obtain the transformed features after the combination of the first three scales 3-6 Transformation features after combining the first three scales Graph convolutional reasoning features with scale 4 Connect them in series to get the features after combining the first four scales; 3-7 The features after the combination of the first four scales are fully connected to obtain the transformed features after the combination of the first four scales 3-8 Convolutional inference features of scale 1 graph Transformation features after combining the first two scales Transformation features after combining the first three scales Transformation features after combining the first four scales These four features are connected in series to obtain the individual relationship expression features of the tth frame 3-9 Input individual relationship expression features of frame t Use the maximum pooling operation to obtain the scene relationship expression features of the tth frame The specific contents of step 4 are as follows: 4-1 Input the first frame of video and obtain the individual features x of the first frame according to steps 1-4 1 and scene features 1 ; 4-2 According to step 3-8, obtain the individual relationship expression features of the first frame 4-3 According to step 3-9, the scene relationship expression feature of the first frame is obtained, which is recorded as 4-4 Use random initialization to obtain the initial memory state feature c of LSTM 0 ; 4-5 Use random initialization to obtain the initial hidden state feature h of LSTM 0 ; 4-6 Obtain the spatiotemporal fusion features of the first frame: 4-6-1 Characterize individual relationships Perform a 1-layer full connection transformation to obtain the transformed individual features 4-6-2 Characterizing scene relationships Perform a 1-layer fully connected transformation to obtain the transformed scene features 4-6-3 Hidden state feature h 0 , perform a 1-layer full connection transformation to obtain the transformed temporal hidden state feature h 0 '; 4-6-4 The transformed scene features and the transformed temporal hidden state feature h 0 'Sum and add to the transformed individual features On the top, the spatiotemporal fusion individual features of the first frame are obtained Among them, Broadcast is a broadcast operation, which uses replication to expand the dimension of features; 4-6-5 Input the spatiotemporal fusion individual features of the first frame Execute step 2 to obtain the multi-scale individual features of the first frame; 4-6-6 For the multi-scale individual features of the first frame, execute step 3 to obtain the spatiotemporal fusion scene features of the first frame 4-7 Input the first frame of spatiotemporal fusion scene features The initial temporal hidden state feature h 0 , the initial memory state feature c 0 , using the LSTM formula, calculate the time memory state feature c after the first frame LSTM inference 1 and the temporal hidden state feature h 1 : Where σ is the Sigmoid function, i 1 is the input gate of the first frame, W i and b i are the weight and bias of the input gate; f 1 is the forget gate of the first frame, W f and b f are the weights and biases of the forget gate; is the memory gate of the first frame, W c and b c are the weight and bias of the memory gate; o 1 is the output gate, W o and b o are the weight and bias of the output gate; 4-8 Input the individual feature x of the second frame 2 , scene features 2 , and the temporal hidden state feature h after LSTM inference in the first frame 1 , execute steps 4-6 to obtain the spatiotemporal fusion scene features of the second frame 4-9 Input the spatiotemporal fusion scene features of the second frame The temporal hidden state feature h of the first frame 1 , the memory state feature c of the first frame 1 , using the LSTM formula of steps 4-7, calculate the temporal hidden state feature h after LSTM inference of the second frame 2 , and the temporal memory state feature c 2 ; 4-10 Input the individual features, scene features, and hidden state features of the subsequent frames, repeat steps 4-8 and 4-9, and obtain the temporal hidden state feature h of the nth frame. n , where n is the number of the last frame; The specific contents of step 5 are as follows: 5-1 Sum the scene features of all frames of the video of group violence and the temporal hidden state features of all frames of the video obtained in step 4 to obtain the group violence features of the video; 5-2 Perform a full-connection transformation on the group violence behavior features of the group violence behavior video to identify the group violence behavior category: Among them, s t is the scene feature of the tth frame, h t is the hidden state feature of the t-th frame, W g are the parameters of the fully connected transformation for group identification; 5-3 Predict the video frames of the video training set of group violence, obtain the predicted group category, and use the real labeled group category of the training set to design the loss function. The loss function adopts the cross entropy form: Among them, y G is the predicted category of group violence behavior, It is a category of group violence that is truly labeled; 5-4 Use the loss function of 5-3 to train the spatiotemporal relationship reasoning expression model to obtain model parameters, which include the model parameters in steps 2, 3, 4, and 5; The specific content of step 6 is as follows: 6-1 Sample the test video to obtain a set of behavior video frame images; 6-2 Input video frames, and use step 1 to obtain individual features and scene features of each frame; 6-3 Input individual features and scene features. In the calculation process of step 2, use the model parameters obtained by training in step 5 to obtain the individual features after graph convolution reasoning; 6-4 Input the individual features after graph convolution inference. In the calculation process of step 3, use the model parameters obtained by training in step 5 to obtain the individual relationship expression features and scene relationship expression features; 6-5 Input the individual relationship expression features and the scene relationship expression features. In the calculation process of step 4, the model parameters obtained by training in step 5 are used to obtain the temporal hidden state features. 6-6 Input the temporal hidden state features and use the model parameters obtained through training in step 5 to obtain the group violence behavior detection results.
