Violent behavior detection method and system

By combining the feature pyramid network and the cascade pyramid network, the accuracy problem of human posture estimation in complex scenes in the existing technology is solved, and high-accuracy recognition and classification of violent behaviors are achieved.

CN111104841BActive Publication Date: 2024-09-10PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910872172.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-09-16
Publication Date
2024-09-10
Estimated Expiration
2039-09-16

AI Technical Summary

Technical Problem

Existing human pose estimation methods have low accuracy when dealing with occluded key points, invisible key points and complex backgrounds, making it difficult to effectively identify violent behaviors.

Method used

Feature pyramid network and cascade pyramid network are used to estimate human posture through GlobalNet and RefineNet networks. Combined with bilinear interpolation method and convolution filter, heat map is generated and processed through residual block structure to improve the accuracy of key point positioning. and recognition speed.

Benefits of technology

It significantly improves the recognition accuracy of key points of the human body, reduces the amount of calculations, and can effectively identify and classify violent behaviors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111104841B
    Figure CN111104841B
Patent Text Reader

Abstract

A method for detecting violent behavior, comprising: acquiring a scene image through a camera; inputting the scene image into a feature pyramid network, and acquiring a target human body from the scene image; using a cascade pyramid network to estimate the human body posture of the target human body to obtain a human body posture estimation result, wherein the cascade pyramid network includes a GlobalNet network and a RefineNet network; and matching the human body posture estimation result with the violent behavior human body posture stored in a database to determine whether there is violent behavior in the scene image based on the matching result, and classify the violent behavior. The embodiment of the present invention also provides a violent behavior detection system, a computer device, and a readable storage medium. Through the embodiment of the present invention, each key point of the human body can be successfully located, which greatly improves the recognition accuracy and reduces the amount of calculation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of big data, and in particular to a violent behavior detection method, a violent behavior detection system, a computer device, and a readable storage medium. Background Art

[0002] For a long time, monitoring people's behavior has been considered an effective means of behavioral deterrence. When a terrorist incident occurs, people panic and hide everywhere, unable to effectively call the police for help. At this time, real-time detection will effectively trigger the alarm in the first time. It uses the real-time transmission of video from surveillance cameras in public places to transmit the data of the incident frame by frame to the cloud for processing, and will process the redundant information of non-violent incidents time by time, and save the monitoring information of violent incidents. Detection of human violence will trigger the relevant law-abiding department closest to the surveillance camera point, which will help maintain social stability and long-term peace. Other application scenarios are also very extensive, such as real-time monitoring of campus violence in public areas and blind spots, violence between family members of injured patients and doctors in hospitals, and violence on public transportation such as buses / subways.

[0003] In the prior art, methods for estimating human body posture include:

[0004] 1. Structured Feature Learning, which is based on fine-tuning the Convolutional Neural Network (CNN), but the accuracy of multi-person pose estimation is not high;

[0005] 2. Deepcut and Deepercut, which use CNN to extract candidate regions of body parts, but this method is very computationally complex and slow;

[0006] 3. Convolutional pose machine (CPM), which uses a sequential convolutional architecture to express spatial and texture information. Although it has good robustness, the network is relatively complex.

[0007] Of course, there are other methods of human posture estimation that have some good performance on human posture estimation. However, there are still many problems, such as: occluded key points, invisible key points and complex backgrounds, which cannot be well solved. Summary of the invention

[0008] In view of this, it is necessary to provide a violent behavior detection method, a violent behavior detection system, a computer device and a readable storage medium, which can successfully locate each key point of the human body, greatly improve the accuracy of recognition, and reduce the amount of calculation.

[0009] To achieve the above objective, an embodiment of the present invention provides a method for detecting violent behavior, the method comprising:

[0010] Acquire scene images through a camera;

[0011] Inputting the scene image into a feature pyramid network, and acquiring a target human body from the scene image;

[0012] Performing human body posture estimation on the target human body by using a cascade pyramid network to obtain a human body posture estimation result, wherein the cascade pyramid network includes a GlobalNet network and a RefineNet network; and

[0013] The human body posture estimation result is matched with the violent behavior human body posture stored in the database, so as to determine whether there is violent behavior in the scene image according to the matching result, and classify the violent behavior.

[0014] Optionally, the step of inputting the scene image into a feature pyramid network to detect a target human body, and acquiring the target human body from the scene image further includes:

[0015] Passing the scene image through a convolutional network and extracting a feature image of the highest layer of the convolutional network to obtain a feature image of a first size;

[0016] Upsampling the first-size feature image to a first intermediate-size feature image by bilinear interpolation;

[0017] Fusing the first intermediate-sized feature image with the output image of the first intermediate size in the convolutional network to obtain a first fusion result; and

[0018] The first fusion result is output to obtain a second-size feature image.

[0019] Optionally, after the step of outputting the first fusion result to obtain a second size feature image, the method further includes:

