Behavior recognition method, device and electronic equipment

Through the combination of three-dimensional convolutional neural network and two-dimensional convolutional neural network, the spatiotemporal and spatial features of human behavior images are extracted, which solves the problem of low accuracy of behavior recognition in the existing technology and achieves high-accuracy behavior recognition.

CN113989938BActive Publication Date: 2024-09-06INNER MONGOLIA UNIV OF SCI & TECH
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202111339812.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-12
Publication Date
2024-09-06
Estimated Expiration
2041-11-12

AI Technical Summary

Technical Problem

Existing technology cannot accurately identify the spatial location of behaviors in human behavior recognition, and the accuracy of behavior recognition is low.

Method used

A three-dimensional convolutional neural network is used to extract spatio-temporal features from multiple frames of continuous target behavior images, and a two-dimensional convolutional neural network is used to extract spatial features from key frame images. The behavior recognition results are determined through the fusion of spatio-temporal features and spatial features.

Benefits of technology

It improves the accuracy of behavior recognition, takes into account the time and spatial location characteristics, reduces the computational complexity of the neural network, and improves the accuracy of the recognition results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113989938B
    Figure CN113989938B
Patent Text Reader

Abstract

The behavior recognition method, device and electronic device provided by the embodiments of the present invention can extract and locate the spatial information of the person from the key frames through a 2D neural network, and extract the spatiotemporal information from the sequence images through a 3D neural network for classification. Ultimately, based on the excellent performance of the two networks themselves, a result that takes into account the spatiotemporal feature information and spatial positioning data of the input image is obtained. Finally, through comprehensive calculation, a high-accuracy behavior category recognition result is obtained, and data processing is efficient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a behavior recognition method, device and electronic equipment. Background Art

[0002] The rapid development of artificial intelligence has enabled computer vision technology to be widely used in many fields such as video surveillance, motion retrieval, human-computer interaction, smart home, and health care. In addition, the human behavior recognition technology in artificial intelligence technology has been able to recognize and classify relatively complex human behaviors. For example, the UCF dataset and HMDB dataset are used to directly recognize and classify human behavior images.

[0003] However, the related technology can only classify behaviors from human behavior images, but cannot identify their spatial positions, and the accuracy of behavior recognition is also low. Summary of the invention

[0004] In view of this, the present invention provides a behavior recognition method, device and electronic device, which at least partially solve the problems existing in the prior art.

[0005] In a first aspect, an embodiment of the present invention provides a behavior recognition method, the method comprising:

[0006] Acquire multiple frames of continuous target behavior images;

[0007] Inputting the multiple frames of continuous target behavior images into a preset three-dimensional convolutional neural network in time sequence, and obtaining first data after spatiotemporal feature extraction and classification;

[0008] Inputting the key frame images in the multiple frames of continuous target behavior images into a preset two-dimensional convolutional neural network, and obtaining second data after spatial feature extraction and positioning;

[0009] A behavior recognition result corresponding to the target behavior image is determined according to the first data and the second data.

[0010] In some embodiments, the three-dimensional convolutional neural network includes at least a first network layer and a second network layer, wherein the first network layer includes a compressed convolution layer and the second network layer includes a convolution layer.

[0011] In some embodiments, the step of inputting the multiple frames of continuous target behavior images into a preset three-dimensional convolutional neural network in time sequence, and obtaining the first data after spatiotemporal feature extraction and classification, includes:

[0012] Input the multiple frames of continuous target behavior images into the first network layer in time sequence, extract spatiotemporal feature information, and obtain a first feature map;

[0013] Passing the first feature map through the second network layer, modifying it into a shape suitable for classification by a preset loss function, and obtaining first feature data;

[0014] Classification calculation is performed according to the first feature data to obtain behavior classification results corresponding to multiple frames of continuous target behavior images, wherein the first data includes the behavior classification results.

[0015] In some embodiments, the step of inputting key frame images in multiple frames of continuous target behavior images into a preset two-dimensional convolutional neural network and obtaining second data through spatial feature extraction and positioning includes:

[0016] Inputting the key frame images in the multiple frames of continuous target behavior images into the two-dimensional convolutional neural network to extract spatial features and obtain a second output tensor;

[0017] A coordinate transformation calculation is performed according to the second output tensor to obtain the behavior information positioning data of the key frame image, wherein the second data includes the positioning data.

