Video motion recognition method, device, computer equipment and storage medium
Through the combination of target detection and tracking algorithms, the action target in the video is locked and tracked, and the action recognition model is input for recognition, which solves the problem of low accuracy of small target and multi-target action recognition in the existing technology, and improves the accuracy and accuracy of action recognition. efficiency.
Patent Information
- Application Number
- CN202010969777.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-15
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2040-09-15
AI Technical Summary
Existing video action recognition methods have low accuracy in identifying small targets and multi-target action categories in videos. This is mainly due to target loss and tracking errors caused by background information interference and displacement of action targets, making it difficult to effectively extract action features.
The target detection model is used to detect targets in the video, and the tracking algorithm is combined with the tracking algorithm to track and correct the action target in real time, capture the changes in the action, and input the target area as the area of interest into the pre-trained action recognition model for identification, and extract the action category.
It improves the efficiency of action feature extraction and recognition accuracy, can effectively identify small targets and multi-target action categories in videos, reduces tracking errors and target loss, and improves the robustness and speed of recognition.
Smart Images

Figure CN112183252B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of video action recognition, and in particular to a video action recognition method, device, computer equipment and storage medium. Background Art
[0002] The purpose of action recognition is to determine the category of the target action in a video. Its main information source is the video frame, that is, the RGB image. Compared with CNN (Convolutional Neural Networks) image classification, this task needs to consider the network's modeling ability of action changes over a long period of time. The TSN (Temporal Segment Networks) detection method is based on a deep convolutional neural network. It learns the entire video through a sparse time sampling strategy, completes action modeling, and achieves the purpose of action recognition.
[0003] The TSN network method needs to use the sampled video frames as network input. Since the input is the entire image, which contains a lot of background information, the background is interference information for identifying the target action category in the video, which is not conducive to the learning of action features. As a result, the accuracy of action recognition for small targets in the video is low, and it is incapable of identifying multi-target action categories. Summary of the invention
[0004] Based on this, it is necessary to provide a video action recognition method, device, computer equipment and storage medium to address the above technical problems.
[0005] A method for video action recognition, comprising:
[0006] Get sample video;
[0007] Using a target detection model to perform target detection on the sample video to obtain an action target in the sample video;
[0008] Tracking the action target in each frame image of the sample video using a tracking algorithm to obtain a target area of the action target in each frame image of the sample video;
[0009] Each of the target areas is input into a pre-trained action recognition model for action recognition to obtain an action category of each of the action targets.
[0010] In one embodiment, the step of using a tracking algorithm to track the action target in each frame image of the sample video includes:
[0011] Using a tracking algorithm to track the action target in each frame image of the sample video;
[0012] At preset time intervals, the target detection model is used to correct the tracked motion target.
[0013] In one embodiment, it also includes:
[0014] Acquire an action data set, wherein the action data set is labeled with action categories;
[0015] The action data set is input into a neural network for model training, and based on the action data set, an action recognition model that can be used to determine the action category of an action target is obtained.
[0016] In one embodiment, the step of inputting each target area into a pre-trained action recognition model for action recognition to obtain the action category of each action target includes:
[0017] Input each of the target areas into a pre-trained action recognition model for action recognition, and output a vector of M*C dimensions, where M is the number of action targets and C is the number of action categories;
[0018] Get the vector value of the M*C dimensional vector;
[0019] The action category corresponding to the largest vector value is extracted from each of the vector values, and is determined as the action category of the action target.
[0020] In one embodiment, before the step of obtaining the action data set, the step further includes:
[0021] Collect action datasets for action recognition;
[0022] Each action category of the action data set is labeled.
[0023] In one embodiment, the step of inputting each target area into a pre-trained action recognition model for action recognition to obtain the action category of each action target includes:
[0024] Extracting N frames of images from the sample video at even intervals or randomly, wherein N is an integer greater than 1;
[0025] Each of the target areas in the extracted N frames of images is input into a pre-trained action recognition model for action recognition to obtain an action category of each of the action targets.
[0026] In one embodiment, the step of extracting N frames of images from the sample video at an average interval or randomly comprises:
[0027] The sample video is evenly divided into S segments, and N frames of images are randomly extracted from the sample video in each segment, where S is an integer greater than 1.
[0028] A video action recognition device, comprising:
[0029] A sample video acquisition module is used to acquire sample videos;
[0030] An action target detection acquisition module, used to perform target detection on the sample video using a target detection model to obtain the action target in the sample video;
[0031] A target region acquisition module, used for tracking the action target in each frame image of the sample video by using a tracking algorithm, and obtaining the target region of the action target in each frame image of the sample video;
[0032] The action category training and acquisition module is used to input each of the target areas into a pre-trained action recognition model for action recognition to obtain the action category of each of the action targets.
[0033] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and wherein the processor implements the following steps when executing the computer program:
[0034] Get sample video;
[0035] Using a target detection model to perform target detection on the sample video to obtain an action target in the sample video;
[0036] Tracking the action target in each frame image of the sample video using a tracking algorithm to obtain a target area of the action target in each frame image of the sample video;
[0037] Each of the target areas is input into a pre-trained action recognition model for action recognition to obtain an action category of each of the action targets.
[0038] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:
[0039] Get sample video;
[0040] Using a target detection model to perform target detection on the sample video to obtain an action target in the sample video;
[0041] Tracking the action target in each frame image of the sample video using a tracking algorithm to obtain a target area of the action target in each frame image of the sample video;
[0042] Each of the target areas is input into a pre-trained action recognition model for action recognition to obtain an action category of each of the action targets.
[0043] The above-mentioned video action recognition method, device, computer equipment and storage medium first use a target detection algorithm to lock the target in the video during the data sampling stage, then use a tracking algorithm to track the target position, capture the action changes, and cut out the tracked target area as the area of interest, input it into the pre-trained action recognition model, perform action recognition, and thus identify the action category of the target. This can effectively improve the efficiency of action feature extraction and can achieve the effect of improving the accuracy of action recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 is a schematic diagram of a flow chart of a method for video motion recognition in one embodiment;
[0045] Figure 2 is a structural block diagram of a video motion recognition device in one embodiment;
[0046] Figure 3 is an internal structure diagram of a computer device in one embodiment;
[0047] Figure 4 Schematic diagram of the implementation process of a method for video motion recognition in one embodiment;
[0048] Figure 5 The diagram is a schematic diagram of a process of obtaining a target area by target detection and tracking in a method for video action recognition in one embodiment. DETAILED DESCRIPTION
[0049] 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.
[0050] Embodiment 1
[0051] In this embodiment, Figure 1 As shown, a method for video action recognition is provided, which includes:
[0052] Step 110, obtaining a sample video.
[0053] Specifically, the sample video contains at least one moving person.
[0054] Step 120: Perform target detection on the sample video using a target detection model to obtain an action target in the sample video.
[0055] Specifically, the action target is the person who is active in the video, or the action target is the person who performs the action in the video, and the action target can also be called the action person target. The target detection model can also be called a target detection algorithm, which is used to detect the target in the video and determine the target in the video. In this embodiment, the target detection model is used to detect the active person in the sample video, determine the action target from the sample video, and thus distinguish the active person from the background of the video.
[0056] In one embodiment, the target detection model is a YOLOv3 model. For example, the YOLOv3 model is used to perform target detection on the sample video to obtain the action target in the sample video. It should be understood that in this application, target detection can also be performed by other target detection models, such as SSD, Mask R-CNN, M2Det, etc.
[0057] In one embodiment, a target detection model is used to perform target detection on the first frame of the sample video to obtain the action target in the sample video.
[0058] In this embodiment, the first frame is the first frame image of the sample video. In this step, taking a single sample video clip V as an example, the target detection model is used to perform target detection on the first frame of the sample video, and all targets of human category can be obtained, and the boundary of the target is output. Assuming that the number of targets is M, the target area is M*(x0, y0, x1, y1). In this embodiment, the shape of the target area is a rectangular frame, where (x0, y0) and (x1, y1) are the upper left corner and the lower right corner of the target area, respectively.
[0059] Step 130: Track the action target in each frame image of the sample video using a tracking algorithm to obtain a target area of the action target in each frame image of the sample video.
[0060] Specifically, since the sample video contains multiple frames of images, the position and size of the character in each frame will change with the movement of the character, which is reflected in the video image as the coordinate position and size of the rectangular frame of the action target will change with the playback of the video frame and the movement of the character. In this way, the action target determined in the first frame may be lost as the position and size of the character change, resulting in the inability to determine the action target in the subsequent playback of the sample video.
[0061] It should be understood that a simple target detection model is difficult to achieve the effect of real-time detection of action targets as the video is played in practical applications. In order to make up for the lack of detection speed, a faster target tracking algorithm is combined to track the target to achieve the purpose of real-time target locking. In this step, the rectangular frame of the action target detected in the first frame of the sample video is used as the initial frame, and the target area of the detected action target is tracked using the tracking algorithm. The target area is frame-shaped in the image, so the target area is the rectangular frame or target frame of the action target.
[0062] In this embodiment, a correlation filter tracking algorithm DSST (Discriminative Scale Space Tracker) with a detection speed of up to 200Fps (Frames Per Second) is used. The algorithm locates and evaluates the scale of the target through a position filter and a scale filter to achieve real-time tracking of the target.
[0063] Therefore, in this embodiment, a tracking algorithm is used to track the action target of each frame image of the sample video, so that in each frame image of the sample video, the action target determined in the first frame image can be tracked, and the rectangular frame of the action target can be determined in real time to avoid the loss of the action target, and the position and size of the action target in each frame image can be quickly determined.
[0064] Step 140: Input each of the target areas into a pre-trained action recognition model to perform action recognition, and obtain the action category of each of the action targets.
[0065] In this embodiment, the target area of the action target of each frame image obtained by tracking with a tracking algorithm is a region of interest (ROI), and the target area is input as the region of interest into a neural network for training, thereby obtaining the action category of each action character. Specifically, the target area obtained in the above steps is used as input, and the action category is used as a label, and is input into a pre-trained action recognition model for action recognition, so that the action category of the action target can be obtained, thereby realizing the recognition of the action of the character.
[0066] In the above embodiment, at the data sampling stage, the target detection algorithm is first used to lock the target in the video, and then the tracking algorithm is used to track the target position, capture the action changes, and the tracked target area is cut out as the area of interest and input into the pre-trained action recognition model for action recognition, thereby identifying the action category of the target. This can effectively improve the efficiency of action feature extraction and improve the accuracy of action recognition.
[0067] It should be understood that during the playback of the sample video, there are situations where the displacement of the action target is large, which may lead to the loss of the action target and the inability to determine the person during the video playback. Even if the tracking algorithm is used, it will not be able to track the action target in time due to the large displacement of the action target, resulting in the loss of the target. Similarly, if the target disappears and then reappears, the tracking algorithm will not be able to track the target again. In addition, there are errors in the tracking of the target by the tracking algorithm, which will lead to error accumulation during long-term tracking. When the error accumulates to a large value, it will also lead to the loss of the target. Therefore, in order to avoid this problem and improve the tracking accuracy of the action target, in one embodiment, the step of using a tracking algorithm to track the action target in each frame image of the sample video includes: using a tracking algorithm to track the action target in each frame image of the sample video; at each preset time interval, using the target detection model to correct the tracked action target.
[0068] In this embodiment, in order to prevent the target frame from drifting too much during the tracking process, the target frame of the action target is corrected by using the target detection model at each interval t, and finally the target area of each person in each frame of the video image can be obtained and cut out as a region of interest (ROI) image. It should be understood that the target detection model used in this embodiment can be the same model as the target detection model in step 120, or it can be the same model as the target detection model used in step 120. In this embodiment, the target detection model is used to perform target detection again on one of the frames in the sample video every once in a while, so that the tracking algorithm can correct the currently tracked target at each interval and track the lost target again.
[0069] In this way, the target detection model corrects the position and size of the target area of the action target during the tracking process. On the one hand, it can eliminate the accumulated errors of the tracking algorithm during the tracking process and avoid the increase of deviations caused by long-term tracking of the tracking algorithm during the multi-frame playback of the sample video; on the other hand, it avoids the problem that the tracking algorithm cannot track the target that disappears and then reappears, and avoids the problem that the tracking algorithm cannot track the target due to excessive movement or displacement. This makes the acquisition of the target area of the action target more accurate.
[0070] In this embodiment, the target detection model and the tracking algorithm are combined to form a complementary method to achieve the speed and accuracy of capturing the action target. Specifically, if the target detection is performed on each frame of the video, the target obtained in this way is highly accurate, but the speed is too slow and consumes more computing resources; if the tracking algorithm is used throughout the process to track the target, although the speed is fast, the accuracy and robustness are poor. Therefore, in this embodiment, the combination of the target detection model and the tracking algorithm can prove the speed and ensure the accuracy.
[0071] In one embodiment, the method further includes: obtaining an action data set, wherein the action data set is labeled with action categories; inputting the action data set into a neural network for model training, and based on the action data set, obtaining an action recognition model that can be used to determine the action category of the action target.
[0072] In this embodiment, the training phase of the neural network is applied. In this embodiment, the neural network is a TSN network, the action data set contains multiple action categories, and these action categories are pre-labeled, and these action data sets of pre-labeled action categories are input into the neural network for training, so that the neural network builds an action recognition model that can identify action categories, thereby completing the training of the model, and the model obtained by training is the action recognition model, which can be used to identify action categories in the action category of the sample video.
[0073] One embodiment is that the step of inputting each of the target areas into a pre-trained action recognition model for action recognition, and obtaining the action category of each of the action targets is: inputting each of the target areas into a pre-trained action recognition model for action recognition, and obtaining the action category of each of the action targets using the trained action recognition model to recognize the action.
[0074] In one embodiment, before the step of obtaining the action data set, the step further includes: collecting the action data set for action recognition; and labeling each action category of the action data set.
[0075] Specifically, the data set is a video clip, which is a video clip containing character actions. In different video clips, the character's actions may be different, and these different actions are annotated and classified so that different action categories are classified, and after annotating, they can be easily compared and identified.
[0076] In this embodiment, firstly, a data set for action recognition is collected and the actions are labeled, that is, a video clip containing the action to be recognized is collected, a single target and a single action. Assuming that C types of actions need to be recognized, each type of action is numbered (1.2...C), and the number 0 represents background or other actions. Each video sample data contains an action, and about 1000 video clips are collected for each category (0~C). Then the data set is labeled in the following style: video name, action category label. In this way, by labeling the action categories in the data set, the neural network can learn and judge the input target area according to the already labeled action categories, and obtain the action category of the target area.
[0077] In one embodiment, the step of inputting each of the target areas into a pre-trained action recognition model for action recognition and obtaining the action category of each of the action targets includes: inputting each of the target areas into a pre-trained action recognition model for action recognition, and outputting an M*C dimensional vector, wherein M is the number of action targets and C is the number of action categories; obtaining the vector value of the M*C dimensional vector; extracting the action category corresponding to the largest vector value from each of the vector values, and determining it as the action category of the action target.
[0078] In this embodiment, the trained model can output a vector of M*C dimensions, where M is the number of action targets, C is the number of action categories, and the vector value of the vector is the confidence level of each type of action, and the index of the one with the highest confidence level is the action category of the target. In this way, the action recognition model obtained through pre-training outputs multiple vector values of each action target, and obtains the largest one of these vector values, and finds the corresponding action category in the data set with the largest vector value, and the action category is the action category of the action target.
[0079] In one embodiment, the step of inputting each of the target areas into a pre-trained action recognition model for action recognition to obtain the action category of each of the action targets includes: extracting N frames of images from the sample video at average intervals or randomly, where N is an integer greater than 1; inputting each of the target areas in the extracted N frames of images into a pre-trained action recognition model for action recognition to obtain the action category of each of the action targets.
[0080] It should be understood that, due to the large amount of data in the sample video, if each action target in each frame of the sample video is used as an image of interest for input into the pre-trained action recognition model, the huge amount of calculation will result in low efficiency in recognition of the action category. Therefore, in this embodiment, each frame image in the sample video is extracted, and N frames of images are extracted. The target area of the extracted N frames of images is used as the region of interest to input into the pre-trained action recognition model for action recognition. In this way, the amount of data can be effectively reduced and the recognition efficiency can be improved. As for the extraction of N frames of images, one frame of image can be extracted every several frames, N frames can be extracted evenly, or N frames can be extracted randomly.
[0081] In order to reduce the amount of data input into the pre-trained action recognition model, improve the diversity of the data, and improve the robustness of the model, in one embodiment, the step of evenly spaced or randomly extracting N frames of images from the sample video includes: evenly dividing the sample video into S segments, and randomly extracting N frames of images from the sample video in each segment, where S is an integer greater than 1.
[0082] It should be understood that because it is necessary to judge the action category of the target in the entire video clip, ideally the entire video can be used as input, but this requires huge computation. Considering that there is a lot of redundant information between adjacent video frames, sparse sampling can be used, that is, taking out a few frames from the entire video, but to ensure that the taken frames can contain the information of the entire video frequency band, first divide it into S segments on average, and take N frames from each segment, so that the S*N frames taken can approximately represent the original video clip information. The random method used here can be understood as a method of data enhancement. For the same video sample, the video frames taken each time may be different, but the S*N frames can represent the sample, which increases the diversity of data samples and improves the robustness of the model.
[0083] In other embodiments, the sample video may be randomly divided into S segments, and N frames of images may be evenly spaced from the sample video in each segment, where S is an integer greater than 1. In this way, the amount of data input to the neural network can be reduced, the diversity of the data can be increased, and the robustness of the model can be improved.
[0084] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0085] Embodiment 2
[0086] This embodiment provides an improved TSN network action recognition method. Figure 4 and Figure 5 , the implementation steps are as follows:
[0087] 1) Determine the target detection model and dataset. The current target detection method is relatively mature. Considering the detection speed, the YOLOv3 model is used and trained using the public dataset COCO. Finally, a model that can accurately identify target categories and target boundaries can be obtained.
[0088] 2) Collect a dataset for action recognition and annotate the actions, that is, collect video clips containing the actions to be recognized (single target single action). Assume that C types of actions need to be recognized, and number each type of action (1.2...C), with label 0 representing background or other actions. Each video sample data contains an action, and about 1,000 video clips are collected for each category (0~C), and then the dataset is annotated in the following style (video name action category label);
[0089] 3) The following 4), 5), and 6) are the main steps for improving the TSN detection method (taking the detection of human movements as an example):
[0090] 4) Taking a single data sample video clip V as an example, the model in 1) is used to detect the target in the first frame of the video, and all the targets of human category can be obtained, and the target boundary is output. Assuming that the number of targets is M, the target area is M*(x0, y0, x1, y1), where (x0, y0) and (x1, y1) are the upper left corner and lower right corner of the rectangular box respectively;
[0091] 5) Considering that the target detection algorithm described in 1) is difficult to achieve real-time effect in practical applications, in order to make up for the lack of detection speed, a faster target tracking algorithm is combined to track the target, so as to achieve the purpose of real-time target locking. The target frame detected in 4) is used as the initial frame, and the tracking algorithm is used to track the detected target. The DSST (Discriminative Scale Space Tracker) correlation filter tracking algorithm with a detection speed of up to 200Fps is used. It locates and evaluates the scale of the target through the position filter and scale filter to achieve real-time tracking of the target.
[0092] In order to prevent the target frame from drifting too much during the tracking process, the target frame is corrected using the model in 1) at every interval t, as shown in the attached figure. Figure 5 As shown. Finally, the target area of each person in each frame of the video image can be obtained and cut out (hereinafter referred to as ROI image).
[0093] On the one hand, DDST tracking will have error accumulation, and the tracking deviation will become larger and larger over time; on the other hand, if the target disappears and then reappears, DDST will not be able to track it again, so it needs to be told the exact target location every once in a while so that it can track it again; in general, the combination of target detection and DDST is a complementary method. Target detection for each frame of the video can also be roughly regarded as tracking, which has high accuracy but too slow speed. DDST is fast but has poor accuracy and robustness. The combination of the two can ensure speed and accuracy.
[0094] 6) Divide the video V into S segments on average. For each human target, N frames of images can be randomly selected from the ROI corresponding to each video segment as the raw data before inputting into the TSN network; the specific address is that because the action category of the target in the entire video segment needs to be judged, ideally the entire video is expected to be used as input, but this requires huge computation. Considering that there is a lot of redundant information between adjacent video frames, sparse sampling can be used, that is, taking a few frames from the entire video segment, but to ensure that the taken frames can contain the information of the entire video frequency band, it is first divided into S segments on average, and N frames are taken from each segment, so that the S*N frames taken can approximately represent the information of the original video segment.
[0095] The random method used here can be understood as a method of data enhancement. For the same video sample, the video frames obtained each time may be different, but the S*N frames can represent the sample, which increases the diversity of data samples and improves the robustness of the model.
[0096] 7) For each target, the frame sequence S*3N*H*W is used as the input of the TSN network, where 3 is the number of channels of the three channels R, G, and B of the image, H and W represent the height and width of the image, and the action category is used as the label for model training, and finally a model that can recognize the action category is obtained;
[0097] 8) In the model inference stage, input the video clip and repeat the processes 4), 5), and 6) to obtain M target persons. The frame sequence of each target is S*3N*H*W. This is input into 7) and the trained model can output an M*C dimensional vector, where M is the number of targets, C is the number of categories, and the vector value is the confidence of each type of action identified. The index with the highest confidence is the action category of the target.
[0098] In this embodiment, the target detection model described in 1) is not limited to the YOLOv3 network, and can be replaced by other target detection models, such as SSD, Mask R-CNN, M2Det, etc. The tracking algorithm described in 4) is not limited to the DDST algorithm, and can also be replaced by other tracking algorithms, such as KCF (Kernel Correlation Filter), SiamNet (SiameseNetworks) and other algorithms.
[0099] In the above embodiment, the TSN detection method is improved by combining target detection and target tracking to improve the accuracy of action recognition and realize the recognition of small targets and multiple targets and multiple actions. In the data sampling stage, the target detection algorithm is first used to lock the target in the video, and then the tracking algorithm is used to track the target position and capture the action changes. The tracked target area is intercepted as ROI (Region Of Interest) and input into the TSN feature extraction network for training and learning to improve the efficiency of action feature extraction. The same method is used for extraction, tracking, and recognition in the reasoning stage to achieve the purpose of improving the accuracy of action recognition and multi-target action recognition.
[0100] Embodiment 3
[0101] In this embodiment, Figure 2 As shown, a video action recognition device is provided, comprising:
[0102] The sample video acquisition module 210 is used to acquire the sample video;
[0103] An action target detection and acquisition module 220 is used to perform target detection on the sample video using a target detection model to obtain an action target in the sample video;
[0104] A target region obtaining module 230 is used to track the action target in each frame image of the sample video using a tracking algorithm to obtain a target region of the action target in each frame image of the sample video;
[0105] The action category training and obtaining module 240 is used to input each of the target areas into a pre-trained action recognition model for action recognition, so as to obtain the action category of each of the action targets.
[0106] In one embodiment, the target area acquisition module includes:
[0107] A tracking unit, used for tracking the action target in each frame image of the sample video by using a tracking algorithm;
[0108] The correction unit is used to correct the tracked motion target using the target detection model at preset time intervals.
[0109] In one embodiment, the action category training acquisition module includes:
[0110] A data set acquisition unit, used to acquire an action data set, wherein the action data set is labeled with action categories;
[0111] The action category training acquisition unit is used to input the action data set into the neural network for model training, and based on the action data set, obtain an action recognition model that can be used to determine the action category of the action target.
[0112] In one embodiment, the action category training acquisition unit includes:
[0113] A vector output subunit, used to input each of the target areas into a pre-trained action recognition model for action recognition, and output a vector of M*C dimensions, where M is the number of action targets and C is the number of action categories;
[0114] A vector value obtaining subunit is used to obtain the vector value of a vector of M*C dimensions;
[0115] The action category determination subunit is used to extract the action category corresponding to the largest vector value from each of the vector values, and determine it as the action category of the action target.
[0116] In one embodiment, the video action recognition device further includes:
[0117] A data set collection module, used for collecting action data sets for action recognition;
[0118] The action category labeling module is used to label each action category of the action data set.
[0119] In one embodiment, the action category training acquisition module includes:
[0120] An N-frame image extraction unit, configured to extract N frames of images from the sample video at even intervals or randomly, wherein N is an integer greater than 1;
[0121] The action category training and obtaining unit is used to input each of the target areas in the extracted N frames of images into a pre-trained action recognition model for action recognition, so as to obtain the action category of each action target.
[0122] In one embodiment, the N-frame image extraction unit is further used to divide the sample video into S segments on average, and randomly extract N frames of images from the sample video in each segment, where S is an integer greater than 1.
[0123] For the specific definition of the video action recognition device, please refer to the definition of the video action recognition method above, which will not be repeated here. The various units in the above-mentioned video action recognition device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned units can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above-mentioned units.
[0124] Embodiment 4
[0125] In this embodiment, a computer device is provided. Its internal structure diagram can be shown as follows: Figure 3 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program, and the non-volatile storage medium is deployed with a database, which is used to store a data set of action categories marked. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with other computer devices. When the computer program is executed by the processor, a method for video action recognition is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse, etc.
[0126] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0127] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0128] Get sample video;
[0129] Using a target detection model to perform target detection on the sample video to obtain an action target in the sample video;
[0130] Tracking the action target in each frame image of the sample video using a tracking algorithm to obtain a target area of the action target in each frame image of the sample video;
[0131] Each of the target areas is input into a pre-trained action recognition model for action recognition to obtain an action category of each of the action targets.
[0132] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0133] Using a tracking algorithm to track the action target in each frame image of the sample video;
[0134] At preset time intervals, the target detection model is used to correct the tracked motion target.
[0135] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0136] Acquire an action data set, wherein the action data set is labeled with action categories;
[0137] The action data set is input into a neural network for model training, and based on the action data set, an action recognition model that can be used to determine the action category of an action target is obtained.
[0138] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0139] Input each of the target areas into a pre-trained action recognition model for action recognition, and output a vector of M*C dimensions, where M is the number of action targets and C is the number of action categories;
[0140] Get the vector value of the M*C dimensional vector;
[0141] The action category corresponding to the largest vector value is extracted from each of the vector values, and is determined as the action category of the action target.
[0142] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0143] Collect action datasets for action recognition;
[0144] Each action category of the action data set is labeled.
[0145] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0146] Extracting N frames of images from the sample video at even intervals or randomly, wherein N is an integer greater than 1;
[0147] Each of the target areas in the extracted N frames of images is input into a pre-trained action recognition model for action recognition to obtain an action category of each of the action targets.
[0148] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0149] The sample video is evenly divided into S segments, and N frames of images are randomly extracted from the sample video in each segment, where S is an integer greater than 1.
[0150] Embodiment 5
[0151] In this embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0152] Get sample video;
[0153] Using a target detection model to perform target detection on the sample video to obtain an action target in the sample video;
[0154] Tracking the action target in each frame image of the sample video using a tracking algorithm to obtain a target area of the action target in each frame image of the sample video;
[0155] Each of the target areas is input into a pre-trained action recognition model for action recognition to obtain an action category of each of the action targets.
[0156] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0157] Using a tracking algorithm to track the action target in each frame image of the sample video;
[0158] At preset time intervals, the target detection model is used to correct the tracked motion target.
[0159] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0160] Acquire an action data set, wherein the action data set is labeled with action categories;
[0161] The action data set is input into a neural network for model training, and based on the action data set, an action recognition model that can be used to determine the action category of an action target is obtained.
[0162] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0163] Input each of the target areas into a pre-trained action recognition model for action recognition, and output a vector of M*C dimensions, where M is the number of action targets and C is the number of action categories;
[0164] Get the vector value of the M*C dimensional vector;
[0165] The action category corresponding to the largest vector value is extracted from each of the vector values, and is determined as the action category of the action target.
[0166] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0167] Collect action datasets for action recognition;
[0168] Each action category of the action data set is labeled.
[0169] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0170] Extracting N frames of images from the sample video at even intervals or randomly, wherein N is an integer greater than 1;
[0171] Each of the target areas in the extracted N frames of images is input into a pre-trained action recognition model for action recognition to obtain an action category of each of the action targets.
[0172] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0173] The sample video is evenly divided into S segments, and N frames of images are randomly extracted from the sample video in each segment, where S is an integer greater than 1.
[0174] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0175] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0176] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for video action recognition, characterized in that: include: Get sample video; Acquire an action data set, wherein the action data set is labeled with action categories; Inputting the action data set into a neural network for model training, and obtaining an action recognition model that can be used to determine the action category of an action target based on the action data set; Using a target detection model to perform target detection on the first frame of the sample video to obtain an action target in the sample video; Tracking the action target in each frame image of the sample video using a tracking algorithm, and correcting the tracked action target using the target detection model at each preset time interval to obtain a target area of the action target in each frame image of the sample video; Input each of the target areas into a pre-trained action recognition model for action recognition, and output an M*C dimensional vector, where M is the number of action targets and C is the number of action categories; obtain the vector value of the M*C dimensional vector; extract the action category corresponding to the largest vector value from each of the vector values, and determine it as the action category of the action target.
2. The method according to claim 1, characterized in that The step of obtaining the action data set also includes: Collect action datasets for action recognition; Each action category of the action data set is labeled.
3. A video action recognition device, characterized in that: include: A sample video acquisition module is used to acquire sample videos; A data set acquisition unit, used to acquire an action data set, wherein the action data set is labeled with action categories; An action recognition model training module is used to input the action data set into a neural network for model training, and based on the action data set, obtain an action recognition model that can be used to determine the action category of an action target; An action target detection acquisition module, used to perform target detection on the first frame of the sample video using a target detection model to obtain the action target in the sample video; A target region acquisition module, configured to track the action target in each frame image of the sample video using a tracking algorithm, and to correct the tracked action target using the target detection model at each preset time interval to obtain a target region of the action target in each frame image of the sample video; The action category training acquisition unit is used to input each of the target areas into a pre-trained action recognition model for action recognition, and output an M*C dimensional vector, wherein M is the number of action targets and C is the number of action categories; obtain the vector value of the M*C dimensional vector; extract the action category corresponding to the largest vector value from each of the vector values, and determine it as the action category of the action target.
4. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 2 are implemented.
5. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 2 are implemented.
Citation Information
Patent Citations
Object tracking method and device based on neural network model
CN105976400A
Urban moving vehicle behavior recognition method based on machine vision
CN106875424A
Real-time detection and tracking method for vehicles
CN107038423A
Non-overlapping area pedestrian tracking method based on deep neural network
CN108509859A
Early warning method and device based on abnormal behavior of person and storage medium
CN110008867A