[0020] Upsampling the second-size feature image to a second intermediate-size feature image by the bilinear interpolation method;

[0021] Fusing the second intermediate-sized feature image with the output image of the second intermediate size in the convolutional network to obtain a second fusion result; and

[0022] The second fusion result is output to obtain a third-size feature image.

[0023] Optionally, after the step of outputting the second fusion result to obtain a third-size feature image, the method further includes:

[0024] Inputting the first size characteristic image, the second size characteristic image and the third size characteristic image into the RPN network;

[0025] performing region frame detection on the first size characteristic image, the second size characteristic image, and the third size characteristic image respectively; and

[0026] According to the detection result, the region of interest and the region with the highest category score of the region of interest are obtained to obtain the target human body.

[0027] Optionally, the step of estimating the human body posture of the target human body by using a cascade pyramid network further includes:

[0028] Sending the detection result image to the GlobalNet network, wherein the GlobalNet network does not include a pooling layer, and the size of the feature map output by each convolutional layer is reduced by adding a convolution step size between each convolutional layer;

[0029] Obtaining the first feature map, the second feature map, the third feature map, and the fourth feature map outputted by the 2nd to 5th convolutional layers respectively; and

[0030] A 3*3 convolution filter is applied to the first feature map, the second feature map, the third feature map and the fourth feature map respectively to generate a heat map of a simple key point.

[0031] Optionally, after the step of applying a 3*3 convolution filter to the first feature map, the second feature map, the third feature map, and the fourth feature map to generate a heat map of a simple key point, the step further includes:

[0032] Sending the heat map to the RefineNet network to process the heat map through the residual block structure respectively, wherein the first feature map does not pass through the residual block structure, the second feature map passes through one residual block structure, the third feature map passes through two residual block structures, and the fourth feature map passes through three residual block structures, and the residual block structure includes a 1*1 convolution structure and a 3*3 convolution structure;

[0033] The processing results are respectively subjected to upsampling processing, wherein the first feature map processing result is not subjected to upsampling processing, the second feature map processing result is subjected to upsampling processing twice, the third feature map processing result is subjected to upsampling processing four times, and the fourth feature map processing result is subjected to upsampling processing eight times;

[0034] Connecting the sampling processing results to integrate the up-sampling results; and

[0035] The integration result is trained using L2 loss, and difficult key points are selected according to the training result to obtain the human posture result.

[0036] Optionally, before the step of matching the human body posture estimation result with the violent behavior human body posture stored in the database to determine whether there is violent behavior in the scene image according to the matching result and classifying the violent behavior, the method further includes:

[0037] Acquire a plurality of sample images, wherein each of the plurality of images includes a plurality of human bodies, and the plurality of human bodies perform different behaviors, and the behaviors at least include: one or more of punching, stabbing, shooting, kicking, and strangling;

[0038] Marking the sample images with behaviors according to the behaviors in the sample images; and

[0039] The multiple images are trained according to the labeling results to obtain human body postures corresponding to the behaviors.

[0040] To achieve the above purpose, an embodiment of the present invention further provides a violent behavior detection system, comprising:

[0041] An acquisition module, used for acquiring scene images through a camera;

[0042] A detection module, used to input the scene image into a feature pyramid network and obtain a target human body from the scene image;

[0043] A human body posture estimation module, used for performing human body posture estimation on the target human body by using a cascade pyramid network to obtain a human body posture estimation result, wherein the cascade pyramid network includes a GlobalNet network and a RefineNet network; and

[0044] The classification module is used to match the human body posture estimation result with the violent behavior human body posture stored in the database, so as to determine whether there is violent behavior in the scene image according to the matching result, and classify the violent behavior.

[0045] To achieve the above objectives, an embodiment of the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the above-mentioned violent behavior detection method when executed by the processor.

[0046] To achieve the above objectives, an embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. The computer program can be executed by at least one processor to enable the at least one processor to perform the steps of the violent behavior detection method as described above.

[0047] The violent behavior detection method, violent behavior detection system, computer device and readable storage medium provided by the embodiments of the present invention first pass the acquired scene image through a feature pyramid network to detect the border of the target human body, and then use a cascade pyramid network to estimate the human body posture of the target human body according to the detection result, and match the estimated result with the violent behavior human body posture stored in the database according to the estimation result, so as to determine whether there is violent behavior according to the matching result, and classify the violent behavior. Through the embodiments of the present invention, each key point of the human body can be successfully located, which greatly improves the accuracy of recognition and reduces the amount of calculation. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 This is a flowchart of the steps of the violent behavior detection method according to the first embodiment of the present invention.

[0049] Figure 2 It is a schematic diagram of obtaining a size characteristic image according to an embodiment of the present invention.

[0050] Figure 3 Schematic diagram of the overall framework of FPN-based fast R-CNN target detection in an embodiment of the present invention.

