Action recognition method and device, terminal equipment and computer readable storage medium

Through frame difference calculation and action response analysis, the problem of insufficient action recognition accuracy in the existing technology is solved, high-precision action recognition and false touch distinction are achieved, and the sensitivity of the recognition system is enhanced.

CN118658196APending Publication Date: 2024-09-17SMARTSENS TECH SHENZHEN CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310247059.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-07
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

In the existing technology, in action recognition, the frame difference method is easily interfered by background changes and motion blur, is difficult to achieve end-to-end prediction, and has insufficient accuracy for continuous action and false touch recognition.

Method used

By performing frame difference calculation on multiple frames of images to be recognized, the action response and motion status of the target object are determined. If the target object shows a forward response or reverse response within the target time period, or reaches a stationary state, it is confirmed that the target action has been executed. , to avoid accidental touches and recognition errors of similar actions.

Benefits of technology

The accuracy and sensitivity of action recognition are improved, end-to-end action recognition is achieved, recognition errors of false touches and similar actions are reduced, and response accuracy to continuous actions is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118658196A
    Figure CN118658196A
Patent Text Reader

Abstract

The invention is suitable for the technical field of action recognition, and provides an action recognition method and device, terminal equipment and a computer readable storage medium. The action recognition method specifically comprises the following steps: acquiring multiple frames of to-be-recognized images of a target object in a target time period; frame difference operation is carried out on the multiple frames of to-be-recognized images to obtain frame difference images, and based on the frame difference images, the action response of the target object in each frame and the motion state of the target object are determined; and then, determining a target frame of the last forward response of the target object in the target time period, and if the target object has a reverse response in the target time period from the start of the target frame, or the motion state of the target object is a static state until the end of the target time period. And if yes, confirming that the target object executes the target action in the target time period. According to the embodiment of the invention, the accuracy of action recognition can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of motion recognition technology, and in particular, relates to a motion recognition method, apparatus, terminal device and computer-readable storage medium. Background Art

[0002] With the development of artificial intelligence in the field of images, vision-based action recognition has greatly improved the convenience of users interacting with various devices. Action recognition can include dynamic gesture recognition, dynamic posture recognition, etc. Taking dynamic gesture recognition as an example, vision-based gesture recognition can solve the problems of contact gesture recognition being limited by application scenarios and relying on wearable hardware devices. It has been widely used in automotive, smart home, medical and other fields.

[0003] In related technologies, detection and classification are often performed frame by frame, and action recognition is performed based on the changes in detection boxes and categories between different frames. This method requires high detection and classification accuracy for each frame. When the action is in an intermediate state (i.e., the action is halfway executed) or the image quality is poor, the action recognition accuracy decreases, and the recognition results are prone to jump back and forth.

[0004] Some related technologies use multi-frame image analysis. Multi-frame-based Action Learning models often use complex operations such as Temporal Shift Module (TSM) and Temporal Relocation Module (TRM) at the feature layer to fuse information between multiple frames, and it is difficult for the model to focus on the area where the object moves. In contrast, the frame difference method can effectively represent the state changes between different frames, and it has fast calculation and high real-time performance. However, the traditional frame difference method is easily affected by background changes, motion blur, etc., and after obtaining the frame difference, post-processing is required to output the result, and end-to-end prediction cannot be achieved. In addition, the above method is difficult to distinguish continuous actions in the video, and the recognition accuracy for false touches or similar actions is insufficient. Summary of the invention

[0005] The embodiments of the present application provide a motion recognition method, apparatus, terminal device and computer storage medium, which can solve the problem of insufficient motion recognition accuracy in related technologies.

[0006] A first aspect of an embodiment of the present application provides an action recognition method, comprising: acquiring multiple frames of images to be recognized of a target object within a target time period; performing frame difference operations on each frame of the image to be recognized in the multiple frames of the image to be recognized and the image to be recognized in the corresponding historical frame, respectively, to obtain a frame difference image corresponding to each frame of the image to be recognized; determining the action response and the motion state of the target object in each frame based on the frame difference image corresponding to each frame, wherein the action response includes a positive response and a negative response, the positive response indicating that the target object is in the process of executing an initial action to a target action, and the negative response indicating that the target object is in the process of restoring the target action to the initial action; determining the target frame in which the positive response appears for the last time in the target time period; if the target object appears the negative response within the target time period starting from the target frame, or the motion state of the target object is in a static state until the end of the target time period, it is confirmed that the target object has performed the target action within the target time period.

[0007] A second aspect of an embodiment of the present application provides an action recognition device, comprising: an image acquisition unit, configured to acquire multiple frames of to-be-recognized images of a target object within a target time period; a frame difference operation unit, configured to perform frame difference operation on each frame of the to-be-recognized images in the multiple frames of the to-be-recognized images and the to-be-recognized images of the corresponding historical frames, respectively, to obtain a frame difference image corresponding to each frame of the to-be-recognized images; an image processing unit, configured to determine the action response and the motion state of the target object in each frame based on the frame difference image corresponding to each frame, wherein the action response includes a positive response and a negative response, the positive response indicating that the target object is in the process of executing from an initial action to a target action, and the negative response indicating that the target object is in the process of restoring from the target action to the initial action; a positive response processing unit, configured to determine the target frame in which the positive response appears for the last time in the target time period; and a action recognition unit, configured to confirm that the target object has performed the target action in the target time period if the negative response appears in the target object in the target time period starting from the target frame, or the motion state of the target object is all static until the end of the target time period.

[0008] A third aspect of an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned action recognition method when executing the computer program.

[0009] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned action recognition method are implemented.

[0010] A fifth aspect of an embodiment of the present application provides a computer program product. When the computer program product is run on a terminal device, the terminal device executes the action recognition method described in the first aspect above.

[0011] In the implementation manner of the present application, on the one hand, the frame difference image obtained by performing frame difference operation on multiple frames of images to be identified can reflect the changes in the action of the target object between different frames. Using the frame difference image for action recognition can focus on the dynamic changes of the target object. At the same time, compared with frame-by-frame detection and classification, it can avoid the influence of the errors of single-frame detection and classification results on action recognition; on the other hand, based on the frame difference image, the action response and the motion state of the target object in each frame are determined. If the target object has a reverse response within the target time period starting from the target frame in which the target object last has a positive response in the target time period, or the target object is in a static state until the end of the target time period, it is confirmed that the target object has performed the target action within the target time period. Regardless of whether the target object performs continuous actions, it can be confirmed that the target object has performed the target action when the target object completes the execution and restoration of the target action, or when the target object stops after performing the target action, thereby avoiding the mistaken touch behavior of not performing the target action, or the similar behavior of performing a non-restoration action after performing the target action as the execution of the target action, thereby effectively improving the accuracy of action recognition. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0013] Figure 1 It is a schematic diagram of an implementation flow of an action recognition method provided in an embodiment of the present application;

[0014] Figure 2 is a schematic diagram of multiple frames of images to be recognized provided in an embodiment of the present application;

[0015] Figure 3 is a schematic diagram of a specific implementation flow of step S103 provided in an embodiment of the present application;

[0016] Figure 4is a first structural diagram of the action recognition model provided in an embodiment of the present application;

[0017] Figure 5 is a second structural diagram of the action recognition model provided in an embodiment of the present application;

[0018] Figure 6 It is a schematic diagram of a specific implementation process of the training action recognition model provided in an embodiment of the present application;

[0019] Figure 7 It is a schematic diagram of a specific implementation process of output action classification provided in an embodiment of the present application;

[0020] Figure 8 It is a schematic diagram of a specific implementation process of determining an action response label provided in an embodiment of the present application;

