Model training method, action recognition method, device, equipment and storage medium

Through joint training of dual-stream convolutional neural networks and classifiers and joint learning of cloud servers, the problem of low accuracy of traditional action recognition methods is solved, the recognition accuracy is improved and data security is ensured.

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

Patent Information

Application Number
CN202011133950.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-21
Publication Date
2024-10-15
Estimated Expiration
2040-10-21

AI Technical Summary

Technical Problem

Traditional action recognition methods have low accuracy and slow recognition speed. The convolutional neural network model has low recognition accuracy due to insufficient number of samples.

Method used

The joint training method of dual-stream convolutional neural network and classifier is adopted. By obtaining the labels of video images and action data, the dual-stream convolutional neural network is trained on the network and the classifier is trained on the classification. The model parameters are merged for local recognition, and then the model is The parameters are uploaded to the cloud server for joint learning to update the model.

Benefits of technology

The recognition accuracy of the action recognition model is improved, and the security and privacy of data are ensured through local training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112257579B_ABST
    Figure CN112257579B_ABST
Patent Text Reader

Abstract

The present application relates to the field of artificial intelligence and model building, and specifically discloses a method for training an action recognition model, an action training method, an apparatus, a device and a storage medium, wherein the method comprises: obtaining video images, action data and action labels corresponding to the video images and action data; performing network training on a two-stream convolutional neural network based on the video images and the corresponding action labels to obtain a network model and a prediction result; training a classifier based on the action data and the corresponding action labels to obtain a classification model and a classification result; merging the network model and the classification model to obtain a local recognition model, and obtaining a local recognition result based on the prediction result and the classification result; uploading the local recognition model and the local recognition result for joint learning to obtain a learning parameter; receiving the learning parameter, and updating the local recognition model based on the learning parameter. It is used to improve the recognition accuracy of the trained action recognition model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence, and in particular to a motion recognition model training method, motion training method, device, equipment and storage medium. Background Art

[0002] Human interaction and collaboration, intelligent care, smart monitoring, and motion analysis all require the recognition of human motion to determine their behavior. However, traditional motion recognition methods mostly use computer image processing to extract motion trajectories and human features from video frames, then train a classifier to identify human motion. This results in low accuracy and slow recognition speed. Furthermore, motion recognition models built using methods such as convolutional neural networks suffer from limited training due to the limited number of samples, resulting in suboptimal training results and, consequently, low recognition accuracy.

[0003] Therefore, how to improve the recognition accuracy of the trained action recognition model becomes an urgent problem to be solved. Summary of the Invention

[0004] The present application provides a motion recognition model training method, motion training method, device, equipment and storage medium to improve the recognition accuracy of the trained motion recognition model.

[0005] In a first aspect, the present application provides a method for training an action recognition model, the method comprising:

[0006] Obtain video images, action data, and action labels corresponding to the video images and action data; perform network training on a two-stream convolutional neural network based on the video images and the corresponding action labels to obtain a trained network model and prediction results; train a pre-configured classifier based on the action data and the corresponding action labels to obtain a trained classification model and classification results; merge the trained network model and the trained classification model to obtain a local recognition model, and obtain a local recognition result based on the prediction result and the classification result; upload the model parameters of the local recognition model and the local recognition result to a cloud server for joint learning to obtain learning parameters; receive the learning parameters sent by the cloud server, and update the local recognition model according to the learning parameters, and use the updated local recognition model as the trained action recognition model.

[0007] In a second aspect, the present application further provides a method for action recognition, the method comprising:

[0008] Obtain an image to be recognized and motion data corresponding to the image to be recognized; input the image to be recognized and the motion data into a pre-trained action recognition model for action recognition to obtain a recognition result; wherein the pre-trained action recognition model is trained using the above-mentioned action recognition model training method.

[0009] In a third aspect, the present application further provides a motion recognition model training device, the device comprising:

[0010] A sample acquisition module is used to obtain video images, action data and action labels corresponding to the video images and action data; a network training module is used to perform network training on a two-stream convolutional neural network based on the video images and the corresponding action labels to obtain a trained network model and prediction results; a classification training module is used to train a pre-configured classifier based on the action data and the corresponding action labels to obtain a trained classification model and classification results; a model merging module is used to merge the trained network model and the trained classification model to obtain a local recognition model, and to obtain a local recognition result based on the prediction result and the classification result; a joint learning module is used to upload the model parameters of the local recognition model and the local recognition result to a cloud server for joint learning to obtain learning parameters; a model updating module is used to receive the learning parameters sent by the cloud server, and to update the local recognition model according to the learning parameters, and to use the updated local recognition model as the trained action recognition model.

