A method and system for detecting and identifying group behavior based on deep learning
By combining trajectory and image features with deep learning, combined with the Banzhaf weighting strategy of cooperative game theory, the core feature modeling and complexity issues in group behavior recognition are solved, and efficient and accurate group behavior recognition and interpretability are achieved.
Patent Information
- Application Number
- CN202311868124.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2043-12-29
AI Technical Summary
It is difficult for existing technologies to accurately model core features in group behavior recognition, and the complexity and computational overhead of deep learning models make it difficult to effectively identify group behaviors in complex scenes, and the model has poor interpretability.
A group behavior detection and recognition method based on deep learning is adopted. By comprehensively utilizing the trajectory features and image features in images and videos, a multi-level information model is designed, combined with the Banzhaf weight strategy of cooperative game theory, dynamically adjusting feature weights, and using the Transformer encoder for classification. Prediction and visualization system through PyQt tool.
It improves the accuracy and efficiency of group behavior recognition, simplifies the model structure, enhances interpretability, can effectively eliminate irrelevant influences in complex scenes, and improves the understandability and accuracy of recognition results.
Smart Images

Figure CN117789094B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of behavior detection and recognition methods, and in particular to a group behavior detection and recognition method and system based on deep learning. Background Art
[0002] The behavior of social groups is diverse and interactive, which is of great significance to various fields. Group behavior analysis can not only deeply understand human social interactions, but also provide key insights for various application fields. This analysis method is not only suitable for behavioral observation and analysis in daily life, but also has important application prospects in aspects such as sports event research and social behavior analysis. Studying group behavior, especially the modeling of core features, is a complex and challenging task. In this process, one of the main challenges is how to determine and model the core features of the group. Another challenge is to accurately identify group behavior in complex scenarios, eliminate interference from irrelevant people, and focus on the behavior patterns within the group.
[0003] Traditional methods usually rely on handcrafted features such as motion trajectories, HOG (histogram of gradients) or MBH (histogram of motion boundaries) to identify group behaviors. These methods analyze from two perspectives: one is top-down, studying the overall motion pattern of the entire group or each subgroup; the other is bottom-up, identifying each individual separately, and conducting analysis at the individual and group levels. With the rise of deep learning technology, more and more studies have begun to use deep models to analyze group behavior. These deep learning models can learn higher-level feature representations directly from raw data and capture more subtle changes and patterns in group behavior. In particular, for models with images as input, they can learn the changes in the spatiotemporal relationship of group behavior, thereby improving the accuracy and robustness of recognition. At present, group behavior recognition algorithms based on deep learning usually go through three processing and analysis stages. First, various network architectures are used for feature learning and extraction to detect human bodies in group behavior scenes. Second, the individual behaviors are characterized and recognized through the obtained human tracking sequences. Then, the group behavior is recognized by combining the interaction information between human bodies and human bodies, and human bodies and scenes. In some network architectures, multiple features such as motion trajectories, RGB images, optical flow information, and scene information are used. Although this improves the recognition accuracy, it greatly increases the complexity of the model.
[0004] Most of the early proposed methods of characterizing group activities based on trajectory features explored the relationship between object entities through the strength and type of causal relationship between two entity trajectories and traditional speed and position features. This method is effective in paired group behavior recognition, but the recognition accuracy is not high. Deep learning models are usually considered black box models, and their internal operating mechanisms and decision-making processes are difficult to explain, which may limit the analysis and understanding of the model recognition results. In addition, some networks such as CNN (Convolutional Neural Network) / 3DCNN and two-stream networks have high computational overhead and are greatly affected by complex background interference. The two-stream network processes RGB video sequences and optical flow data separately, and trains two networks separately, which has a higher computational overhead. RNN (Recurrent Neural Network) / LSTM (Long Short Time Memory) uses a serial processing method for time series data, and the network architecture training is more difficult, the demand for training data is relatively large, and the hardware requirements are also relatively high. Transformer uses parallel computing to effectively reduce the computing time. However, this architecture cannot use the sequential information in the sequence data, and needs to introduce position encoding information, and also requires a large amount of data for network training. At present, Transformer is rarely used in the field of group behavior recognition and the technology is not yet mature.
[0005] In order to solve the above problems, the present invention proposes a group behavior detection and recognition method and system based on deep learning. Summary of the invention
[0006] The purpose of the present invention is to propose a group behavior detection and recognition method and system based on deep learning to solve the problems raised in the background technology. The present invention comprehensively utilizes the trajectory characteristics and image characteristics of human motion in image videos to form multi-level information including individual motion characteristics, group member interaction characteristics and group overall characteristics, taking into account the spatial relationship, dynamic changes and interactive behaviors between individuals, and solving the problem of what features should be used to model the core group behavior characteristics while ensuring accuracy.
[0007] In order to achieve the above object, the present invention adopts the following technical solutions:
[0008] A group behavior detection and recognition method based on deep learning includes the following steps:
[0009] S1. Collect group image videos, extract trajectory features from the collected group image videos, and obtain individual behavior features and interactive behavior features;
[0010] S2, processing the images in the collected group image video to obtain group behavior characteristics;
[0011] S3, based on the individual behavior characteristics and interactive behavior characteristics obtained in S1 and the group behavior characteristics obtained in S2, a branch fusion strategy combined with cooperative game theory is designed to adjust the weights of the above three different levels of characteristics to achieve a dynamic weight allocation strategy;
[0012] S4. Design a group behavior recognition network based on deep learning to process the three different levels of behavior features processed by S3, achieve accurate classification prediction, and obtain the final classification result;
[0013] S5. Use PyQt tools on PyCharm software to design and implement a group behavior recognition system, input the classification results obtained in S4, and visualize the current group behavior category.
[0014] Preferably, the obtaining of personal behavior characteristics in S1 specifically includes the following contents:
[0015] A1. Clearly define the individual motion information of the task at the time frame level. The specific content is as follows: The individual motion information of character j at time frame t is defined as Where t=0,1,.....,t′,j=0,1.....,j′; individual motion information The function is expressed as:
[0016]
[0017] Where P i Indicates the center position; V i Indicates speed; A i represents acceleration;
[0018] A2. Integrate the motion information of each member in the current frame to obtain a comprehensive representation of the motion information of all members P t , the specific function is expressed as:
[0019]
[0020] A3. Divide the entire video into t consecutive frames, and integrate the motion information of the t frames together as the final information representation of the video segment. The above information representation is recorded as set G, and its specific function is expressed as:
[0021] G={P 0 ,P 1 ,P 2 ,.....,P t′} (3)
[0022] Where P t’ It represents the comprehensive representation of the motion information of all group members in the t'th frame.
[0023] Preferably, the acquiring of the interactive behavior features in S1 specifically includes the following contents:
[0024] B1. Capture the relative position between characters m and n D m,n , obtain the spatial contact or proximity between the two;
[0025] B2. Get the speed difference V between characters m and n m,n , used to reflect the coordination or conflict of movement between the two;
[0026] B3. Obtain the acceleration information of characters m and n to reflect the speed of individual motion state change; further obtain the acceleration difference A between characters m and n m,n , used to reflect the motor coordination and interaction between individuals;
[0027] B4. Combining various factors in B1 to B3, construct the interaction information between characters m and n as a m,n , the specific function is expressed as:
[0028] a m,n ={D m,n ,V m,n ,A m,n (4) Based on this, generate the interaction information set A between group member m and other members in the current time frame m , the specific function is expressed as:
[0029] A m ={a m,0 ,a m,1 ,a m,2 ,......,a m,j′} (5)
[0030] B5. Use a two-way interactive method to construct a comprehensive representation I of all interactive information in the entire image. The specific function is expressed as:
[0031] I={A 0 ,A 1 ,A 2 ,......,A j′} (6)
[0032] In the formula, matrix I represents a matrix containing multiple dimensions, in which each element is used to reflect the interaction characteristics between different group members;
[0033] B6. Apply convolution operation to process the interactive features extracted in B5, define a one-dimensional convolution kernel k, and the function of convolution operation is expressed as follows:
[0034] E=I*k(7)
[0035] Where E is a more discriminative and expressive semantic representation.
[0036] Preferably, the acquiring of group behavior characteristics in S2 specifically includes the following contents:
[0037] C1, using feature maps as the source of generating overall information semantics, selecting the only key frame in the video to extract overall information;
[0038] C2, select ResNet-18 as the backbone network and input the original image X∈R C×H×W , after ResNet-18 network processing, the feature map f∈R K×K×D , where H×W is the size of the original image X, C is the number of channels of the original image X; K×K is the size of the feature map f, and D is the number of channels of the feature map f;
[0039] C3, flatten the multi-channel feature map to construct the overall information semantics V. The specific function is expressed as:
[0040] V=vec(f) (8)
[0041] Where vec represents matrix-vector operation.
[0042] Preferably, S3 specifically includes the following contents:
[0043] S3.1. Based on the three branch behavior characteristics of individual behavior characteristics, interactive behavior characteristics, and group behavior characteristics, combined with cooperative game theory, each branch is regarded as player i. Assuming that there are n∈R players participating in the game, there are N=2n non-empty alliances. Define a non-empty alliance as s∈N. For any non-empty alliance, define an alliance value function, which is used to describe the value brought by the results of the collaboration of each player in a specific alliance. For a given non-empty alliance, its value function is expressed as:
[0044]
[0045] In the formula, Indicates the predicted probability of branch i obtaining category j for a certain sample;
[0046] S3.2. For a given non-empty coalition s, calculate the support of other branches for each category j Its specific function is expressed as:
[0047]
[0048] In the formula, support The size of represents the combined impact of other models in the alliance; if Indicates that branch i is decisive for the classification result to be category j, and the support The size of A also reflects the influence of branch i on a certain category j from the side. i ; A i The specific function is expressed as follows:
[0049]
[0050] S3.3. Add up the influence of branch i in different categories to get its total influence on the non-empty alliance s The specific function is expressed as:
[0051]
[0052] S3.4. Comprehensively consider all possible non-empty alliances and calculate the total influence B(i) of branch i on different alliances. The specific function is expressed as:
[0053]
[0054] S3.5. Normalize the total influence B(i) of different alliances obtained in S3.4, introduce the concept of Banzhaf weight, and calculate the final Banzhaf weight index Banzhaf(i). The specific function is expressed as:
[0055]
[0056] S3.6. Use the Banzhaf weight index Banzhaf(i) obtained in S3.5 to adjust the branch weights of the three branch behavior characteristics: individual behavior characteristics, interactive behavior characteristics, and group behavior characteristics, to implement a dynamic weight allocation strategy.
[0057] Preferably, the S4 specifically includes the following contents:
[0058] S4.1, integrate the hierarchical information of individual behavior characteristics, interactive behavior characteristics, group behavior characteristics and learnable embedding vector CLS to generate three unique semantics;
[0059] S4.2, import the three types of semantic information generated in S4.1 into the Transformer encoder along their respective paths for multiple encoding;
[0060] S4.3, after the encoding is completed, the classification information is extracted through the MLP Head;
[0061] S4.4, use the Banzhaf fusion module to perform weighted fusion on the classification information obtained in S4.3, and after the Softmax layer, obtain accurate classification prediction results.
[0062] A group behavior detection and recognition system based on deep learning, the system comprising:
[0063] A data acquisition module, used to collect and input group image videos to be processed;
[0064] The data processing module includes a trajectory feature processing unit and an RGB image processing unit. The trajectory feature processing unit is used to extract trajectory features from the collected video to obtain individual behavior features and interactive behavior features; the RGB image processing unit is used to process the collected images to obtain group behavior features;
[0065] The three-level semantic feature Banzhaf fusion module uses a branch fusion strategy combined with cooperative game theory to adjust the weights of the individual behavior features, interactive behavior features, and group behavior features obtained in the data processing module to achieve a dynamic weight distribution;
[0066] The group behavior classification and recognition module is used to process the three different levels of behavior features processed by the three-level semantic feature Banzhaf fusion module to achieve accurate classification prediction and obtain the final classification results;
[0067] The visualization module uses the PyQt tool on the PyCharm software to process the classification results obtained by the group behavior classification and recognition module to visualize the current group behavior category.
[0068] Compared with the prior art, the present invention provides a method and system for detecting and identifying group behavior based on deep learning, which has the following beneficial effects:
[0069] (1) The present invention constructs multi-level information including individual motion features, group member interaction features and group overall features by comprehensively utilizing the trajectory features and image features of the person's motion in the image. It takes into account the spatial relationship, dynamic changes and interactive behaviors between individuals, and solves the problem of what features should be used to model the core group behavior characteristics while ensuring accuracy.
[0070] (2) The present invention adopts a multi-branch structure to design a network model and a corresponding detection and recognition method. The model structure is simple and clear. By encoding and integrating different information at multiple levels and introducing the Banzhaf power index in game theory as a fusion strategy for model branches, it can effectively eliminate the influence of irrelevant personnel in complex scenarios and solve the problem of the limitations of deep learning models in analyzing and understanding recognition results. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] Figure 1 This is a flow chart of a group behavior detection and recognition method based on deep learning mentioned in Example 1 of the present invention;
[0072] Figure 2 This is a network structure diagram of the group feature detection and recognition model combined with deep learning mentioned in Example 2 of the present invention;
[0073] Figure 3 This is a network structure diagram of the group behavior recognition model based on deep learning mentioned in Example 2 of the present invention;
[0074] Figure 4 This is a framework diagram of a GUI system for group behavior recognition based on deep learning mentioned in Example 2 of the present invention;
[0075] Figure 5 This is a schematic diagram of the GUI system login interface mentioned in Example 2 of the present invention;
[0076] Figure 6 This is a schematic diagram of the functional interface of the GUI system mentioned in Example 2 of the present invention;
[0077] Figure 7 This is a visualization diagram of the recognition results using the t-SNE method mentioned in Example 2 of the present invention.
[0078] Figure 8 This is a diagram showing the influence of whether to use the Banzhaf fusion strategy on the accuracy of the recognition result mentioned in Example 2 of the present invention. DETAILED DESCRIPTION
[0079] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0080] The present invention proposes a group behavior detection and recognition method and system based on deep learning. The present invention utilizes trajectory information and image information of human motion to construct multi-level feature semantic information: individual motion features, group member interaction features and group overall features.
[0081] First, we extract rough motion trajectory information from the video to model the individual’s motion trajectory, behavior, and other individual-level features, so as to capture the spatial relationship and dynamic changes between individuals. This helps us understand the interaction between individuals and their role in group behavior.
[0082] Secondly, the interaction information of group members is used. Interaction is an important part of group behavior. Starting from the trajectory changes between group members and analyzing the movement information difference between group members, more fine-grained information about the interaction and collaboration between individuals can be obtained. This information can help understand the dynamic relationship between individuals in order to capture key behaviors such as collaboration, cooperation or competition in the group.
[0083] Finally, the original image is used as the source of overall information. The original image is analyzed and processed to obtain overall information about group behavior from a visual perspective. This method has a wide range of application scenarios and can adapt to a variety of group behavior recognition scenarios and data sources. It provides important information about the background, context, and motivation of group behavior, thereby enhancing the understanding and recognition of group behavior.
[0084] Based on the above information modeling method, the present invention adopts a multi-branch structure to design a network model. The model structure is clear and concise. By encoding and integrating different information at multiple levels and making full use of multi-level information, it not only enhances the interpretability but also can effectively analyze complex group behaviors.
[0085] At the same time, in the context of multi-source information fusion, the present invention focuses on designing a branch fusion strategy of the Banzhaf power index. This strategy is based on the concept of cooperative game theory, and its purpose is to accurately give the degree of influence of each information source on the final classification result. Specifically, by calculating the Banzhaf power index, the relative importance of the semantic information used by each branch of the network model in the decision-making process can be accurately measured. In the application process in the model, this strategy allows weighted fusion based on the contribution of each information source to the classification result, thereby achieving orderly integration of multi-source information. At the same time, the use of this strategy enriches the way of information integration, and also provides a new method for the effective convergence of multi-source information.
[0086] The following is an explanation of a group behavior detection and recognition method and system based on deep learning proposed by the present invention in conjunction with specific examples and related drawings. The specific contents are as follows.
[0087] Embodiment 1:
[0088] See also Figure 1 The present invention proposes a group behavior detection and recognition method based on deep learning. The specific process is as follows: Figure 1 shown.
[0089] 1. The present invention proposes a group feature modeling method combined with deep learning. The constructed network model is as follows: Figure 2As shown in the figure: trajectory features and image RGB features are used to model a video into multi-level semantic information, including individual motion feature semantics, interactive behavior feature semantics and group feature semantics, as shown below.
[0090] (1) Individual motion feature semantics: In order to accurately and comprehensively describe the motion features of each team member, the individual motion information of the characters is clearly defined at the time frame level as follows: The individual motion information of character j (j = 0, 1, ..., j') at time frame t (t = 0, 1, ..., t') is defined as Specifically, the motion information of an individual is uniquely identified by an individual identifier and includes its center position P on the time frame. i , speed V i and acceleration A i And other important dynamic properties. It is expressed as follows:
[0091]
[0092] Then, in order to obtain the comprehensive representation P of the motion information of all members in the current frame t , and integrate the information of each member. In this way, the motion status of all members in the current frame can be fully described:
[0093]
[0094] In order to fully consider the contextual characteristics of individual motion behaviors and their dynamic changes, the following strategy is adopted: the entire video is divided into t consecutive frames, and the motion information of t frames is integrated together as the final information representation of the video segment. Such information representation is represented as a set called G:
[0095] G={P 0 ,P 1 ,P 2 ,.....,P t′} (3)
[0096] The application of this strategy is not only to comprehensively display the movement state of individuals, but also to capture the temporal characteristics of the entire video sequence. The integration of multi-frame information helps to more accurately understand the movement patterns of individuals and the temporal dynamics of group behavior.
[0097] (2) Interaction behavior feature semantics: Information differences are used to model the interaction behavior feature semantics, aiming to capture the relative relationships between group members. The process of interactive behavior feature semantic modeling includes key elements such as spatial contact, movement coordination, and dynamic changes.
[0098] Specifically: define the interaction information between characters m and n (m, n∈j=0,1,2,...,j′) as a m,n By capturing the relative position D between two individuals m,n , we can obtain important information about the degree of spatial contact or proximity between the two; the velocity difference V m,n As an indicator of the coordination or conflict between their movements; in addition, acceleration reflects the speed of change of individual movement state, which has an important influence on dynamic changes in interaction; by examining the acceleration difference A m,n , we can further grasp the movement coordination and interaction between individuals. Taking these factors into consideration, we can construct a comprehensive interaction information:
[0099] a m,n ={D m,n , V m,n , A m,n} (4)
[0100] On this basis, the interactive information set A between group member m and other members in the current time frame is generated. m :
[0101] A m ={a m,0 , a m,1 , a m,2 ......, a m,j′} (5)
[0102] Using a two-way interactive approach, we finally construct a comprehensive representation of all interactive semantic information in the entire image as I:
[0103] I={A 0 ,A 1 , A 2 ,......,A j′} (6)
[0104] The above matrix I is a matrix containing multiple dimensions, in which each element reflects the interaction characteristics between different group members. In order to explore the complex and diverse interaction patterns more deeply, the extracted interaction features are processed by convolution operation, and a one-dimensional convolution kernel k is defined. The convolution operation is expressed as follows:
[0105] E=I*k(7)
[0106] This generates a more discriminative and expressive semantic representation E, so as to deeply explore the complex and rich interactive relationships occurring in a frame of image and provide strong support for subsequent behavior recognition.
[0107] (3) Group feature semantics: In order to fully understand the image information, a comprehensive approach is adopted to construct the overall information semantics through the overall image. This paper chooses to use feature maps as the source of generating overall information semantics. To avoid information redundancy, only the unique key frame in the video is selected to extract the overall information. In this paper, ResNet-18 is selected as the backbone network. The input original image X∈R C×H×W , H×W is the size of the image, and C is the number of channels. The feature map obtained by the ResNet-18 network is f∈R K×K×D , K×K is the size of the feature map, and D is the number of channels of the feature map f. Flatten the multi-channel feature map to construct the overall information semantics V:
[0108] V=vec(f) (8)
[0109] Compared with the original image, the feature map can better capture local and global visual features, including information such as edges, textures, shapes, and colors, and is more abstract and semantically expressive. In addition, the process of obtaining the feature map combines convolution operations with pooling operations, which can preserve the spatial structure of the input data and learn local and global contextual relationships in the network. Doing so can not only preserve important visual information, but also reduce data dimensions, providing richer and more powerful information support for subsequent behavior recognition tasks.
[0110] 2. The present invention proposes a branch fusion strategy combined with cooperative game theory. In the field of cooperative game theory, the core research issues involve the decision-making of multiple players to reach common interests through negotiation, cooperation and distribution of benefits. In this context, in order to objectively evaluate the influence of each player in the cooperative game, the concept of Banzhaf weight is introduced. The core idea of Banzhaf weight is to measure the degree of influence of each player on the results of the cooperative game, especially when forming a cooperative alliance, it quantifies the degree to which a certain player has a decisive influence on the collaborative results.
[0111] In the present invention, each branch of the model is regarded as player i, and there are a total of n∈R players participating in the game, and there will be N=2 n non-empty alliances, define a non-empty alliance as s∈N, for any non-empty alliance, we can define an alliance value function, which describes the value brought by the result of the collaboration of each player in a specific alliance. Formally, for a given non-empty alliance, its value function can be expressed as:
[0112]
[0113] Value function v i(s) represents the predicted probability of model branch i for a certain sample to obtain category j. For a given non-empty coalition s, calculate the support of other branches for each category j. The specific formula is as follows:
[0114]
[0115] The size of the support indicates the combined influence of other models in the alliance. It indicates that branch i is decisive for the classification result to be category j. It can be seen that the support The size of A also reflects the influence of branch i on a certain category j from the side. i ; A i The specific expressions are as follows:
[0116]
[0117] The influence of branch i in different categories is accumulated to get the total influence on alliance s:
[0118]
[0119] Therefore, considering all possible non-empty alliances, the total influence B(i) of branch i on different alliances can be calculated:
[0120]
[0121] At this time, B(i) needs to be normalized to obtain the final Banzhaf weight index Banzhaf(i):
[0122]
[0123] By using the normalized Banzhaf power index to adjust the weights of the three branches of the model, a dynamic weight allocation strategy is implemented. This strategy enables the model to adaptively select the most suitable weight combination according to the characteristics and requirements of different samples, thereby significantly improving the recognition accuracy and performance of the model.
[0124] 3. This invention proposes a group behavior recognition network based on deep learning. The network model structure is as follows Figure 3As shown in the figure, the model generates three unique semantics by integrating the multi-level information constructed in the early stage and the learnable embedding vector CLS. These three semantic information are imported into the Transformer encoder along their respective paths. After multiple encodings, the classification information is finally extracted by the MLP (Multi-Layer Perceptron) Head. Then, the Banzhaf fusion module is used to perform weighted fusion on this information, and after the Softmax layer, accurate classification prediction is obtained.
[0125] Then, a group behavior recognition system was designed and implemented using the PyQt tool on the PyCharm software. The system is equipped with a deep learning-based group behavior recognition algorithm that can be applied to complex scenarios. The system block diagram is shown below: Figure 4 The interface is simple and clear, and the functions are powerful, which can provide users with various needs for behavior detection and dangerous situation forecasting. After the user logs in to the system, load the image, and select the required function according to the control. The final classification result is visualized in the image in the form of a label. If the reporting function is selected, the current system status will be recorded and a reporting file will be generated. The GUI system login interface is as follows Figure 5 As shown, the GUI system function page is displayed as follows Figure 6 shown.
[0126] Embodiment 2:
[0127] Based on Example 1, but with the following differences:
[0128] The network model mentioned in Example 1 of the present invention is compared with the existing network models of the same type on the market, and the specific results are shown in Table 1.
[0129] Table 1
[0130]
[0131] It can be seen from Table 1 that compared with the model that only uses RGB features, the method proposed in the present invention uses additional trajectory feature input, which enables the model to capture more rich contextual information and achieve better recognition results. In addition, compared with the model that uses two modal features at the same time, the model performance is also remarkable. Compared with the complex optical flow features, the trajectory feature processing method used by the network model is simpler and has smaller computational requirements. This enables the model to have higher efficiency and practicality while maintaining high recognition accuracy. The lightweight computing requirements of the model provide strong support for its deployment in practical applications. Compared with the model that relies on scene information as an auxiliary, the network model proposed in the present invention is not limited by the constraints of the scene, so it can be more easily applied to a variety of different scenes and applications. This provides a basis for its wide applicability, thereby facilitating the promotion and application of group behavior recognition technology.
[0132] In order to evaluate the effectiveness of the proposed multi-level information modeling method, it was verified on the volleyball dataset. The results are shown in Table 2:
[0133] Table 2
[0134] Information Hierarchy Accuracy on the volleyball dataset. Individual·+·interaction·+·group 93.7% Interaction+group 87.7% Individual·+·group 89.5% Individual·+·interaction 86.5% individual 81.9% interaction 85.8% group 79.8%
[0135] At the same time, the present invention uses the t-SNE method to visualize the recognition results. Figure 7 It can be seen that when the information level is increased, the accuracy of the model is improved. At the same time, each model level has different expressiveness for different group behaviors. When all are used, the best recognition accuracy is obtained, and each behavior category is effectively clustered together. At the same time, in order to reflect the effectiveness of the Banzhaf fusion strategy proposed in this invention, the average weight method of the model branch is used for comparison. The results obtained on the volleyball dataset are as follows: Figure 8 It shows that the model using the Banzhaf fusion strategy has better performance in the recognition task. Using the average weighted method can only obtain an 82.6% recognition accuracy rate. When these branches are combined using the Banzhaf fusion strategy, not only can better recognition results be achieved than a single branch, but by comprehensively utilizing the features provided by different information, we can obtain more comprehensive and accurate behavior recognition results with an accuracy rate of 93.7%. It is worth noting that when all information is used, that is, in the original model design, the performance of each branch is balanced to a certain extent. This means that each branch has played its respective role, and through the Banzhaf fusion strategy, they have cooperated with each other to finally achieve the best performance of the model.
[0136] Embodiment 3:
[0137] Based on Example 1-2, but with the following differences:
[0138] See also Figure 1 The implementation process of the group behavior detection and recognition method based on deep learning proposed by the present invention is described below in combination with a specific implementation case. The specific contents are as follows:
[0139] Step 1: Preprocess the collected group image video and use the Dlib tool to extract the required trajectory features to obtain the position coordinate information of the characters, such as [x min ,y min ,x max ,y max] .
[0140] Step 2: Extract individual behavior features and interactive behavior features from trajectory features, and extract group behavior features from images; the specific operations are as follows:
[0141] Calculate the center position of the position coordinate information obtained in step 1 to obtain:
[0142] [x center ,y center ]=[(x min +x max ) / 2,(y min +y max ) / 2]
[0143] Calculate the position difference between frames to get the speed information, with frame t 1 , t 2 For example, assuming that their center positions are The speed information is:
[0144]
[0145] Then the speed difference is calculated by the formula:
[0146]
[0147] By calculating the acceleration, we can get the required individual behavior characteristics. By integrating the individual behaviors of all the characters in the current image, we can get the behavior characteristics of all people in the current video. Taking individuals m and n as an example, by calculating the distance between different individuals:
[0148]
[0149] Speed difference:
[0150]
[0151] Acceleration difference:
[0152]
[0153] For all characters in the video, we take the middle frame and perform traversal calculations, and then extract it through convolution operations to obtain the interactive behavior features in the current frame. For the original RGB image, we use the pre-trained ResNet-18 network to obtain the feature map. The specific operation process is as follows: normalize the image size to 3*224*224, then pass it through forward propagation, and after the average pooling layer, obtain the feature map size of 512*1*1. After flattening, we get the group behavior features.
[0154] Step S3: Perform group behavior recognition on the extracted features. The specific operations are as follows:
[0155] After adding the learnable embedding vector CLS to the extracted features of the three different levels, they are sent to the Transformer network, and the multi-head attention mechanism is used. The Transformer model has 4 layers and 6 attention heads at the individual level, 6 layers and 6 attention heads at the interaction level, and 4 layers and 8 attention heads at the group level. At the same time, in order to avoid overfitting, the droppath technology is used in the group level branch. After MLPhead, the classification result obtained by three layers of information is obtained. At this time, it is sent to the three-level semantic feature fusion module implemented according to the Banzhaf power index strategy, and the final classification result is obtained through the softmax function;
[0156] Step S4, visualize the current group behavior category. The specific operations are as follows: use the PyQt tool on the PyCharm software to design a visual page, embed the written network model into the page control in the form of a slot function, and realize system construction.
[0157] The above description is only a preferred specific embodiment of the present invention, which is illustrative rather than restrictive. For example, the above examples (or one or more of them) can be used in combination with each other. However, the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field, within the technical scope disclosed by the present invention, can make equivalent replacements, modifications, omissions, combinations and other changes (for example, partial fusion of individual motion characteristics, interactive behavior characteristics, group behavior characteristics or adjustment of the fusion module order) according to the technical solution and inventive concept of the present invention, which should be covered within the protection scope of the present invention.
Claims
1. A group behavior detection and recognition method based on deep learning, It is characterized in that The following steps are involved: S1. Collect group image videos, extract trajectory features from the collected group image videos, and obtain individual behavior features and interactive behavior features; The obtaining of personal behavior characteristics specifically includes the following contents: A1. Clearly define the individual motion information of the task at the time frame level. The specific content is as follows: The individual motion information of character j at time frame t is defined as Where t=0,1,.....,t′,j=0,1.....,j′; individual motion information The function is expressed as: Where P i Indicates the center position; V i Indicates speed; A i represents acceleration; A2. Integrate the motion information of each member in the current frame to obtain a comprehensive representation of the motion information of all members P t , the specific function is expressed as: A3. Divide the entire video into t consecutive frames, and integrate the motion information of the t frames together as the final information representation of the video segment. The above information representation is recorded as set G, and its specific function is expressed as: G={P 0 ,P 1 ,P 2 ,.....,P t′ } (3) Where P t’ It represents the comprehensive representation of the motion information of all group members in the t'th frame; The acquisition of interactive behavior characteristics specifically includes the following contents: B1. Capture the relative position between characters m and n D m,n , obtain the spatial contact or proximity between the two; B2. Get the speed difference V between characters m and n m,n , used to reflect the coordination or conflict of movement between the two; B3. Obtain the acceleration information of characters m and n to reflect the speed of individual motion state change; further obtain the acceleration difference A between characters m and n m,n , used to reflect the motor coordination and interaction between individuals; B4. Combining various factors in B1 to B3, construct the interaction information between characters m and n as a m,n , the specific function is expressed as: a m,n ={D m,n ,V m,n ,A m,n (4) Based on this, generate the interaction information set A between group member m and other members in the current time frame m , the specific function is expressed as: A m ={a m,0 ,a m,1 ,a m,2 ,......,a m,j′ } (5) B5. Use a two-way interactive method to construct a comprehensive representation I of all interactive information in the entire image. The specific function is expressed as: I={A 0 ,A 1 ,A 2 ,......,A j′ }(6) In the formula, matrix I represents a matrix containing multiple dimensions, in which each element is used to reflect the interaction characteristics between different group members; B6. Apply convolution operation to process the interactive features extracted in B5, define a one-dimensional convolution kernel k, and the function of convolution operation is expressed as follows: E=I*k(7) In the formula, E is a semantic representation with more discriminative and expressive power; S2, processing the images in the collected group image video to obtain group behavior characteristics; The obtaining of group behavior characteristics specifically includes the following contents: C1, using feature maps as the source of generating overall information semantics, selecting the only key frame in the video to extract overall information; C2, select ResNet-18 as the backbone network and input the original image X∈R C×H×W , after ResNet-18 network processing, the feature map f∈R K×K×D , where H×W is the size of the original image X, C is the number of channels of the original image X; K×K is the size of the feature map f, and D is the number of channels of the feature map f; C3, flatten the multi-channel feature map to construct the overall information semantics V. The specific function is expressed as: V=vec(f) (8) In the formula, vec represents matrix-vector operation; S3. Based on the individual behavior characteristics and interactive behavior characteristics obtained in S1 and the group behavior characteristics obtained in S2, a branch fusion strategy combined with cooperative game theory is designed to adjust the weights of the above three different levels of characteristics to achieve a dynamic weight allocation strategy; specifically, it includes the following contents: S3.
1. Based on the three branch behavior characteristics of individual behavior characteristics, interactive behavior characteristics, and group behavior characteristics, combined with cooperative game theory, each branch is regarded as player i. Assuming that there are n∈R players participating in the game, there are N=2n non-empty alliances. Define a non-empty alliance as s∈N. For any non-empty alliance, define an alliance value function, which is used to describe the value brought by the results of the collaboration of each player in a specific alliance. For a given non-empty alliance, its value function is expressed as: In the formula, Indicates the predicted probability of branch i obtaining category j for a certain sample; S3.
2. For a given non-empty coalition s, calculate the support of other branches for each category j Its specific function is expressed as: In the formula, support The size of represents the combined impact of other models in the alliance; if It means that branch i is decisive for the classification result to be category j, and the support The size of A also reflects the influence of branch i on a certain category j. i , A i The specific expressions are as follows: S3.
3. Add up the influence of branch i in different categories to get its total influence on the non-empty alliance s The specific function is expressed as: S3.
4. Comprehensively consider all possible non-empty alliances and calculate the total influence B(i) of branch i on different alliances. The specific function is expressed as: S3.
5. Normalize the total influence B(i) of different alliances obtained in S3.4, introduce the concept of Banzhaf weight, and calculate the final Banzhaf weight index Banzhaf(i). The specific function is expressed as: S3.6, using the Banzhaf weight index Banzhaf(i) obtained in S3.5 to adjust the branch weights of the three branch behavior characteristics of individual behavior characteristics, interactive behavior characteristics, and group behavior characteristics, to achieve a dynamic weight allocation strategy; S4. Design a group behavior recognition network based on deep learning to process the three different levels of behavior features processed by S3, achieve accurate classification prediction, and obtain the final classification result; specifically include the following contents: S4.1, integrate the hierarchical information of individual behavior characteristics, interactive behavior characteristics, group behavior characteristics and learnable embedding vector CLS to generate three unique semantics; S4.2, import the three types of semantic information generated in S4.1 into the Transformer encoder along their respective paths for multiple encoding; S4.3, after the encoding is completed, the classification information is extracted through the MLP Head; S4.4, use the Banzhaf fusion module to perform weighted fusion on the classification information obtained in S4.3, and after the Softmax layer, obtain accurate classification prediction results; S5. Use PyQt tools on PyCharm software to design and implement a group behavior recognition system, input the classification results obtained in S4, and visualize the current group behavior category.
2. A deep learning-based group behavior detection and recognition system constructed based on the method of claim 1, It is characterized in that The system comprises: A data acquisition module, used to collect and input group image videos to be processed; The data processing module includes a trajectory feature processing unit and an RGB image processing unit. The trajectory feature processing unit is used to extract trajectory features from the collected video to obtain individual behavior features and interactive behavior features; the RGB image processing unit is used to process the collected images to obtain group behavior features; The three-level semantic feature Banzhaf fusion module uses a branch fusion strategy combined with cooperative game theory to adjust the weights of the individual behavior features, interactive behavior features, and group behavior features obtained in the data processing module to achieve a dynamic weight distribution; The group behavior classification and recognition module is used to process the three different levels of behavior features processed by the three-level semantic feature Banzhaf fusion module to achieve accurate classification prediction and obtain the final classification results; The visualization module uses the PyQt tool on the PyCharm software to process the classification results obtained by the group behavior classification and recognition module to visualize the current group behavior category.