[0051] Figure 4 4 is a diagram of a residual block structure according to an embodiment of the present invention.

[0052] Figure 5 FIG. 4 is a schematic diagram of the hardware architecture of a computer device according to the second embodiment of the present invention.

[0053] Figure 6 Schematic diagram of program modules of a violent behavior detection system according to Embodiment 3 of the present invention.

[0054] Reference numerals:

[0055]

[0056]

[0057] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0058] In order to make the purpose, technical scheme and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0059] It should be noted that the descriptions of "first", "second", etc. in the present invention are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.

[0060] Embodiment 1

[0061] See also Figure 1 , shows a flowchart of the steps of the violent behavior detection method of the first embodiment of the present invention. It can be understood that the flowchart in the embodiment of the method is not used to limit the order of executing the steps. It should be noted that the present embodiment is described exemplarily with the computer device 2 as the execution subject. The details are as follows:

[0062] Step S100, acquiring a scene image through a camera.

[0063] For example, surveillance cameras are installed in public places, and the data of the incidents are transmitted frame by frame to the cloud for processing by using the real-time transmission of the surveillance cameras in public places. The computer device 2 obtains the captured scene images to detect violent behavior on the scene images.

[0064] Step S102: input the scene image into a feature pyramid network, and obtain a target human body from the scene image.

[0065] It should be noted that the feature pyramid is a basic component in the multi-scale object detection system.

[0066] Exemplarily, the acquired scene image of size 128*128*3 is input into the feature pyramid network to obtain image features, and the target human body is detected from the image features, for example: user A with violent behavior and user B with normal behavior.

[0067] In a preferred embodiment, after the scene image is input into the feature pyramid network, the scene image is first passed through a convolutional network, and the feature image of the highest layer of the convolutional network is extracted to obtain a first-size feature image. Then, the first-size feature image is upsampled to a first-intermediate-size feature image by bilinear interpolation, and the first-intermediate-size feature image is fused with the output image of the first-intermediate-size in the convolutional network to obtain a first fusion result, and the first fusion result is output to obtain a second-size feature image.

[0068] For example, see Figure 2 , if the size of the acquired scene image is 128*128*3, where 3 is RGB three channels. The scene image is input into the feature pyramid network, and a first-size feature image with a minimum feature size of 16*16*128 is obtained through convolution transformation. Then, the first-size feature image is upsampled by bilinear interpolation to obtain a feature image of 32*32*128, and the feature image of 32*32*128 is fused with the feature image of 32*32*64 output by the convolution layer in the feature pyramid network to obtain a second-size feature image of 32*32*64.

[0069] Bilinear interpolation is a type of interpolation algorithm and an extension of linear interpolation. It uses the four real pixel values ​​around the target point in the original image to jointly determine a pixel value in the target image. Its core idea is to perform linear interpolation in two directions respectively.

[0070] The main purpose of upsampling is to enlarge the image, and almost all of them use interpolation, that is, based on the original image pixels, a suitable interpolation algorithm is used to insert new elements between the pixel values.

[0071] Feature-level image fusion is to extract feature information from the source image. These feature information are the information of the observer on the target or area of ​​interest in the source image, such as edges, people, buildings or vehicles, and then analyze, process and integrate these feature information to obtain the fused image features. The accuracy of target recognition of the fused features is significantly higher than that of the original image. Feature-level fusion compresses the image information and then uses a computer to analyze and process it. The memory and time consumed will be reduced compared to the pixel level, and the real-time performance of the required image will be improved. Feature-level image fusion does not require as high accuracy of image matching as the first layer, and the calculation speed is faster than the first layer, but it extracts image features as fusion information, so it will lose a lot of detailed features.

[0072] After the second-size feature image is obtained, the second-size feature image is upsampled to a second-intermediate-size feature image by the bilinear interpolation method. Then, the second-intermediate-size feature image is fused with the output image of the second-intermediate-size in the convolutional network to obtain a second fusion result, and the second fusion result is output to obtain a third-size feature image.

[0073] For example, please refer to Figure 2 , the second-size feature image of 32*32*64 is fused with the feature image of 64*64*32 output by the convolutional layer in the feature pyramid network to obtain a third-size feature image of 64*64*32.

[0074] After the third-size feature image is obtained, the first-size feature image, the second-size feature image and the third-size feature image are input into the RPN network, and then region frame detection is performed on the first-size feature image, the second-size feature image and the third-size feature image respectively, and the region of interest and the region with the highest category score of the region of interest are obtained according to the detection results to obtain the target human body.

[0075] Exemplarily, a first-size feature image of 16*16*128, a second-size feature image of 32*32*64, and a third-size feature image of 64*64*32 are input into the RPN network for target detection. If the detection results are [person; 0.6], [person; 0.65], and [person; 0.8] respectively, the area with the detection result of [person; 0.8] is the target human body.

