A dangerous behavior warning method and system based on group behavior recognition
By designing a behavioral feature extraction network and an adaptive subgroup division algorithm, combined with a convolutional recognition network, the problem of identifying dangerous behaviors in the complex environment of railway maintenance stations is solved, and high-precision and highly adaptable dangerous behavior alarms are achieved.
Patent Information
- Application Number
- CN202411151012.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2044-08-21
AI Technical Summary
Existing technology cannot effectively identify and warn of dangerous behaviors in complex environments in railway maintenance stations, especially due to complex lighting conditions and equipment layouts. Existing automated monitoring technology cannot meet the needs for identifying dangerous behaviors in railway maintenance.
Design a dangerous behavior warning method based on group behavior recognition. Group and individual behavior characteristics are extracted through the behavioral feature extraction network, and the adaptive subgroup division algorithm and convolutional recognition network are used to enhance global features to improve recognition accuracy and adaptability.
It significantly improves the accuracy of dangerous behavior identification and adaptability to complex environments, enhances the accuracy and generalization ability of individual and group behavior identification, and ensures accurate identification and warning in complex environments.
Smart Images

Figure CN118675114B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing and recognition, and in particular to a dangerous behavior warning method and system based on group behavior recognition. Background Art
[0002] With the rapid development of the railway transportation industry, the inspection and maintenance work of railways has gradually increased. However, the environment of railway maintenance stations is generally more complex and there are many safety risks. Therefore, when carrying out railway maintenance work, ensuring the safety of maintenance personnel has naturally become an important goal that cannot be ignored.
[0003] In the prior art, safety monitoring during railway maintenance is often carried out through manual supervision and inspection to ensure that no safety problems occur during the maintenance process. However, the efficiency of manual supervision and inspection is too low, and the inspection range is limited, and it is impossible to monitor the entire maintenance section in real time. Therefore, it is necessary to combine the existing automated monitoring technology to identify and warn maintenance workers in the entire maintenance section of dangerous behaviors.
[0004] However, the environment inside the railway maintenance station is complex, and the lighting conditions and equipment layout greatly increase the difficulty of identification. In addition, there are many people involved in railway maintenance work and the maintenance behaviors are diverse. The existing automated monitoring technology cannot meet the requirements of dangerous behavior identification and alarm during railway maintenance. Summary of the invention
[0005] Based on this, the purpose of the present invention is to provide a dangerous behavior warning method and system based on group behavior recognition. By designing a behavior feature extraction network, group behavior features and individual behavior features in the image to be identified are extracted respectively, and the interactive relationship between single targets to be identified and subgroups composed of similar targets to be identified is extracted, which greatly enhances the accuracy and generalization ability of individual and group behavior recognition. In addition, by designing an adaptive subgroup division algorithm, the complex dynamics within the subgroup are accurately identified, which greatly improves the accuracy of subgroup division and further improves the accuracy of overall recognition. A convolutional recognition network is also designed to perform global feature enhancement, thereby improving the recognition accuracy and adaptability in complex environments. The present invention greatly improves the accuracy of dangerous behavior recognition warnings and its adaptability to complex environments.
[0006] The present invention proposes a dangerous behavior warning method based on group behavior recognition, comprising:
[0007] Acquire an image to be identified and perform preprocessing to extract basic features of each target individual to be identified in the image to be identified, wherein the preprocessing is used to correct the brightness and color of the image to be identified, and the basic features include features of all single target individuals to be identified;
[0008] Inputting two identical basic features into a group behavior feature extraction branch and an individual behavior feature extraction branch of a behavior feature extraction network, respectively, wherein the behavior feature extraction network is used to respectively obtain group behavior features between subgroups composed of a plurality of target individuals to be identified and individual behavior features between a single target individual to be identified;
[0009] The group behavior feature extraction branch classifies the basic features according to an adaptive subgroup division algorithm to obtain a plurality of different subgroups. The adaptive subgroup division algorithm is used to divide the target individuals to be identified with similar features into a subgroup, and then obtain the group behavior features according to the interactive feature extraction algorithm;
[0010] The individual behavior feature extraction branch obtains individual behavior features according to a deep interactive feature extraction algorithm;
[0011] The group behavior characteristics and the individual behavior characteristics are fused to obtain fused features and input into a convolutional recognition network to obtain dangerous behavior recognition results for warning. The convolutional recognition network is used to enhance the fused features on a global scale and then identify and classify them into dangerous behaviors and non-dangerous behaviors.
[0012] In summary, according to the above-mentioned dangerous behavior warning method based on group behavior recognition, by designing a behavior feature extraction network, group behavior features and individual behavior features in the image to be identified are extracted respectively, and the interactive relationship between single targets to be identified and subgroups composed of similar targets to be identified is extracted, which greatly enhances the accuracy and generalization ability of individual and group behavior recognition, and also designs an adaptive subgroup division algorithm to accurately identify the complex dynamics within the subgroup, greatly improves the accuracy of subgroup division, and further improves the accuracy of overall recognition, and designs a convolutional recognition network to perform global feature enhancement, thereby improving the recognition accuracy and adaptability in complex environments. The present invention greatly improves the accuracy of dangerous behavior recognition warnings and adaptability to complex environments. Specifically, an image to be identified is obtained and preprocessed to extract basic features of each target individual to be identified in the image to be identified. The preprocessing is used to correct the brightness and color of the image to be identified. The basic features include features of all single target individuals to be identified. Preprocessing the image improves the quality of the image to be identified and reduces the impact of complex environments. Two completely identical basic features are input into a group behavior feature extraction branch and an individual behavior feature extraction branch of a behavior feature extraction network. The behavior feature extraction network is used to respectively obtain group behavior features between subgroups composed of multiple target individuals to be identified and individual behavior features between single target individuals to be identified. The group behavior feature extraction branch classifies the basic features according to an adaptive subgroup division algorithm to obtain multiple different subgroups. The adaptive subgroup division algorithm is used to The target individuals to be identified with similar characteristics are divided into a subgroup, and then the group behavior characteristics are obtained according to the interactive feature extraction algorithm, which greatly improves the accuracy of subgroup division and effectively captures the interactive relationship between subgroups, thereby improving the overall behavior recognition accuracy. The individual behavior feature extraction branch obtains individual behavior characteristics according to the deep interactive feature extraction algorithm, effectively captures the complex interactive relationship between individuals, thereby improving the overall behavior recognition accuracy. The group behavior characteristics and the individual behavior characteristics are fused to obtain fused characteristics and input into the convolutional recognition network to obtain dangerous behavior recognition results for alarm. The convolutional recognition network is used to enhance the fused characteristics on a global scale, and then identify and classify them as dangerous behaviors and non-dangerous behaviors. The present invention greatly improves the accuracy of dangerous behavior recognition alarms and its adaptability to complex environments.
[0013] Furthermore, the step of obtaining the image to be identified and preprocessing it to extract basic features of each target individual to be identified in the image to be identified specifically includes:
[0014] Extract the red, green and blue color channels in the image to be identified to obtain the images of the corresponding color channels and compare the values of each pixel position on the red, green and blue channels to perform weighted grayscale processing. The formula for the weighted grayscale processing is as follows:
[0015]
[0016] in, Represents the weighted gray value of the pixel. represents the minimum function, represents the maximum value function, represents the red channel pixel value, represents the green channel pixel value, Represents the blue channel pixel value;
[0017] According to the weighted grayscale values of the pixels, a grayscale image is constructed and input into the graph convolutional neural network. According to the relationship and bounding box between the key skeletal nodes of each target individual to be identified in the grayscale image, the basic features of each target individual to be identified are extracted.
[0018] Furthermore, the adaptive subgroup division algorithm specifically includes:
[0019] Determine the position coordinates of a single target individual to be identified based on the basic features, and the position coordinates are defined as follows:
[0020]
[0021] in, represents the horizontal coordinate of the left bounding box, represents the horizontal coordinate of the right bounding box, Represents the horizontal and vertical coordinates of the upper bounding box, Indicates the horizontal and vertical coordinates of the lower bounding box;
[0022] Projecting the position coordinates into position features according to a multi-layer perceptron, wherein the dimension of the position features is D;
[0023] The position feature and the basic feature are added element by element to obtain the individual comprehensive features of all target individuals to be identified and perform cosine similarity calculation, and the first k target individuals to be identified with the highest similarity are divided into the same subgroup.
[0024] Furthermore, the interactive feature extraction algorithm specifically includes:
[0025] The spatial position distances between subgroups are obtained according to the geometric matrix, which is as follows:
[0026]
[0027] in, represents the geometric matrix, represents the time frame, Indicates Frame Neutron Population , Indicates Frame Neutron Population , Indicates the number of channels of input features, Represents spatial location characteristics;
[0028] The spatial position relationship between subgroups is obtained according to the relationship matrix, and the relationship matrix is as follows:
[0029]
[0030] in, represents the relationship matrix, Represents the transformed function, represents the cosine distance calculation function, represents transpose;
[0031] According to the spatial position distance and the spatial position relationship, an association adjacency matrix is constructed to obtain group behavior characteristics. The association adjacency matrix is as follows:
[0032]
[0033] in, represents the correlation adjacency matrix, represents the learnable parameters, , and represents a normalized diagonal matrix.
[0034] Furthermore, the deep interactive feature extraction algorithm specifically includes:
[0035] The first graph convolution layer obtains the interaction relationship between the target individuals to be identified according to the correlation adjacency matrix. The formula for obtaining the interaction relationship between the target individuals to be identified is as follows:
[0036]
[0037] in, Represents the individual interaction relationship, represents the activation function, Indicates The learnable weight matrix of the layer, Indicates the number of layers, represents the association adjacency matrix;
[0038] The similarity of the interaction relationship between the target individuals to be identified is calculated. The formula for calculating the similarity of the interaction relationship between the target individuals to be identified is as follows:
[0039]
[0040] in, Represents an individual For individuals The importance of Represents an individual , Represents an individual , Represents the spatial relationship between individuals. represents the cosine similarity between individuals, Represents an individual The coordinates of the center point of the bounding box, Represents an individual The coordinates of the center point of the bounding box, and Represents an individual and individuals The cosine similarity parameter is Indicates the number of individuals;
[0041] The second graph convolution layer aggregates the interaction relationships according to the interaction relationship similarity to obtain individual behavior characteristics. The formula for obtaining individual behavior characteristics is as follows:
[0042]
[0043] in, represents the individual behavior characteristics after aggregation, Represents independent individual interactions. represents the learnable weight matrix.
[0044] Furthermore, the convolutional recognition network specifically includes:
[0045] An input layer, which fuses group behavior features and individual behavior features through element-wise matrix addition to obtain a feature image of size H*W*3, where H represents the height of the feature image, W represents the width of the feature image, and 3 represents the color channel;
[0046] A convolution layer, wherein the convolution layer includes a plurality of convolution units, each of the convolution units includes a convolution filter, and the convolution filter extracts local features of the feature image;
[0047] A key layer, the key layer comprising a context-aware block and a multi-layer attention block, the context-aware block and the multi-layer attention block enhancing the global features of the feature image;
[0048] A fully connected layer, wherein the fully connected layer maps the global features and the local features to dangerous behavior categories and then performs regularization processing according to dropout;
[0049] The output layer includes a softmax activation function to output the probability of the dangerous behavior category.
[0050] Furthermore, the context perception block and the multi-layer attention block specifically include:
[0051] The context perception block has a dual-channel structure, and the feature graph processed by the convolution layer is input into the dilated convolution branch and the convolution branch respectively. The dilated convolution branch includes a dilated convolution block, a normalization block, a Swish activation block and a 3x3 convolution block. The expansion coefficient of the dilated convolution block is r=3, and the convolution branch includes a 3x3 convolution block and a normalization block.
[0052] The context perception block and the multi-layer attention block are connected via a Swish activation block;
[0053] The multi-layer attention block includes a channel attention layer and a spatial attention layer. The definition of the multi-layer attention block is as follows:
[0054]
[0055] in, represents the output feature through channel attention, represents the channel attention weight, represents the original input features, represents the output feature through spatial attention, represents the spatial attention weight;
[0056] The channel attention layer is defined as follows:
[0057]
[0058] in, represents the activation function, represents average pooling, represents the maximum pooling, represents a shared fully connected network, and represents the multi-layer perception weights, represents the channel-based average pooling feature, Represents the channel-based maximum pooling feature;
[0059] The spatial attention layer is defined as follows:
[0060]
[0061] in, Represents 7X7 convolution kernel convolution operation, represents the average pooling feature based on space, Represents the spatial maximum pooling feature.
[0062] The present invention proposes a dangerous behavior warning system based on group behavior recognition, comprising:
[0063] A basic feature extraction module is used to obtain the image to be identified and perform preprocessing to extract the basic features of each target individual to be identified in the image to be identified. The preprocessing is used to correct the brightness and color of the image to be identified. The basic features include the features of all single target individuals to be identified.
[0064] A behavior feature extraction module, used to input two identical basic features into a group behavior feature extraction branch and an individual behavior feature extraction branch of a behavior feature extraction network, wherein the behavior feature extraction network is used to respectively obtain group behavior features between subgroups composed of a plurality of target individuals to be identified and individual behavior features between a single target individual to be identified;
[0065] The group behavior feature extraction branch classifies the basic features according to an adaptive subgroup division algorithm to obtain a plurality of different subgroups. The adaptive subgroup division algorithm is used to divide the target individuals to be identified with similar features into a subgroup, and then obtain the group behavior features according to the interactive feature extraction algorithm;
[0066] The individual behavior feature extraction branch obtains individual behavior features according to a deep interactive feature extraction algorithm;
[0067] The convolution recognition module is used to fuse the group behavior characteristics and the individual behavior characteristics to obtain the fused characteristics and input them into the convolution recognition network to obtain the dangerous behavior recognition results for alarm. The convolution recognition network is used to enhance the fused characteristics on a global scale and then identify and classify them into dangerous behaviors and non-dangerous behaviors.
[0068] The present invention also provides a storage medium, wherein the storage medium stores one or more programs, and when the programs are executed by a processor, the dangerous behavior warning method based on group behavior recognition as described above is implemented.
[0069] The present invention also provides a computer device, the computer device comprising a memory and a processor, wherein:
[0070] The memory is used to store computer programs;
[0071] When the processor is used to execute the computer program stored in the memory, the dangerous behavior warning method based on group behavior recognition as described above is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] Figure 1 This is a flow chart of a dangerous behavior warning method based on group behavior recognition proposed in the first embodiment of the present invention;
[0073] Figure 2 A flowchart of a dangerous behavior warning method based on group behavior recognition proposed in a second embodiment of the present invention;
[0074] Figure 3 This is a schematic diagram of the structure of a dangerous behavior warning system based on group behavior recognition proposed in the third embodiment of the present invention.
[0075] The following specific implementation manner will further illustrate the present invention in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION
[0076] In order to facilitate understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Several embodiments of the present invention are provided in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.
[0077] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only.
[0078] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0079] See also Figure 1 , which is a flow chart of a dangerous behavior warning method based on group behavior recognition proposed in the first embodiment of the present invention, the dangerous behavior warning method based on group behavior recognition includes steps S01 to S05, wherein:
[0080] Step S01: obtaining an image to be identified and performing preprocessing to extract basic features of each target individual to be identified in the image to be identified;
[0081] It should be noted that in this embodiment, the preprocessing extracts the three color channels of red, green and blue in the image to be identified to obtain images of the corresponding color channels and compare the values of each pixel position on the red, green and blue channels to perform weighted grayscale processing. The formula for the weighted grayscale processing is as follows:
[0082]
[0083] in, Represents the weighted gray value of the pixel. represents the minimum function, represents the maximum value function, represents the red channel pixel value, represents the green channel pixel value, Represents the blue channel pixel value;
[0084] In this embodiment, basic features are extracted by constructing a grayscale image based on the weighted grayscale values of the pixels and inputting it into the graph convolutional neural network. The basic features of each target individual to be identified are extracted based on the relationship between the key skeletal nodes and the bounding box of each target individual to be identified in the grayscale image.
[0085] Step S02: inputting two identical basic features into the group behavior feature extraction branch and the individual behavior feature extraction branch of the behavior feature extraction network respectively;
[0086] Step S03: The group behavior feature extraction branch classifies the basic features according to the adaptive subgroup division algorithm to obtain multiple different subgroups, and then obtains the group behavior features according to the interactive feature extraction algorithm;
[0087] It should be noted that the adaptive subgroup division algorithm in this embodiment determines the position coordinates of a single target individual to be identified based on basic features, and the position coordinates are defined as follows:
[0088]
[0089] in, represents the horizontal coordinate of the left bounding box, represents the horizontal coordinate of the right bounding box, Represents the horizontal and vertical coordinates of the upper bounding box, Indicates the horizontal and vertical coordinates of the lower bounding box;
[0090] Projecting the position coordinates into position features according to a multi-layer perceptron, wherein the dimension of the position features is D;
[0091] The position feature and the basic feature are added element by element to obtain the individual comprehensive features of all target individuals to be identified and the cosine similarity is calculated, and the first k target individuals to be identified with the highest similarity are divided into the same subgroup;
[0092] The interactive feature extraction algorithm in this embodiment specifically includes:
[0093] The spatial position distances between subgroups are obtained according to the geometric matrix, which is as follows:
[0094]
[0095] in, represents the geometric matrix, represents the time frame, Indicates Frame Neutron Population , Indicates Frame Neutron Population , Indicates the number of channels of input features, Represents spatial location characteristics;
[0096] The spatial position relationship between subgroups is obtained according to the relationship matrix, and the relationship matrix is as follows:
[0097]
[0098] in, represents the relationship matrix, Represents the transformed function, represents the cosine distance calculation function, represents transpose;
[0099] According to the spatial position distance and the spatial position relationship, an association adjacency matrix is constructed to obtain group behavior characteristics. The association adjacency matrix is as follows:
[0100]
[0101] in, represents the correlation adjacency matrix, represents the learnable parameters, , and represents a normalized diagonal matrix;
[0102] Traditional partitioning methods only consider spatial information, but do not fully utilize the potential connections between individuals in behavioral characteristics. Since individual characteristics may show different similarities in different contexts, the adaptive subgroup partitioning algorithm adopts a dynamic partitioning strategy to adapt to subgroup partitioning in different situations. In addition, considering that subgroups of fixed scales may not be able to fully capture all important interactions, the adaptive subgroup partitioning algorithm constructs subgroups of different scales by adjusting the value of k. This multi-scale partitioning can more comprehensively capture and express the interactions within the group, thereby forming richer and more expressive group behavior characteristics.
[0103] Step S04: the individual behavior feature extraction branch obtains individual behavior features according to the deep interaction feature extraction algorithm;
[0104] It should be noted that the deep interactive feature extraction algorithm in this embodiment specifically includes:
[0105] The first graph convolution layer obtains the interaction relationship between the target individuals to be identified according to the correlation adjacency matrix. The formula for obtaining the interaction relationship between the target individuals to be identified is as follows:
[0106]
[0107] in, Represents the individual interaction relationship, represents the activation function, Indicates The learnable weight matrix of the layer, Indicates the number of layers, represents the association adjacency matrix;
[0108] The similarity of the interaction relationship between the target individuals to be identified is calculated. The formula for calculating the similarity of the interaction relationship between the target individuals to be identified is as follows:
[0109]
[0110] in, Represents an individual For individuals The importance of Represents an individual , Represents an individual , Represents the spatial relationship between individuals. represents the cosine similarity between individuals, Represents an individual The coordinates of the center point of the bounding box, Represents an individual The coordinates of the center point of the bounding box, and Represents an individual and individuals The cosine similarity parameter is Indicates the number of individuals;
[0111] The second graph convolution layer aggregates the interaction relationships according to the interaction relationship similarity to obtain individual behavior characteristics. The formula for obtaining individual behavior characteristics is as follows:
[0112]
[0113] in, represents the individual behavior characteristics after aggregation, Represents independent individual interactions. represents the learnable weight matrix;
[0114] Through this hierarchical interaction feature extraction, the present invention can more comprehensively understand the dynamic changes of group behavior, provide a more in-depth and accurate analysis method for group behavior identification, and improve the accuracy of group interaction behavior.
[0115] It should be noted that the behavior feature extraction network in this embodiment is implemented in an end-to-end manner to simultaneously identify individual behavior and group behavior, use cross entropy loss for the two branches, and combine the two losses into a weighted sum. ,in, represents the weighted sum of losses, and represents the cross entropy loss function, and are the true labels of group behavior and individual behavior, and are the model’s predicted labels for group behavior and individual behavior, is the weight used to balance the two tasks.
[0116] Step S05: Fusing group behavior features and individual behavior features to obtain fusion features and input them into a convolutional recognition network to obtain dangerous behavior recognition results for alarming;
[0117] It should be noted that the convolutional recognition network in this embodiment specifically includes:
[0118] An input layer, which fuses group behavior features and individual behavior features through element-wise matrix addition to obtain a feature image of size H*W*3, where H represents the height of the feature image, W represents the width of the feature image, and 3 represents the color channel;
[0119] A convolution layer, wherein the convolution layer includes a plurality of convolution units, each of the convolution units includes a convolution filter, and the convolution filter extracts local features of the feature image;
[0120] A key layer, the key layer comprising a context-aware block and a multi-layer attention block, the context-aware block and the multi-layer attention block enhancing the global features of the feature image;
[0121] A fully connected layer, wherein the fully connected layer maps the global features and the local features to dangerous behavior categories and then performs regularization processing according to dropout;
[0122] An output layer, the output layer comprising a softmax activation function to output the probability of the dangerous behavior category;
[0123] The context perception block and the multi-layer attention block in this embodiment specifically include:
[0124] The context perception block has a dual-channel structure, and the feature graph processed by the convolution layer is input into the dilated convolution branch and the convolution branch respectively. The dilated convolution branch includes a dilated convolution block, a normalization block, a Swish activation block and a 3x3 convolution block. The expansion coefficient of the dilated convolution block is r=3, and the convolution branch includes a 3x3 convolution block and a normalization block.
[0125] In order to enhance the network's perception of scene information and feature extraction capabilities, the context-aware block uses a dilation factor of 3 for the hole convolution. This convolution operation effectively expands the receptive field by introducing "holes" between the pixels of the convolution kernel, allowing the network to capture a wider range of spatial information. This design not only improves the resolution of feature mapping, but also helps the network retain more detailed information when performing semantic segmentation.
[0126] The feature map processed by the dilated convolution is processed by normalization to ensure that the feature value is within a reasonable range, thereby improving the stability and convergence speed of the network. The normalized feature map is then activated by the Swish nonlinear function to further enhance the expressiveness of the feature.
[0127] After Swish activation, the feature map will further extract more discriminative features through conventional 3x3 convolution filtering. This convolution operation helps the network extract deeper feature information from local features. At the same time, the Swish function is used to activate these features to ensure the nonlinear expression ability of the features.
[0128] In order to integrate local features with scene features and alleviate the gradient vanishing problem, the context-aware block also uses conventional 3x3 convolution and batch normalization shortcut connections. This design not only helps the network maintain the flow of gradients during training, but also enhances the network's ability to adapt to complex scenes.
[0129] Through the integration of such modules, the context-aware block can significantly enhance the network's ability to perceive scene context information, providing richer and more accurate feature support for the classification and recognition of ground objects, enabling the network to more effectively utilize scene context information when processing complex visual tasks, thereby improving recognition accuracy and robustness.
[0130] The context perception block and the multi-layer attention block are connected via a Swish activation block;
[0131] The multi-layer attention block includes a channel attention layer and a spatial attention layer. The definition of the multi-layer attention block is as follows:
[0132]
[0133] in, represents the output feature through channel attention, represents the channel attention weight, represents the original input features, represents the output feature through spatial attention, represents the spatial attention weight;
[0134] The channel attention layer is defined as follows:
[0135]
[0136] in, represents the activation function, represents average pooling, represents the maximum pooling, represents a shared fully connected network, and represents the multi-layer perception weights, represents the channel-based average pooling feature, Represents the channel-based maximum pooling feature;
[0137] The spatial attention layer is defined as follows:
[0138]
[0139] in, Represents 7X7 convolution kernel convolution operation, represents the average pooling feature based on space, Represents the spatial maximum pooling feature.
[0140] In summary, according to the above-mentioned dangerous behavior warning method based on group behavior recognition, by designing a behavior feature extraction network, group behavior features and individual behavior features in the image to be identified are extracted respectively, and the interactive relationship between single targets to be identified and subgroups composed of similar targets to be identified is extracted, which greatly enhances the accuracy and generalization ability of individual and group behavior recognition, and also designs an adaptive subgroup division algorithm to accurately identify the complex dynamics within the subgroup, greatly improves the accuracy of subgroup division, and further improves the accuracy of overall recognition, and designs a convolutional recognition network to perform global feature enhancement, thereby improving the recognition accuracy and adaptability in complex environments. The present invention greatly improves the accuracy of dangerous behavior recognition warnings and adaptability to complex environments. Specifically, an image to be identified is obtained and preprocessed to extract basic features of each target individual to be identified in the image to be identified. The preprocessing is used to correct the brightness and color of the image to be identified. The basic features include features of all single target individuals to be identified. Preprocessing the image improves the quality of the image to be identified and reduces the impact of complex environments. Two completely identical basic features are input into a group behavior feature extraction branch and an individual behavior feature extraction branch of a behavior feature extraction network. The behavior feature extraction network is used to respectively obtain group behavior features between subgroups composed of multiple target individuals to be identified and individual behavior features between single target individuals to be identified. The group behavior feature extraction branch classifies the basic features according to an adaptive subgroup division algorithm to obtain multiple different subgroups. The adaptive subgroup division algorithm is used to The target individuals to be identified with similar characteristics are divided into a subgroup, and then the group behavior characteristics are obtained according to the interactive feature extraction algorithm, which greatly improves the accuracy of subgroup division and effectively captures the interactive relationship between subgroups, thereby improving the overall behavior recognition accuracy. The individual behavior feature extraction branch obtains individual behavior characteristics according to the deep interactive feature extraction algorithm, effectively captures the complex interactive relationship between individuals, thereby improving the overall behavior recognition accuracy. The group behavior characteristics and the individual behavior characteristics are fused to obtain fused characteristics and input into the convolutional recognition network to obtain dangerous behavior recognition results for alarm. The convolutional recognition network is used to enhance the fused characteristics on a global scale, and then identify and classify them as dangerous behaviors and non-dangerous behaviors. The present invention greatly improves the accuracy of dangerous behavior recognition alarms and its adaptability to complex environments.
[0141] See also Figure 2 , which is a flow chart of a dangerous behavior warning method based on group behavior recognition proposed in the second embodiment of the present invention, the dangerous behavior warning method based on group behavior recognition includes steps S11 to S15, wherein:
[0142] Step S11: extract the red, green and blue color channels in the image to be identified, obtain images of the corresponding color channels and compare the values of each pixel position on the red, green and blue channels to perform weighted grayscale processing, construct a grayscale image according to the weighted grayscale value of the pixel point and input it into the graph convolutional neural network, and extract the basic features of each target individual to be identified according to the relationship between the key skeleton nodes and the bounding box of each target individual to be identified in the grayscale image;
[0143] Step S12: Determine the position coordinates of a single target individual to be identified based on the basic features, project the position coordinates into position features according to the multi-layer perceptron, add the position features and the basic features element by element to obtain the individual comprehensive features of all target individuals to be identified and perform cosine similarity calculation, and divide the first k target individuals to be identified with the highest similarity into the same subgroup;
[0144] Step S13: obtaining the spatial position distance between subgroups according to the geometric matrix, obtaining the spatial position relationship between subgroups according to the relationship matrix, and constructing an association adjacency matrix according to the spatial position distance and the spatial position relationship to obtain group behavior characteristics;
[0145] Step S14: the first graph convolution layer obtains the interaction relationship between the target individuals to be identified according to the correlation adjacency matrix, and the second graph convolution layer aggregates the interaction relationship to obtain individual behavior characteristics;
[0146] Step S15: The input layer fuses the group behavior features and the individual behavior features through element-level matrix addition, the convolution filter of the convolution layer extracts the local features of the feature image, the context-aware block and the multi-layer attention block of the key layer enhance the global features of the feature image, the fully connected layer maps the global features and the local features to the dangerous behavior category, and the output layer outputs the probability of the dangerous behavior category.
[0147] In summary, according to the above-mentioned dangerous behavior warning method based on group behavior recognition, by designing a behavior feature extraction network, group behavior features and individual behavior features in the image to be identified are extracted respectively, and the interactive relationship between single targets to be identified and subgroups composed of similar targets to be identified is extracted, which greatly enhances the accuracy and generalization ability of individual and group behavior recognition, and also designs an adaptive subgroup division algorithm to accurately identify the complex dynamics within the subgroup, greatly improves the accuracy of subgroup division, and further improves the accuracy of overall recognition, and designs a convolutional recognition network to perform global feature enhancement, thereby improving the recognition accuracy and adaptability in complex environments. The present invention greatly improves the accuracy of dangerous behavior recognition warnings and adaptability to complex environments. Specifically, an image to be identified is obtained and preprocessed to extract basic features of each target individual to be identified in the image to be identified. The preprocessing is used to correct the brightness and color of the image to be identified. The basic features include features of all single target individuals to be identified. Preprocessing the image improves the quality of the image to be identified and reduces the impact of complex environments. Two completely identical basic features are input into a group behavior feature extraction branch and an individual behavior feature extraction branch of a behavior feature extraction network. The behavior feature extraction network is used to respectively obtain group behavior features between subgroups composed of multiple target individuals to be identified and individual behavior features between single target individuals to be identified. The group behavior feature extraction branch classifies the basic features according to an adaptive subgroup division algorithm to obtain multiple different subgroups. The adaptive subgroup division algorithm is used to The target individuals to be identified with similar characteristics are divided into a subgroup, and then the group behavior characteristics are obtained according to the interactive feature extraction algorithm, which greatly improves the accuracy of subgroup division and effectively captures the interactive relationship between subgroups, thereby improving the overall behavior recognition accuracy. The individual behavior feature extraction branch obtains individual behavior characteristics according to the deep interactive feature extraction algorithm, effectively captures the complex interactive relationship between individuals, thereby improving the overall behavior recognition accuracy. The group behavior characteristics and the individual behavior characteristics are fused to obtain fused characteristics and input into the convolutional recognition network to obtain dangerous behavior recognition results for alarm. The convolutional recognition network is used to enhance the fused characteristics on a global scale, and then identify and classify them as dangerous behaviors and non-dangerous behaviors. The present invention greatly improves the accuracy of dangerous behavior recognition alarms and its adaptability to complex environments.
[0148] See also Figure 3 , which is a schematic diagram of the structure of a dangerous behavior warning system based on group behavior recognition proposed in the third embodiment of the present invention, the system includes:
[0149] A basic feature extraction module 10 is used to obtain an image to be identified and perform preprocessing to extract basic features of each target individual to be identified in the image to be identified. The preprocessing is used to correct the brightness and color of the image to be identified. The basic features include features of all single target individuals to be identified.
[0150] A behavior feature extraction module 20, used to input two identical basic features into a group behavior feature extraction branch and an individual behavior feature extraction branch of a behavior feature extraction network, wherein the behavior feature extraction network is used to respectively obtain group behavior features between subgroups composed of a plurality of target individuals to be identified and individual behavior features between a single target individual to be identified;
[0151] The group behavior feature extraction branch classifies the basic features according to an adaptive subgroup division algorithm to obtain a plurality of different subgroups. The adaptive subgroup division algorithm is used to divide the target individuals to be identified with similar features into a subgroup, and then obtain the group behavior features according to the interactive feature extraction algorithm;
[0152] The individual behavior feature extraction branch obtains individual behavior features according to a deep interactive feature extraction algorithm;
[0153] The convolution recognition module 30 is used to fuse the group behavior characteristics and the individual behavior characteristics to obtain the fused characteristics and input them into the convolution recognition network to obtain the dangerous behavior recognition results for warning. The convolution recognition network is used to enhance the fused characteristics on a global scale and then identify and classify them into dangerous behaviors and non-dangerous behaviors.
[0154] The present invention also provides a computer storage medium on which one or more programs are stored, and when the programs are executed by a processor, the dangerous behavior warning method based on group behavior recognition is implemented.
[0155] The present invention also proposes a computer device, comprising a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory to implement the above-mentioned dangerous behavior warning method based on group behavior recognition.
[0156] Those skilled in the art will appreciate that the logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable instructions for implementing logical functions, and may be specifically implemented in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For purposes of this specification, "computer-readable medium" may be any device that can contain storage, communication, propagation or transmission of a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0157] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.
[0158] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or a combination thereof: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0159] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0160] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. A dangerous behavior warning method based on group behavior recognition, characterized in that: include: Acquire an image to be identified and perform preprocessing to extract basic features of each target individual to be identified in the image to be identified, wherein the preprocessing is used to correct the brightness and color of the image to be identified, and the basic features include features of all single target individuals to be identified; Inputting two identical basic features into a group behavior feature extraction branch and an individual behavior feature extraction branch of a behavior feature extraction network, respectively, wherein the behavior feature extraction network is used to respectively obtain group behavior features between subgroups composed of a plurality of target individuals to be identified and individual behavior features between a single target individual to be identified; The group behavior feature extraction branch classifies the basic features according to an adaptive subgroup division algorithm to obtain a plurality of different subgroups. The adaptive subgroup division algorithm is used to divide the target individuals to be identified with similar features into a subgroup, and then obtain the group behavior features according to the interactive feature extraction algorithm; The individual behavior feature extraction branch obtains individual behavior features according to a deep interactive feature extraction algorithm; The group behavior characteristics and the individual behavior characteristics are fused to obtain fused features and input into a convolutional recognition network to obtain dangerous behavior recognition results for warning. The convolutional recognition network is used to enhance the fused features on a global scale and then identify and classify them into dangerous behaviors and non-dangerous behaviors.
2. The dangerous behavior warning method based on group behavior recognition according to claim 1 is characterized in that: The step of obtaining the image to be identified and preprocessing it to extract the basic features of each target individual to be identified in the image to be identified specifically includes: Extract the red, green and blue color channels in the image to be identified to obtain the images of the corresponding color channels and compare the values of each pixel position on the red, green and blue channels to perform weighted grayscale processing. The formula for the weighted grayscale processing is as follows: in, Represents the weighted gray value of the pixel. represents the minimum function, represents the maximum value function, represents the red channel pixel value, represents the green channel pixel value, Represents the blue channel pixel value; According to the weighted grayscale values of the pixels, a grayscale image is constructed and input into the graph convolutional neural network. According to the relationship and bounding box between the key skeletal nodes of each target individual to be identified in the grayscale image, the basic features of each target individual to be identified are extracted.
3. The dangerous behavior warning method based on group behavior recognition according to claim 1 is characterized in that: The adaptive subgroup division algorithm specifically includes: Determine the position coordinates of a single target individual to be identified based on the basic features, and the position coordinates are defined as follows: in, represents the horizontal coordinate of the left bounding box, represents the horizontal coordinate of the right bounding box, Represents the horizontal and vertical coordinates of the upper bounding box, Indicates the horizontal and vertical coordinates of the lower bounding box; Projecting the position coordinates into position features according to a multi-layer perceptron, wherein the dimension of the position features is D; The position feature and the basic feature are added element by element to obtain the individual comprehensive features of all target individuals to be identified and perform cosine similarity calculation, and the first k target individuals to be identified with the highest similarity are divided into the same subgroup.
4. The dangerous behavior warning method based on group behavior recognition according to claim 1 is characterized in that: The interactive feature extraction algorithm specifically includes: The spatial position distances between subgroups are obtained according to the geometric matrix, which is as follows: in, represents the geometric matrix, represents the time frame, Indicates Frame Neutron Population , Indicates Frame Neutron Population , Indicates the number of channels of input features, Represents spatial location characteristics; The spatial position relationship between subgroups is obtained according to the relationship matrix, and the relationship matrix is as follows: in, represents the relationship matrix, Represents the transformed function, represents the cosine distance calculation function, represents transpose; According to the spatial position distance and the spatial position relationship, an association adjacency matrix is constructed to obtain group behavior characteristics. The association adjacency matrix is as follows: in, represents the correlation adjacency matrix, represents the learnable parameters, , and represents a normalized diagonal matrix.
5. The dangerous behavior warning method based on group behavior recognition according to claim 1 is characterized in that: The deep interactive feature extraction algorithm specifically includes: The first graph convolution layer obtains the interaction relationship between the target individuals to be identified according to the correlation adjacency matrix. The formula for obtaining the interaction relationship between the target individuals to be identified is as follows: in, Represents the individual interaction relationship, represents the activation function, Indicates The learnable weight matrix of the layer, Indicates the number of layers, represents the correlation adjacency matrix; The similarity of the interaction relationship between the target individuals to be identified is calculated. The formula for calculating the similarity of the interaction relationship between the target individuals to be identified is as follows: in, Represents an individual For individuals The importance of Represents an individual , Represents an individual , Represents the spatial relationship between individuals. represents the cosine similarity between individuals, Represents an individual The coordinates of the center point of the bounding box, Represents an individual The coordinates of the center point of the bounding box, and Represents an individual and individuals The cosine similarity parameter is Indicates the number of individuals; The second graph convolution layer aggregates the interaction relationships according to the interaction relationship similarity to obtain individual behavior characteristics. The formula for obtaining individual behavior characteristics is as follows: in, represents the individual behavior characteristics after aggregation, Represents independent individual interactions, represents the learnable weight matrix.
6. The dangerous behavior warning method based on group behavior recognition according to claim 1 is characterized in that: The convolutional recognition network specifically includes: An input layer, which fuses group behavior features and individual behavior features through element-wise matrix addition to obtain a feature image of size H*W*3, where H represents the height of the feature image, W represents the width of the feature image, and 3 represents the color channel; A convolution layer, wherein the convolution layer includes a plurality of convolution units, each of the convolution units includes a convolution filter, and the convolution filter extracts local features of the feature image; A key layer, the key layer comprising a context-aware block and a multi-layer attention block, the context-aware block and the multi-layer attention block enhancing the global features of the feature image; A fully connected layer, wherein the fully connected layer maps the global features and the local features to dangerous behavior categories and then performs regularization processing according to dropout; The output layer includes a softmax activation function to output the probability of the dangerous behavior category.
7. The dangerous behavior warning method based on group behavior recognition according to claim 6 is characterized in that: The context perception block and the multi-layer attention block specifically include: The context perception block has a dual-channel structure, and the feature graph processed by the convolution layer is input into the dilated convolution branch and the convolution branch respectively. The dilated convolution branch includes a dilated convolution block, a normalization block, a Swish activation block and a 3x3 convolution block. The expansion coefficient of the dilated convolution block is r=3, and the convolution branch includes a 3x3 convolution block and a normalization block. The context perception block and the multi-layer attention block are connected via a Swish activation block; The multi-layer attention block includes a channel attention layer and a spatial attention layer. The definition of the multi-layer attention block is as follows: in, represents the output feature through channel attention, represents the channel attention weight, represents the original input features, represents the output feature through spatial attention, represents the spatial attention weight; The channel attention layer is defined as follows: in, represents the activation function, represents average pooling, represents the maximum pooling, represents a shared fully connected network, and represents the multi-layer perception weights, represents the channel-based average pooling feature, Represents the channel-based maximum pooling feature; The spatial attention layer is defined as follows: in, Represents 7X7 convolution kernel convolution operation, represents the average pooling feature based on space, Represents the spatial maximum pooling feature.
8. A dangerous behavior warning system based on group behavior recognition, characterized in that: include: A basic feature extraction module is used to obtain the image to be identified and perform preprocessing to extract the basic features of each target individual to be identified in the image to be identified. The preprocessing is used to correct the brightness and color of the image to be identified. The basic features include the features of all single target individuals to be identified. A behavior feature extraction module, used to input two identical basic features into a group behavior feature extraction branch and an individual behavior feature extraction branch of a behavior feature extraction network, wherein the behavior feature extraction network is used to respectively obtain group behavior features between subgroups composed of a plurality of target individuals to be identified and individual behavior features between a single target individual to be identified; The group behavior feature extraction branch classifies the basic features according to an adaptive subgroup division algorithm to obtain a plurality of different subgroups. The adaptive subgroup division algorithm is used to divide the target individuals to be identified with similar features into a subgroup, and then obtain the group behavior features according to the interactive feature extraction algorithm; The individual behavior feature extraction branch obtains individual behavior features according to a deep interactive feature extraction algorithm; The convolution recognition module is used to fuse the group behavior characteristics and the individual behavior characteristics to obtain the fused characteristics and input them into the convolution recognition network to obtain the dangerous behavior recognition results for alarm. The convolution recognition network is used to enhance the fused characteristics on a global scale and then identify and classify them into dangerous behaviors and non-dangerous behaviors.
9. A storage medium, characterized in that: The storage medium stores one or more programs, which, when executed by the processor, implement the dangerous behavior warning method based on group behavior recognition as described in any one of claims 1 to 7.
10. A computer device, characterized in that: The computer device comprises a memory and a processor, wherein: The memory is used to store computer programs; When the processor is used to execute the computer program stored in the memory, the dangerous behavior warning method based on group behavior recognition described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Video group behavior recognition method based on cascade Transformer
CN113673489A
Group behavior detection and identification method and system based on deep learning
CN117789094A
Sensor data group behavior recognition method based on multistage feature enhancement
CN117807494A
Dangerous behavior protection method and system based on Yolov4 network
CN118097580A
Target object identification method and apparatus
US20220036141A1