[0021] Fig. 9 It is a schematic diagram of a specific implementation process of determining a motion state label provided in an embodiment of the present application;

[0022] Fig.10 is a schematic diagram of image translation provided in an embodiment of the present application;

[0023] Fig.11 It is a schematic diagram of a specific implementation process of determining classification labels provided in an embodiment of the present application;

[0024] Fig.12 is a structural schematic diagram of a motion recognition device provided in an embodiment of the present application;

[0025] Fig.13 It is a schematic diagram of the structure of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solutions 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 intended to limit the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work are protected by the present application.

[0027] In related technologies, detection and classification are often performed frame by frame, and action recognition is performed based on the changes in detection boxes and categories between different frames. This method requires high detection and classification accuracy for each frame. When the action is in an intermediate state (i.e., the action is halfway executed) or the image quality is poor, the action recognition accuracy decreases, and the recognition results are prone to jump back and forth.

[0028] Some related technologies use multi-frame image analysis. Multi-frame-based Action Learning models often use complex operations such as Temporal Shift Module (TSM) and Temporal Relocation Module (TRM) at the feature layer to fuse information between multiple frames, and it is difficult for the model to focus on the area where the object moves. In contrast, the frame difference method can effectively represent the state changes between different frames, and it has fast calculation and high real-time performance. However, the traditional frame difference method is easily affected by background changes, motion blur, etc., and after obtaining the frame difference, post-processing is required to output the result, and end-to-end prediction cannot be achieved. In addition, the above method is difficult to distinguish continuous actions in the video, and the recognition accuracy for false touches or similar actions is insufficient.

[0029] Based on this, the present application proposes an action recognition method, which can use frame difference images to analyze the execution process of the target object's action, is compatible with the continuous actions performed by the target object, and can also better distinguish false touches or similar actions.

[0030] In order to illustrate the technical solution of the present application, a specific embodiment is provided below for illustration.

[0031] Figure 1 A schematic diagram of the implementation flow of a motion recognition method provided by an embodiment of the present application is shown. The method can be applied to a terminal device and can be applicable to situations where the accuracy of motion recognition needs to be improved. Among them, the above-mentioned terminal device can be a smart device such as a mobile phone, a computer, a tablet computer, a vehicle-mounted device, etc. In some specific scenarios, the above-mentioned terminal device can also be a smart home device, such as a smart air conditioner, a smart fan, etc. These smart home devices can identify whether the user has performed the target action based on the motion recognition method provided by the present application, and then execute instructions related to the target action, such as executing a start instruction, a sleep instruction, volume adjustment, air volume adjustment, etc. Among them, the target action image or video can be obtained based on the image sensor on the terminal device, and then detected and identified to achieve the corresponding function.

[0032] Specifically, the above-mentioned action recognition method may include the following steps S101 to S105.

[0033] Step S101, obtaining multiple frames of to-be-recognized images of a target object within a target time period.

[0034] The target object is the object to be action-recognized, that is, the object of action execution. In the implementation of the present application, the target object can be a complete individual such as a person or an animal, or a part of a person such as a hand or head. Taking the recognition of a thumb press action as an example, the target object can be a hand; taking the recognition of a takeoff action indicating that an airplane takes off as an example, the target object can be a takeoff commander; this application does not impose any restrictions on this.

[0035] The target time period is the time period during which it is necessary to determine whether the target object has performed the target action. The length of the target time period can be adjusted according to actual needs, for example, it can be 3s, 5s, etc. In order to identify whether the target object has performed the target action in the target time period, the terminal device needs to obtain multiple frames of images to be identified of the target object in the target time period. Among them, the images to be identified are images used for action recognition.

[0036] Specifically, in some implementations, the terminal device can continuously shoot the target object in the target time period through the built-in camera to obtain multiple frames of images to be recognized. In other implementations, the terminal device can also download the video that needs to be action recognized from the server, parse the video frame by frame, and obtain multiple frames of images to be recognized. It should be understood that other methods for obtaining images to be recognized are also applicable to this application, and this application does not limit this.

[0037] Step S102 , performing frame difference calculation on each frame of the image to be recognized in the plurality of frames of the image to be recognized and the image to be recognized in the corresponding historical frame, so as to obtain a frame difference image corresponding to each frame of the image to be recognized.

[0038] In the implementation of the present application, the historical frame refers to the image frame that occurred previously, and each frame of the image to be identified corresponds to one or more historical frames. That is, the historical frame corresponding to the i-th frame of the image to be identified is the iA-th frame, A is a positive integer greater than or equal to 1, and the value of A can be one or more. According to actual needs, the value of A can be specifically set to 3, 6, 9 or other values.

[0039] For each of the multiple frames of images to be identified, a frame difference operation can be performed with the corresponding historical frame of the image to be identified to obtain a frame difference image corresponding to each frame of the image to be identified. The frame difference operation is to perform a difference on the information of pixels at the same position in the two images.

[0040] In some implementations, the terminal device may also calculate the grayscale value of each pixel in each frame of the image to be identified based on the above multiple frames of the image to be identified, and make a difference in the grayscale values ​​of the pixels at the same position in the two images to obtain the grayscale value of the pixel at that position in the corresponding frame difference image, and then obtain the frame difference image corresponding to each frame. That is, the grayscale value of the pixel at the position (x, y) of the i-th frame of the image to be identified in the target time period sequence is recorded as f i (x, y), the gray value of the pixel at position (x, y) of the image to be identified in the historical frame corresponding to the i-th frame is f j (x, y), then the grayscale value of the pixel at position (x, y) in the frame difference image corresponding to the i-th frame is D(x, y) = |f i (x, y)-f j (x, y)|.

[0041] In some other implementations, the terminal device can perform a difference on the pixel values ​​of the pixel points at the same position in the two images on each color channel, obtain the pixel value of the pixel points at the same position in the corresponding frame difference image, and then obtain the frame difference image corresponding to each frame. The color channels include but are not limited to the red channel (R), the green channel (G), and the blue channel (B).

[0042] In other words, the frame difference image obtained in step S102 can be either a grayscale image or a color image.

[0043] Step S103 : determining the action response and motion state of the target object in each frame based on the frame difference image corresponding to each frame.

[0044] In the implementation of the present application, the image content of the frame difference image is the difference in the image content of the target object in the two images, which can reflect the change in the action of the target object between different frames. Based on the frame difference image corresponding to the i-th frame, the terminal device can determine the action response and motion state of the target object in the i-th frame.

[0045] Among them, the action response is used to characterize the change process of the action, which can include positive response and negative response. The positive response can characterize the target object in the process of executing from the initial action to the target action, and the negative response can characterize the target object in the process of restoring from the target action to the initial action. The target action is the action that needs to be identified, and the initial action is the pre-action performed by the target object in order to execute the target action.

[0046] Take the recognition of thumb pressing as an example, the target object is the hand, the initial action is thumb raising, and the target action is pressing. Take the recognition of nodding as an example, the target object is the head, the initial action is raising the head, and the target action is lowering the head.

[0047] In some implementations, the action response also includes other responses, which may indicate that the target object is in other processes other than the aforementioned execution process and restoration process. Taking the identification of a thumb pressing action as an example, other responses may refer to the thumb being in a process of deflecting to the left or right.

[0048] The motion state is used to characterize whether the target object is stationary, and can include a stationary state and a moving state. The stationary state indicates that the target object is stationary, which indicates that the target object has not changed compared to the corresponding historical frame action; the moving state indicates that the target object is moving, which indicates that the target object has changed compared to the corresponding historical frame action. Taking the recognition of thumb pressing action as an example, the stationary state indicates that the entire hand has not moved, and the moving state indicates that the entire hand has moved, for example, the wrist drives the movement of the hand.