[0011] In a fourth aspect, the present application further provides a motion recognition device, comprising:

[0012] A data acquisition module is used to obtain the image to be identified and the motion data corresponding to the image to be identified; an action recognition module is used to input the image to be identified and the motion data into a pre-trained action recognition model for action recognition to obtain a recognition result; wherein the pre-trained action recognition model is trained using the above-mentioned action recognition model training method.

[0013] In a fifth aspect, the present application also provides a computer device, which includes a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement the above-mentioned action recognition model training method and the above-mentioned action recognition method when executing the computer program.

[0014] In a sixth aspect, the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor implements the above-mentioned action recognition model training method and the above-mentioned action recognition method.

[0015] The present application discloses a method for training an action recognition model, an action training method, an apparatus, a device, and a storage medium. The method comprises the following steps: obtaining a video image, action data, and action labels corresponding to the video image and action data, and then training a two-stream convolutional neural network based on the video image and the corresponding action label to obtain a trained network model and a prediction result. At the same time, a pre-configured classifier is trained based on the action data and the corresponding action label to obtain a trained classification model and a classification result. The trained network model and the trained classification model are then merged to obtain a local recognition model. A local recognition result is obtained based on the prediction result and the classification result. The model parameters of the local recognition model and the local recognition result are uploaded to a cloud server for joint learning to obtain learning parameters. Finally, each participant receives the learning parameters sent by the cloud server and updates the local recognition model according to the learning parameters to complete the model training. Each participant performs model training locally to obtain its own local recognition model, and then uploads the local recognition model to the cloud server for joint learning, thereby expanding the number of samples when training the model and improving the recognition accuracy of the trained action recognition model. Moreover, since each participant performs model training locally, the training data is not interoperable, which also ensures the security and privacy of the data. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0017] Figure 1 This is a schematic flow chart of a method for training an action recognition model provided in an embodiment of the present application;

[0018] Figure 2 This is a schematic diagram of the network structure of the network model provided in the embodiment of the present application;

[0019] Figure 3 yes Figure 1 A flowchart illustrating the sub-steps of a method for training an action recognition model is provided;

[0020] Figure 4 This is an action recognition method provided by an embodiment of the present application;

[0021] Figure 5 The embodiment of the present application further provides a schematic block diagram of a motion recognition model training device;

[0022] Figure 6 The embodiment of the present application further provides a schematic block diagram of a motion recognition device;

[0023] Figure 7 This is a schematic block diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0024] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0025] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, combined, or partially merged, so the actual execution order may vary depending on the actual situation.

[0026] It should be understood that the terms used in this specification are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in this specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms unless the context clearly indicates otherwise.

[0027] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0028] The embodiments of the present application provide a method, apparatus, computer device, and storage medium for training an action recognition model. The action recognition model training method can be used to train an action recognition model to recognize human actions, thereby improving the recognition accuracy of the trained action recognition model and thereby improving the accuracy of action recognition.

[0029] The following describes some embodiments of the present application in detail with reference to the accompanying drawings. In the absence of conflict, the following embodiments and features therein may be combined with each other.

[0030] See also Figure 1 , Figure 1 This is a schematic flow chart of a method for training an action recognition model provided in an embodiment of the present application. This method can be applied to various participants, namely, each local client. By jointly training sample data from multiple participants, this method enriches the sample size and improves the recognition accuracy of the trained action recognition model.

[0031] like Figure 1 As shown, the action recognition model training method specifically includes: steps S101 to S106.

[0032] S101: Obtain video images, action data, and action tags corresponding to the video images and action data.

[0033] Since the action recognition model includes two parts, namely a network model and a classification model, the video image, action data and action labels corresponding to the video image and action data can be obtained to train the network model and the classification model respectively.

[0034] A user wearing a smart wearable device performs an action, which is then captured and recorded as a video image. The gyroscope and accelerometer onboard the smart wearable device collect the user's motion data during the exercise. The user's action becomes the action label corresponding to the video image and motion data.

[0035] Among them, video images, action data and corresponding action labels are all local data of each participant. That is, each participant trains the model based on local data and does not need to share data with other participants, thereby improving data security and reliability.

[0036] S102: Perform network training on a two-stream convolutional neural network based on the video image and the corresponding action label to obtain a trained network model and prediction results.