[0018] In some embodiments, performing coordinate transformation calculation according to the second output tensor to obtain the behavior information positioning data of the key frame image includes:

[0019] According to the second output tensor, a predicted bounding box coordinate conversion is performed to obtain predicted bounding box data, where the predicted bounding box data includes the bounding box center coordinates and the bounding box width and height;

[0020] According to the second output tensor, a prediction bounding box corresponding to a confidence level greater than a threshold is selected to determine the prediction bounding box, wherein the behavior information positioning data includes the prediction bounding box and the prediction bounding box confidence level.

[0021] In some embodiments, determining the behavior recognition result corresponding to the target behavior image according to the first data and the second data includes:

[0022] According to the predicted bounding box, a behavior classification result corresponding to the target behavior image is determined.

[0023] In a second aspect, an embodiment of the present invention provides a behavior recognition device, the device comprising:

[0024] An acquisition module, used for acquiring multiple frames of continuous target behavior images;

[0025] A first feature extraction module, used to input the multiple frames of continuous target behavior images into a preset three-dimensional convolutional neural network in time sequence, and obtain first data after spatiotemporal feature extraction and classification;

[0026] A second feature extraction module is used to input the key frame images in the multiple frames of continuous target behavior images into a preset two-dimensional convolutional neural network, and obtain second data after spatial feature extraction and positioning;

[0027] A recognition module is used to determine a behavior recognition result corresponding to the target behavior image according to the first data and the second data.

[0028] In some embodiments, the second feature extraction module includes:

[0029] A feature extraction submodule, used for inputting the key frame images in the multiple frames of continuous target behavior images into the two-dimensional convolutional neural network to perform spatial feature extraction to obtain a second output tensor;

[0030] The coordinate calculation submodule is used to perform coordinate conversion calculation according to the second output tensor to obtain the behavior information positioning data of the key frame image, wherein the second data includes the positioning data.

[0031] In a third aspect, an embodiment of the present invention provides an electronic device, the device comprising: a processor and a memory storing computer program instructions;

[0032] When the processor executes the computer program instructions, the behavior recognition method as described in the first aspect is implemented.

[0033] In a fourth aspect, a computer storage medium is provided, wherein computer program instructions are stored on the computer storage medium, and when the computer program instructions are executed by a processor, the behavior recognition method described in the first aspect is implemented.

[0034] The embodiment of the present invention can extract and locate the spatial information of the person from the key frame through the 2D neural network, and extract the spatiotemporal information from the sequence image for classification through the 3D neural network. Finally, based on the excellent performance of the two networks themselves, a result that takes into account the spatiotemporal feature information and spatial positioning data of the input image is obtained. Finally, through comprehensive calculation, a high-accuracy behavior category recognition result is obtained, and data processing is efficient. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0036] Figure 1 A flow chart of a behavior recognition method provided by an embodiment of the present invention;

[0037] Figure 2 is a schematic diagram of input image processing in a specific embodiment of the present invention;

[0038] Figure 3A This is a flowchart of performing step S103 in a specific example of the present invention;

[0039] Figure 3B A schematic diagram of performing a predicted bounding box coordinate transformation in a specific example of the present invention;

[0040] Figure 3C A schematic diagram of performing real offset conversion in a specific example of the present invention;

[0041] Figure 4 A schematic diagram of the structure of a behavior recognition device provided by an embodiment of the present invention;

[0042] Figure 5 A schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0043] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0044] It should be noted that the following embodiments and features in the embodiments may be combined with each other in the absence of conflict; and, based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making any creative work are within the scope of protection of the present disclosure.

[0045] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein may be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein may be used to implement this device and / or practice this method.

[0046] The embodiment of the present invention provides a behavior recognition method, device and electronic device. The behavior recognition method provided by the embodiment of the present invention is first introduced below.

[0047] Figure 1 FIG. 1 is a flow chart of a behavior recognition method provided by an embodiment of the present invention. Figure 1 As shown, the method includes:

[0048] S101. Acquire multiple frames of continuous target behavior images;

[0049] S102. Inputting multiple frames of continuous target behavior images into a preset three-dimensional convolutional neural network in time sequence, and obtaining first data after spatiotemporal feature extraction and classification;