[0049] In some implementations, step S103 may be implemented using an action recognition model, which may be a convolutional neural network model (CNN), a recurrent neural network model (RNN), a deep neural network model (DNN), or a model of other structures. It should be understood that other methods for determining action responses and motion states may also be applicable to the present application, and the present application does not limit this.

[0050] Step S104, determining the target frame in which the target object has a positive response for the last time in the target time period.

[0051] In the implementation of the present application, by determining the action response made by the target object in each frame, the target frame in which the target object has a positive response for the last time in the target time period can be determined. The target frame is the end frame of the positive response, which represents the end of the execution process of the target object from the initial action to the target action. With the target frame as a reference, the influence of other actions that occur before the execution of the target action on the recognition of the target action can be avoided.

[0052] Step S105: if the target object shows a reverse response within the target time period starting from the target frame, or the target object is in a static state until the end of the target time period, it is confirmed that the target object has performed the target action within the target time period.

[0053] In an implementation manner of the present application, if starting from the target frame, the target object shows a reverse response within the target time period, it means that the target object has completed the execution and restoration of the target action, that is, the target object has completely performed the target action once, then the terminal device can confirm that the target object has performed the target action within the target time period.

[0054] If the target object is in a stationary state from the start of the target frame to the end of the target time period, it means that the target object stops after performing the target action and waits for restoration. The terminal device can also confirm that the target object has performed the target action within the target time period.

[0055] Correspondingly, after step S103, if the target object does not make a positive response within the target time period, the terminal device can confirm that the target object does not perform the target action within the target time period.

[0056] After step S104, if the target object does not show a reverse response within the target time period starting from the target frame, and the target object is in a moving state from the start of the target frame to the end of the target time period, it means that the target object is not restored after executing the target action, and the action actually performed by the target object is a similar action to the target action, not the target action, then the terminal device can confirm that the target object did not execute the target action within the target time period.

[0057] It should be noted that, in some embodiments, the terminal device can determine the target frame after determining the action response and motion state of the target object in all frames, and identify whether the target object has performed the target action within the target time period. In some embodiments, if the last frame of the multiple frames of images to be identified within the target time period is determined to be the target frame, the terminal device can postpone at least one frame from the last frame of the multiple frames of images to be identified, that is, by supplementing at least one frame backward, the number of multiple frames of images to be identified is increased; in other embodiments, it can also be moved backward by at least one frame, that is, by supplementing at least one frame backward and dropping at least one frame of the same number from the initial frame forward, so that the number of multiple frames of images to be identified remains unchanged, which is beneficial to the judgment after the target frame, so as to obtain the result of whether to perform a reverse response or motion state, etc.

[0058] In some other implementations, the terminal device may also process frame by frame to determine whether it is a forward response and whether it is a target frame, and after determining the target frame, continue to process frame by frame to determine whether it is a reverse response or in a static state, thereby identifying whether the target object has performed a target action within the target time period. It should be understood that after confirming that the target object has performed a target action once within the target time period, the terminal device may continue to process frame by frame to confirm whether the target object has performed the next target action within the target time period.

[0059] For ease of understanding, Figure 2 The schematic diagram of multiple frames of images to be recognized for thumb press recognition is shown. First, the terminal device can match the positive response, set the current frame t (such as each frame in the multiple frames of images to be recognized is the current frame t), and respectively combine with the previous t-3, t-6, and t-9 frames to calculate the corresponding frame difference image to determine whether the current frame has a positive response. If a positive response occurs, it is as follows Figure 2 At the middle frame 21, this frame is used as the target frame and the reverse response is matched backwards. If a positive response appears again during the matching process, the target frame is postponed backwards as follows Figure 2The position shown in the middle frame 22; or, by calculating the corresponding frame difference image by combining the current frame t with the previous t-3, t-6, t-9 frames respectively and the three types of images of the previous t-3, t-6, t-9 frames corresponding to the current frame t, it is determined whether the current frame t has a positive response, based on the judgment result, such as Figure 2 The position shown in the middle frame 22 is the target frame, and the reverse response is matched backward. Figure 2 At the position shown in the middle frame 23, it can be confirmed that a thumb press action has been performed. If no reverse response is matched, but the device remains stationary within the target time period, it can also be confirmed that a thumb press action has been performed. After a thumb press action occurs, the terminal device can continue to confirm whether to perform the next thumb press action, and the confirmation method is the same as the confirmation process of the first thumb press action.

[0060] In the embodiments of the present application, on the one hand, the frame difference image obtained by performing frame difference operation on multiple frames of images to be identified can reflect the changes in the actions of the target object between different frames. Using the frame difference image for action recognition can focus on the dynamic changes of the target object. At the same time, compared with frame-by-frame detection and classification, it can avoid the influence of the errors of single-frame detection and classification results on action recognition; on the other hand, based on the frame difference image, the action response and the motion state of the target object in each frame are determined. If the target object has a reverse response in the target time period starting from the target frame in which the target object has a positive response for the last time in the target time period, or the motion state of the target object is a static state until the end of the target time period, it is confirmed that the target object has performed the target action in the target time period. Regardless of whether the target object performs continuous actions, it can be confirmed that the target object has completed the execution and restoration of the target action, or that the target object has performed the target action when it stops after performing the target action, thereby avoiding the false touch behavior of not performing the target action, or the similar behavior of performing a non-restoration action after performing the target action as the execution of the target action, effectively improving the accuracy and sensitivity of action recognition, and achieving end-to-end recognition.

[0061] The specific implementation of the above action recognition method is described in detail below.

[0062] In some embodiments of the present application, each frame of the image to be identified is taken as the current frame in turn, and its corresponding frame difference image and the corresponding historical frame image are obtained. Through the above three types of images, the action response and the motion state of the target object in the current frame can be determined in turn.

[0063] In order to ensure that the determined action response and motion state are more accurate, the terminal device can combine the frame difference image and the two images obtained by the frame difference image for joint analysis. That is, the terminal device can use the image to be identified in the current frame, the image to be identified in the historical frame corresponding to the current frame, and the frame difference image corresponding to the current frame to determine the action response and motion state of the target object in the current frame.

[0064] For details, please refer to Figure 3 The above-mentioned determination of the action response and the motion state of the target object in the current frame may specifically include steps S301 to S305.

[0065] Step S301, performing a first convolution operation on the image to be recognized in the current frame to obtain a first feature.

[0066] Step S302, performing a first convolution operation on the image to be identified in the historical frame corresponding to the current frame to obtain a second feature.

[0067] In some embodiments of the present application, the terminal device may use the same convolutional network to perform feature extraction on the image to be identified in the current frame and the image to be identified in the corresponding historical frame, respectively, to obtain the first feature and the second feature, respectively.

[0068] The first feature may represent the category feature of the action of the target object in the current frame. The category feature may represent the outline, shape, orientation, etc., and may be used to determine the category of the action of the target object in the current frame.

[0069] Taking thumb press recognition as an example, the action category of the hand (target object) can be fisting, thumbs up, etc., and the first feature can represent the outline of the hand, the direction of the fingers, etc.

[0070] Similarly, the second feature can represent the category feature of the action of the target object in the historical frame corresponding to the current frame.

[0071] Step S303: performing a second convolution operation on the frame difference image corresponding to the current frame to obtain a third feature.

[0072] The third feature may characterize the motion trend of the target object in the current frame. The motion trend is the motion change trend of the target object between the historical frame corresponding to the current frame and the current frame.