[0037] The two-stream convolutional neural network model is trained according to the video images and the corresponding action labels to obtain the network model.

[0038] like Figure 2 Figure 1 is a schematic diagram of the network structure of the network model. The network model includes a spatial stream convolutional network and a temporal stream convolutional network. The spatial stream convolutional network and the temporal stream convolutional network respectively include several convolutional layers, fully connected layers and softmax layers.

[0039] In some embodiments, as Figure 3 As shown, step S102 specifically includes steps S1021 to S1024.

[0040] S1021. Extract an optical flow image corresponding to the video image based on the video image.

[0041] When extracting the corresponding optical flow image from a video image, you can use OpenCV to process a frame in the video image to obtain the key points, and then perform gradient calculations on adjacent frames of the video image to obtain the pixel movement information of the key points, which is the optical flow. The frame and the subsequent frames are superimposed into an optical flow stack, which is the optical flow image.

[0042] S1022: Use the video image and the corresponding action label to train the spatial stream convolutional network in the two-stream convolutional neural network and obtain a spatial prediction result.

[0043] The video image and the corresponding action label are fed into the spatial stream convolutional network within the two-stream convolutional neural network for training to obtain spatial prediction results. In the specific implementation, each frame of the video image terminal is fed into the spatial stream convolutional network for training. The loss between the spatial prediction result and the corresponding action label is then calculated. When the loss value reaches a preset condition, the spatial stream convolutional network training is considered complete, and the spatial prediction result is obtained.

[0044] In one embodiment, the temporal stream convolutional network may use L2 regularization to supervise the loss and prevent overfitting.

[0045] Among them, the objective function expression using L2 regularization is:

[0046]

[0047] Among them, L represents the loss function with regularization, J(θ) represents the loss function, θ represents all parameters in the convolutional neural network, and λ represents the regularization coefficient. It refers to the sum of the squares of the weights, i represents the action number of each identified action, and k represents the total number of identified actions. The regularization coefficient can be determined according to the actual situation.

[0048] After obtaining the output of the fully connected layer, the softmax layer converts the data based on the output value of the fully connected layer so that the final output spatial prediction result is the probability that the video image is predicted to be a certain action.

[0049] Among them, the conversion formula of the softmax layer can be:

[0050]

[0051] Among them, V i is the output value of the fully connected layer, i represents any action category, N represents the total number of action categories, S i It represents the ratio of the exponential of the current output value of the fully connected layer to the sum of the exponentials of all output values ​​of the fully connected layer, that is, the probability of the output of the spatial stream convolutional network.

[0052] S1023. Use the optical flow image and the corresponding action label to train the time stream convolutional network in the two-stream convolutional neural network and obtain a time prediction result.

[0053] Since the optical flow image includes the motion state information between frames, the optical flow image and the corresponding action label are input into the time stream convolutional network in the two-stream convolutional neural network for training to obtain the time prediction result. Then, the loss between the time prediction result and the corresponding action label is calculated. When the loss value reaches the preset condition, the training of the time stream convolutional network is considered to be completed, and the time prediction result is obtained.

[0054] In one embodiment, the temporal stream convolutional network may use L2 regularization to supervise the loss and prevent overfitting.

[0055] Among them, the objective function expression using L2 regularization is:

[0056]

[0057] Among them, L represents the loss function with regularization, J(θ) represents the loss function, θ represents all parameters in the convolutional neural network, and λ represents the regularization coefficient. It refers to the sum of the squares of the weights, i represents the action number of each identified action, and k represents the total number of identified actions. The regularization coefficient can be determined according to the actual situation.

[0058] After obtaining the output of the fully connected layer, the softmax layer converts the data based on the output value of the fully connected layer so that the final output time prediction result is the probability that the optical flow image is predicted as a certain action.

[0059] Among them, the conversion formula of the softmax layer can be:

[0060]

[0061] Among them, V i is the output value of the fully connected layer, i represents any action category, N represents the total number of action categories, S i It represents the ratio of the exponential of the current output value of the fully connected layer to the sum of the exponentials of all output values ​​of the fully connected layer, that is, the probability of the output of the time stream convolutional network.

[0062] S1024: Aggregate the spatial prediction result and the temporal prediction result to obtain a prediction result.

