Non-human primate social activity identification method
By establishing a dual-stream neural network model of non-human primate social behavior data set and self-attention mechanism, combined with a multi-objective tracking system, the problems of low accuracy and high computational cost in non-human primate social behavior recognition are solved, and lightweight and efficient social behavior recognition and multi-objective tracking are achieved.
Patent Information
- Application Number
- CN202510461895.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-08-12
AI Technical Summary
The lack of effective data sets and identification methods for non-human primates in the prior art, especially multi-objective tracking and social behavior analysis, results in low recognition accuracy and high computational cost.
A data set of social behavior in non-human primates is established, a dual-stream neural network model with self-attention mechanism is used to combine with a multi-objective tracking system, and inter-frame action correlation modeling is enhanced through self-attention mechanism, Kalman filtering is used to improve occlusion problems, and lightweight and efficient social behavior recognition is achieved.
It significantly improves the accuracy of social behavior recognition in non-human primate social videos, provides about 2,000 multi-target tracking data, solves the problem of high label interchange and missed detection rates caused by occlusion, and improves the accuracy and robustness of behavior recognition.
Smart Images

Figure CN120472525A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of neuroscience technology, and in particular to a method for identifying social activities of non-human primates. Background Art
[0002] Identifying, analyzing, and studying the individual behaviors and social activities of non-human primates lays the foundation for biological characterization and provides experimental evidence for the field of neuroscience. This work is of great significance for research in human neuroscience and the treatment of related diseases. Currently, such studies are typically conducted using macaques and primarily focus on single macaques. Studies of multiple macaques, especially social behaviors between macaques, are rare. For example, MonkeyinLab provides 13 categories of daily behaviors of individual macaques in a cage, but does not provide categories for interactive behaviors. The MBVD-9 dataset provides behavioral data for both single and group monkey scenarios, but does not cover social behavior data between macaques.
[0003] In recent years, an increasing amount of biological object tracking data has been published, but datasets for multi-object tracking of non-human primates are extremely rare. A few multi-object tracking datasets do include non-human primates, but their data volume is minimal. For example, the YouTube-VIS dataset and the OVIS multi-object tracking dataset provide multi-object tracking, detection, and segmentation annotation information for non-human primates. However, the total number of videos and instances of non-human primates included in these datasets is relatively small.
[0004] The behavior recognition task of non-human primates is usually transferred from the behavior recognition task of humans. The segmented continuous video sequence is calculated through the behavior recognition algorithm to obtain the corresponding social behavior categories, such as grooming, mounting, and active approach. To date, behavior recognition is mainly divided into two types: traditional manual feature methods and deep learning methods. Before the emergence of deep learning, the manual feature method performed well on behavior recognition tasks, but it had a huge computational cost and was difficult to expand and deploy. With the development of deep learning, convolutional neural networks have been applied to solve behavior recognition tasks. This process can be summarized into three major trends: the first trend is to use a two-stream convolutional neural network to learn the motion information in the video by adding an optical flow branch. The motion information and appearance information in the video are the two most important attributes. The RGB stream branch in the two-stream network can effectively learn the appearance information, while the optical flow branch can learn the motion information. Finally, the final prediction result is obtained through the fusion of the two streams. This pioneering method has promoted the development of behavior recognition technology. However, the cost of pre-calculating the optical flow is high and difficult to store, which is not conducive to efficient training and deployment; the second trend is to use 3D convolution kernels as processing units to model the motion information in the video by adding The third dimension is used to learn temporal information to extract deeper features. The C3D and I3D models adopt this method. However, the optimization of 3D convolutional networks is more difficult and requires more video frames for training, which increases the training cost and takes several weeks to converge and optimize. At the same time, deployment is also challenging. In order to replace the 3D convolution kernel to model the temporal relationship between frames, so as to improve the efficiency and accuracy of behavior recognition and deploy the model to a larger dataset, an efficient video modeling method has been proposed. For example, the TSM network uses time-shifting operations instead of 3D convolution kernels for temporal modeling, and performs long-term modeling in a segmented manner, thereby learning the temporal correlation between video frames at multiple time scales.
[0005] In recent years, many researchers have focused on behavioral analysis of individual macaques, while relatively little research has been conducted on the social behavior of non-human primates. For example, SK Han et al. used depth images to study non-human primate behavior, but unfortunately, they did not include analysis of social behavior. While the SIPEC proposed by Marks et al. can analyze three types of social behaviors, the range of social behaviors is significantly limited. Furthermore, while the BARN and TAS-MBR networks can perform multi-label behavioral detection in social macaques, they do not address the analysis of interactive behaviors in non-human primates. Therefore, there is a need to strengthen research on the social behavior of non-human primates. Summary of the Invention
[0006] The purpose of the present invention is to provide a new method for identifying and analyzing social activities of non-human primates in response to the problems existing in the prior art.
[0007] The technical solution of the present invention is: a method for identifying social activities of non-human primates, using macaques as representatives of non-human primates, comprising the following steps:
[0008] The first step is to obtain the original video data of macaque social behavior;
[0009] The second step is to define the macaque social behavior categories and establish a macaque social behavior dataset;
[0010] The third step is to establish a multi-target tracking system on the monitoring platform and train the built multi-target tracking system;
[0011] The fourth step is to establish a network model for identifying macaque social behavior;
[0012] The fifth step is to use the macaque social behavior dataset to train the macaque social behavior recognition network model;
[0013] In the sixth step, the trained macaque social behavior recognition network model is combined with the trained multi-target tracking system to directly identify the long video of macaque social behavior and output the final recognition result of the macaque social behavior category.
[0014] A further solution is that the above first step includes the following specific steps:
[0015] ① Build a data acquisition platform: Prepare a breeding cage with a middle horizontal bar and an upper top bar. A camera for data video acquisition is fixed in front of the breeding cage. At the same time, a monitoring platform is set up to receive the video data collected and sent by the camera and to classify, store, and analyze the video data;
[0016] ②Prepare and place macaques: Divide 8 young macaques into 4 groups, 6 middle-aged macaques into 3 groups, and 10 old macaques into 5 groups, with two macaques in each group; each macaque is equipped with an identity chip for identification, and each macaque's head, limbs, and back are dyed with different colors to distinguish macaques with similar appearances in the same group.
[0017] ③ Video recording of macaque social behavior: Each group of macaques was placed in a cage for video recording for one week. The lights were turned on at 8:00 and turned off at 17:00 every day to obtain the original video data.
[0018] A further solution is that the second step includes the following specific steps:
[0019] ① Define macaque social behavior categories within the monitoring platform: 13 categories in total, including chasing, grooming, sitting, riding, passing the middle bars in opposite directions, avoiding the bottom of the cage, approaching the bottom of the cage, approaching the upper middle bar, avoiding the upper middle bar, approaching the lower middle bar, avoiding the lower middle bar, approaching the top bar, and avoiding the top bar.
[0020] ② Construct a macaque social behavior dataset: Use the monitoring platform to crop the cage area from the original video, use a Python script to input the start time of the interaction action to crop the cropped video, obtain video clips of the corresponding behavior category, and use OpenCV tools and Dense_Flow tools to extract RGB images and optical flow images for each cropped video clip.
[0021] A further solution is that when constructing the macaque social behavior dataset in step ② of the second step above, the social behavior categories of middle-aged and elderly macaques are limited to 11 categories except for approaching the top pole and avoiding the top pole, resulting in a total of 1,653 video clips of middle-aged and elderly macaques; the social behavior categories of young macaques are limited to 12 social behavior categories except for mounting, resulting in a total of 2,290 video clips of young macaques.
[0022] A further solution is that the above third step includes the following specific steps: establishing an existing multi-target tracking system on the monitoring platform, manually selecting video clips with partial occlusion and severe occlusion from the original video, using Baidu BMLAI platform to label them, and using the labeled data to train the constructed multi-target tracking system.
[0023] A further solution is that the macaque social behavior recognition network model established in the fourth step includes an input module for video input, an image extraction module for optical flow images and RGB images from the input video, a network structure for processing optical flow images and RGB images, a self-attention module for the network structure to adaptively predict results, and an output module for outputting recognition results; the above network structure uses ResNet as the backbone network, introduces a self-attention mechanism into the TS-SA dual-stream neural network, performs self-attention calculation on the feature vector after global pooling of each frame, and adds a self-attention branch in parallel to the fully connected layer with fixed weights to form an adaptive prediction head. The weight of the dynamic self-attention layer enables the network to adaptively make predictions based on different inputs, combines the results of temporal pooling, and through softmax operation, obtains the prediction results of the RGB branch and the optical flow branch respectively, and obtains the final prediction result after weighted fusion of the two.
[0024] A further solution is that the specific method of the above fifth step is: input the macaque social behavior dataset constructed in the second step into the macaque social behavior recognition network model, use OpenCV and Dense_Flow tools to extract the RGB images and optical flow images of the video clips respectively, and use them as the input of the RGB branch and the optical flow branch respectively, and then perform temporal sparse group random sampling, and select 8 frames from each video clip to input them into the RGB branch and the optical flow branch for training respectively; during the training process, the self-attention mechanism is used to enhance the modeling ability of inter-frame action correlation to better capture the timing information in the video clips; at the same time, the time-shift module is used for temporal modeling, and the piece group attention mechanism is added to make the network model focus on the part that is most beneficial to the final result; finally, the output information of the RGB branch and the optical flow branch is weightedly fused to give the recognition result of the macaque social behavior category in the video clip.
[0025] A further solution is that the sixth step includes the following specific steps:
[0026] ① The original long video of the macaque social behavior to be identified was continuously cut into a fixed 40-frame window to obtain the cropped video clips;
[0027] ② A multi-target tracking system was used to obtain the center point position of each macaque in the cropped video clip, and a Kalman filter was used to improve the occlusion problem of the two macaques in the video clip;
[0028] ③ Input the video clip processed by step ① into the trained macaque social behavior recognition network model to give a preliminary recognition result of the macaque social behavior category in the video clip. Combined with the center point position of each macaque obtained in step ②, a more accurate final recognition result of the macaque social behavior category is output.
[0029] The present invention has positive effects: (1) The present invention establishes a non-human primate social behavior dataset containing approximately 4,000 video clips of 13 social behavior categories of young and middle-aged macaques, providing solid data support for the progress of non-human primate social behavior analysis. (2) For the non-human primate dataset, the present invention introduces a self-attention mechanism and applies it to the dual-stream model for behavior recognition. This innovative measure only slightly increases the computational complexity while maintaining the lightweight and high efficiency of the model, greatly enhancing the model's ability to model inter-frame action correlation. (3) The present invention adopts a method that integrates multi-target tracking and social behavior recognition, thereby significantly improving the recognition accuracy of social behavior in long non-human primate social videos, providing approximately 2,000 non-human primate multi-target tracking data, and improving the occlusion problem through Kalman filtering technology, solving the problem of label exchange and high missed detection rate caused by occlusion, and comprehensively improving the joint judgment accuracy of social behavior recognition and multi-target tracking in long video scenes, laying a solid foundation for future biological characteristic analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 This is a schematic diagram of the modeling method of the macaque social behavior recognition network model built in the present invention. DETAILED DESCRIPTION
[0031] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0032] (Example 1)
[0033] The non-human primate social activity recognition method of this embodiment uses macaques as a representative non-human primate and is implemented according to the following steps:
[0034] The first step is to obtain the original video data of macaque social behavior, which includes the following specific steps:
[0035] 1. Build a data acquisition platform: Prepare a feeding cage with a middle horizontal bar and an upper top bar. A camera for data video acquisition is fixed in front of the cage. A monitoring platform is also provided to receive the video data collected and sent by the camera and to classify, store, and analyze the video data. In this embodiment, the camera resolution is 1280×1204, and the cage dimensions are 2m long × 1m wide × 1m high.
[0036] ②Prepare and place macaques: Divide 8 young macaques into 4 groups, 6 middle-aged macaques into 3 groups, and 10 old macaques into 5 groups, with two macaques in each group; each macaque is equipped with an identity chip for identification, and each macaque's head, limbs, and back are dyed with different colors to distinguish macaques with similar appearances in the same group.
[0037] ③ Video recording of macaque social behavior: Each group of macaques was placed in a cage for video recording for one week. The lights were turned on at 8:00 and turned off at 17:00 every day to obtain the original video data.
[0038] The second step is to define the macaque social behavior categories and establish a macaque social behavior dataset, which includes the following specific steps:
[0039] ① Define macaque social behavior categories within the monitoring platform: The social behavior categories of macaques are defined as chasing, grooming, sitting, riding, passing the middle bars towards each other, avoiding the bottom of the cage, approaching the bottom of the cage, approaching the upper middle bar, avoiding the upper middle bar, approaching the lower middle bar, avoiding the lower middle bar, approaching the top bar, and avoiding the top bar, a total of 13 categories. This definition basically covers all the interactive behaviors of the two macaques in the experimental cage.
[0040] ② Construct a macaque social behavior dataset: Use the monitoring platform to crop the cage area from the original video, use a Python script to input the start time of the interactive action into the cropped video, obtain video clips of the corresponding behavior category, and crop approximately 4,000 video action clips. Finally, use OpenCV tools and Dense_Flow tools to extract RGB images and optical flow images for each video clip.
[0041] Preferably, since middle-aged and elderly macaques rarely jump to the top pole, the social behavior categories of middle-aged and elderly macaques are limited to 11 categories except top pole approach and top pole avoidance, and the total number of video clips of middle-aged and elderly macaques is 1,653; young macaques almost never perform mounting actions, so the social behavior categories of young macaques are limited to 12 social behavior categories except mounting, and the total number of video clips of young macaques is 2,290.
[0042] Preferably, in this step, the video resolution is set to 640×320 and the video frame rate is set to 25fps, and the breeding cage area is cropped from the original video.
[0043] As can be seen from the foregoing, compared with the current situation in which most non-human primate behavior datasets in the prior art only contain behavior data of a single macaque or multi-label behavior data, and the number of interactive behavior categories and video clips is extremely small, the non-human primate social behavior dataset of the present invention provides 13 categories of social behavior data of two macaques in a single cage, filling the gap in non-human primate interactive behavior datasets.
[0044] The third step is to establish a multi-target tracking system on the monitoring platform and train the built multi-target tracking system:
[0045] An existing multi-target tracking system was established on the monitoring platform. Video clips with partial occlusion and severe occlusion were manually selected from the original video, annotated using the Baidu BML AI platform, and the established multi-target tracking system was trained using the annotated data. During the annotation process, all identity instance labels in the video were fixed into two categories. Each macaque had a unique identity instance label in the same video. When a target object disappeared due to occlusion and then reappeared, its identity instance label remained unchanged. In this embodiment, 45 video clips with occlusion were selected from the original video, and the coordinate points and mask information of approximately 2,000 target objects were annotated.
[0046] The fourth step is to establish a network model for identifying macaque social behavior:
[0047] Using the existing ResNet as the backbone network, a self-attention mechanism is introduced into the existing TS-SA two-stream neural network. Specifically, the globally pooled feature vector of each frame is incorporated into the self-attention calculation. A self-attention branch is added in parallel to the fixed-weight fully connected layer to form an adaptive prediction head, enabling the network to adaptively predict results. The time complexity of the self-attention mechanism is O(n^2d), where n is the sequence length and d is the vector dimension. The pseudocode for applying the self-attention mechanism to the TS-SA two-stream neural network is shown in Table 1, where the dimension of Hpooled is T×C, where T is the number of video frames (8) and C is the hidden layer dimension. Because T is extremely small, the adaptive prediction head in the model only adds a small amount of computation. However, this "dynamic" self-attention layer weighting enables the model to more effectively capture temporal information in the video sequence, significantly improving the accuracy and robustness of action recognition.
[0048] The structure of the macaque social behavior recognition network model is as follows: Figure 1 As shown in Figure 1, it includes an input module, an image extraction module, a network structure, a self-attention module, and an output module. In the input module of Figure (a), S1, S2, …, SN represent the input video clips. The image extraction module extracts the corresponding optical flow images and RGB images, namely the Flow x and Flow y images and RGB images shown in Figure (b). Through temporal sparse group random sampling, 8 frames are selected from each video clip as input features and passed to the network structure of Figure (c). The input features are temporally modeled by the time-shift module in Figure (c). Compared to other video understanding tasks, action recognition tasks require not only learning spatial information (appearance information) but also capturing temporal information.
[0049] The time-shift module utilizes a two-dimensional convolutional neural network to capture temporal information, enabling information exchange between adjacent frames. Through iteration, information from the previous frame is transferred to the next, achieving zero-computation spatiotemporal modeling and comparable performance to 3D convolutional kernels. To maintain spatial modeling capabilities and prevent the loss of channel information in the current frame during the shift, the time-shift module is inserted into the residual branch of the residual module to prevent degradation of spatial feature learning capabilities.
[0050] After time-shifting, the features are divided into N basis groups. Within each basis group, a slice-group attention mechanism is computed, and the basis groups are concatenated along the channel dimension. Next, a 1×1 convolution kernel replaces the fully connected layer to integrate the channel dimension of the feature map, and global average pooling is used to extract global features. Differences in social behavior among non-human primates are reflected in changes in spatial relationships and have a global scale. The hidden layer features after global average pooling are sufficient to capture key action characteristics.
[0051] Therefore, the present invention performs self-attention calculation on the feature vector after global pooling of each frame, and adds a self-attention branch in parallel to the fully connected layer with fixed weights to form an adaptive prediction head. The weight of this dynamic self-attention layer enables the network to adaptively make predictions based on different inputs. Combined with the results of temporal pooling and through the softmax operation, the prediction results of the RGB branch and the optical flow branch are obtained respectively. After weighted fusion of the two, the final prediction result is obtained.
[0052] The principle of adaptive prediction head is as follows Figure 1 As shown in the upper right corner: Q is the query vector, which represents the information that the current element wants to interact with other elements; K is the key vector, which represents the characteristics of each element in the input sequence; V is the value vector, which represents the actual information carried by each element. Q, K, and V are obtained by performing different linear transformations on the same input sequence. By calculating the similarity between Q and K, V is weighted and summed. In the multi-head self-attention mechanism, the attention mechanism is repeated many times to generate multiple different attention outputs, called multiple "heads". A total of 8 "heads" are used in the present invention. The outputs of these heads are concatenated and then processed through linear transformation to fuse the information of multiple heads.
[0053] The algorithm of the macaque social behavior recognition network model built in this step is shown in Table 1:
[0054] Table 1
[0055]
[0056] In Table 1, H represents the feature map obtained by the residual neural network, Hpooled is the output feature map after global average pooling of H, and a simplified representation is obtained after pooling. Hfinal is the vector after time-series pooling of Hpooled. By averaging Hpooled in the time dimension, a simplified representation representing the entire time-series feature is generated. Hattention is the attention weight matrix calculated by the self-attention mechanism, and Hattention_final is the vector after time-series average pooling of Hattention. Hattention_final and Hfinal are respectively processed by the fully connected layer and then the softmax operation to obtain the prediction result prediction. The final label prediction result label is obtained by weighted fusion of the prediction result of the RGB branch and the prediction result of the optical flow branch in a ratio of 1:1.5.
[0057] The fifth step is to use the macaque social behavior dataset to train the macaque social behavior recognition network model:
[0058] The constructed macaque social behavior dataset was used as input to the macaque social behavior recognition network model. The RGB images and optical flow images of the video clips were extracted using OpenCV and Dense_Flow tools, respectively, and used as the input of the RGB branch and optical flow branch respectively. Then, temporal sparse group random sampling was performed. 8 frames were selected from each video clip, and these frames were input into the RGB branch and optical flow branch for training respectively. During the training process, the self-attention mechanism was used to enhance the modeling ability of inter-frame action correlation to better capture the temporal information in the video clips. At the same time, the time-shift module was used for temporal modeling, and the piece group attention mechanism was added to make the network model focus on the part that is most beneficial to the final result. Finally, the output information of the RGB and optical flow branches was weightedly fused to give the recognition result of the macaque social behavior category in the video clip.
[0059] To verify the effectiveness of the macaque social behavior recognition network model established in the present invention, three popular network models, SlowFastm, TSN, and TS-SA, were selected together with the model of the present invention. Recognition accuracy tests were conducted using the commonly used public HMDB51 and UCF101 datasets in the industry, as well as the middle-aged and elderly macaque datasets and the young macaque datasets established in the present invention. The results are shown in Table 2. It can be seen that the recognition model of the present invention has significantly improved recognition accuracy compared with various classic algorithm models.
[0060] Table 2
[0061]
[0062] The sixth step is to use the trained macaque social behavior recognition network model in combination with the trained multi-target tracking system to directly identify the long video of macaque social behavior and output the final recognition result of the macaque social behavior category. The specific steps include the following:
[0063] ① The original long video of the macaque social behavior to be identified was continuously cut into a fixed 40-frame window to obtain the cropped video clips;
[0064] ② A multi-target tracking system was used to obtain the center point position of each macaque in the cropped video clip, and a Kalman filter was used to improve the occlusion problem of the two macaques in the video clip;
[0065] ③ Input the video clip processed by step ① into the trained macaque social behavior recognition network model to give a preliminary recognition result of the macaque social behavior category in the video clip. Combined with the center point position of each macaque obtained in step ②, a more accurate final recognition result of the macaque social behavior category is output.
[0066] The present invention further improves the accuracy of behavior recognition in long videos by combining a multi-target tracking system with a macaque social behavior recognition network model. Kalman filtering is used to improve the occlusion problem of multi-target tracking data, solving the difficult problems of label swapping and high missed detection rate caused by occlusion.
[0067] To verify the effectiveness of this embodiment's method for identifying social activities in non-human primates, we employed manual labeling for comparison. Because middle-aged and juvenile macaques exhibit a rich variety of movements, and manual comparison is cumbersome and labor-intensive, we randomly sampled one hour of video from each of the juvenile and middle-aged macaques for labeling and comparison. The results demonstrated that the error rate between the inferred recognition results from this embodiment and the manually labeled results was below 10%.
[0068] The above embodiments are illustrations of specific implementation methods of the present invention, rather than limitations of the present invention. Technicians in the relevant technical fields can make various changes and modifications to obtain corresponding equivalent technical solutions without departing from the spirit and scope of the present invention. Therefore, all equivalent technical solutions should be included in the patent protection scope of the present invention.
Claims
1. A method for identifying social activities of non-human primates, characterized in that: Using macaques as a representative non-human primate, the following steps are included: The first step is to obtain the original video data of macaque social behavior; The second step is to define the macaque social behavior categories and establish a macaque social behavior dataset; The third step is to establish a multi-target tracking system on the monitoring platform and train the built multi-target tracking system; The fourth step is to establish a network model for identifying macaque social behavior; The fifth step is to use the macaque social behavior dataset to train the macaque social behavior recognition network model; In the sixth step, the trained macaque social behavior recognition network model is combined with the trained multi-target tracking system to directly identify the long video of macaque social behavior and output the final recognition result of the macaque social behavior category.
2. The method for identifying social activities of non-human primates according to claim 1, wherein: The first step includes the following specific steps: ① Build a data acquisition platform: Prepare a breeding cage with a middle horizontal bar and an upper top bar. A camera for data video acquisition is fixed in front of the breeding cage. At the same time, a monitoring platform is set up to receive the video data collected and sent by the camera and to classify, store, and analyze the video data; ②Preparing and placing macaques: Divide 8 young macaques into 4 groups, 6 middle-aged macaques into 3 groups, and 10 elderly macaques into 5 groups, with two macaques in each group. Each macaque was equipped with an identification chip for identification. The top of the head, limbs, and back of each macaque were dyed with different colors to distinguish macaques with similar appearances in the same group. ③ Video recording of macaque social behavior: Each group of macaques was placed in a cage for video recording for one week. The lights were turned on at 8:00 and turned off at 17:00 every day to obtain the original video data.
3. The method for identifying social activities of non-human primates according to claim 1, wherein: The second step includes the following specific steps: ① Define macaque social behavior categories within the monitoring platform: 13 categories in total, including chasing, grooming, sitting, riding, passing the middle bars in opposite directions, avoiding the bottom of the cage, approaching the bottom of the cage, approaching the upper middle bar, avoiding the upper middle bar, approaching the lower middle bar, avoiding the lower middle bar, approaching the top bar, and avoiding the top bar. ② Construct a macaque social behavior dataset: Use the monitoring platform to crop the cage area from the original video, use a Python script to input the start time of the interaction action to crop the cropped video, obtain video clips of the corresponding behavior category, and use OpenCV tools and Dense_Flow tools to extract RGB images and optical flow images for each cropped video clip.
4. The method for identifying social activities of non-human primates according to claim 3, wherein: When constructing the macaque social behavior dataset in step ② of the second step, the social behavior categories of middle-aged and elderly macaques were limited to 11 categories except for pole approach and pole avoidance, resulting in a total of 1,653 video clips of middle-aged and elderly macaques; the social behavior categories of young macaques were limited to 12 social behavior categories except for mounting, resulting in a total of 2,290 video clips of young macaques.
5. The method for identifying social activities of non-human primates according to claim 1, wherein: The third step includes the following specific steps: An existing multi-target tracking system was established on the monitoring platform. Video clips with partial occlusion and severe occlusion were manually selected from the original video and annotated using Baidu's BML AI platform. The annotated data was then used to train the established multi-target tracking system.
6. The method for identifying social activities of non-human primates according to claim 1, wherein: The macaque social behavior recognition network model established in the fourth step includes an input module for video input, an image extraction module for optical flow images and RGB images from the input video, a network structure for processing optical flow images and RGB images, a self-attention module for the network structure to adaptively predict results, and an output module for outputting recognition results; the network structure uses ResNet as the backbone network, introduces a self-attention mechanism into the TS-SA dual-stream neural network, performs self-attention calculation on the feature vector after global pooling of each frame, and adds a self-attention branch in parallel to the fully connected layer with fixed weights to form an adaptive prediction head. The weight of the dynamic self-attention layer enables the network to adaptively make predictions based on different inputs, combines the results of temporal pooling, and through a softmax operation, obtains the prediction results of the RGB branch and the optical flow branch respectively, and obtains the final prediction result after weighted fusion of the two.
7. The method for identifying social activities of non-human primates according to claim 1, wherein: The specific method of the fifth step is as follows: inputting the macaque social behavior dataset constructed in the second step into the macaque social behavior recognition network model, using OpenCV and Dense_Flow tools to extract RGB images and optical flow images of the video clips respectively, and using them as inputs of the RGB branch and the optical flow branch respectively, then performing temporal sparse group random sampling, selecting 8 frames from each video clip and inputting them into the RGB branch and the optical flow branch respectively for training; During training, the self-attention mechanism is used to enhance the modeling capability of inter-frame action correlation to better capture the temporal information in video clips. At the same time, a time-shift module is used for temporal modeling, and a piece group attention mechanism is added to make the network model focus on the part that is most beneficial to the final result; finally, the output information of the RGB branch and the optical flow branch is weightedly fused to give the recognition result of the macaque social behavior category in the video clip.
8. The method for identifying social activities of non-human primates according to claim 1, wherein: The sixth step includes the following specific steps: ① The original long video of the macaque social behavior to be identified was continuously cut into a fixed 40-frame window to obtain the cropped video clips; ② A multi-target tracking system was used to obtain the center point position of each macaque in the cropped video clip, and a Kalman filter was used to improve the occlusion problem of the two macaques in the video clip; ③ Input the video clip processed by step ① into the trained macaque social behavior recognition network model to give a preliminary recognition result of the macaque social behavior category in the video clip. Combined with the center point position of each macaque obtained in step ②, a more accurate final recognition result of the macaque social behavior category is output.