[0076] In another preferred embodiment, see Figure 3 , by obtaining the feature maps of the 2nd to 5th convolutional layers, and fusing the feature maps respectively to obtain the 2nd to 5th feature maps P2 to P5, and then passing the feature maps through the region of interest pooling layer (ROI Pooling) respectively, and passing the pooling results through the fully connected layer, and then obtaining the classification results when passing through the classifier, and obtaining the frame regression results when passing through the frame regression, and then comprehensively obtaining the frame of the target human body by combining the classification results and the frame regression results. In this embodiment, the fusion method is the same as the fusion method in other embodiments of the present invention, so it will not be repeated.

[0077] Step S104: performing human body posture estimation on the target human body by using a cascade pyramid network to obtain a human body posture estimation result, wherein the cascade pyramid network includes a GlobalNet network and a RefineNet network.

[0078] In this embodiment, simple visible key points are located by the GlobalNet network, and difficult key points are further processed by the RefineNet network to achieve human body posture estimation of the target human body.

[0079] In a preferred embodiment, when the target human body is estimated by using a cascade pyramid network according to the detection result, the detection result image is also sent to the GlobalNet network, wherein the GlobalNet network does not include a pooling layer, and the size of the feature map output by each convolution layer is reduced by adding a convolution step between each convolution layer. Then, the first feature map, the second feature map, the third feature map and the fourth feature map output by the 2nd to 5th convolution layers are obtained, and the first feature map, the second feature map, the third feature map and the fourth feature map are respectively applied with a 3*3 convolution filter to generate a heat map of a simple key point.

[0080] It should be noted that, since the pooling layer will cause the loss of feature information, all the pooling layers in the original GlobalNet network are changed to achieve the reduction of the size of the feature map by setting the step size of the convolution. For example, by setting the step size Stride = 2, when the convolution kernel is 3*3, the output size will become half of the original. In this embodiment, the network designed without the pooling layer can also be called a full convolution network, which can improve the accuracy of the GlobalNet network for human body frame detection. In addition, the first feature map and the second feature map have a higher spatial resolution in positioning, but the recognized semantic information is less, and the third feature map and the fourth feature map recognize more semantic information, but the resolution is lower. The feature information with different semantic information and different resolutions is fused to improve the accuracy.

[0081] After applying 3*3 convolution filters to the first feature map, the second feature map, the third feature map and the fourth feature map respectively to generate a heat map of a simple key point, the heat map is also sent to the RefineNet network to process the heat map respectively through a residual block structure, wherein the first feature map does not pass through the residual block structure, the second feature map passes through one residual block structure, the third feature map passes through two residual block structures, and the fourth feature map passes through three residual block structures, and the residual block structure includes a 1*1 convolution structure and a 3*3 convolution structure. Then, the processing results are respectively subjected to upsampling processing, wherein the processing result of the first feature map is not subjected to upsampling processing, the processing result of the second feature map is subjected to two upsampling processing, the processing result of the third feature map is subjected to four upsampling processing, and the processing result of the fourth feature map is subjected to eight upsampling processing. Finally, the sampling processing results are connected to integrate the upsampling results, the integrated results are trained using L2 loss, and difficult key points are selected according to the training results to obtain the human body posture results.

[0082] For example, see Figure 4 The residual block structure diagram shows that the 1*1 convolution in the residual block structure adjusts the size of the heat map, and the 3*3 convolution structure extracts feature information. Compared with the bottleneck structure design of the existing Resnet, the residual block structure reduces one convolution layer, greatly reducing the amount of calculation, but the accuracy is not affected.

[0083] Step S106, matching the human body posture estimation result with the violent behavior human body posture stored in the database, so as to determine whether there is violent behavior in the scene image according to the matching result, and classify the violent behavior.

[0084] Exemplarily, the database stores a correspondence between a plurality of violent behavior human body postures and behavior names corresponding to the violent behavior human body postures, for example, a punching behavior posture and a corresponding behavior name are punching. If the human body posture estimation result is punching, the punching human body posture is matched with a plurality of violent behavior postures stored in the database, and the punching human body posture behavior is matched as punching, and it is determined that there is a violent behavior.

[0085] In a preferred embodiment, the human body posture estimation result is matched with the violent behaviors stored in the database to determine whether there is a violent behavior according to the matching result, and before the violent behavior is classified, a plurality of sample images are obtained, wherein each of the plurality of images includes a plurality of human bodies, and the plurality of human bodies perform different behaviors, and the behaviors include at least one or more of punching, stabbing, shooting, kicking, and strangling. Then, the sample images are behaviorally labeled according to the behaviors in the sample images, and the plurality of images are trained according to the labeled results to obtain human body postures corresponding to the behaviors.