[0063] After the spatial stream convolutional network outputs the spatial prediction result and the temporal stream convolutional network outputs the temporal prediction structure, the temporal prediction result and the spatial prediction result can be aggregated to obtain the prediction result P A ={a1:pa1 ;a2:p a2 ……a n :p an}, where a1, a2, ... a n Represents the action label, p a1 、p a2 ...p an Represents the probability of predicting the corresponding human action. Among them, the direct averaging method can be used to take the average value for aggregation, or the SVM method can be used for aggregation.

[0064] S103 : Training a pre-configured classifier based on the action data and the corresponding action labels to obtain a trained classification model and classification results.

[0065] Motion data includes three-axis angular velocity data collected by the gyroscope sensor and three-axis acceleration data collected by the acceleration sensor in the smart wearable device when the user performs the corresponding action.

[0066] The mean, variance and root mean square of the three-axis angular velocity data and the three-axis acceleration data are calculated respectively, and a feature matrix is ​​formed. Then the feature matrix and the corresponding action label are input into the pre-configured classifier for action classification, and the trained classification model and classification result P are obtained. B ={b1:p b1 ;b2:p b2 ...b n :p bn}, where b1, b2, ... b n Represents the human action label, p b1 、p b2 ...p bn Represents the probability of the prediction being the corresponding human action. The pre-configured classifier can be a support vector machine.

[0067] S104: merging the trained network model and the trained classification model to obtain a local recognition model, and obtaining a local recognition result according to the prediction result and the classification result.

[0068] Since the local recognition model consists of a network model and a classification model, each participant will merge the trained network model and the trained classification model to obtain the local recognition model. After obtaining the local recognition model, the local recognition result is obtained based on the prediction result and the classification result.

[0069] In one embodiment, obtaining a local recognition result according to the prediction result and the classification result includes: obtaining a local recognition result according to the prediction result and the classification result based on a weight calculation formula.

[0070] Since the local recognition model includes two parts, the network model and the classification model, the local recognition model can calculate the prediction results of the network model and the classification results of the classification model according to the pre-set weight coefficients, thereby obtaining the final local recognition results.

[0071] The weight calculation formula includes:

[0072] R=λ1P a +λ2P b

[0073] Among them, R represents the local recognition result, P a Indicates the result with the highest probability in the prediction results, and λ1 indicates the result with the highest probability P a The weight coefficient, P b Indicates the result with the highest probability in the classification results, and λ2 indicates the result with the highest probability P b The weight coefficient of .

[0074] S105 : Uploading the model parameters of the local recognition model and the local recognition result to a cloud server for joint learning to obtain learning parameters.

[0075] After each participant obtains the local recognition model locally, the model parameters of the local recognition model and the local recognition results of the local recognition model are uploaded to the cloud server, and the cloud server performs joint learning based on the received information to obtain the learning parameters.

[0076] In the specific implementation process, the cloud server can use the global averaging method for joint learning to obtain the learning parameters, that is, calculate the average values ​​of the model parameters in the local recognition model respectively, and then lower the parameter weights of some model parameters that differ too much from the average value to obtain the learning parameters.

[0077] In one embodiment, uploading the model parameters of the local recognition model and the local recognition results to the cloud server for joint learning includes: encrypting the model parameters of the local recognition model and the local recognition results to obtain encrypted data; and uploading the encrypted data to the cloud server for joint learning.

[0078] Each participant encrypts the data to be uploaded, obtains the encrypted data, and then uploads the encrypted data to the cloud server. After receiving the encrypted data, the cloud server decrypts the encrypted data and then conducts joint learning based on this data to reduce data leakage during transmission and improve data security.

[0079] When encrypting data, privacy-preserving computing methods such as homomorphic encryption, differential privacy, or multi-party secure computation can be used. It should be noted that when homomorphic encryption is used, the cloud server can perform joint learning directly on the encrypted data without decrypting it.

[0080] In one embodiment, before step S104, the method includes: uploading the trained network model and the prediction result to the cloud server for joint learning to obtain a joint network model; receiving the joint network model sent by the cloud server, and using the joint network model as the trained network model; and / or uploading the trained classification model and the classification result to the cloud server for joint learning to obtain a joint classification model; receiving the joint classification model sent by the cloud server, and using the joint classification model as the trained classification model.

[0081] After each participant completes the training of the local network model, the model parameters and prediction results of the local trained network model can be uploaded to the cloud server, so that the cloud server can perform joint learning based on the model parameters and prediction results of the trained network model uploaded by each participant to obtain a joint network model.