[0073] Taking thumb press recognition as an example, the movement trend of the hand (target object) in the current frame can be a positive trend from thumbs up to fist clenching (pressing), a reverse trend from fist clenching (pressing) to thumbs up, and other trends.

[0074] Step S304: perform positional multiplication of the first feature and the second feature with the third feature respectively, and perform feature fusion on the features obtained by the positional multiplication to obtain a fused feature.

[0075] In the implementation of the present application, the first feature, the second feature and the third feature can be represented as a feature matrix. Positional multiplication refers to multiplying the elements in the feature matrix in correspondence with each other in position, and the size (shape) of the obtained feature matrix is ​​consistent with the size of the feature matrix before the positional multiplication.

[0076] The first feature With the third feature Taking bitwise multiplication as an example, the feature obtained by bitwise multiplication is expressed as

[0077] The first feature is multiplied with the third feature, and the second feature is multiplied with the third feature, so that a feature obtained by two multiplications can be obtained. The two multiplications are fused to obtain a fused feature. The fused feature combines the first feature, the second feature, and the third feature, and comprehensively represents the action of the target object in the current frame, the action of the corresponding historical frame, and the action trend from the historical frame to the current frame.

[0078] Specifically, the above-mentioned feature fusion can be fused in the channel dimension. In some implementations, the above-mentioned feature fusion can be implemented by concatenation: assuming that the dimensions obtained by multiplying the two aforementioned pairs are p and q respectively, the dimension of the fused feature is p+q. In other implementations, the above-mentioned feature fusion can also be implemented by addition or other commonly used feature fusion methods, which is not limited in this application.

[0079] In some embodiments, before respectively multiplying the first feature and the second feature with the third feature, the terminal device may also activate the third feature using an activation function. The activation function may be a Sigmoid function, a rectified linear unit (ReLU), etc., which is not limited in this application.

[0080] Step S305, performing the third convolution operation and the fourth convolution operation on the fused features respectively, and correspondingly obtaining the action response and the motion state of the target object in the current frame.

[0081] In the implementation mode of the present application, since the fused features comprehensively represent the action of the target object in the current frame, the action of the corresponding historical frame, and the action trend from the historical frame to the current frame, feature extraction is performed through convolution operation, which can analyze the action change process of the target object, and then obtain the action response and motion state of the target object in the current frame.

[0082] Specifically, by performing feature extraction through the third convolution operation, it is possible to analyze whether the target object is in the process of executing from the initial action to the target action, or in the process of restoring from the target action to the initial action, thereby obtaining the action response made by the target object in the current frame. By performing feature extraction through the fourth convolution operation, it is possible to analyze the change of the target object from the historical frame to the current frame, determine whether the target object is in a stationary state or a moving state, and thereby obtain the motion state of the target object in the current frame.

[0083] Exemplarily, the third convolution operation and the fourth convolution operation can be implemented by fully connected layers (FC).

[0084] It should be noted that the convolution operation is the process of sliding a convolution kernel on the image to be identified to obtain a feature map. The first convolution operation, the second convolution operation, the third convolution operation, and the fourth convolution operation may refer to processing the image to be identified using a preset number of convolution layers in the convolution network. Each convolution layer includes one or more convolution kernels, and the size of each convolution kernel may be different sizes such as 1x1, 3x3, 5x5, and each convolution kernel may be used to extract features. In order to extract different features, the number of convolution layers and / or convolution kernels used in the first convolution operation, the second convolution operation, the third convolution operation, and the fourth convolution operation are different.

[0085] In the above manner, the terminal device can combine the image to be identified and the frame difference image to perform action classification analysis and action change analysis, which is conducive to accurately determining the action response and motion state of the target object.

[0086] In some embodiments, the above steps S301 to S305 may be performed by a pre-trained action recognition model. That is, in some embodiments, the terminal device may input the image to be recognized in the current frame, the image to be recognized in the historical frame corresponding to the current frame, and the frame difference image corresponding to the current frame into the action recognition model to obtain the action response and motion state of the target object in the current frame output by the action recognition model.

[0087] Specifically, Figure 4A schematic diagram of an action recognition model is shown. The input of the action recognition model is two frames of images and a frame difference image of the two frames of images. The two frames of images use the same convolutional network for feature extraction to obtain the first feature ① and the second feature ②, and the frame difference image uses another convolutional network for feature extraction to obtain the third feature ③. After the third feature ③ is activated by the sigmoid function, it is respectively multiplied with the first feature ① and the second feature ②, and the feature fusion is performed on the channel dimension to obtain the fusion feature ④. The fusion feature ④ is passed through two fully connected layers M_FC and S_FC to predict the action response and motion state respectively. The output results of the M_FC branch are divided into 3 categories: other responses, forward responses, and reverse responses. The output results of the S_FC are divided into 2 categories: static state and moving state.

[0088] Before using the above action recognition model, the terminal device can use sample images to perform model training on the model to be trained until the model to be trained converges to obtain the action recognition model.

[0089] To accelerate the convergence speed of model training, such as Figure 5 As shown, the first feature ① and the second feature ② can be connected to a classification prediction branch F_FC respectively, and the output result of the classification prediction branch F_FC is the classification of the action. When training the model, the two classification prediction branches can be enabled, and the two classification branches can share parameters. When the model is used, the two classification prediction branches can be disabled. Taking the action recognition model as a thumb press model as an example, the output results of the classification prediction branch F_FC can be divided into 2 categories: fist (clenched fist) and thumb (thumb up).

[0090] For more information, see Figure 6 The training process of the above-mentioned action recognition model may include the following steps S601 to S603.

[0091] Step S601 , obtaining multiple frames of sample images when the sample object performs a target action within a sample time period, and image annotations of each frame of the multiple frames of sample images.

[0092] The sample object is an object used for model training, which is of the same type as the target object and can be the same object or a different object from the target object. Taking the target object as the hand of user A as an example, the sample object can be either the hand of user A or the hand of user B. The selection of the sample object can be adjusted according to the scenario of model training.

[0093] The sample time period is a time period during which it is necessary to determine whether the sample object has performed the target action. The length of the sample time period can also be adjusted according to actual needs, and the lengths of the sample time period and the target time period can be the same or different.

[0094] Image annotation is the annotation of the accurate category of the sample image, which may include action response annotation of the aforementioned action response, motion state annotation of the aforementioned motion state, and classification annotation of the classification of the action in which the sample object is in.

[0095] It should be noted that the method for obtaining the above sample images can refer to the method for obtaining the above-mentioned image to be identified, and this application will not elaborate on it. The above image annotation can be obtained by manually annotating the sample images or automatically annotating them, and this application does not limit this.

[0096] Step S602 : performing frame difference calculation on each sample image frame in the multiple sample image frames and the sample image of the corresponding training frame, to obtain a sample frame difference image corresponding to each frame.

[0097] In the implementation manner of the present application, each frame of sample image may correspond to one or more frames of training frames, and the training frame may be any frame within the sample time period. In some implementation manners, each frame of sample image performs frame difference calculation and training with multiple frames of sample images acquired within the sample time period, and each frame of sample image may perform frame difference calculation and training with each other frame of the multiple frames of sample images acquired within the sample time period, excluding itself. Of course, in other implementation manners, each frame of sample image may perform frame difference calculation and training with each frame of the multiple frames of sample images acquired within the sample time period, including itself.

[0098] The specific implementation process of the frame difference calculation can refer to the aforementioned method of obtaining the frame difference image, which will not be elaborated in this application.