[0086] Exemplarily, a spatial violent personal database is used, which consists of 2,000 images, each of which contains 2 to 10 people. The entire database contains 10,863 people, of which 5,124 (i.e., 48%) are involved in one or more of the five types of violent behaviors. Among them, the five types of violent behaviors are: punching, stabbing, shooting, kicking, and strangling. It should be noted that the accuracy is highest when there are fewer people to be processed. For example: when there is only one person in a picture, the accuracy of the system is 94.1%, but when there are 5 people, the accuracy drops to 84%, and when there are 10 people, the accuracy drops to 79.8%.

[0087] Through the embodiments of the present invention, each key point of the human body can be successfully located, which greatly improves the recognition accuracy and reduces the amount of calculation.

[0088] Embodiment 2

[0089] See also Figure 5 , which shows a schematic diagram of the hardware architecture of a computer device according to the second embodiment of the present invention. The computer device 2 includes, but is not limited to, a memory 21, a processor 22, and a network interface 23 which can be interconnected and communicated via a system bus. Figure 5 Only a computer device 2 having components 21 - 23 is shown, but it should be understood that implementation of all of the components shown is not a requirement, and more or fewer components may alternatively be implemented.

[0090] The memory 21 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 21 can be an internal storage unit of the computer device 2, such as a hard disk or memory of the computer device 2. In other embodiments, the memory can also be an external storage device of the computer device 2, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. equipped on the computer device 2. Of course, the memory 21 can also include both the internal storage unit of the computer device 2 and its external storage device. In this embodiment, the memory 21 is generally used to store the operating system and various application software installed on the computer device 2, such as the program code of the violent behavior detection system 20, etc. In addition, the memory 21 can also be used to temporarily store various types of data that have been output or are to be output.

[0091] The processor 22 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 22 is generally used to control the overall operation of the computer device 2. In this embodiment, the processor 22 is used to run the program code stored in the memory 21 or process data, such as running the violent behavior detection system 20.

[0092] The network interface 23 may include a wireless network interface or a wired network interface, and the network interface 23 is generally used to establish a communication connection between the computer device 2 and other electronic devices. For example, the network interface 23 is used to connect the computer device 2 to an external terminal through a network, and to establish a data transmission channel and a communication connection between the computer device 2 and the external terminal. The network may be a wireless or wired network such as an Intranet, the Internet, the Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), a 4G network, a 5G network, Bluetooth, or Wi-Fi.

[0093] Embodiment 3

[0094] See also Figure 6 , showing a schematic diagram of the program modules of the violent behavior detection system of the third embodiment of the present invention. In this embodiment, the violent behavior detection system 20 may include or be divided into one or more program modules, one or more program modules are stored in a storage medium, and are executed by one or more processors to complete the present invention and implement the above-mentioned violent behavior detection method. The program module referred to in the embodiment of the present invention refers to a series of computer program instruction segments that can complete specific functions, and is more suitable for describing the execution process of the violent behavior detection system 20 in the storage medium than the program itself. The following description will specifically introduce the functions of each program module of this embodiment:

[0095] The acquisition module 201 is used to acquire a scene image through a camera.

[0096] For example, surveillance cameras are installed in public places, and the data of the incidents are transmitted frame by frame to the cloud for processing by using the real-time transmission of the surveillance camera videos in public places. The acquisition module 201 acquires the captured scene images to detect violent behavior in the scene images.

[0097] The detection module 202 is used to input the scene image into a feature pyramid network and obtain a target human body from the scene image.

[0098] It should be noted that the feature pyramid is a basic component in the multi-scale object detection system.

[0099] Exemplarily, by inputting the acquired scene image of size 128*128*3 into the feature pyramid network to obtain image features, the detection module 202 detects the target human body from the image features, for example: user A with violent behavior and user B with normal behavior.

[0100] In a preferred embodiment, after the scene image is input into the feature pyramid network, the detection module 202 first passes the scene image through a convolutional network and extracts the feature image of the highest layer of the convolutional network to obtain a first-size feature image. Then, the first-size feature image is upsampled to a first-intermediate-size feature image by bilinear interpolation, and the first-intermediate-size feature image is fused with the output image of the first-intermediate-size in the convolutional network to obtain a first fusion result, and the first fusion result is output to obtain a second-size feature image.

[0101] For example, see Figure 2, if the size of the acquired scene image is 128*128*3, where 3 is the RGB three-channel. The detection module 202 inputs the scene image into the feature pyramid network, and obtains a first-size feature image with a minimum feature image size of 16*16*128 through convolution transformation. Then, the first-size feature image is upsampled by bilinear interpolation to obtain a feature image of 32*32*128, and the feature image of 32*32*128 is fused with the feature image of 32*32*64 output by the convolution layer in the feature pyramid network to obtain a second-size feature image of 32*32*64.

[0102] Bilinear interpolation is a type of interpolation algorithm and an extension of linear interpolation. It uses the four real pixel values ​​around the target point in the original image to jointly determine a pixel value in the target image. Its core idea is to perform linear interpolation in two directions respectively.