[0050] S103. Inputting the key frame images in the multiple frames of continuous target behavior images into a preset two-dimensional convolutional neural network, and obtaining second data after spatial feature extraction and positioning;

[0051] S104. Determine a behavior recognition result corresponding to the target behavior image according to the first data and the second data.

[0052] The method of the embodiment of the present invention can process the continuous frame target behavior images with time series characteristics separately through three-dimensional convolutional neural network (i.e. 3D CNN, where CNN is Convolutional Neural Networks) and two-dimensional convolutional neural network (i.e. 2D CNN), extract the spatiotemporal feature data and spatial positioning data for fusion, so as to obtain the behavior recognition result corresponding to the target behavior image. In this way, in the process of behavior recognition, not only the time and space position characteristics are taken into account, but also the complexity of the neural network used is low, which reduces the computational redundancy of the neural network and helps to improve the accuracy of the recognition result.

[0053] Exemplarily, in step S101 , a plurality of frames of continuous target behavior images of a preset length are acquired. The preset length may be a data length, that is, the number of frames of the target behavior image.

[0054] In this example, a certain number of multi-frame continuous target behavior images can be obtained from a captured behavior video to extract temporal feature information and spatial feature information related to the behavior in the image. The behavior video can be a video recording human behavior.

[0055] After obtaining multiple frames of continuous target behavior images in step S101, they can be processed separately by a preset three-dimensional convolutional neural network (hereinafter referred to as "3D neural network") and a two-dimensional convolutional neural network (hereinafter referred to as "2D neural network") to obtain relevant spatiotemporal information and spatial positioning results. Figure 2 Schematic diagram of image processing is shown.

[0056] In this example, S102. Multiple frames of continuous target behavior images are input into a preset three-dimensional convolutional neural network in time sequence, and first data is obtained after spatiotemporal feature extraction and classification, which may specifically include steps S201 to S204:

[0057] S201. Preprocessing multiple frames of continuous target behavior images;

[0058] In order to avoid overfitting during the training of neural networks, the input data can be preprocessed to change the position of image pixels through geometric transformation while ensuring that the features remain unchanged, thereby achieving the purpose of data enhancement.

[0059] Preprocessing may include rotating, shearing, changing image color difference, distorting image features, changing image size, and enhancing image noise.

[0060] Specifically, the orientation of the input image content can be changed by randomly rotating the image by a certain angle, or the image can be flipped horizontally or vertically.

[0061] Alternatively, the translation range and translation step size may be specified in a random or manually defined manner, and translation may be performed in the horizontal or vertical direction to change the position of the content in the input image.

[0062] Alternatively, the input image can be enlarged or reduced according to a specified scale factor.

[0063] The preprocessed multi-frame continuous target behavior images have data enhancement and the sizes of each frame are the same, which is conducive to subsequent network learning.

[0064] S202. Input multiple frames of continuous target behavior images into a preset three-dimensional convolutional neural network in time sequence, perform convolution processing, extract spatiotemporal feature information, and obtain a first feature map.

[0065] The three-dimensional convolutional neural network can extract the temporal and spatial features of the input image (that is, the above-mentioned multi-frame continuous target behavior image), and then capture the operation information in the input image from the temporal and spatial dimensions through convolution processing, which is conducive to obtaining accurate behavior recognition results in the subsequent process.

[0066] For example, the 3D neural network can specifically use the 3D-ResNext-101 structure network. This structure network has a strong performance in learning using the Kinetics behavior data set, especially compared with the residual network ResNet. Under the same accuracy, the parameters used by the 3D-ResNext-101 structure network are only half of the residual network ResNet, so the amount of calculation is low, which is conducive to the efficient processing of the input image.

[0067] In this example, the input image of the 3D neural network consists of multiple consecutive frames of behavioral images arranged in time order, which is equivalent to a video clip, and is therefore a 3D image. The 3D image is 4-dimensional data, namely, it includes the number of color channels, depth, height, and width, and can be expressed as [C×D×H×W].

[0068] In this example, Figure 2 As shown, the 3D neural network includes at least a first network layer 201 and a second network layer 202, wherein the first network layer 201 may be a compressed convolution layer Squeeze, and the second network layer 202 may be a convolution layer.

[0069] The input image [C×D×H×W] is input into the first network layer of the 3D neural network, where C=3, D represents the number of frames of the input image, and H and W represent the height and width of the input image, respectively (the height and width of multiple consecutive frames of target behavior images are consistent).