[0099] Step S603, using each frame of sample images, each frame of the sample image of the training frame corresponding to the frame, and each frame of the sample frame difference image corresponding to the frame, the model to be trained is iteratively trained until the accuracy of the result calculated using the output result of the model to be trained and the image annotation is greater than the accuracy threshold, or until the number of iterations of the iterative training is greater than the number threshold, to obtain the action recognition model.

[0100] Specifically, a certain frame of sample image, a sample image of a training frame corresponding to the frame, and a sample frame difference image corresponding to the frame are input into the model to be trained, and the current output result of the model to be trained can be obtained. According to the output result and image annotation, the current result accuracy of the model to be trained can be calculated. The result accuracy represents the accuracy of the current output result of the model to be trained. If the result accuracy is greater than the accuracy threshold, it means that the current output result accuracy of the model to be trained is relatively high, and the model to be trained has converged, then the model to be trained can be used as an action recognition model. If the result accuracy is less than or equal to the accuracy threshold, it means that the current output result accuracy of the model to be trained is relatively low, and the model to be trained has not converged, then the parameters of the model to be trained can be adjusted, and a frame of sample image, a sample image of a training frame corresponding to the frame, and a sample frame difference image corresponding to the frame are reselected and input into the model to be trained, and iterative training is implemented until the result accuracy is greater than the accuracy threshold, or until the number of iterations of iterative training is greater than the number threshold, and the action recognition model is obtained.

[0101] In an embodiment of the present application, the above output results may specifically include the action response of the sample object in the current frame, the motion state in the current frame, the classification of the action in the current frame, and the classification of the action in the corresponding training frame.

[0102] The process of outputting action response and motion state of the trained model can be referred to Figure 3 The described process will not be described in detail in this application.

[0103] In the process of iterative training of the training model, the process of obtaining the classification of the action can specifically include: Figure 7 Steps S701 to S702 are shown.

[0104] Step S701, performing a first convolution operation on a sample image of a current frame to obtain a first feature, and performing a fifth convolution operation on the first feature to obtain a fifth feature.

[0105] Step S701, performing a first convolution operation on a sample image of a historical frame corresponding to the current frame to obtain a second feature, and performing a fifth convolution operation on the second feature to obtain a sixth feature.

[0106] Among them, the first feature represents the category feature of the action of the sample object in the current frame, and the fifth feature represents the category of the action of the target object in the current frame. The second feature represents the category feature of the action of the sample object in the historical frame corresponding to the current frame, and the sixth feature represents the category of the action of the target object in the historical frame corresponding to the current frame.

[0107] That is to say, the two classification prediction branches F_FC can further perform a fifth convolution operation on the corresponding first feature to obtain a corresponding output result. It should be understood that the fifth convolution operation is different from the first convolution operation, the second convolution operation, the third convolution operation, and the fourth convolution operation in terms of the number of convolution layers and / or convolution kernels used between each other.

[0108] by Figure 5 Taking the action recognition model shown as an example, when calculating the accuracy of the result, the action response output by M_FC can be compared with the action response annotation, the motion state output by S_FC can be compared with the motion state annotation, and the classifications (fifth feature and sixth feature) output by the two F_FCs can be compared with the classification annotations corresponding to the two frames of sample images. Due to the addition of two classification prediction branches F_FC, compared with only using the output results of M_FC and S_FC for model training, the above model training method can accelerate the convergence speed of the model.

[0109] It should be noted that the accuracy threshold and the number threshold can be adjusted according to actual conditions. For example, the accuracy threshold can be set to 95% and the number threshold can be set to 100 times.

[0110] In the process of the above model training, each image annotation can be obtained by automatic annotation. The automatic annotation process can be implemented by a corresponding annotation algorithm.

[0111] In some embodiments, Figure 8 As shown, the above-mentioned action response annotation algorithm may specifically include the following steps S801 to S803.

[0112] Step S801 : determining the action score of each frame according to the total number of frames of the multiple sample images and the number of frames of each sample image in the multiple sample images.

[0113] Among them, the action score is positively correlated with the frame number of each sample image.

[0114] Step S802: Calculate a first difference between the motion score of each frame and the motion scores of other frames.

[0115] Step S803: determining the action response label of each frame of the sample image according to the first difference.

[0116] Specifically, the terminal device may determine the action response annotation of the frame sample image as the annotation corresponding to the interval range according to the interval range where the first difference between the action score of a frame and the action scores of other frames is located.

[0117] In some implementations, the above steps S801 to S803 may be implemented by a first calculation formula, that is, the terminal device may determine the action response label according to the first calculation formula.

[0118] Among them, the first operation formula can be expressed as:

[0119]

[0120] M i represents the action score of the i-th frame sample image, i represents the number of frames of the sample image, Max represents the total number of frames of multiple sample images, and M ij represents the first difference in action scores between the i-th frame sample image and the j-th frame sample image. For example, when performing thumb press recognition, M label represents the action response label of the i-th frame, M label 1 indicates a positive response, M label 2 indicates reverse response, M label 0 indicates other responses, M label If it is -1, it is not used as a training sample or written as other status.

[0121] In some embodiments, Fig. 9 As shown, the above-mentioned motion state labeling algorithm may specifically include the following steps S901 to S904.

[0122] Step S901 : translating each frame of sample images in a plurality of frames of sample images by a random amount in the image width direction and the image length direction.

[0123] Please refer to Fig.10 , the sample image of the i-th frame can be translated by a random amount shift_xi in the image width direction and a random amount shift_yi in the image length direction relative to itself. The random amounts of translation of sample images of different frames can be the same or different, and the random amounts of translation of the sample image of the same frame in two directions can be the same or different.

[0124] Step S902, calculating a second difference between the random amount of each frame sample image when translated and the random amount of other frames sample image when translated.

[0125] The second difference can be specifically divided into a difference shift_xi-shift_xj of a random amount of translation between two frames of images (the i-th frame and the j-th frame) in the image width direction, and a difference shift_yi-shift_yj of a random amount of translation in the image length direction.

[0126] Step S903, calculating the motion state score according to the second difference, the image width of the multiple frames of sample images, and the image length of the multiple frames of sample images.

[0127] Among them, the motion state score is positively correlated with the size of the second difference.

[0128] Step S904: determining the motion state label of each frame of sample image according to the motion state score.

[0129] Similarly, the terminal device may determine the motion state label of the frame sample image as a label corresponding to the interval range where the second difference between the motion state score of a frame and the motion state scores of other frames is located.

[0130] In some implementations, the above steps S901 to S904 may be implemented by a second operation formula, that is, the terminal device may determine the motion state label according to the second operation formula.

[0131] The second operation formula can be expressed as:

[0132]

[0133] S ij represents the second difference between the random amount of the i-th frame sample image when translated and the random amount of the j-th frame sample image when translated, shift_xi represents the random amount of the i-th frame sample image translated in the image width direction, shift_xj represents the random amount of the j-th frame sample image translated in the image width direction, shift_yi represents the random amount of the i-th frame sample image translated in the image length direction, shift_yj represents the random amount of the j-th frame sample image translated in the image length direction, wi represents the image width of the i-th frame sample image, hi represents the image length of the i-th frame sample image. For example, when performing thumb press recognition, S label represents the motion state annotation of the i-th frame, S label 0 means static state, S label 1 indicates the moving state, S label -1 indicates other status.

[0134] In some embodiments, Fig.11 As shown, the above-mentioned classification labeling algorithm may specifically include the following steps S1101 to S1102.

[0135] Step S1101 , determining the action score of each frame according to the total number of frames of the multiple sample images and the number of frames of each sample image in the multiple sample images.

[0136] Among them, the action score is positively correlated with the frame number of each sample image.

[0137] Step S1102: determining a classification label for each frame of sample image according to the action score of each frame.

