Abnormal behavior identification method and device
Through the combination of the target silhouette deep learning model and the abnormal behavior deep learning model, irregular partial sequences are intercepted for identification, which solves the problem of poor recognition of short-duration actions in the existing technology and achieves more accurate abnormal behavior identification.
Patent Information
- Application Number
- CN202410691149.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-30
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-05-30
AI Technical Summary
The existing technology is not effective when the recognition duration is short and sudden movements occur, making it difficult to accurately identify and detect.
The target silhouette deep learning model is used to obtain the initial image sequence, the irregular parts are intercepted as the initial behavioral silhouette sequence, and the pre-trained abnormal behavior deep learning model is input to obtain the abnormal behavior classification results, avoiding redundant background information caused by directly inputting the initial silhouette sequence.
It improves the recognition accuracy of short-duration and sudden abnormal behaviors, and extracts image information more accurately to meet actual needs.
Smart Images

Figure CN118570872A
Abstract
Description
Technical Field
[0001] The present application belongs to the field of image processing technology, and more specifically, to a method and device for identifying abnormal behavior. Background Art
[0002] With the rapid development of artificial intelligence and image processing technology, the research on intelligent video surveillance systems based on deep learning is of great significance. With the development of science and technology, intelligent monitoring technology is also constantly improving, and the demand for abnormal human behavior recognition and detection technology in social production and life is becoming more and more extensive. In the field of medical monitoring, through abnormal behavior recognition and detection technology, real-time monitoring of unattended patients or elderly people can be achieved, judging whether the target has fallen or other accidents, and calling the police for help in time to ensure that they receive treatment and help as soon as possible; in the field of traffic supervision, abnormal human behavior recognition and detection technology can be used to monitor abnormal conditions inside and outside the car, including driver behavior, to reduce the risk of accidents; in the field of public safety, this technology can be used to detect abnormal conditions of people in public places and judge behaviors such as fighting.
[0003] However, compared with actions that last longer, such as running, brisk walking, and backwards, the recognition effect for actions that last shorter and occur suddenly still needs to be strengthened. Summary of the invention
[0004] In view of the defects existing in the related art, the embodiments of the present application provide a method and device for identifying abnormal behavior, aiming to solve the problem of poor recognition effect of actions that are of short duration and occur suddenly.
[0005] In a first aspect, an embodiment of the present application provides a method for identifying abnormal behavior, comprising:
[0006] Obtain an initial image sequence, where the images in the initial image sequence are minimum rectangular images containing the target;
[0007] Inputting the initial image sequence into the target silhouette deep learning model to generate an initial silhouette sequence of the target; wherein the target silhouette deep learning model is obtained after training based on sample images and predetermined binary silhouette annotation information;
[0008] intercepting an irregular part of the initial silhouette sequence as the initial behavior silhouette sequence;
[0009] Based on the initial behavior silhouette sequence and the pre-trained abnormal behavior deep learning model, the abnormal behavior classification result is obtained; wherein the abnormal behavior deep learning model is used to determine the abnormal behavior classification result of the input silhouette sequence.
[0010] In a second aspect, the embodiment of the present application further provides an abnormal behavior recognition device, comprising:
[0011] A first acquisition module is used to acquire an initial image sequence, where the images in the initial image sequence are minimum rectangular images containing the target;
[0012] A generation module, used to input the initial image sequence into the target silhouette deep learning model to generate an initial silhouette sequence of the target; wherein the target silhouette deep learning model is obtained after training based on the sample image and predetermined binary silhouette annotation information;
[0013] A capture module, used for capturing an irregular part of the initial silhouette sequence as an initial behavior silhouette sequence;
[0014] The second acquisition module is used to obtain abnormal behavior classification results based on the initial behavior silhouette sequence and the pre-trained abnormal behavior deep learning model; wherein the abnormal behavior deep learning model is used to determine the abnormal behavior classification results of the input silhouette sequence.
[0015] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: at least one memory for storing programs; and at least one processor for executing the programs stored in the memory. When the program stored in the memory is executed, the processor is used to execute the method described in the first aspect or any possible implementation of the first aspect.
[0016] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a processor, the processor executes the method described in the first aspect or any possible implementation of the first aspect.
[0017] In a fifth aspect, an embodiment of the present application further provides a computer program product, which, when executed on a processor, enables the processor to execute the method described in the first aspect or any possible implementation of the first aspect.
[0018] The abnormal behavior recognition method and device provided in the embodiments of the present application use a target silhouette deep learning model to obtain an initial silhouette sequence corresponding to the target's initial image sequence, intercept the irregular part of the initial silhouette sequence to obtain a short-term behavior sequence, and use the short-term behavior sequence as the input basis of the abnormal behavior deep learning model, which is more in line with the actual needs of identifying abnormal behaviors that are of short duration and occur suddenly, and realizes the recognition of abnormal behaviors that are of short duration and occur suddenly, and avoids excessive redundant background information caused by directly using the initial silhouette sequence as input, and the extracted image information is more accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the present application or related technologies, the following is a brief introduction to the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0020] Figure 1 It is a flowchart of the abnormal behavior identification method provided in the embodiment of the present application;
[0021] Figure 2 is a schematic diagram of a process for obtaining a fitted behavior silhouette sequence provided in an embodiment of the present application;
[0022] Figure 3 It is a schematic diagram of the structure of the target silhouette deep learning model provided in the embodiment of the present application;
[0023] Figure 4 It is a schematic diagram of the architecture of the abnormal behavior deep learning model provided in the embodiment of the present application;
[0024] Figure 5 is a schematic diagram of the structure of an abnormal behavior identification device provided in an embodiment of the present application;
[0025] Figure 6 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application 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 application and are not used to limit the present application.
[0027] In different application scenarios, the types of abnormal behaviors that need to be detected are also different. In particular, short-duration and sudden actions are difficult to detect. However, some short-duration and sudden actions can already have serious consequences such as transmitting abnormal information or causing security threats. Therefore, conventional abnormal behavior recognition can no longer meet actual recognition needs.
[0028] Based on the above-mentioned problems existing in the related technology, the embodiments of the present application provide a method and device for identifying abnormal behavior, which utilizes the target silhouette deep learning model to obtain an initial silhouette sequence corresponding to the initial image sequence of the target, and intercepts the irregular part of the initial silhouette sequence to obtain a short-term behavior sequence. The short-term behavior sequence is used as the input basis of the abnormal behavior deep learning model, which is more in line with the actual needs of identifying abnormal behaviors that are of short duration and occur suddenly, and realizes the identification of abnormal behaviors that are of short duration and occur suddenly, and avoids excessive redundant background information caused by directly using the initial silhouette sequence as input, and the extracted image information is more accurate.
[0029] Figure 1 is a flow chart of the abnormal behavior identification method provided in the embodiment of the present application, such as Figure 1 As shown, the method at least includes the following steps:
[0030] S101, obtaining an initial image sequence, where the images in the initial image sequence are minimum rectangular images containing a target.
[0031] Specifically, the initial image sequence is generally obtained by preprocessing the video (stream) shot by a camera.
[0032] Optionally, the video captured by the camera is preprocessed, including: real-time frame extraction of the video (stream), and target position detection, target tracking, and subsequent abnormal behavior recognition are performed only on the extracted partial frame images. Considering that the gait characteristics of the target do not change significantly in a very short duration, frame extraction can reduce the overall computational workload and computational complexity of the system without affecting the final recognition effect.
[0033] Optionally, the video captured by the camera is preprocessed, including: after determining the frame image containing the target, the frame image is cropped to obtain the minimum rectangular image containing the target, and the initial image sequence corresponding to the target is obtained in time sequence. The target can be a human body, an animal body, etc.
[0034] Optionally, the video captured by the camera is preprocessed, including: detecting the positions of different targets in the video frame image by a target position detection algorithm (such as a position detection deep learning model), and tracking each detected target by a target tracking algorithm (such as a general DeepSort algorithm), that is, locating the position of the same target in different frame images. The target position detection algorithm and the target tracking algorithm are not limited in the embodiments of the present application.
[0035] When the target is detected to leave the camera's field of view, or the number of images (real-time frame images) accumulates to a certain threshold, the initial image sequence is determined. The video data captured by the camera can be real-time video data or historical video data; the video data can be collected and pre-processed by itself, or the processed initial image sequence can be directly obtained.
[0036] S102: Input the initial image sequence into the target silhouette deep learning model to generate an initial silhouette sequence of the target.
[0037] Among them, the target silhouette deep learning model is obtained after training based on sample images and predetermined binary silhouette annotation information.
[0038] Specifically, the images in the initial image sequence are sequentially input into a pre-trained target silhouette deep learning model to generate an initial silhouette sequence of the target. Before executing S102, a target silhouette deep learning model needs to be constructed and trained.
[0039] The training process of the target silhouette deep learning model is as follows: first, obtain sample images collected under different states; then determine the binary silhouette annotation information corresponding to the sample in the image; multiple sample images and corresponding binary silhouette annotation information constitute training samples. Optionally, the target silhouette deep learning model adopts a segmentation convolutional network, which includes: an encoder module, a decoder module, an encoding and decoding connection model, and a pixel-level classification layer. After obtaining the training samples and determining the type of the target silhouette deep learning model, the model is trained until the model converges.
[0040] When binarizing and annotating samples, polygons are used to annotate the edge contours of each sample based on the sample position in the image. The edge contours of the sample can be used to distinguish whether the pixels in the image are foreground pixels or background pixels. For example, by using python code to load the saved json file, the contour coordinates can be parsed, and the pointPolygonTest method of opencv can be used to distinguish whether the pixels in the image are outside the contour (background pixels) or inside the contour (foreground pixels).
[0041] Assign different color values to the background pixels and foreground pixels in the image, for example, set the background pixels to 0 and the foreground pixels to 255, and save it as a picture to obtain a binary silhouette image with a black background and a white silhouette of the collected sample.
[0042] S103, intercepting an irregular part of the initial silhouette sequence as an initial behavior silhouette sequence.
[0043] Specifically, for the target's normal behavior, such as normal walking, running, and stillness, its silhouette sequence shows certain regular changes. For example, walking and running show periodic changes, while the silhouette sequence remains basically unchanged for stillness. Therefore, the irregular part of the initial silhouette sequence is intercepted as the initial behavior silhouette sequence, that is, the initial short-term behavior sequence is obtained, which contains the target's abnormal behavior characteristics.
[0044] S104. Obtain abnormal behavior classification results based on the initial behavior silhouette sequence and the pre-trained abnormal behavior deep learning model.
[0045] Among them, the abnormal behavior deep learning model is used to determine the abnormal behavior classification results of the input silhouette sequence.
[0046] Specifically, the extracted initial behavior silhouette sequence and the pre-trained abnormal behavior deep learning model are used to obtain the abnormal behavior classification results.
[0047] Optionally, the initial behavior silhouette sequence is input into a pre-trained abnormal behavior deep learning model to obtain abnormal behavior classification results.
[0048] Optionally, the initial behavior silhouette sequence is fitted, and the fitted behavior silhouette sequence is input into a pre-trained abnormal behavior deep learning model to obtain an abnormal behavior classification result.
[0049] The abnormal behavior recognition method provided in the embodiment of the present application utilizes the target silhouette deep learning model to obtain the initial silhouette sequence corresponding to the initial image sequence of the target, intercepts the irregular part of the initial silhouette sequence to obtain the short-term behavior sequence, and uses the short-term behavior sequence as the input basis of the abnormal behavior deep learning model. It is more in line with the actual needs of identifying abnormal behaviors that are of short duration and occur suddenly, and realizes the recognition of abnormal behaviors that are of short duration and occur suddenly, and avoids excessive redundant background information caused by directly using the initial silhouette sequence as input, and the extracted image information is more accurate.
[0050] In some embodiments, intercepting an irregular portion of the initial silhouette sequence as the initial behavior silhouette sequence in S103 includes:
[0051] Determine the centroid position of the silhouette of the target in each silhouette image in the initial silhouette sequence;
[0052] Based on the position of the contour centroid, part of the mutation sequence in the initial silhouette sequence is intercepted as the initial behavior silhouette sequence.
[0053] Specifically, after obtaining the initial silhouette sequence output by the target silhouette deep learning model, the initial silhouette sequence is analyzed to find out the abnormal behavior of the target in a long period of normal behavior, such as a pedestrian walking normally suddenly bending over, or a person standing suddenly jumping, etc. Therefore, it is necessary to capture the irregular part in the initial silhouette sequence as the initial behavior silhouette sequence.
[0054] Determine the contour centroid position of the target in each silhouette image in the initial silhouette sequence, and intercept part of the mutation sequence in the initial silhouette sequence based on the contour centroid position as the initial behavior silhouette sequence. The main basis for interception is the contour centroid position of the target in the silhouette image, that is, the pixel position where the centroid of the target's external contour is located. It can be imagined that in addition to the centroid, other points of interest can also be used. Considering that the position change of the center of mass of the target in a long-lasting regular motion is relatively stable, the contour centroid position is selected as the basis for intercepting irregular partial sequences, rather than a certain pixel point at the head or limbs.
[0055] In some embodiments, extracting a portion of the mutation sequence in the initial silhouette sequence based on the contour centroid position comprises:
[0056] Performing equal-width processing on the silhouette images in the initial silhouette sequence, based on the height change of the center of mass position of the target's silhouette in the initial silhouette sequence after the equal-width processing, intercepting part of the mutation sequence in the initial silhouette sequence as the initial behavior silhouette sequence; or,
[0057] The silhouette images in the initial silhouette sequence are processed with contour heights, and based on the width change of the target's contour centroid position in the initial silhouette sequence after the contour height processing, part of the mutation sequence in the initial silhouette sequence is intercepted as the initial behavior silhouette sequence.
[0058] Specifically, the centroid position of the target's silhouette image can be calculated using the following formula:
[0059]
[0060] Among them, x and y represent the x-coordinate and y-coordinate of the contour centroid respectively. i Represents the x-coordinates and y-coordinates of all pixels within the target contour. i Represents the y coordinates of all pixels within the target contour.
[0061] Since the silhouette is a binary image, all targets are considered to have the same mass, the x-coordinate of the centroid is the average of the x-coordinates of all pixels in the target contour, and the y-coordinate of the centroid is the average of the y-coordinates of all pixels in the target contour. The image of the mutation can be determined by the position change of the centroid in all silhouette images in the initial silhouette sequence.
[0062] If the silhouette images in all the initial silhouette images are processed with equal width, for example, all images are adjusted to images with a width of 256 pixels and a proportionally scaled height, that is, the width and height of the original image are w and h respectively, and the width becomes 256 and the height becomes (h×256) / w after adjustment; then only the change in the height of the centroid (corresponding to the y coordinate) needs to be considered, and the partial sequence where the centroid position of the contour appears abruptly on the y axis is intercepted as the initial behavior silhouette sequence. If the silhouette images in the initial silhouette images are processed with equal height, for example, all images are adjusted to images with a height of 256 pixels and a proportionally scaled width, that is, the width and height of the original image are w and h respectively, and the width becomes (w×256) / h and the height becomes 256 after adjustment; then only the change in the width of the centroid (corresponding to the x coordinate) needs to be considered, and the partial sequence where the centroid position of the contour appears abruptly on the x axis is intercepted as the initial behavior silhouette sequence.
[0063] The image where the mutation occurs is the starting image of the initial behavior silhouette sequence, corresponding to the beginning of the abnormal behavior; the image where the mutation ends is the ending image of the initial behavior silhouette sequence, corresponding to the end of the abnormal behavior.
[0064] The abnormal behavior recognition method provided in the embodiment of the present application intercepts the irregular part of the initial silhouette sequence of the target output by the target silhouette deep learning model through the change of the contour center position of the target in the silhouette image, and obtains a short-term behavior sequence, thereby avoiding the problem of excessive redundant background information caused by directly inputting the initial silhouette sequence for abnormal behavior recognition.
[0065] In some embodiments, S105 specifically includes:
[0066] Fitting the initial behavior silhouette sequence to obtain a fitted behavior silhouette sequence;
[0067] The fitted behavior silhouette sequence is input into the pre-trained abnormal behavior deep learning model to obtain the abnormal behavior classification results.
[0068] Specifically, in the same behavior sequence, the pixels in the binary silhouette of the target will not mutate, so it is necessary to fit the initial behavior silhouette sequence to correct the pixel positions in the mutated image and obtain the fitted behavior silhouette sequence. The fitted behavior silhouette sequence is input into the pre-trained abnormal behavior deep learning model to obtain the abnormal behavior classification results, and the abnormal behavior recognition effect is more accurate.
[0069] In some embodiments, fitting the initial behavior silhouette sequence specifically includes:
[0070] Performing equal height and equal width processing on the silhouette images in the initial silhouette sequence, and determining the positions of at least two key points of the target in the processed silhouette images;
[0071] In the behavior sequence corresponding to the regular part in the initial silhouette sequence, based on the position of the first key point in the time-series continuous silhouette images, determine a first average change rate of the first key point in the x direction and a second average change rate in the y direction;
[0072] Based on the first average change rate, a first threshold in the x direction is set; based on the second average change rate, a second threshold in the y direction is set;
[0073] If a first change rate of a current silhouette image in the initial behavior silhouette sequence in the x direction compared to a previous silhouette image that is continuous in time sequence exceeds a first threshold, and a change rate of a subsequent silhouette image that is continuous in time sequence with the current silhouette image in the x direction compared to the current silhouette image exceeds the first threshold, the current silhouette image is fitted in the x direction and adjusted to the average value of the coordinate values of the previous silhouette image and the subsequent silhouette image in the x direction;
[0074] If the third change rate of the current silhouette image in the initial behavior silhouette sequence in the y direction compared to the previous silhouette image in temporal sequence exceeds the second threshold, and the change rate of the next silhouette image in temporal sequence with the current silhouette image in the y direction compared to the current silhouette image exceeds the second threshold, then the current silhouette image is fitted in the y direction and adjusted to the average of the coordinate values of the previous silhouette image and the next silhouette image in the y direction.
[0075] Specifically, the silhouette images in the initial silhouette sequence are processed to be equal in height and width, for example, all the silhouette images in the initial silhouette sequence are adjusted to images with a width and height of 256 pixels, so that all images in the sequence have the same size.
[0076] Determine the positions of at least two key points of the target in the processed silhouette image. The key points can be selected from the contour centroid, the highest point of the target head, the edge points of the target limbs, etc. Since the original images are all minimum rectangular images containing the complete target, that is, the contour position of the target in the image will occupy the entire image, taking the target as a pedestrian as an example, the highest point of the pedestrian's head is the white position closest to the upper edge in the binary image, and the lowest point of the foot is the white position closest to the lower edge in the binary image. Similarly, the white positions closest to the left and right edges are the limbs. To distinguish between upper limbs and lower limbs, it can be considered that the lower limbs are below 0.3 of the image height and the upper limbs are above 0.3 according to the human body structure. Therefore, the positions of the pedestrian's head and limbs in the image can be obtained in a silhouette image, thereby selecting key points. The at least two key points selected can be 5 key points, which are the highest point of the target's head and the edge pixel points of the limbs.
[0077] During the target's continuous normal behavior, the position of the key points should change in a regular manner, that is, the position of the key points will not change suddenly. The position change trend of each key point can be obtained by analyzing the position of each key point in each silhouette image.
[0078] For any one of the key points, record it as the first key point. In the behavior sequence corresponding to the regular part in the initial silhouette sequence, based on the position of the first key point in the time-series continuous silhouette image, determine the first average change rate of the first key point in the x direction, record it as σ x ; Determine the second average rate of change of the first key point in the y direction, denoted as σ y . Set a first threshold based on the first average change rate, for example, 2 x Or other values; set the second threshold based on the second average change rate, for example, 2 y Or other values.
[0079] In the irregular initial action silhouette sequence, if the first change rate of the current silhouette image A in the x direction exceeds 2 compared with the previous silhouette image A0 in the temporal sequence, x , and the change rate of the next silhouette image A1 that is continuous with the current silhouette image A in the x direction exceeds 2 x , it is considered that in the current silhouette image A, the first key point needs to be fitted in the x direction, and the specific fitting method can be: adjusting to the average value of the coordinate values of the previous silhouette image A0 and the next silhouette image A1 in the x direction.
[0080] In the irregular initial action silhouette sequence, if the first change rate of the current silhouette image A in the x direction exceeds 2 compared with the previous silhouette image A0 in the temporal sequence, x , and the second change rate of the next silhouette image A1 that is sequentially continuous with the current silhouette image A in the x direction exceeds 2 x , it is considered that in the current silhouette image A, the first key point needs to be fitted in the x direction, and the specific fitting method can be: adjusting to the average value of the coordinate values of the previous silhouette image A0 and the next silhouette image A1 in the x direction.
[0081] In the irregular initial action silhouette sequence, if the third change rate of the current silhouette image A in the y direction compared with the previous silhouette image A0 in the temporal sequence exceeds 2 y , and the fourth change rate of the next silhouette image A1 that is sequentially continuous with the current silhouette image A in the y direction exceeds 2 y, it is considered that in the current silhouette image A, the first key point needs to be fitted in the y direction. The specific fitting method can be: adjusting to the average value of the coordinate values of the previous silhouette image A0 and the next silhouette image A1 in the y direction.
[0082] Figure 2 is a schematic diagram of a process for obtaining a fitted behavior silhouette sequence provided in an embodiment of the present application, such as Figure 2 As shown, after obtaining the initial silhouette sequence output by the target silhouette deep learning model, the irregular part of the sequence is intercepted, and key point position fitting is performed to obtain the fitted behavior silhouette sequence as the input of the abnormal behavior deep learning model.
[0083] The abnormal behavior recognition method provided in the embodiment of the present application, after intercepting the irregular part of the initial silhouette sequence of the target output by the target silhouette deep learning model to obtain the short-term behavior sequence, also uses the continuity of the target's normal action behavior to fit the short-term behavior sequence, and considers more comprehensive dimensions, so that the subsequently extracted image information is more accurate and more in line with the requirements of identifying behaviors of shorter duration.
[0084] In some embodiments, the target silhouette deep learning model adopts a segmentation convolutional network, which includes: an encoder network, a decoder network, an encoding and decoding connection module and a pixel-level classification layer; the encoder network includes a convolutional layer and a maximum pooling layer, and the decoder network includes a convolutional layer and an upsampling layer, and the network structures of the encoder network and the decoder are symmetrical; the encoding and decoding connection module adopts a skip connection, and the convolutional layer before each maximum pooling layer in the encoder network is connected to the last convolutional layer of the corresponding size in the decoder network; the encoder network records boundary information through pooling indexes, and the decoder network realizes nonlinear upsampling through the pooling indexes derived from the corresponding maximum pooling layers.
[0085] Specifically, the object silhouette deep learning model adopts a segmentation convolutional neural network to improve the performance of image segmentation, and uses set indexing in the segmentation convolutional network to further improve the accuracy of segmentation boundaries.
[0086] The segmentation convolutional network includes an encoder module, a decoder network, an encoder-decoder connection module, and a pixel-level classification layer. The encoder module includes a convolutional layer and a maximum pooling layer, and the decoder module includes a convolutional layer and an upsampling layer. The encoder module and the decoder module adopt a symmetrical network structure, that is, each layer in the encoder module has a corresponding layer in the decoder.
[0087] The encoder module records boundary information through pooling index. During the encoding process, after the maximum pooling operation of the pooling layer, the size of the feature map will change, and the low-resolution features generated by the downsampling operation will lose some information; in order to retain more details, the segmentation convolutional network uses the pooling index to record the boundary information, that is, the pixel position of the maximum value selected by the pooling layer in the maximum pooling operation. During the decoding process, the upsampling operation is the inverse process of the pooling operation. The feature map is first enlarged, and then the data of the feature map is placed in the corresponding position according to the pooling index.
[0088] The decoder module implements nonlinear upsampling through the pooling index derived from the corresponding maximum pooling layer, so that the upsampling layer does not need to be learned and the training parameters can be reduced. Due to the introduction of the pooling index, more boundary information can be obtained, improving the segmentation performance of the model. The role of the convolution operation is to enrich the information of the sparse feature map generated by the upsampling layer and generate a more continuous feature map.
[0089] In some embodiments, the codec connection module adopts skip connection, and the convolution layer before each maximum pooling layer in the encoder module is connected to the last convolution layer of the corresponding size in the decoder module.
[0090] Specifically, a skip layer fusion mechanism is also implemented in the segmentation convolutional network, that is, the feature maps of different scales generated by different layers are fused into a fusion map. After each downsampling or upsampling operation, the scale of the feature map is changed, so the feature maps in the segmentation convolutional network have multiple scales.
[0091] In order to utilize sparse feature maps and continuous feature maps of different scales, a cross-layer fusion mechanism is established to connect the encoder network and the decoder network. The encoder-coder connection module adopts skip connection to connect the convolutional layer before each maximum pooling layer in the encoder module to the last convolutional layer of the corresponding scale in the decoder network.
[0092] Figure 3 is a schematic diagram of the structure of the target silhouette deep learning model provided in the embodiment of the present application, such as Figure 3 As shown in the figure, the network structure of the encoder module is consistent with that of VGG16, including 13 convolutional layers and 5 pooling layers; the network structure of the decoder module is symmetrical to that of the encoder module, including 13 convolutional layers and 5 upsampling layers, and each layer of the encoder module has a corresponding layer in the decoder module. The decoder can implement nonlinear upsampling operations by deriving pooling indices from the corresponding maximum pooling layers, so that the upsampling layers do not need to be learned and the training parameters can be reduced.
[0093] At the same time, due to the introduction of pooling index, more boundary information can be obtained and the performance of segmentation can be improved. During the encoding process, after the maximum pooling operation, the size of the feature map will change, and the low-resolution features generated by the downsampling operation will lose some information; in order to retain more details, the segmentation convolutional network uses the pooling index to record the boundary information, that is, the pixel position of the maximum value selected by the pooling layer in the maximum pooling operation. During the decoding process, the upsampling operation is the inverse process of the pooling operation. The feature map is first enlarged, and then the data of the feature map is placed in the corresponding position according to the pooling index. The role of the convolution operation is to enrich the information of the sparse feature map generated by the upsampling layer and generate a more continuous feature map.
[0094] At the same time, a skip layer fusion mechanism is implemented on the segmentation convolutional network, that is, the feature maps of different scales generated by different layers are fused into a fusion map. After each downsampling or upsampling operation, the scale of the feature map is changed, so there are 5 scales of feature maps in the segmentation convolutional network. In order to utilize sparse feature maps and continuous feature maps of different scales, a cross-layer fusion mechanism is established to connect the encoder network and the decoder network, connecting the convolutional layer before each maximum pooling layer in the encoder network to the last convolutional layer of the corresponding scale in the decoder network.
[0095] In some embodiments, the abnormal behavior deep learning model uses a twin structure to simultaneously extract features from a behavior silhouette sequence and a randomly enhanced behavior silhouette sequence. The feature images obtained by the two branches after the attention mechanism are fused and output, and the twin structure shares parameters. The output results of the twin structure after feature fusion and the behavior silhouette sequence are respectively input into the same feature extraction network and fused through lateral connections, and the abnormal behavior category is output after passing through the fully connected layer and the classifier layer.
[0096] Figure 4 Schematic diagram of the architecture of the abnormal behavior deep learning model provided in the embodiment of the present application, such as Figure 4 As shown in the figure, a twin structure is introduced at the input stage of the network model. One branch takes the behavior silhouette sequence (initial behavior silhouette sequence or fitted behavior silhouette sequence) as input, and the other branch takes the behavior silhouette sequence after random enhancement as input. Sharing parameters in the two branches greatly improves the efficiency of network training.
[0097] At the input, different interferences are randomly generated for the data, mainly random enhancement is applied to the image of one input branch, including random cropping, random flipping, and random erasing. Then, random regularization (Dropout) is applied to the output features of the two branches.
[0098] After the data passes through the twin structure, the output results of the twin structure after feature fusion (slow channel) and the behavior silhouette sequence (fast channel) are respectively input into the same feature extraction network, such as the ResNet network, and feature fusion is performed through lateral connections. Here, the output results of the fast channel are sent to the slow channel through lateral connections, but the data sample shapes of the two channels are different, so the output shape of the fast channel is transformed before fusion.
[0099] The feature fusion module includes an attention mechanism and an optimization part. The attention mechanism is a simple and effective attention module that can be directly applied to feedforward convolutional neural networks. It consists of two parts: a channel attention module and a spatial attention module. For the feature map generated by the convolutional neural network, the attention mechanism calculates the attention map of the feature map from the two dimensions of channel and space, and then multiplies the corresponding elements of the attention map and the feature map for adaptive learning of the features.
[0100] Optionally, the feature map obtained after the attention mechanism is concat fused to directly connect the two features. If the dimensions of the two input features x and y are p and q, the dimension of the output feature z is p+q. At this time, due to weight sharing, the efficiency of the network training process will not be reduced. After the Concat operation, a Bn function and a ReLu function can be used. From the perspective of the data saturation area, if ReLu is performed first, some units will be inactivated during Bn, causing Bn to be unstable and affecting model performance; Bn standardizes the data distribution, returns the data to the non-saturated area, and then passes through ReLu to control the degree of activation saturation. Therefore, in the embodiment of the present application, the operation of placing Bn before Relu is adopted.
[0101] Finally, the fully connected layer is used to output an n-dimensional vector O (the number of abnormal behaviors identified), and the softmax operation is performed on the vector to obtain an n-dimensional vector O ′ , represents the probability of each abnormal behavior, and sets the threshold to 2 / n. If O ′ The maximum value O ′ max >2 / n, the abnormal behavior result represented by the vector position where the maximum value is located is output, otherwise the output category is other categories.
[0102] The abnormal behavior recognition method provided in the embodiment of the present application is an abnormal behavior deep learning model that directly uses the behavior silhouette sequence as input. During input, a twin structure is used to simultaneously process the original sequence data and the enhanced data. The two structures share parameters and perform feature fusion in the subsequent process, so that the training speed is not affected and the robustness is greatly improved. At the same time, since the input sequence information already contains semantic information, there is no need to skip frames. By horizontally connecting and fusing the feature information, the behavior characteristics can be better extracted.
[0103] Figure 5 is a schematic diagram of the structure of the abnormal behavior identification device provided in the embodiment of the present application, such as Figure 5 As shown, the device at least includes:
[0104] The first acquisition module 501 is used to acquire an initial image sequence, where the images in the initial image sequence are minimum rectangular images containing the target;
[0105] A generation module 502 is used to input the initial image sequence into a target silhouette deep learning model to generate an initial silhouette sequence of the target; wherein the target silhouette deep learning model is obtained after training based on sample images and predetermined binary silhouette annotation information;
[0106] A capture module 503, used for capturing an irregular part of the initial silhouette sequence as an initial behavior silhouette sequence;
[0107] The second acquisition module 504 is used to obtain the abnormal behavior classification result based on the initial behavior silhouette sequence and the pre-trained abnormal behavior deep learning model; wherein the abnormal behavior deep learning model is used to determine the abnormal behavior classification result of the input silhouette sequence.
[0108] In some embodiments, the interception module 503 includes:
[0109] A determination unit, used to determine the centroid position of the silhouette of the target in each silhouette image in the initial silhouette sequence;
[0110] The interception unit is used to intercept part of the mutation sequence in the initial silhouette sequence based on the position of the contour centroid as the initial behavior silhouette sequence.
[0111] In some embodiments, the interception unit is specifically configured to:
[0112] Performing equal-width processing on the silhouette images in the initial silhouette sequence, based on the height change of the center of mass position of the target's silhouette in the initial silhouette sequence after the equal-width processing, intercepting part of the mutation sequence in the initial silhouette sequence as the initial behavior silhouette sequence; or,
[0113] The silhouette images in the initial silhouette sequence are processed with contour heights, and based on the width change of the target's contour centroid position in the initial silhouette sequence after the contour height processing, part of the mutation sequence in the initial silhouette sequence is intercepted as the initial behavior silhouette sequence.
[0114] In some embodiments, the second acquisition module 504 includes:
[0115] A fitting unit, used for fitting the initial behavior silhouette sequence to obtain a fitted behavior silhouette sequence;
[0116] The acquisition unit is used to input the fitted behavior silhouette sequence into the pre-trained abnormal behavior deep learning model to obtain the abnormal behavior classification result.
[0117] In some embodiments, the fitting unit is specifically configured to:
[0118] Performing equal height and equal width processing on the silhouette images in the initial silhouette sequence, and determining the positions of at least two key points of the target in the processed silhouette images;
[0119] In the behavior sequence corresponding to the regular part in the initial silhouette sequence, based on the position of the first key point in the time-series continuous silhouette images, determine a first average change rate of the first key point in the x direction and a second average change rate in the y direction;
[0120] Based on the first average change rate, a first threshold in the x direction is set; based on the second average change rate, a second threshold in the y direction is set;
[0121] If a first change rate of a current silhouette image in the initial behavior silhouette sequence in the x direction compared to a previous silhouette image that is continuous in time sequence exceeds a first threshold, and a change rate of a subsequent silhouette image that is continuous in time sequence with the current silhouette image in the x direction compared to the current silhouette image exceeds the first threshold, the current silhouette image is fitted in the x direction and adjusted to the average value of the coordinate values of the previous silhouette image and the subsequent silhouette image in the x direction;
[0122] If the third change rate of the current silhouette image in the initial behavior silhouette sequence in the y direction compared to the previous silhouette image in temporal sequence exceeds the second threshold, and the change rate of the next silhouette image in temporal sequence with the current silhouette image in the y direction compared to the current silhouette image exceeds the second threshold, then the current silhouette image is fitted in the y direction and adjusted to the average of the coordinate values of the previous silhouette image and the next silhouette image in the y direction.
[0123] In some embodiments, the target silhouette deep learning model uses a segmentation convolutional network, which includes: an encoder module, a decoder module, an encoder-decoder connection module, and a pixel-level classification layer;
[0124] The encoder module includes a convolutional layer and a maximum pooling layer, and the decoder module includes a convolutional layer and an upsampling layer. The network structures of the encoder module and the decoder module are symmetrical.
[0125] The encoder module records boundary information through pooling indexes, and the decoder module implements nonlinear upsampling through the pooling indexes derived from the corresponding maximum pooling layer;
[0126] The encoder-decoder connection module adopts skip connection, and the convolution layer before each maximum pooling layer in the encoder module is connected to the last convolution layer of the corresponding size in the decoder module.
[0127] In some embodiments, the abnormal behavior deep learning model uses a twin structure to simultaneously extract features from a behavior silhouette sequence and a randomly enhanced behavior silhouette sequence. The feature images obtained by the two branches after the attention mechanism are fused and output, and the twin structure shares parameters. The output results of the twin structure after feature fusion and the behavior silhouette sequence are respectively input into the same feature extraction network and fused through lateral connections, and the abnormal behavior category is output after passing through the fully connected layer and the classifier layer.
[0128] It can be understood that the detailed functional implementation of each of the above-mentioned units / modules can be found in the introduction of the aforementioned method embodiment, and will not be repeated here.
[0129] It should be understood that the above-mentioned device is used to execute the method in the above-mentioned embodiment. The implementation principle and technical effect of the corresponding program module in the device are similar to those described in the above-mentioned method. The working process of the device can refer to the corresponding process in the above-mentioned method, which will not be repeated here.
[0130] Based on the method in the above embodiment, an embodiment of the present application provides an electronic device. The device may include: at least one memory for storing programs and at least one processor for executing the programs stored in the memory. When the program stored in the memory is executed, the processor is used to execute the method described in the above embodiment.
[0131] Figure 6 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, such as Figure 6 As shown, the electronic device may include: a processor (processor) 601, a communication interface (Communications Interface) 620, a memory (memory) 603 and a communication bus 604, wherein the processor 601, the communication interface 602, and the memory 603 communicate with each other through the communication bus 604. The processor 601 can call the software instructions in the memory 603 to execute the method described in the above embodiment.
[0132] In addition, the logic instructions in the above-mentioned memory 603 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present application, or the part that contributes to the relevant technology or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present application.
[0133] Based on the method in the above embodiment, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a processor, the processor executes the method in the above embodiment.
[0134] Based on the method in the above embodiment, an embodiment of the present application provides a computer program product. When the computer program product runs on a processor, the processor executes the method in the above embodiment.
[0135] It is understandable that the processor in the embodiment of the present application may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. A general-purpose processor may be a microprocessor or any conventional processor.
[0136] The method steps in the embodiments of the present application can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC.
[0137] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loading and executing computer program instructions on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted by a computer-readable storage medium. The computer instructions can be transmitted from a website site, a computer, a server or a data center to another website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, a data center, etc. that contains one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
[0138] It should be understood that the various numerical numbers involved in the embodiments of the present application are only used for the convenience of description and are not used to limit the scope of the embodiments of the present application.
[0139] It is easy for those skilled in the art to understand that the above are only preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A method for identifying abnormal behavior, characterized in that: include: Acquire an initial image sequence, wherein the images in the initial image sequence are minimum rectangular images containing the target; Inputting the initial image sequence into a target silhouette deep learning model to generate an initial silhouette sequence of the target; wherein the target silhouette deep learning model is obtained after training based on sample images and predetermined binary silhouette annotation information; intercepting the irregular part of the initial silhouette sequence as an initial behavior silhouette sequence; Based on the initial behavior silhouette sequence and the pre-trained abnormal behavior deep learning model, an abnormal behavior classification result is obtained; wherein the abnormal behavior deep learning model is used to determine the abnormal behavior classification result of the input silhouette sequence.
2. The abnormal behavior identification method according to claim 1, characterized in that: The step of intercepting the irregular portion of the initial silhouette sequence as the initial behavior silhouette sequence comprises: Determine the centroid position of the outline of the target in each silhouette image in the initial silhouette sequence; Based on the centroid position of the contour, a partial mutation sequence in the initial silhouette sequence is intercepted as the initial behavior silhouette sequence.
3. The abnormal behavior identification method according to claim 2, characterized in that: The method of intercepting a partial mutation sequence in the initial silhouette sequence based on the contour centroid position comprises: Performing equal-width processing on the silhouette images in the initial silhouette sequence, and based on the height change of the center of mass position of the silhouette of the target in the initial silhouette sequence after the equal-width processing, intercepting a part of the mutation sequence in the initial silhouette sequence as the initial behavior silhouette sequence; or The silhouette images in the initial silhouette sequence are processed with contour heights, and based on the width change of the contour centroid position of the target in the initial silhouette sequence after the contour height processing, a partial mutation sequence in the initial silhouette sequence is intercepted as the initial behavior silhouette sequence.
4. The abnormal behavior identification method according to claim 1, characterized in that: The obtaining of abnormal behavior classification results based on the initial behavior silhouette sequence and the pre-trained abnormal behavior deep learning model includes: Fitting the initial behavior silhouette sequence to obtain a fitted behavior silhouette sequence; The fitted behavior silhouette sequence is input into a pre-trained abnormal behavior deep learning model to obtain abnormal behavior classification results.
5. The abnormal behavior identification method according to claim 4, characterized in that: The fitting of the initial behavior silhouette sequence comprises: Performing equal height and equal width processing on the silhouette images in the initial silhouette sequence, and determining the positions of at least two key points of the target in the processed silhouette images; In the behavior sequence corresponding to the regular part in the initial silhouette sequence, based on the position of the first key point in the time-series continuous silhouette images, determine the first average change rate of the first key point in the x-direction and the second average change rate of the first key point in the y-direction; Based on the first average change rate, a first threshold in the x direction is set; based on the second average change rate, a second threshold in the y direction is set; If a first change rate of a current silhouette image in the initial behavior silhouette sequence in the x direction compared to a previous silhouette image in temporal sequence exceeds the first threshold, and a change rate of a subsequent silhouette image in temporal sequence with the current silhouette image in the x direction compared to the current silhouette image exceeds the first threshold, the current silhouette image is fitted in the x direction and adjusted to an average value of the coordinate values of the previous silhouette image and the subsequent silhouette image in the x direction; If the third change rate of the current silhouette image in the initial behavior silhouette sequence in the y direction compared to the previous silhouette image in temporal sequence exceeds the second threshold, and the change rate of the next silhouette image in temporal sequence with the current silhouette image in the y direction compared to the current silhouette image exceeds the second threshold, the current silhouette image is fitted in the y direction and adjusted to the average of the coordinate values of the previous silhouette image and the next silhouette image in the y direction.
6. The abnormal behavior identification method according to claim 1, characterized in that: The target silhouette deep learning model adopts a segmentation convolutional network, which includes: an encoder module, a decoder module, an encoder-decoder connection module and a pixel-level classification layer; The encoder module includes a convolution layer and a maximum pooling layer, the decoder module includes a convolution layer and an upsampling layer, and the network structures of the encoder module and the decoder module are symmetrical; The encoder module records boundary information through pooling indexes, and the decoder module implements nonlinear upsampling through pooling indexes derived from the corresponding maximum pooling layer; The codec connection module adopts skip connection, and the convolution layer before each maximum pooling layer in the encoder module is connected to the last convolution layer of the corresponding size in the decoder module.
7. The abnormal behavior identification method according to claim 1, characterized in that: The abnormal behavior deep learning model adopts a twin structure to simultaneously extract features from a behavior silhouette sequence and a randomly enhanced behavior silhouette sequence. The feature images obtained by the two branches after the attention mechanism are output after feature fusion, and the twin structure shares parameters. The output result of the twin structure after feature fusion and the behavior silhouette sequence are respectively input into the same feature extraction network and fused through lateral connections, and the abnormal behavior category is output after passing through the fully connected layer and the classifier layer.
8. An abnormal behavior recognition device, characterized in that: include: A first acquisition module is used to acquire an initial image sequence, where the images in the initial image sequence are minimum rectangular images containing the target; A generation module, used for inputting the initial image sequence into a target silhouette deep learning model to generate an initial silhouette sequence of the target; wherein the target silhouette deep learning model is obtained after training based on sample images and predetermined binary silhouette annotation information; An interception module, used for intercepting the irregular part of the initial silhouette sequence as an initial behavior silhouette sequence; The second acquisition module is used to obtain the abnormal behavior classification result based on the initial behavior silhouette sequence and the pre-trained abnormal behavior deep learning model; wherein the abnormal behavior deep learning model is used to determine the abnormal behavior classification result of the input silhouette sequence.
9. An electronic device / image signal generator / network device / transmitter / terminal / base station / industrial computer, characterized in that: include: at least one memory for storing a computer program; At least one processor is used to execute the program stored in the memory. When the program stored in the memory is executed, the processor is used to execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program runs on a processor, the processor is caused to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method and device for metering lithium battery electric quantity
CN103048629A
Gait recognition method based on deep camera and 3D convolutional neural network
CN107103277A
Methods and systems for film previsualization
US20180268565A1
Process of Image
US20220343507A1
Cited By
Gait anomaly detection method and device, medium and product
CN119326405A
Training method of gait recognition model, gait recognition method, medium and controller
CN119723245A
Training Method of Gait Recognition Model Augmented by Motion Mode, Gait Recognition Method, Medium, and Controller
CN119723245B
Method and system for analyzing impurities of basic nickel carbonate
CN120747046A