[0070] The first network layer may include multiple convolutional layers. After the input image is extracted by convolutional features of multiple convolutional layers in the first network layer, the last convolutional layer passes through the Squeeze function and outputs the first feature map with a shape of [C'×D'×H'×W'], where C' is the number of output channels, D'=1,

[0071] That is, the depth dimension of the output first feature map is compressed to 1, so that the output first feature map can be represented as [C'×H'×W'].

[0072] It can be understood that the first feature map is essentially a pixel matrix obtained from the input image.

[0073] S203. The first feature map is modified into a shape suitable for classification by a preset loss function through the second network layer 202 to obtain first feature data.

[0074] In order to facilitate subsequent classification and match the output data dimension of the 2D neural network, in this step, the first feature map [C'×H'×W'] is converted into the first feature data [N×H'×W'] through a convolution kernel of a preset size in the convolution layer, where N is the preset number of behavior categories.

[0075] It can be understood that the first feature data is the output tensor of the 3D neural network (ie, the first output tensor), which represents the image size after spatiotemporal feature extraction, and is essentially a pixel matrix obtained from the first feature map.

[0076] S204. Perform classification calculation according to the first feature data to determine the behavior category corresponding to the multiple frames of continuous target behavior images.

[0077] In this step, since the first feature data (first output tensor) obtained after the above steps S201 to S203 is the spatiotemporal feature data of multiple frames of continuous target behavior images, the behavior category corresponding to the multiple frames of continuous target behavior images can be determined by a preset multi-classifier. Among them, the multi-classifier can be a Softmax classifier, which identifies and classifies the first feature data and can output the probability value of each behavior category corresponding to the first feature data, and the sum of each probability value is 1; the behavior category corresponding to the maximum probability value among the output multiple probability values ​​is determined as the behavior category of the multiple frames of continuous target behavior images.

[0078] In other examples, the adopted classifier may also be other suitable classifiers, which is not limited in this embodiment.

[0079] The first output tensor of the 3D neural network is divided into H'×W' tensors, each of which is N×1×1 in size. The tensor at the center of the object is used to predict the category of the object. Through the preset multi-classifier, the behavior classification result is output to determine the behavior category corresponding to multiple frames of continuous target behavior images.

[0080] The behavior classification result is output as the first data for subsequent calculation with the output data of the 2D neural network.

[0081] In a specific example, step S103: input the key frame images in the multiple frames of continuous target behavior images into a preset two-dimensional convolutional neural network, and obtain the second data after spatial feature extraction and positioning, such as Figure 3A As shown, it may specifically include steps S301 to S303:

[0082] S301. Input the key frame images in the multiple frames of continuous target behavior images into a preset two-dimensional convolutional neural network to extract spatial features and obtain a second output tensor.

[0083] Exemplary, reference Figure 3A The two-dimensional convolutional neural network 203 may include a Darknet-19 structure network, which may include 19 convolutional layers and 5 pooling layers.

[0084] Specifically, the last frame of the target behavior image in the above multiple frames of continuous target behavior images is used as a key frame input image of the 2D neural network. The input image is a two-dimensional image and can be expressed as [C×H×W].

[0085] The last frame of the target behavior image is processed by the Darknet-19 structure in the 2D neural network, and the second feature map is output, which can be expressed as [C"×H'×W'], where C" is the number of output channels.

[0086] In order to facilitate the calculation of spatial position and match the output data of the 3D neural network, in this step, the second feature map [C"×H'×W'] output by the Darknet-19 structure network is transformed into the shape of [25×H'×W'] as the second output tensor, where 25 can represent the data of 5 bounding boxes, and each bounding box data is used to represent the prediction of four offsets t x ,t y ,t h ,t w and a confidence score.

[0087] It can be understood that the second output tensor [25×H'×W'] is the output tensor of the 2D neural network, which represents the image size after spatiotemporal feature extraction. Its essence is the pixel matrix obtained from the last frame of the input image.

[0088] In specific implementation, the above two output tensors obtained after the shape adjustment of the convolution layer through the 3D neural network and the 2D neural network can be used for behavior category prediction and bounding box regression calculation respectively. In actual operation, when the output tensors [N×H'×W'] and [25×H'×W'] after the shape adjustment of the two neural network convolution layers are obtained, the two tensors can be spliced, but the two parts of the spliced ​​data are still processed separately. Therefore, in this example, in order to facilitate the understanding of the processing flow of the second output tensor, the following continues to introduce the bounding box regression processing flow of the second output tensor.

[0089] S302. Perform coordinate transformation calculation according to the second output tensor to obtain the behavior information positioning data of the key frame image, wherein the second data includes the positioning data.

[0090] Before deploying the 2D network, a large amount of real-box data needs to be trained, and the network parameters need to be adjusted to be suitable for the behavior recognition corresponding to the target behavior image, so that when data with similar features is input, the network can automatically obtain the behavior position offset in the image, and then obtain the predicted coordinates through coordinate transformation. Specifically, when training the network, the second output tensor is divided into [H′×W′] grids, each grid has 5 pre-built candidate boxes (anchor boxes), and the network parameters are adjusted by the offset of the center coordinates of the marked real box (groundtrue) itself relative to the grid and the corresponding width and height offset with the anchor box, so that the predicted offset is close to these real offsets. When deploying the network, the predicted coordinates, that is, the predicted bounding box coordinates, are obtained directly through the coordinate transformation formula.

[0091] For the bounding box, a four-dimensional vector (x, y, w, h) can generally be used to represent the center point coordinates and width and height of the bounding box window. Therefore, in this example, the real box is a pre-labeled label, which can be expressed as (g x ,g y ,g h ,g w ), the candidate bounding box constructed for the second output tensor (that is, the offset of the second output tensor) can be expressed as (t x , t y , t h , t w ), and use (b x , b y , b w , b h ) represents the center point coordinates and width and height of the predicted bounding box (abbreviated as "prediction box"), where the predicted bounding box is the predicted value obtained by calculation of the trained 2D neural network output, which can predict the real box; specifically, the offset output by the 2D neural network is converted into coordinates through the corresponding relationship with the anchor box to obtain the predicted box coordinates.

[0092] Specifically, step S302 may include steps S3021 and S3022:

[0093] S3021. Perform prediction bounding box coordinate transformation according to the second output tensor to obtain prediction bounding box data.

[0094] In this step, refer to Figure 3B , perform bounding box coordinate transformation according to the following preset formulas (1-1), (1-2), (1-3) and (1-4):

[0095] b x =σ(t x )+C x (1-1)

[0096] b y =σ(t y )+C y (1-2)

[0097]

[0098]

[0099] In formulas (1-1), (1-2), (1-3) and (1-4), C x ,C y are the coordinates of the upper left corner of the preset prediction grid, where the preset prediction grid is used to represent the gridded key frame image, and the multiple anchor frames constructed in each grid are centered on the center of the grid; tx ,t y ,t h ,t w are the four offsets corresponding to the second output tensor, σ is the sigmoid function, which ensures that the center of the true bounding box always moves within the grid corresponding to the center of the anchor box; p w , p h are the width and height of the candidate box respectively; b x , b y , b w , b h They are the center point coordinates and width and height of the prediction box respectively.

[0100] During the training process, the network parameters need to be adjusted to make the offset output by the 2D neural network close to the real offset. In practical applications, when inputting data with similar features, the network can automatically obtain the position offset of the behavior in the image. In addition, the 2D neural network reduces the image, such as from 224×224 to 7×7, and the corresponding pre-marked labels are also reduced accordingly, so the real offset needs to be calculated through the anchor box.

[0101] S3022. According to the second output tensor, select a prediction box corresponding to a confidence level greater than a threshold, and determine the prediction bounding box, wherein the behavior information positioning data includes the prediction bounding box and the confidence level corresponding to the prediction bounding box.

[0102] Exemplarily, in step S3022, firstly, a real offset conversion calculation is performed based on the real bounding box data to determine the bounding box confidence. In this step, reference is made to Figure 3C , the real offset conversion calculation is performed using the following equations (2-1), (2-2), (2-3) and (2-4):

[0103]

[0104]

[0105]

[0106]

[0107] In formulas (2-1), (2-2), (2-3) and (2-4), g x ,g y ,g w ,g h are the center point coordinates (including horizontal and vertical coordinates) and width and height of the real box corresponding to the second output tensor after scaling relative to the output feature map; [g x ] means taking g x The integer part of [gy ] means taking g y The integer part of w ,p h are the width and height of the candidate box respectively. is the real coordinate offset of the corresponding candidate box.

[0108] During the training process, the optimal candidate box is responsible for predicting the location of the behavior. Therefore, the true confidence of this candidate box is the IOU value between it and the true box, and the corresponding values ​​of the true confidence of other candidate boxes are 0. Through the back propagation process, the confidence values ​​of the candidate boxes output by the 2D neural network are close to these true values. Therefore, in practical applications, when data with similar features are input, confidence information is automatically output, and it is considered that the candidate box confidence output by the 2D neural network is greater than a threshold value as an object.

[0109] According to the coordinates of the true bounding box, the IOU of the true box and the anchor box can be obtained, and then the true confidence can be determined according to the following formula (3):

[0110]

[0111] The confidence reflects the possibility of the object being contained in the prediction box and the accuracy of the predicted object. represents the true confidence of the jth bounding box of the i-th grid cell; P r (Object) determines whether this candidate box is responsible for the object, in which grid the center of the real box falls, and which grid corresponds to the candidate box with the largest IOU with the real box is responsible for detecting the object and P r (Object)=1, otherwise P r (Object) = 0; IOU is the intersection-over-union ratio between the ground truth box and the prior bounding box.

[0112] The above step S3021 shows the conversion of the coordinate offset output by the network into the predicted coordinates. S3022 shows the conversion of the real coordinate offset and the real confidence corresponding to the candidate box during the training process. In this embodiment, in step S104, the behavior recognition result corresponding to the target behavior image is determined according to the first data and the second data. The bounding box coordinate loss, bounding box width and height loss, category loss and confidence loss are calculated respectively through a preset loss function. According to the calculation results, the network parameters are adjusted through back propagation to make the network prediction value close to the true value. And in actual applications, the 2D neural network converts the predicted offset into a predicted value through step S3021, and then selects the responsible prediction box through the confidence threshold. Finally, the 3D neural network determines the behavior category of this position.

[0113] Exemplarily, step S104 may specifically include:

[0114] According to the predicted bounding box, a behavior classification result corresponding to the target behavior image is determined.

[0115] Specifically, a large amount of real frame data can be trained by presetting the loss function, and the network parameters can be adjusted to adapt to the behavior recognition corresponding to the target behavior image. In practical applications, the center coordinates, width and height of the predicted bounding box are calculated through the coordinate conversion formula to determine the predicted box with a confidence greater than the threshold and the behavior classification result corresponding to the image position of the predicted box.

[0116] For example, the bounding box coordinate loss loss can be calculated by the preset loss functions of the following equations (4-1) to (4-5). xy , border width loss Border height loss Confidence loss conf , and category loss loss cls Perform the calculation:

[0117]

[0118]

[0119]

[0120]

[0121]

[0122] In formulas (4-1) to (4-5), S 2 Indicates that the key frame image is divided into S×S grids; B indicates the number of anchor boxes in the grid; and They respectively indicate whether the object falls into or does not fall into the jth prior bounding box of grid i; Otherwise is the range of the remaining data set; Classes refers to the probability of the 3D neural network predicting the category of the corresponding grid, and class is the category corresponding to the label data; C i j Represents the confidence of the j-th prior bounding box of the i-th grid cell.

[0123] The method of the embodiment of the present invention can extract and locate the spatial information of the character from the key frame through a 2D neural network, and extract the spatiotemporal information from the sequence image for classification through a 3D neural network. Ultimately, based on the excellent performance of the two networks themselves, a result that takes into account the spatiotemporal feature information and spatial positioning data of the input image is obtained. Finally, through comprehensive loss calculation, a high-accuracy behavior category recognition result is obtained.

[0124] Figure 4 A schematic diagram of the structure of a behavior recognition device provided by an embodiment of the present invention is shown.

[0125] like Figure 4 As shown, the device comprises:

[0126] An acquisition module 401 is used to acquire multiple frames of continuous target behavior images;

[0127] A first feature extraction module 402 is used to input the multiple frames of continuous target behavior images into a preset three-dimensional convolutional neural network in time sequence, and obtain first data through spatiotemporal feature extraction and classification;

[0128] A second feature extraction module 403 is used to input the key frame images in the multiple frames of continuous target behavior images into a preset two-dimensional convolutional neural network, and obtain second data after spatial feature extraction and positioning;

[0129] The recognition module 404 is used to determine the behavior recognition result corresponding to the target behavior image according to the first data and the second data.

[0130] Exemplarily, the acquisition module 401 may execute the above Figure 1 In step S101 shown in FIG. 1 , the first feature extraction module 402 may perform the above Figure 1 In step S102 shown in FIG. 1 , the second feature extraction module 403 may perform the above Figure 1 In step S103 shown in FIG. 1 , the identification module 404 may perform the above Figure 1 Step S104 shown in FIG.

[0131] It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and can achieve its corresponding technical effects. For the sake of concise description, they will not be repeated here.

[0132] Exemplarily, the three-dimensional convolutional neural network includes at least a first network layer and a second network layer, wherein the first network layer includes a compressed convolution layer and the second network layer includes a convolution layer.

[0133] Correspondingly, the first feature extraction module 402 may include:

[0134] The extraction submodule 4021 is used to input the multiple frames of continuous target behavior images into the first network layer in time sequence, extract spatiotemporal feature information, and obtain a first feature map;

[0135] Modification submodule 4022 is used to modify the first feature map into a shape suitable for classification by a preset loss function through the second network layer to obtain first feature data;

[0136] The calculation submodule 4023 is used to perform classification calculation according to the first feature data to obtain a behavior classification result corresponding to multiple frames of continuous target behavior images, wherein the first data includes the behavior classification result.

[0137] Exemplarily, the second feature extraction module 403 may include:

[0138] The feature extraction submodule 4031 is used to input the key frame images in the multiple frames of continuous target behavior images into the two-dimensional convolutional neural network to extract spatial features and obtain a second output tensor;

[0139] The coordinate calculation submodule 4032 is used to perform coordinate transformation calculation according to the second output tensor to obtain the behavior information positioning data of the key frame image, wherein the second data includes the positioning data.

[0140] The device of the embodiment of the present invention can extract and locate the spatial information of the character from the key frames through a 2D neural network, and extract the spatiotemporal information from the sequence images through a 3D neural network for classification. Ultimately, based on the excellent performance of the two networks themselves, a result that takes into account the spatiotemporal feature information and spatial positioning data of the input image is obtained. Finally, through comprehensive calculation, a high-accuracy behavior category recognition result is obtained.

[0141] Figure 5 A schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention is shown.

[0142] The electronic device may include a processor 501 and a memory 502 storing computer program instructions.

[0143] Specifically, the processor 501 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present disclosure.

[0144] The memory 502 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 502 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 502 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 502 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 502 is a non-volatile solid-state memory.

[0145] The memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present invention.

[0146] The processor 501 implements any one of the behavior recognition methods in the above embodiments by reading and executing computer program instructions stored in the memory 502 .

[0147] In one example, the electronic device may further include a communication interface 503 and a bus 510. As shown in Fig. 3, the processor 501, the memory 502, and the communication interface 503 are connected via the bus 510 and communicate with each other.

[0148] The communication interface 503 is mainly used to implement the communication between the modules, devices, units and / or equipment in the embodiment of the present invention.

[0149] Bus 510 includes hardware, software or both, and the components of online data flow billing equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front-side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 310 may include one or more buses. Although the embodiment of the present invention describes and shows a specific bus, the present invention considers any suitable bus or interconnection.

[0150] In addition, in combination with the behavior recognition method in the above embodiment, the embodiment of the present invention can provide a computer storage medium to implement. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the behavior recognition methods in the above embodiment is implemented.

[0151] Various aspects of the present invention are described above with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to embodiments of the present invention. It should be understood that each box in the flowchart and / or block diagram and the combination of boxes in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the functions / actions specified in one or more boxes in the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by special-purpose hardware that performs the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.

[0152] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A behavior recognition method, It is characterized in that The method comprises: Acquire multiple frames of continuous target behavior images; Inputting the multiple frames of continuous target behavior images into a preset three-dimensional convolutional neural network in time sequence, and obtaining first data after spatiotemporal feature extraction and classification; Inputting the key frame images in the multiple frames of continuous target behavior images into a preset two-dimensional convolutional neural network, and obtaining second data after spatial feature extraction and positioning; Determine a behavior recognition result corresponding to the target behavior image according to the first data and the second data; The three-dimensional convolutional neural network comprises at least a first network layer and a second network layer, wherein the first network layer comprises a compressed convolution layer, and the second network layer comprises a convolution layer; The step of inputting the multiple frames of continuous target behavior images into a preset three-dimensional convolutional neural network in time sequence, and obtaining first data after spatiotemporal feature extraction and classification, comprises: Input the multiple frames of continuous target behavior images into the first network layer in time sequence, extract spatiotemporal feature information, and obtain a first feature map; Passing the first feature map through the second network layer, modifying it into a shape suitable for classification by a preset loss function, and obtaining first feature data; Performing classification calculation according to the first feature data to obtain a behavior classification result corresponding to multiple frames of continuous target behavior images, wherein the first data includes the behavior classification result; The step of inputting key frame images in multiple frames of continuous target behavior images into a preset two-dimensional convolutional neural network and obtaining second data through spatial feature extraction and positioning includes: Inputting the key frame images in the multiple frames of continuous target behavior images into the two-dimensional convolutional neural network to extract spatial features and obtain a second output tensor; A coordinate transformation calculation is performed according to the second output tensor to obtain the behavior information positioning data of the key frame image, wherein the second data includes the positioning data.

2. The method according to claim 1, It is characterized in that The step of performing coordinate transformation calculation according to the second output tensor to obtain the behavior information positioning data of the key frame image includes: According to the second output tensor, a predicted bounding box coordinate conversion is performed to obtain predicted bounding box data, where the predicted bounding box data includes the bounding box center coordinates and the bounding box width and height; According to the second output tensor, a prediction bounding box corresponding to a confidence level greater than a threshold is selected to determine the prediction bounding box, wherein the behavior information positioning data includes the prediction bounding box and the confidence level corresponding to the prediction bounding box.

3. The method according to claim 2, It is characterized in that The determining the behavior recognition result corresponding to the target behavior image according to the first data and the second data includes: According to the predicted bounding box, a behavior classification result corresponding to the target behavior image is determined.

4. A behavior recognition device, It is characterized in that The device comprises: An acquisition module, used for acquiring multiple frames of continuous target behavior images; A first feature extraction module, used to input the multiple frames of continuous target behavior images into a preset three-dimensional convolutional neural network in time sequence, and obtain first data after spatiotemporal feature extraction and classification; A second feature extraction module is used to input the key frame images in the multiple frames of continuous target behavior images into a preset two-dimensional convolutional neural network, and obtain second data after spatial feature extraction and positioning; an identification module, configured to determine a behavior identification result corresponding to the target behavior image according to the first data and the second data; The three-dimensional convolutional neural network comprises at least a first network layer and a second network layer, wherein the first network layer comprises a compressed convolution layer, and the second network layer comprises a convolution layer; The first feature extraction module comprises: An extraction submodule, used for inputting the multiple frames of continuous target behavior images into the first network layer in time sequence, extracting spatiotemporal feature information, and obtaining a first feature map; A modification submodule, used for modifying the first feature map into a shape suitable for classification by a preset loss function through the second network layer to obtain first feature data; A calculation submodule, configured to perform classification calculation according to the first feature data to obtain a behavior classification result corresponding to a plurality of frames of continuous target behavior images, wherein the first data includes the behavior classification result; The second feature extraction module comprises: A feature extraction submodule, used for inputting the key frame images in the multiple frames of continuous target behavior images into the two-dimensional convolutional neural network to perform spatial feature extraction to obtain a second output tensor; The coordinate calculation submodule is used to perform coordinate conversion calculation according to the second output tensor to obtain the behavior information positioning data of the key frame image, wherein the second data includes the positioning data.

5. An electronic device, It is characterized in that The device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the behavior recognition method as described in any one of claims 1-3 is implemented.

6. A computer storage medium, It is characterized in that The computer storage medium stores computer program instructions, and when the computer program instructions are executed by the processor, the behavior recognition method described in any one of items 1-3 is implemented.

Citation Information

Patent Citations

  • Time-space local feature extraction method based on linear dynamic system

    CN104200235A

  • Video-based human body behavior recognition method

    CN112749671A

  • Action recognition method based on convolutional neural network

    CN113052091A

  • Behavior identification model-based fall-down action determining method and apparatus, computer device, and storage medium

    WO2021051545A1