[0138] Specifically, the terminal device may determine the classification label of the sample image of a frame as a label corresponding to the interval range according to the interval range of the action score of the frame.

[0139] In some implementations, the above steps S1101 to S1102 may be implemented by a third operation formula, that is, the terminal device may determine the classification label according to the third operation formula.

[0140] The third operation formula can be expressed as:

[0141]

[0142] M i represents the action score of the i-th frame sample image, i represents the number of frames of the sample image, Max represents the total number of frames of multiple frames of sample images, and F label Indicates the classification label of the i-th frame. When performing thumb press recognition, F label 0 means thumbs up, F label 1 means fist, F label -1 represents other (that is, intermediate state).

[0143] After completing the automatic annotation of each sample image, Figure 6 The training method shown is used to train the training model to obtain the action recognition model. According to the above training process, the obtained action recognition model is an end-to-end model, that is, the action recognition model can directly process the image (the image to be recognized, the frame difference image) and output the required action response and motion state results.

[0144] The action recognition method provided by the present application takes two frames of images at different times and their frame difference images as input, directly predicts the action after extracting features through the model, and realizes end-to-end prediction. In order to improve the response accuracy and sensitivity of continuous actions, the model results can not only predict the forward response, but also predict the reverse response, so that action recognition can be performed based on the forward and reverse responses when applied. At the same time, the model also predicts the motion state between the two frames, and determines whether the target object moves significantly between the two frames, which can reduce false touches and better distinguish each thumb press action. During the model training process, a classification prediction branch that is only enabled during model training is introduced, which can speed up the convergence of the network.

[0145] It should be noted that, for the sake of simplicity of description, the aforementioned method embodiments are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited to the described order of actions, because according to the present application, certain steps can be performed in other orders.

[0146] like Fig.12 The figure is a schematic diagram of the structure of a motion recognition device 1200 provided in an embodiment of the present application, and the motion recognition device 1200 is configured on a terminal device.

[0147] Specifically, the action recognition device 1200 may include:

[0148] An image acquisition unit 1201 is used to acquire multiple frames of to-be-recognized images of a target object within a target time period;

[0149] The frame difference calculation unit 1202 is used to perform frame difference calculation on each frame of the image to be recognized in the multiple frames of the image to be recognized and the image to be recognized in the corresponding historical frame, so as to obtain a frame difference image corresponding to each frame of the image to be recognized;

[0150] The image processing unit 1203 is used to determine the action response and the motion state of the target object in each frame based on the frame difference image corresponding to each frame, wherein the action response includes a positive response and a negative response, the positive response represents that the target object is in the process of executing from the initial action to the target action, and the negative response represents that the target object is in the process of restoring from the target action to the initial action;

[0151] A positive response processing unit 1204 is used to determine the target frame in which the positive response of the target object appears for the last time in the target time period;

[0152] The action recognition unit 1205 is used to confirm that the target object has performed the target action within the target time period if, starting from the target frame, the target object shows the reverse response within the target time period, or, by the end of the target time period, the motion state of the target object is a static state.

[0153] In some embodiments of the present application, the above-mentioned image processing unit 1203 can be specifically used to: use the image to be identified in the current frame, the image to be identified in the historical frame corresponding to the current frame, and the frame difference image corresponding to the current frame to determine the action response made by the target object in the current frame and the motion state.

[0154] In some embodiments of the present application, the above-mentioned image processing unit 1203 can be specifically used to: perform a first convolution operation on the image to be identified in the current frame to obtain a first feature, and the first feature represents the category feature of the action of the target object in the current frame; perform the first convolution operation on the image to be identified in the historical frame corresponding to the current frame to obtain a second feature, and the second feature represents the category feature of the action of the target object in the historical frame corresponding to the current frame; perform a second convolution operation on the frame difference image corresponding to the current frame to obtain a third feature, and the third feature represents the action trend of the target object in the current frame; perform positional multiplication of the first feature and the second feature with the third feature respectively, and perform feature fusion on the features obtained by the positional multiplication to obtain a fused feature; perform a third convolution operation and a fourth convolution operation on the fused feature respectively, and obtain the action response and the motion state made by the target object in the current frame; wherein the number of convolution layers and / or convolution kernels used between the first convolution operation, the second convolution operation, the third convolution operation and the fourth convolution operation are different.

[0155] In some embodiments of the present application, the above-mentioned image processing unit 1203 can be specifically used to: input the image to be recognized in the current frame, the image to be recognized in the historical frame corresponding to the current frame, and the frame difference image corresponding to the current frame into the action recognition model, and obtain the action response and the motion state made by the target object in the current frame output by the action recognition model.

[0156] In some embodiments of the present application, the above-mentioned action recognition device 1200 may also include a model training unit, which is used to: obtain multiple frames of sample images when the sample object performs the target action within a sample time period, and image annotations for each frame of the sample images in the multiple frames of sample images: wherein the image annotations include action response annotations for the action response, motion state annotations for the motion state, and classification annotations for the action in which the sample object is in; for each frame of the sample images in the multiple frames of sample images, frame difference operations are performed with the sample images of the corresponding training frames, respectively, to obtain sample frame difference images corresponding to each frame; using each frame of sample images, each frame of the sample images of the training frames corresponding to each frame, and each frame of the sample frame difference images corresponding to each frame, iterative training is performed on the model to be trained until the accuracy of the result calculated using the output result of the model to be trained and the image annotations is greater than the accuracy threshold, or until the number of iterations of the iterative training is greater than the number threshold, to obtain the action recognition model.

[0157] In some embodiments of the present application, the above-mentioned action recognition device 1200 may also include an image annotation unit, which is used to: determine the action score of each frame according to the total number of frames of the multiple frame sample images and the frame number of each frame sample image in the multiple frame sample images, wherein the action score is positively correlated with the frame number of each frame sample image; calculate the first difference between the action score of each frame and the action scores of other frames; and determine the action response annotation of each frame sample image according to the first difference.

[0158] In some embodiments of the present application, the above-mentioned image annotation unit can be specifically used to: translate each frame of the multiple sample images by a random amount in the image width direction and the image length direction respectively; calculate the second difference between the random amount when each frame of the sample image is translated and the random amount when other frame sample images are translated; calculate the motion state score according to the second difference, the image width of the multiple frames of sample images, and the image length of the multiple frames of sample images, wherein the motion state score is positively correlated with the size of the second difference; determine the motion state annotation of each frame of the sample image according to the motion state score.

[0159] In some embodiments of the present application, the above-mentioned image annotation unit can be specifically used to: determine the action score of each frame according to the total number of frames of the multiple sample images and the frame number of each sample image in the multiple sample images, wherein the action score is positively correlated with the frame number of each sample image; determine the classification annotation of each sample image according to the action score of each frame.

[0160] In some embodiments of the present application, the image annotation unit may be specifically used to: determine the action response annotation according to a first operation formula; wherein the first operation formula is expressed as:

[0161]

[0162] M i represents the action score of the i-th frame sample image, i represents the frame number of the sample image, Max represents the total frame number of the multiple frames of sample images, and M ij represents the first difference of the action score between the i-th frame sample image and the j-th frame sample image, M label Represents the action response annotation of the i-th frame.

[0163] In some embodiments of the present application, the image annotation unit may be specifically used to: determine the motion state annotation according to a second operation formula; wherein the second operation formula is expressed as:

[0164]