[0103] The main purpose of upsampling is to enlarge the image, and almost all of them use interpolation, that is, based on the original image pixels, a suitable interpolation algorithm is used to insert new elements between the pixel values.

[0104] Feature-level image fusion is to extract feature information from the source image. These feature information are the information of the observer on the target or area of ​​interest in the source image, such as edges, people, buildings or vehicles, and then analyze, process and integrate these feature information to obtain the fused image features. The accuracy of target recognition of the fused features is significantly higher than that of the original image. Feature-level fusion compresses the image information and then uses a computer to analyze and process it. The memory and time consumed will be reduced compared to the pixel level, and the real-time performance of the required image will be improved. Feature-level image fusion does not require as high accuracy of image matching as the first layer, and the calculation speed is faster than the first layer, but it extracts image features as fusion information, so it will lose a lot of detailed features.

[0105] After acquiring the second-size feature image, the detection module 202 also upsamples the second-size feature image to a second intermediate-size feature image by the bilinear interpolation method. Then, the second intermediate-size feature image is fused with the output image of the second intermediate size in the convolutional network to obtain a second fusion result, and the second fusion result is output to obtain a third-size feature image.

[0106] For example, please refer to Figure 2The detection module 202 also fuses the second-sized feature image of 32*32*64 with the feature image of 64*64*32 output by the convolutional layer in the feature pyramid network to obtain a third-sized feature image of 64*64*32.

[0107] After acquiring the third-size feature image, the detection module 202 also inputs the first-size feature image, the second-size feature image and the third-size feature image into the RPN network, and then performs region frame detection on the first-size feature image, the second-size feature image and the third-size feature image respectively, and obtains the region of interest and the region with the highest category score of the region of interest according to the detection results to obtain the target human body.

[0108] Exemplarily, the detection module 202 also inputs a first-size feature image of 16*16*128, a second-size feature image of 32*32*64, and a third-size feature image of 64*64*32 into the RPN network for target detection. If the detection results are [person; 0.6], [person; 0.65], and [person; 0.8] respectively, the area with the detection result of [person; 0.8] is the target human body.

[0109] In another preferred embodiment, see Figure 3 The detection module 202 also obtains the feature maps of the 2nd to 5th convolutional layers, and fuses the feature maps to obtain the 2nd to 5th feature maps P2 to P5, and then passes the feature maps through the region of interest pooling layer (ROI Pooling) respectively, and passes the pooling results through the fully connected layer, and then obtains the classification results when passing through the classifier, and obtains the frame regression results when passing through the frame regression, and then obtains the frame of the target human body by combining the classification results and the frame regression results. In this embodiment, the fusion method is the same as the fusion method in other embodiments of the present invention, so it will not be repeated.

[0110] The human body posture estimation module 203 is used to perform human body posture estimation on the target human body by using a cascade pyramid network to obtain a human body posture estimation result, wherein the cascade pyramid network includes a GlobalNet network and a RefineNet network.

[0111] In this embodiment, the human body posture estimation module 203 locates simple visible key points through the GlobalNet network, and further processes difficult key points through the RefineNet network to achieve human body posture estimation of the target human body.

[0112] In a preferred embodiment, the human posture estimation module 203 also sends the detection result image to the GlobalNet network, wherein the GlobalNet network does not include a pooling layer, and the size of the feature map output by each convolution layer is reduced by adding a convolution step between each convolution layer. Then, the first feature map, the second feature map, the third feature map and the fourth feature map output by the 2nd to 5th convolution layers are obtained, and the first feature map, the second feature map, the third feature map and the fourth feature map are respectively applied with a 3*3 convolution filter to generate a heat map of a simple key point.

[0113] It should be noted that, since the pooling layer will cause the loss of feature information, all the pooling layers in the original GlobalNet network are changed to achieve the reduction of the size of the feature map by setting the step size of the convolution. For example, by setting the step size Stride = 2, when the convolution kernel is 3*3, the output size will become half of the original. In this embodiment, the network designed without the pooling layer can also be called a full convolution network, which can improve the accuracy of the GlobalNet network for human body frame detection. In addition, the first feature map and the second feature map have a higher spatial resolution in positioning, but the recognized semantic information is less, and the third feature map and the fourth feature map recognize more semantic information, but the resolution is lower. The feature information with different semantic information and different resolutions is fused to improve the accuracy.