[0082] The joint network model is used as the trained network model. That is, after the cloud server obtains the joint network model, it sends the parameters of the joint network model to each participant. Each participant receives the model parameters of the joint network model and updates the local trained network model according to the model parameters of the joint network model. The updated network model is then used as the trained network model.

[0083] Similarly, after each participant completes the training of the local classification model, the model parameters and classification results of the local trained classification model can be uploaded to the cloud server, so that the cloud server can perform joint learning based on the model parameters and classification results of the trained classification model uploaded by each participant to obtain a joint classification model.

[0084] The joint classification model is used as the trained classification model. That is, after the cloud server obtains the joint classification model, the parameters of the joint classification model are sent to each participant. Each participant receives the model parameters of the joint classification model and updates the local trained classification model according to the model parameters of the joint classification model. The updated classification model is then used as the trained classification model.

[0085] That is, in the training method of the action recognition model, at most three different joint learnings can be performed, and the three different joint learnings refer to the joint learning of the locally trained network model, the joint learning of the locally trained classification model, and the joint learning of the local recognition model.

[0086] S106: Receive the learning parameters sent by the cloud server, update the local recognition model according to the learning parameters, and use the updated local recognition model as the trained action recognition model.

[0087] Each participant receives the learning parameters sent by the cloud server, and updates the local recognition model according to the learning parameters, and uses the updated local recognition model as the trained action recognition model to complete the training of the action recognition model.

[0088] The motion recognition model training method provided in the above embodiment obtains video images, motion data, and motion labels corresponding to the video images and motion data, then performs network training on a two-stream convolutional neural network based on the video images and corresponding motion labels to obtain a trained network model and prediction results. Simultaneously, a pre-configured classifier is trained based on the motion data and corresponding motion labels to obtain a trained classification model and classification results. The trained network model and the trained classification model are then merged to obtain a local recognition model. Local recognition results are obtained based on the prediction results and classification results. The model parameters and local recognition results of the local recognition model are uploaded to a cloud server for joint learning to obtain learning parameters. Finally, each participant receives the learning parameters sent by the cloud server and updates the local recognition model based on the learning parameters to complete model training. Each participant performs model training locally to obtain their own local recognition model, which is then uploaded to the cloud server for joint learning. This increases the number of samples used in model training and improves the recognition accuracy of the trained motion recognition model. Furthermore, since each participant performs model training locally, the training data is not shared, ensuring data security and privacy.

[0089] See also Figure 4 , Figure 4 This is an action recognition method provided by an embodiment of the present application.

[0090] like Figure 4 As shown, the action recognition model training method specifically includes: step S201 and step S202.

[0091] S201: Acquire an image to be recognized and motion data corresponding to the image to be recognized.

[0092] When recognizing an action of a user wearing a wearable device, an image to be recognized and action data corresponding to the image to be recognized when the user performs the action can be obtained.

[0093] Among them, motion data includes three-axis angular velocity data collected by the gyroscope sensor and three-axis acceleration data collected by the acceleration sensor in the smart wearable device when the user performs the corresponding action.

[0094] S202: Input the image to be recognized and the motion data into a pre-trained motion recognition model to perform motion recognition and obtain a recognition result.

[0095] The pre-trained action recognition model refers to a model trained according to the aforementioned action recognition model training method.

[0096] Since the pre-trained action recognition model includes a network model and a prediction model, the image to be recognized is input into the network model, which then predicts the action based on the image to be recognized and obtains the prediction result. The motion data is input into the classification model, which then classifies the action based on the motion data and obtains the classification result.

[0097] Then, according to the weight coefficients configured in the action recognition model, the prediction results obtained by the network model and the classification results obtained by the classification model are calculated according to the corresponding weight coefficients, and finally a certain recognition result is obtained, the action recognition is completed, and the recognition result is output.

[0098] It should be noted that if there is only an image to be recognized or only motion data, the image to be recognized or the motion data can also be input into a pre-trained motion recognition model for motion recognition.

[0099] The above-described embodiment provides a method for action recognition. This method obtains an image to be recognized and motion data corresponding to the image, then inputs the image and motion data into a pre-trained action recognition model to perform action recognition, obtaining a recognition result and completing action recognition. Action recognition is performed based on both the image to be recognized and the motion data, and the recognition results are combined to improve the accuracy of action recognition.

[0100] See also Figure 5 , Figure 5 The embodiment of the present application further provides a schematic block diagram of a motion recognition model training device, which is used to execute the aforementioned motion recognition model training method. The motion recognition model training device can be configured in a server or a terminal.