[0165] S ij represents the second difference between the random amount of the i-th frame sample image when it is translated and the random amount of the j-th frame sample image when it is translated, shift_xi represents the random amount of the i-th frame sample image translated in the image width direction, shift_xj represents the random amount of the j-th frame sample image translated in the image width direction, shift_yi represents the random amount of the i-th frame sample image translated in the image length direction, shift_yj represents the random amount of the j-th frame sample image translated in the image length direction, wi represents the image width of the i-th frame sample image, hi represents the image length of the i-th frame sample image, S label Represents the motion state annotation of the i-th frame.

[0166] In some implementations of the present application, the image annotation unit may be specifically used to: determine the classification annotation according to a third operation formula; the third operation formula is expressed as:

[0167]

[0168] M i represents the action score of the i-th frame sample image, i represents the frame number of the sample image, Max represents the total frame number of the multiple frames of sample images, and F label Represents the classification label of the i-th frame.

[0169] In some embodiments of the present application, the above-mentioned model training unit can be specifically used to: perform a first convolution operation on the sample image of the current frame to obtain a first feature, wherein the first feature represents the category feature of the action of the sample object in the current frame, and perform a fifth convolution operation on the first feature to obtain a fifth feature, wherein the fifth feature represents the category of the action of the target object in the current frame; perform the first convolution operation on the sample image of the historical frame corresponding to the current frame to obtain a second feature, wherein the second feature represents the category feature of the action of the sample object in the historical frame corresponding to the current frame, and perform the fifth convolution operation on the second feature to obtain a sixth feature, wherein the sixth feature represents the category of the action of the target object in the historical frame corresponding to the current frame.

[0170] In some embodiments of the present application, the above-mentioned action recognition unit 1205 can also be specifically used to: if the target object does not show the positive response within the target time period, confirm that the target object does not perform the target action within the target time period.

[0171] In some embodiments of the present application, the above-mentioned action recognition unit 1205 can also be specifically used for: if starting from the target frame, the target object does not show the reverse response within the target time period, and from the start of the target frame to the end of the target time period, the motion state of the target object is in a moving state, then it is confirmed that the target object has not performed the target action within the target time period.

[0172] In some embodiments of the present application, the frame difference operation unit 1202 may be specifically used to: perform frame difference operation on an image to be identified in the multiple frames of images to be identified for determining the positive response and a corresponding multiple historical frames of images to be identified, to obtain multiple frame difference images corresponding to the image to be identified; perform frame difference operation on an image to be identified in the multiple frames of images to be identified for determining the negative response and a corresponding single historical frame of images to be identified, to obtain a single frame difference image corresponding to the image to be identified.

[0173] In some embodiments of the present application, when the target object is a hand, the initial action is a thumbs-up action, and the target action is a pressing action.

[0174] It should be noted that, for the convenience and simplicity of description, the specific working process of the above-mentioned action recognition device 1200 can refer to Figures 1 to 11 The corresponding process of the method will not be repeated here.

[0175] like Fig.13 , which is a schematic diagram of a terminal device provided in an embodiment of the present application. Specifically, the terminal device 13 may include: a processor 130, a memory 131, and a computer program 132 stored in the memory 131 and executable on the processor 130, such as an action recognition program. When the processor 130 executes the computer program 132, the steps in the above-mentioned various action recognition method embodiments are implemented, such as Figure 1 Alternatively, when the processor 130 executes the computer program 132, the functions of each module / unit in the above-mentioned device embodiments are realized, for example Fig.12 The shown image acquisition unit 1201, frame difference calculation unit 1202, image processing unit 1203, positive response processing unit 1204 and action recognition unit 1205.

[0176] The computer program may be divided into one or more modules / units, which are stored in the memory 131 and executed by the processor 130 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program in the terminal device.

[0177] For example, the computer program may be divided into: an image acquisition unit, a frame difference calculation unit, an image processing unit, a positive response processing unit, and a motion recognition unit.

[0178] The specific functions of each unit are as follows: an image acquisition unit, used to acquire multiple frames of images to be identified of the target object within a target time period; a frame difference operation unit, used to perform frame difference operation on each frame of the image to be identified in the multiple frames of the image to be identified and the image to be identified of the corresponding historical frame, respectively, to obtain a frame difference image corresponding to each frame of the image to be identified; an image processing unit, used to determine the action response and the motion state of the target object in each frame based on the frame difference image corresponding to each frame, wherein the action response includes a positive response and a negative response, the positive response represents that the target object is in the process of executing from the initial action to the target action, and the negative response represents that the target object is in the process of restoring from the target action to the initial action; a positive response processing unit, used to determine the target frame in which the positive response appears for the last time in the target time period; an action recognition unit, used to confirm that the target object has performed the target action in the target time period if the negative response appears in the target object in the target time period starting from the target frame, or the motion state of the target object is a static state until the end of the target time period.

[0179] The terminal device may include, but is not limited to, a processor 130 and a memory 131. Those skilled in the art will appreciate that Fig.13 It is only an example of a terminal device and does not constitute a limitation of the terminal device. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal device may also include input and output devices, network access equipment, buses, etc.

[0180] The processor 130 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), off-the-shelf programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0181] The memory 131 may be an internal storage unit of the terminal device, such as a hard disk or memory of the terminal device. The memory 131 may also be an external storage device of the terminal device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device. Further, the memory 131 may also include both an internal storage unit of the terminal device and an external storage device. The memory 131 is used to store the computer program and other programs and data required by the terminal device. The memory 131 may also be used to temporarily store data that has been output or is to be output.

[0182] It should be noted that, for the convenience and brevity of description, the structure of the above-mentioned terminal device can also refer to the specific description of the structure in the method embodiment, which will not be repeated here.

[0183] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0184] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0185] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0186] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0187] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0188] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0189] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0190] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A method for motion recognition, characterized in that: include: Acquire multiple frames of to-be-recognized images of the target object within a target time period; Performing frame difference calculation on each frame of the image to be identified in the plurality of frames of the image to be identified and the image to be identified in the corresponding historical frame, so as to obtain a frame difference image corresponding to each frame of the image to be identified; Based on the frame difference image corresponding to each frame, determine the action response and the motion state of the target object in each frame, wherein the action response includes a positive response and a negative response, the positive response represents that the target object is in the process of executing from the initial action to the target action, and the negative response represents that the target object is in the process of restoring from the target action to the initial action; Determine the target frame in which the target object last appears in the target time period; If, starting from the target frame, the target object shows the reverse response within the target time period, or, by the end of the target time period, the motion state of the target object is a stationary state, it is confirmed that the target object has performed the target action within the target time period.

2. The motion recognition method according to claim 1, characterized in that: In the step of determining the action response and the motion state of the target object in each frame based on the frame difference image corresponding to each frame, determining the action response and the motion state of the target object in the current frame includes: The action response and the motion state of the target object in the current frame are determined by using the image to be identified in the current frame, the image to be identified in the historical frame corresponding to the current frame, and the frame difference image corresponding to the current frame.

3. The motion recognition method according to claim 2, characterized in that: The determining the action response and the motion state of the target object in the current frame by using the image to be recognized in the current frame, the image to be recognized in the historical frame corresponding to the current frame, and the frame difference image corresponding to the current frame, includes: Performing a first convolution operation on the image to be recognized in the current frame to obtain a first feature, where the first feature represents a category feature of the action of the target object in the current frame; Performing the first convolution operation on the image to be recognized in the historical frame corresponding to the current frame to obtain a second feature, where the second feature represents a category feature of the action of the target object in the historical frame corresponding to the current frame; Performing a second convolution operation on the frame difference image corresponding to the current frame to obtain a third feature, wherein the third feature represents a movement trend of the target object in the current frame; Multiplying the first feature and the second feature with the third feature respectively, and performing feature fusion on the features obtained by the multiplication to obtain a fused feature; Performing a third convolution operation and a fourth convolution operation on the fused features respectively, and correspondingly obtaining the action response and the motion state of the target object in the current frame; The first convolution operation, the second convolution operation, the third convolution operation, and the fourth convolution operation use different numbers of convolution layers and / or convolution kernels.