[0114] After applying 3*3 convolution filters to the first feature map, the second feature map, the third feature map and the fourth feature map respectively to generate a heat map of simple key points, the human body posture estimation module 203 also sends the heat map to the RefineNet network to process the heat map respectively through the residual block structure, wherein the first feature map does not pass through the residual block structure, the second feature map passes through one residual block structure, the third feature map passes through two residual block structures, and the fourth feature map passes through three residual block structures, and the residual block structure includes a 1*1 convolution structure and a 3*3 convolution structure. Then, the processing results are respectively subjected to upsampling processing, wherein the first feature map processing result is not subjected to upsampling processing, the second feature map processing result is subjected to two upsampling processing, the third feature map processing result is subjected to four upsampling processing, and the fourth feature map processing result is subjected to eight upsampling processing. Finally, the sampling processing results are connected to integrate the upsampling results, the integrated results are trained using L2 loss, and difficult key points are selected according to the training results to obtain the human body posture results.

[0115] For example, see Figure 4The residual block structure diagram shows that the 1*1 convolution in the residual block structure adjusts the size of the heat map, and the 3*3 convolution structure extracts feature information. Compared with the bottleneck structure design of the existing Resnet, the residual block structure reduces one convolution layer, greatly reducing the amount of calculation, but the accuracy is not affected.

[0116] The classification module 204 is used to match the human body posture estimation result with the violent behavior human body posture stored in the database, so as to determine whether there is violent behavior in the scene image according to the matching result, and classify the violent behavior.

[0117] Exemplarily, the database stores a correspondence between a plurality of violent behavior human body postures and behavior names corresponding to the violent behavior human body postures, for example, a punching behavior posture and a corresponding behavior name are punching. If the human body posture estimation result is punching, the classification module 204 matches the punching human body posture with a plurality of violent behavior postures stored in the database, matches the punching human body posture behavior as punching, and determines that there is a violent behavior.

[0118] In a preferred embodiment, the violent behavior detection system 20 further includes a human posture training module 205, which is used to obtain multiple sample images, wherein each of the multiple images includes multiple human bodies, and the multiple human bodies perform different behaviors, and the behaviors at least include: punching, stabbing, shooting, kicking, and strangling. Then, the human posture training module 205 performs behavior marking on the sample images according to the behaviors in the sample images, and trains the multiple images according to the marking results to obtain human postures corresponding to the behaviors.

[0119] Exemplarily, a spatial violent personal database is used, which consists of 2,000 images, each of which contains 2 to 10 people. The entire database contains 10,863 people, of which 5,124 (i.e., 48%) are involved in one or more of the five types of violent behaviors. Among them, the five types of violent behaviors are: punching, stabbing, shooting, kicking, and strangling. It should be noted that the accuracy is highest when there are fewer people to be processed. For example: when there is only one person in a picture, the accuracy of the system is 94.1%, but when there are 5 people, the accuracy drops to 84%, and when there are 10 people, the accuracy drops to 79.8%.

[0120] Through the embodiments of the present invention, each key point of the human body can be successfully located, which greatly improves the recognition accuracy and reduces the amount of calculation.

[0121] The present invention also provides a computer device, such as a smart phone, tablet computer, laptop computer, desktop computer, rack server, blade server, tower server or cabinet server (including an independent server or a server cluster composed of multiple servers) that can execute programs. The computer device of this embodiment includes at least but is not limited to: a memory and a processor that can communicate with each other through a system bus.

[0122] This embodiment also provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a disk, an optical disk, a server, an App application store, etc., on which a computer program is stored, and the program implements a corresponding function when executed by a processor. The computer-readable storage medium of this embodiment is used to store the violent behavior detection system 20, and implements the violent behavior detection method of embodiment 1 when executed by the processor.

[0123] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0124] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method.

[0125] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for detecting violent behavior, characterized in that: include: Acquire scene images through a camera; Inputting the scene image into a feature pyramid network, and acquiring a target human body from the scene image; Performing human body posture estimation on the target human body by using a cascade pyramid network to obtain a human body posture estimation result, wherein the cascade pyramid network includes a GlobalNet network and a RefineNet network; and Matching the human body posture estimation result with the violent behavior human body posture stored in the database, so as to determine whether there is violent behavior in the scene image according to the matching result, and classify the violent behavior; Wherein, the step of estimating the human body posture of the target human body by using the cascade pyramid network further includes: Sending the detection result image to the GlobalNet network, wherein the GlobalNet network does not include a pooling layer, and the size of the feature map output by each convolutional layer is reduced by adding a convolution step size between each convolutional layer; The step of inputting the scene image into a feature pyramid network to detect a target human body and obtaining the target human body from the scene image further includes: Passing the scene image through a convolutional network and extracting a feature image of the highest layer of the convolutional network to obtain a feature image of a first size; Upsampling the first-size feature image to a first intermediate-size feature image by bilinear interpolation; Fusing the first intermediate-sized feature image with the output image of the first intermediate size in the convolutional network to obtain a first fusion result; and Outputting the first fusion result to obtain a second-size feature image; After the step of outputting the first fusion result to obtain a second size feature image, the method further includes: Upsampling the second-size feature image to a second intermediate-size feature image by the bilinear interpolation method; Fusing the second intermediate-sized feature image with the output image of the second intermediate size in the convolutional network to obtain a second fusion result; and Outputting the second fusion result to obtain a feature image of a third size; After the step of outputting the second fusion result to obtain a third-size feature image, the method further includes: Inputting the first size characteristic image, the second size characteristic image and the third size characteristic image into the RPN network; performing region frame detection on the first size characteristic image, the second size characteristic image, and the third size characteristic image respectively; and According to the detection result, the region of interest and the region with the highest category score of the region of interest are obtained to obtain the target human body.