[0101] The server may be an independent server or a server cluster. The terminal may be an electronic device such as a mobile phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, or a wearable device.

[0102] like Figure 5 As shown, the action recognition model training device 300 includes: a sample acquisition module 301, a network training module 302, a classification training module 303, a model merging module 304, a joint learning module 305 and a model updating module 306.

[0103] The sample acquisition module 301 is used to acquire video images, action data, and action labels corresponding to the video images and action data.

[0104] The network training module 302 is used to perform network training on the two-stream convolutional neural network based on the video image and the corresponding action label to obtain a trained network model and prediction results.

[0105] The network training module 302 includes an optical flow extraction submodule 3021 , a spatial training submodule 3022 , a temporal training submodule 3023 and a result aggregation submodule 3024 .

[0106] Specifically, the optical flow extraction submodule 3021 is used to extract an optical flow image corresponding to the video image based on the video image. The spatial training submodule 3022 is used to train the spatial stream convolutional network in the two-stream convolutional neural network using the video image and the corresponding action label, and obtain a spatial prediction result. The temporal training submodule 3023 is used to train the temporal stream convolutional network in the two-stream convolutional neural network using the optical flow image and the corresponding action label, and obtain a temporal prediction result. The result aggregation submodule 3024 is used to aggregate the spatial prediction result and the temporal prediction result to obtain a prediction result.

[0107] The classification training module 303 is used to train a pre-configured classifier based on the action data and the corresponding action labels to obtain a trained classification model and classification results.

[0108] The model merging module 304 is used to merge the trained network model and the trained classification model to obtain a local recognition model, and to obtain a local recognition result according to the prediction result and the classification result.

[0109] The joint learning module 305 is used to upload the model parameters of the local recognition model and the local recognition results to the cloud server for joint learning to obtain learning parameters.

[0110] The model updating module 306 is configured to receive the learning parameters sent by the cloud server, update the local recognition model according to the learning parameters, and use the updated local recognition model as the trained action recognition model.

[0111] It should be noted that those skilled in the art can clearly understand that, for the sake of convenience and brevity of description, the specific working processes of the action recognition model training device and each module described above can refer to the corresponding processes in the aforementioned action recognition model training method embodiment, and will not be repeated here.

[0112] See also Figure 6 , Figure 6 The embodiment of the present application further provides a schematic block diagram of a motion recognition device, which is used to perform the aforementioned motion recognition method. The motion recognition device can be configured in a server or a terminal.

[0113] The server may be an independent server or a server cluster. The terminal may be an electronic device such as a mobile phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, or a wearable device.

[0114] like Figure 6 As shown, the motion recognition device 400 includes: a data acquisition module 401 and a motion recognition module 402 .

[0115] The data acquisition module 401 is used to acquire an image to be recognized and motion data corresponding to the image to be recognized.

[0116] The action recognition module 402 is used to input the image to be recognized and the motion data into a pre-trained action recognition model to perform action recognition and obtain a recognition result; wherein the pre-trained action recognition model is trained according to the above-mentioned action recognition model training method.

[0117] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the action recognition device and each module described above can refer to the corresponding processes in the aforementioned action recognition method embodiment, and will not be repeated here.

[0118] The above-mentioned action recognition model training device and action recognition device can be implemented in the form of a computer program. The computer program can be used in Figure 7 Runs on the computer device shown.

[0119] See also Figure 7 , Figure 7 This is a schematic block diagram of the structure of a computer device provided in an embodiment of the present application. The computer device may be a server or a terminal.

[0120] See Figure 7 The computer device includes a processor, a memory, and a network interface connected through a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.

[0121] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, which, when executed, can cause the processor to execute any one of the action recognition model training methods or action recognition methods.

[0122] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.

[0123] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any action recognition model training method or action recognition method.

[0124] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0125] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.

[0126] In one embodiment, the processor is configured to execute a computer program stored in a memory to implement the following steps when implementing the action recognition model training method:

[0127] Obtain video images, action data, and action labels corresponding to the video images and action data; perform network training on a two-stream convolutional neural network based on the video images and the corresponding action labels to obtain a trained network model and prediction results; train a pre-configured classifier based on the action data and the corresponding action labels to obtain a trained classification model and classification results; merge the trained network model and the trained classification model to obtain a local recognition model, and obtain a local recognition result based on the prediction result and the classification result; upload the model parameters of the local recognition model and the local recognition result to a cloud server for joint learning to obtain learning parameters; receive the learning parameters sent by the cloud server, and update the local recognition model according to the learning parameters, and use the updated local recognition model as the trained action recognition model.