4. The motion recognition method according to claim 2, characterized in that: The determining the action response and the motion state of the target object in the current frame by using the image to be recognized in the current frame, the image to be recognized in the historical frame corresponding to the current frame, and the frame difference image corresponding to the current frame, includes: The image to be identified in the current frame, the image to be identified in the historical frame corresponding to the current frame, and the frame difference image corresponding to the current frame are input into the action recognition model to obtain the action response and the motion state of the target object in the current frame output by the action recognition model.

5. The motion recognition method according to claim 4, characterized in that: The training process of the action recognition model includes: Acquire multiple frames of sample images when the sample object performs the target action within a sample time period, and image annotations for each frame of the sample images: The image annotation includes an action response annotation for the action response, a motion state annotation for the motion state, and a classification annotation for the action of the sample object; Performing frame difference calculation on each sample image frame in the plurality of sample image frames and the sample image of the corresponding training frame, to obtain a sample frame difference image corresponding to each frame; The model to be trained is iteratively trained using each frame of sample images, the sample images of the training frames corresponding to each frame, and the sample frame difference images corresponding to each frame, until the accuracy of the result calculated using the output result of the model to be trained and the image annotation is greater than the accuracy threshold, or until the number of iterations of the iterative training is greater than the number threshold, to obtain the action recognition model.

6. The motion recognition method according to claim 5, characterized in that: The process of obtaining the action response annotation includes: Determining an action score of each frame according to the total number of frames of the multiple sample images and the number of frames of each sample image in the multiple sample images, wherein the action score is positively correlated with the number of frames of each sample image; Calculating a first difference between the motion score of each frame and the motion scores of other frames; The action response label of each frame of sample image is determined according to the first difference.

7. The motion recognition method according to claim 5, characterized in that: The process of obtaining the motion state annotation includes: Each frame of sample images in the multiple frames of sample images is translated by a random amount in the image width direction and the image length direction respectively; Calculate a second difference between the random amount when each frame of sample image is translated and the random amount when other frames of sample image are translated; Calculating a motion state score according to the second difference, the image width of the multiple frames of sample images, and the image length of the multiple frames of sample images, wherein the motion state score is positively correlated with the magnitude of the second difference; The motion state label of each frame of sample image is determined according to the motion state score.

8. The motion recognition method according to claim 5, characterized in that: The process of obtaining the classification annotation includes: Determining an action score of each frame according to the total number of frames of the multiple sample images and the number of frames of each sample image in the multiple sample images, wherein the action score is positively correlated with the number of frames of each sample image; The classification label of each frame of sample image is determined according to the action score of each frame.

9. The motion recognition method according to claim 5, characterized in that: The process of obtaining the image annotation includes: Determining the action response label according to the first operation formula; and / or, Determining the motion state label according to a second operation formula; and / or, Determining the classification label according to a third operation formula; Wherein, the first operation formula is expressed as: M i represents the action score of the i-th frame sample image, i represents the frame number of the sample image, Max represents the total frame number of the multiple frames of sample images, and M ij represents the first difference of the action score between the i-th frame sample image and the j-th frame sample image, M label represents the action response label of the i-th frame; The second operation formula is expressed as: S ij represents the second difference between the random amount of the i-th frame sample image when it is translated and the random amount of the j-th frame sample image when it is translated, shift_xi represents the random amount of the i-th frame sample image translated in the image width direction, shift_xj represents the random amount of the j-th frame sample image translated in the image width direction, shift_yi represents the random amount of the i-th frame sample image translated in the image length direction, shift_yj represents the random amount of the j-th frame sample image translated in the image length direction, wi represents the image width of the i-th frame sample image, hi represents the image length of the i-th frame sample image, S label Indicates the motion state label of the i-th frame; The third operation formula is expressed as: M i represents the action score of the i-th frame sample image, i represents the frame number of the sample image, Max represents the total frame number of the multiple frames of sample images, and F label Represents the classification label of the i-th frame.

10. The motion recognition method according to claim 5, characterized in that: In the process of iteratively training the training model using each frame of sample image, each frame of sample image of a historical frame corresponding to the frame, and each frame of sample frame difference image corresponding to the frame, the process includes: Performing a first convolution operation on the sample image of the current frame to obtain a first feature, the first feature characterizing the category feature of the action of the sample object in the current frame, and performing a fifth convolution operation on the first feature to obtain a fifth feature, the fifth feature characterizing the category of the action of the target object in the current frame; The first convolution operation is performed on the sample image of the historical frame corresponding to the current frame to obtain a second feature, wherein the second feature represents the category feature of the action of the sample object in the historical frame corresponding to the current frame, and the fifth convolution operation is performed on the second feature to obtain a sixth feature, wherein the sixth feature represents the category of the action of the target object in the historical frame corresponding to the current frame.

11. The motion recognition method according to any one of claims 1 to 10, characterized in that: After determining the action response and motion state of the target object in each frame by using the frame difference image corresponding to each frame, the action recognition method further includes: If the target object does not show the positive response within the target time period, confirming that the target object does not perform the target action within the target time period; And / or, after determining that the target object has the target frame of the positive response for the last time within the target time period, the action recognition method further includes: If, starting from the target frame, the target object does not show the reverse response within the target time period, and, from the start of the target frame to the end of the target time period, the motion state of the target object includes a moving state, then it is confirmed that the target object has not performed the target action within the target time period.

12. The motion recognition method according to any one of claims 1 to 10, characterized in that: The step of performing frame difference calculation on each frame of the image to be identified in the plurality of frames of the image to be identified and the image to be identified in the corresponding historical frame to obtain a frame difference image corresponding to each frame of the image to be identified includes: Performing frame difference operation on an image to be identified in the multiple frames of images to be identified for determining the positive response and a corresponding multiple historical frames of images to be identified to obtain multiple frame difference images corresponding to the image to be identified; and / or, performing frame difference operation on an image to be identified in the multiple frames of images to be identified for determining the negative response and a corresponding single historical frame of image to be identified to obtain a single frame difference image corresponding to the image to be identified.

13. The motion recognition method according to any one of claims 1 to 10, characterized in that: When the target object is a hand, the initial action is a thumb-up action, and the target action is a pressing action.

14. A motion recognition device, characterized in that: include: An image acquisition unit, used to acquire multiple frames of to-be-recognized images of a target object within a target time period; A frame difference calculation unit, used for performing frame difference calculation on each frame of the image to be recognized in the plurality of frames of the image to be recognized and the image to be recognized in the corresponding historical frame, respectively, to obtain a frame difference image corresponding to each frame of the image to be recognized; An image processing unit, configured to determine the action response and the motion state of the target object in each frame based on the frame difference image corresponding to each frame, wherein the action response includes a positive response and a negative response, the positive response represents that the target object is in the process of executing from the initial action to the target action, and the negative response represents that the target object is in the process of restoring from the target action to the initial action; A positive response processing unit, used to determine the target frame in which the positive response of the target object appears for the last time in the target time period; An action recognition unit is used to confirm that the target object has performed the target action within the target time period if, starting from the target frame, the target object shows the reverse response within the target time period, or, by the end of the target time period, the motion state of the target object is a stationary state.

15. A terminal device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the action recognition method according to any one of claims 1 to 13 are implemented.

16. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the action recognition method according to any one of claims 1 to 13 are implemented.