2. The method for detecting violent behavior according to claim 1, wherein: The step of using the cascade pyramid network to estimate the human body posture of the target human body also includes: Obtain the first feature map, the second feature map, the third feature map and the fourth feature map outputted by the 2nd to 5th convolutional layers respectively; and A 3*3 convolution filter is applied to the first feature map, the second feature map, the third feature map and the fourth feature map respectively to generate a heat map of a simple key point.

3. The method for detecting violent behavior according to claim 2, wherein: After the step of applying a 3*3 convolution filter to the first feature map, the second feature map, the third feature map and the fourth feature map respectively to generate a heat map of a simple key point, the method further includes: Sending the heat map to the RefineNet network to process the heat map through the residual block structure respectively, wherein the first feature map does not pass through the residual block structure, the second feature map passes through one residual block structure, the third feature map passes through two residual block structures, and the fourth feature map passes through three residual block structures, and the residual block structure includes a 1*1 convolution structure and a 3*3 convolution structure; The processing results are respectively subjected to upsampling processing, wherein the first feature map processing result is not subjected to upsampling processing, the second feature map processing result is subjected to upsampling processing twice, the third feature map processing result is subjected to upsampling processing four times, and the fourth feature map processing result is subjected to upsampling processing eight times; Connecting the sampling processing results to integrate the up-sampling results; and The integrated results are trained using L2 loss, and difficult key points are selected based on the training results.

4. The method for detecting violent behavior according to claim 1, wherein: Before the step of matching the human body posture estimation result with the violent behavior human body posture stored in the database to determine whether there is violent behavior in the scene image according to the matching result and classifying the violent behavior, the step further includes: Acquire a plurality of sample images, wherein each of the plurality of sample images includes a plurality of human bodies, and the plurality of human bodies perform different behaviors, and the behaviors at least include: one or more of punching, stabbing, shooting, kicking, and strangling; Performing behavior marking on the sample images according to the behaviors in the plurality of sample images; and The plurality of sample images are trained according to the labeling results to obtain human body postures corresponding to the behaviors.

5. A violent behavior detection system, characterized in that: include: An acquisition module, used for acquiring scene images through a camera; A detection module, used to input the scene image into a feature pyramid network and obtain a target human body from the scene image; A human body posture estimation module, used for performing human body posture estimation on the target human body by using a cascade pyramid network to obtain a human body posture estimation result, wherein the cascade pyramid network includes a GlobalNet network and a RefineNet network; and A classification module, used for matching the human body posture estimation result with the violent behavior human body posture stored in the database, so as to determine whether there is violent behavior in the scene image according to the matching result, and classify the violent behavior; The human body posture estimation module also sends the detection result image to the GlobalNet network, wherein the GlobalNet network does not include a pooling layer, and reduces the size of the feature map output by each convolutional layer by adding a convolution step size between each convolutional layer; The step of inputting the scene image into a feature pyramid network to detect a target human body and obtaining the target human body from the scene image further includes: Passing the scene image through a convolutional network and extracting a feature image of the highest layer of the convolutional network to obtain a feature image of a first size; Upsampling the first-size feature image to a first intermediate-size feature image by bilinear interpolation; Fusing the first intermediate-sized feature image with the output image of the first intermediate size in the convolutional network to obtain a first fusion result; and Outputting the first fusion result to obtain a second-size feature image; After outputting the first fusion result to obtain a second size feature image, the method further includes: Upsampling the second-size feature image to a second intermediate-size feature image by the bilinear interpolation method; Fusing the second intermediate-sized feature image with the output image of the second intermediate size in the convolutional network to obtain a second fusion result; and Outputting the second fusion result to obtain a feature image of a third size; After outputting the second fusion result to obtain a third-size feature image, the method further includes: Inputting the first size characteristic image, the second size characteristic image and the third size characteristic image into the RPN network; performing region frame detection on the first size characteristic image, the second size characteristic image, and the third size characteristic image respectively; and According to the detection result, the region of interest and the region with the highest category score of the region of interest are obtained to obtain the target human body.

6. A computer device, characterized in that: The computer device memory, the processor and the computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of the violent behavior detection method according to any one of claims 1 to 4 are implemented.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program can be executed by at least one processor to enable the at least one processor to perform the steps of the violent behavior detection method according to any one of claims 1 to 4.