[0128] In one embodiment, when the processor implements the network training of the two-stream convolutional neural network based on the video image and the corresponding action label to obtain the trained network model and prediction results, it is used to implement: extracting the optical flow image corresponding to the video image according to the video image; using the video image and the corresponding action label to train the spatial stream convolutional network in the two-stream convolutional neural network and obtain a spatial prediction result; using the optical flow image and the corresponding action label to train the temporal stream convolutional network in the two-stream convolutional neural network and obtain a temporal prediction result; aggregating the spatial prediction result and the temporal prediction result to obtain a prediction result.

[0129] In one embodiment, when the processor implements obtaining the local recognition result based on the prediction result and the classification result, it is configured to implement: obtaining the local recognition result based on the prediction result and the classification result based on a weight calculation formula; the weight calculation formula includes:

[0130] R=λ1P a +2P b

[0131] Among them, R represents the local recognition result, P a Indicates the result with the highest probability in the prediction results, and λ1 indicates the result with the highest probability P a The weight coefficient, P b Indicates the result with the highest probability in the classification results, and λ2 indicates the result with the highest probability P b The weight coefficient of .

[0132] In one embodiment, when the processor implements uploading the model parameters of the local recognition model and the local recognition results to the cloud server for joint learning, it is used to implement: encrypting the model parameters of the local recognition model and the local recognition results to obtain encrypted data; and uploading the encrypted data to the cloud server for joint learning.

[0133] In one embodiment, before implementing the uploading of the model parameters of the local recognition model and the local recognition results to the cloud server for joint learning, the processor is used to implement: uploading the trained network model and the prediction results to the cloud server for joint learning to obtain a joint network model; receiving the joint network model sent by the cloud server, and using the joint network model as the trained network model; and / or uploading the trained classification model and the classification results to the cloud server for joint learning to obtain a joint classification model; receiving the joint classification model sent by the cloud server, and using the joint classification model as the trained classification model.

[0134] In one embodiment, the processor is configured to execute a computer program stored in a memory to implement the following steps when implementing the action recognition method:

[0135] Obtain an image to be recognized and motion data corresponding to the image to be recognized; input the image to be recognized and the motion data into a pre-trained action recognition model for action recognition to obtain a recognition result; wherein the pre-trained action recognition model is trained according to the above-mentioned action recognition model training method.

[0136] A computer-readable storage medium is also provided in an embodiment of the present application, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and the processor executes the program instructions to implement any action recognition model training method provided in the embodiment of the present application.

[0137] The computer-readable storage medium may be an internal storage unit of the computer device described in the aforementioned embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a SmartMedia Card (SMC), a Secure Digital (SD) card, a flash memory card, etc., equipped on the computer device.

[0138] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present application, and such modifications or substitutions should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A method for training an action recognition model, characterized in that: The method comprises: Acquire video images, action data, and action tags corresponding to the video images and action data; Based on the video image and the corresponding action label, the two-stream convolutional neural network is trained to obtain a trained network model and a prediction result; an optical flow image corresponding to the video image is extracted according to the video image; the spatial stream convolutional network in the two-stream convolutional neural network is trained using the video image and the corresponding action label to obtain a spatial prediction result; the temporal stream convolutional network in the two-stream convolutional neural network is trained using the optical flow image and the corresponding action label to obtain a temporal prediction result; the spatial prediction result and the temporal prediction result are aggregated to obtain a prediction result; A pre-configured classifier is trained based on the motion data and the corresponding motion labels to obtain a trained classification model and classification results; the motion data includes three-axis angular velocity data collected by a gyroscope sensor and three-axis acceleration data collected by an acceleration sensor in the smart wearable device when the user performs the corresponding action; the mean, variance and root mean square of the three-axis angular velocity data and the three-axis acceleration data are calculated respectively, and a feature matrix is ​​formed, and then the feature matrix and the corresponding motion label are input into the pre-configured classifier for motion classification to obtain a trained classification model and classification results; The trained network model and the trained classification model are combined to obtain a local recognition model, and a local recognition result is obtained according to the prediction result and the classification result; a local recognition result is obtained according to the prediction result and the classification result based on a weight calculation formula; the weight calculation formula includes: ; Where R represents the local recognition result, Indicates the result with the highest probability among the predicted results. Indicates the most likely outcome The weight coefficient of Indicates the result with the highest probability among the classification results. Indicates the most likely outcome The weight coefficient of Uploading the model parameters of the local recognition model and the local recognition results to the cloud server for joint learning to obtain learning parameters; Receive the learning parameters sent by the cloud server, update the local recognition model according to the learning parameters, and use the updated local recognition model as the trained action recognition model.

2. The action recognition model training method according to claim 1, characterized in that: The uploading of the model parameters of the local recognition model and the local recognition result to the cloud server for joint learning includes: Encrypting the model parameters of the local recognition model and the local recognition result to obtain encrypted data; The encrypted data is uploaded to a cloud server for joint learning.

3. The action recognition model training method according to claim 1, characterized in that: Before uploading the model parameters of the local recognition model and the local recognition results to the cloud server for joint learning, the method includes: Uploading the trained network model and prediction results to the cloud server for joint learning to obtain a joint network model; receiving the joint network model sent by the cloud server, and using the joint network model as the trained network model; and / or The trained classification model and classification results are uploaded to the cloud server for joint learning to obtain a joint classification model; the joint classification model sent by the cloud server is received, and the joint classification model is used as the trained classification model.

4. A method for motion recognition, characterized in that: include: Acquire an image to be identified and motion data corresponding to the image to be identified; Inputting the image to be recognized and the motion data into a pre-trained motion recognition model to perform motion recognition and obtain a recognition result; Wherein, the pre-trained action recognition model is trained according to the action recognition model training method according to any one of claims 1-3.

5. A motion recognition model training device, characterized in that: include: A sample acquisition module, used to acquire video images, action data and action labels corresponding to the video images and action data; A network training module is used to perform network training on a two-stream convolutional neural network based on the video image and the corresponding action label to obtain a trained network model and a prediction result; extract an optical flow image corresponding to the video image according to the video image; use the video image and the corresponding action label to train a spatial stream convolutional network in the two-stream convolutional neural network and obtain a spatial prediction result; use the optical flow image and the corresponding action label to train a temporal stream convolutional network in the two-stream convolutional neural network and obtain a temporal prediction result; Aggregating the spatial prediction result and the temporal prediction result to obtain a prediction result; A classification training module is used to train a pre-configured classifier based on the motion data and the corresponding motion labels to obtain a trained classification model and classification results; the motion data includes three-axis angular velocity data collected by a gyroscope sensor and three-axis acceleration data collected by an acceleration sensor in the smart wearable device when the user performs the corresponding action; the mean, variance and root mean square of the three-axis angular velocity data and the three-axis acceleration data are calculated respectively, and a feature matrix is ​​formed, and then the feature matrix and the corresponding motion label are input into a pre-configured classifier for motion classification to obtain a trained classification model and classification results; A model merging module, used to merge the trained network model and the trained classification model to obtain a local recognition model, and to obtain a local recognition result according to the prediction result and the classification result; Obtaining a local recognition result according to the prediction result and the classification result based on a weight calculation formula; The weight calculation formula includes: ; Where R represents the local recognition result, Indicates the result with the highest probability among the predicted results. Indicates the most likely outcome The weight coefficient of Indicates the result with the highest probability among the classification results. Indicates the most likely outcome The weight coefficient of A joint learning module, used for uploading the model parameters of the local recognition model and the local recognition results to the cloud server for joint learning to obtain learning parameters; The model updating module is used to receive the learning parameters sent by the cloud server, and update the local recognition model according to the learning parameters, and use the updated local recognition model as the trained action recognition model.

6. A motion recognition device, characterized in that: include: A data acquisition module, used to acquire an image to be identified and motion data corresponding to the image to be identified; An action recognition module is used to input the image to be recognized and the motion data into a pre-trained action recognition model to perform action recognition and obtain a recognition result; Wherein, the pre-trained action recognition model is trained according to the action recognition model training method according to any one of claims 1-3.

7. A computer device, characterized in that: The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is used to execute the computer program and implement the action recognition model training method as described in any one of claims 1 to 3 or the action recognition method as described in claim 4 when executing the computer program.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, enables the processor to implement the action recognition model training method according to any one of claims 1 to 3 or the action recognition method according to claim 4.

Citation Information

Patent Citations

  • Video human body behavior recognition method and system based on multi-mode double-flow 3D network

    CN110705463A

  • Human body recognition method and device, computer equipment and storage medium

    CN110781836A

  • Behavior recognition method and equipment based on double-flow convolutional neural network

    CN111199238A