Action feature acquisition method and device, electronic equipment and storage medium
By using the gradient information of the neural network model for feature selection, the problem of low feature extraction accuracy in the existing technology is solved, high-accuracy acquisition of action features is achieved, and the innovation and effectiveness in feature selection are demonstrated.
Patent Information
- Application Number
- CN202410700494.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2044-05-31
AI Technical Summary
Existing feature extraction methods extract features with low accuracy and fail to include more important features, resulting in inaccurate acquisition of action features.
The evaluation parameters of action features are determined through the gradient information of the trained neural network model, and feature selection is performed based on these parameters to select the most valuable features from a large number of action features.
It improves the accuracy of action feature acquisition, reduces the dependence on prior knowledge, can discover important features from features that are difficult to select with traditional methods, and improves the efficiency and accuracy of feature extraction.
Smart Images

Figure CN118675006A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of motion recognition technology, and in particular to a motion feature acquisition method, device, electronic equipment and storage medium. Background Art
[0002] Feature engineering includes feature extraction and feature selection. Feature extraction is to further extract features with certain physical or statistical significance from the original data or original features. These features are more abstract and can help with subsequent research and can more easily express the characteristics of the data. Feature selection, also known as feature subset selection, refers to selecting a small number of feature subsets from an existing feature set to make it have a smaller dimension and improve the performance of the algorithm.
[0003] The features extracted by the existing feature extraction methods generally include time domain features and frequency domain features. The time domain features are mostly features such as mean, variance, standard deviation, etc., and the frequency domain features are mostly extracted using Fourier transform or wavelet transform. The existing feature extraction methods only extract a subset of features and do not include more important features, and the extraction accuracy is not high. Summary of the invention
[0004] The present invention provides a feature extraction method to solve the defect of low extraction accuracy of feature extraction methods in the prior art. Evaluation parameters corresponding to action features are determined through gradient information of a trained neural network model, and feature selection is performed according to the evaluation parameters, thereby realizing the selection of the most valuable action features from a large number of action features, and improving the accuracy of action feature acquisition.
[0005] The present invention provides a method for acquiring action features, comprising the following steps: Acquire an initial feature set, wherein the initial feature set includes a plurality of action features related to the time series task; When the initial feature set is input into a trained neural network model, an evaluation parameter corresponding to each action feature in the initial feature set is determined according to gradient information of the trained neural network model, wherein the evaluation parameter is used to indicate the importance of the action feature, and the trained neural network model is trained using a preset feature set, and the preset feature set includes a plurality of action features; Feature selection is performed according to the evaluation parameters corresponding to each action feature to obtain a target feature subset, wherein the number of action features included in the target feature subset is less than the number of action features included in the initial feature set.
[0006] According to a feature extraction method provided by the present invention, determining the evaluation parameter corresponding to each action feature in the initial feature set according to the gradient information of the trained neural network model includes: Obtaining gradient information corresponding to each action feature, where the gradient information corresponding to each action feature is the gradient information of the loss function of the trained neural network model with respect to each input action feature; An evaluation parameter corresponding to each action feature is determined according to the gradient information corresponding to each action feature and the gradient information corresponding to all action features in the initial feature set.
[0007] According to a feature extraction method provided by the present invention, the gradient information corresponding to each action feature includes the gradient absolute value corresponding to each action feature, and the evaluation parameter corresponding to each action feature is determined according to the gradient information corresponding to each action feature and the gradient information corresponding to all action features in the initial feature set, including: calculating the proportion of the gradient absolute value corresponding to each action feature in the gradient absolute values corresponding to all action features to obtain the weight corresponding to each action feature, and the weight corresponding to each action feature is the evaluation parameter corresponding to each action feature; The step of performing feature selection according to the evaluation parameters corresponding to each action feature to obtain a target feature subset includes: determining the target feature subset according to the size of the weight corresponding to each action feature.
[0008] According to a feature extraction method provided by the present invention, before performing feature selection according to the evaluation parameters corresponding to each action feature to obtain a target feature subset, the method further includes: Obtaining a parameter threshold corresponding to the evaluation parameter; The feature selection is performed according to the evaluation parameters corresponding to each action feature to obtain a target feature subset, including: obtaining the target feature subset according to the evaluation parameters corresponding to each action feature and a parameter threshold corresponding to the evaluation parameters, wherein the parameter value indicated by the evaluation parameters corresponding to each action feature included in the target feature subset is greater than the parameter threshold.
[0009] According to a feature extraction method provided by the present invention, before determining the evaluation parameter corresponding to each action feature in the initial feature set based on the gradient information of the trained neural network model, the method also includes: determining the trained neural network model and / or the preset feature set based on the target evaluation result, and the target evaluation result is obtained by performing classification accuracy evaluation on the candidate feature subset obtained from the previous round of feature selection.
[0010] According to a feature extraction method provided by the present invention, determining the trained neural network model and / or the preset feature set according to the target evaluation result includes: If the ability to distinguish feature categories indicated by the classification accuracy is lower than the ability parameter threshold, then replacing the trained neural network, or retraining the trained neural network, or replacing the preset feature set; If the ability to distinguish feature categories indicated by the classification accuracy is greater than or equal to the ability parameter threshold, and the number of action features included in the candidate feature subset is greater than the number threshold, the candidate feature subset is determined to be a preset feature set.
[0011] According to a feature extraction method provided by the present invention, the action features included in the preset feature set are part or all of the action features in the initial feature set.
[0012] According to a feature extraction method provided by the present invention, the obtaining of an initial feature set includes: Acquire a motion data set, wherein the motion data set includes motion data collected by an accelerometer; A time series data feature extraction tool is used to extract features from the action data set to obtain the initial feature set.
[0013] The present invention also provides an action feature acquisition device, comprising the following modules: An initial feature acquisition module, used to acquire an initial feature set, wherein the initial feature set includes a plurality of action features related to the time series task; An evaluation parameter acquisition module, used for determining, when the initial feature set is input into a trained neural network model, an evaluation parameter corresponding to each action feature in the initial feature set according to gradient information of the trained neural network model, wherein the evaluation parameter is used to indicate the importance of the action feature, and the trained neural network model is trained using a preset feature set, and the preset feature set includes a plurality of action features; A feature acquisition module is selected to perform feature selection according to the evaluation parameters corresponding to each action feature to obtain a target feature subset, wherein the number of action features included in the target feature subset is less than the number of action features included in the initial feature set.
[0014] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of any of the above-mentioned motion feature acquisition methods are implemented.
[0015] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of any of the above-mentioned motion feature acquisition methods are implemented.
[0016] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the steps of any of the above-mentioned motion feature acquisition methods are implemented.
[0017] The motion feature acquisition method, device, electronic device and storage medium provided by the present invention determine the evaluation parameters corresponding to the motion features based on the gradient information of the trained neural network model, perform feature selection according to the evaluation parameters, thereby realizing the selection of the most valuable motion features from a large number of motion features and improving the accuracy of motion feature acquisition. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 This is one of the flow charts of the action feature acquisition method provided by the present invention.
[0020] Figure 2 This is one of the flow charts of the method for obtaining evaluation parameters provided by the present invention.
[0021] Figure 3 This is the second flow chart of the method for obtaining evaluation parameters provided by the present invention.
[0022] Figure 4 The second flowchart of the method for acquiring action features provided by the present invention.
[0023] Figure 5 This is the third flow chart of the action feature acquisition method provided by the present invention.
[0024] Figure 6 It is a scene schematic diagram of the action feature acquisition method provided by the present invention.
[0025] Figure 7 It is a structural schematic diagram of the action feature acquisition device provided by the present invention.
[0026] Figure 8 It is a schematic diagram of the physical structure of the electronic device adopted by the present invention. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0028] Feature engineering includes feature extraction and feature selection. Feature extraction is to further extract features with certain physical or statistical significance from the original data or original features. These features are more abstract and can help with subsequent research and can more easily express the characteristics of the data. Feature selection, also known as feature subset selection, refers to selecting a small number of feature subsets from an existing feature set to make it have a smaller dimension and improve the performance of the algorithm.
[0029] The features extracted by the existing feature extraction methods generally include time domain features and frequency domain features. The time domain features are mostly features such as mean, variance, standard deviation, etc., and the frequency domain features are mostly extracted using Fourier transform or wavelet transform. The existing feature extraction methods only extract a subset of features and do not include more important features, and the extraction accuracy is not high.
[0030] In view of this, an embodiment of the present invention provides a method for acquiring action features, including acquiring an initial feature set, wherein the initial feature set includes multiple action features related to a time series task; when the initial feature set is input into a trained neural network model, an evaluation parameter corresponding to each action feature in the initial feature set is determined according to the gradient information of the trained neural network model; and feature selection is performed according to the evaluation parameter corresponding to each action feature to obtain a target feature subset. The method can select the most valuable features from a large number of action features, thereby improving the accuracy of action feature acquisition.
[0031] The technical solutions in the embodiments of the present invention will be described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0032] Figure 1 FIG. 1 is one of the flow charts of the method for acquiring action features provided by the present invention. Figure 1 As shown, the method includes the following steps 101 to 103.
[0033] Step 101: Acquire an initial feature set, where the initial feature set includes a plurality of action features related to a time series task.
[0034] It should be noted that the initial feature set includes a large number of action features, which may be features related to the time series task obtained through feature extraction, or may be features related to the time series task sent by other devices. The present invention does not limit the method of obtaining the initial feature set. Among them, the multiple action features related to the time series task refer to specific data attributes or metrics that need to be considered or utilized when performing time series analysis or prediction. These features can directly serve to solve specific tasks such as time series prediction, classification, and clustering. Exemplarily, the features in the initial feature set can be features obtained after feature extraction based on the time series task.
[0035] Step 102: When the initial feature set is input into the trained neural network model, an evaluation parameter corresponding to each action feature in the initial feature set is determined according to the gradient information of the trained neural network model, and the evaluation parameter is used to indicate the importance of the action feature. The trained neural network model is trained using a preset feature set, and the preset feature set includes multiple action features.
[0036] It should be noted that, since the neural network is optimized by the gradient descent algorithm, its feature extraction and selection capabilities are also improved with the optimization process of gradient descent. The solution of the present invention analyzes the gradient information of the neural network model to understand the evaluation parameters of the neural network model for different input features, that is, to determine the importance of the action features, so as to understand which input information the neural network model attaches more importance to during the classification process. If these input information themselves are some features, such as mean, variance, Fourier coefficient, wavelet coefficient, etc., then this method can explore which input features the neural network attaches more importance to, and which input features are considered relatively unimportant, that is, the neural network can be used to perform feature selection on the input features. This analysis method can also be called attribution technology.
[0037] Among them, there are many ways to determine the evaluation parameters corresponding to each action feature in the initial feature set according to the gradient information of the trained neural network model. For example, the weight of the feature can be determined according to the gradient information, or the feature coefficient can be determined according to the gradient information. The present invention does not limit the way to determine the evaluation parameters corresponding to each action feature in the initial feature set according to the gradient information of the trained neural network model. Among them, the trained neural network model can be trained by a preset feature set, and the preset feature set can include multiple action features. The features in the preset feature set can be a large number of related features extracted manually, or they can be features in the initial feature set, etc. The present invention has no limitation on the content of the action features included in the preset feature set.
[0038] In some embodiments, the action features included in the preset feature set may be part or all of the action features in the initial feature set.
[0039] It should be noted that since the purpose of the present invention is to perform feature selection on the initial feature set, the initial neural network model is trained by part or all of the features of the initial feature set to obtain a trained neural network model, and then feature selection is performed on the features of the initial feature set to obtain more important or more valuable features.
[0040] Step 103: performing feature selection according to the evaluation parameters corresponding to each action feature to obtain a target feature subset, wherein the number of action features included in the target feature subset is less than the number of action features included in the initial feature set.
[0041] It should be noted that there are many ways to perform feature selection based on the evaluation parameters corresponding to each action feature, such as comparing the size of the evaluation parameters, or determining the target feature subset based on the relationship between the evaluation parameters and the threshold, etc. The present invention does not limit the method of performing feature selection based on the evaluation parameters corresponding to each action feature to obtain the target feature subset. It is understandable that after feature selection, the number of action features included in the target feature subset is less than the number of action features included in the initial feature set.
[0042] The method provided by the embodiment of the present invention uses the trained neural network model to obtain the evaluation parameters of the action features from the gradient information of each feature, and then performs feature selection based on the evaluation parameters. This can minimize the substitution of prior knowledge for feature selection, and use the neural network to analyze which features are more important to the task objectives to select features. This method uses the complexity of the neural network to explore the cause through the results, and can discover features whose causal relationships were previously unknown in the prior knowledge. It achieves the selection of the most valuable features from a large number of features, and improves the accuracy of action feature acquisition. In addition, for a large number of features, traditional feature selection methods are difficult to carry out. The method for feature selection for time series tasks based on a neural network model proposed in the present invention has obvious advantages.
[0043] It is understandable that the neural network model extracts and selects features of the input data through multiple hidden layers in the middle. However, since the deep neural network is driven by a large amount of data and optimizes the model through back propagation, it is not good in terms of interpretability. Therefore, it is currently difficult to understand the specific feature extraction mechanism of the neural network model during the recognition process. And the features extracted by the neural network often do not have actual statistical or physical significance. Although these features are usually better than manually extracted features in completing subsequent tasks when the amount of data matches the complexity of the model, humans cannot understand the specific meaning of these features. Therefore, the present invention does not directly use feature selection through the neural network model.
[0044] In some embodiments, the initial feature set may be extracted from a dataset.
[0045] In an embodiment of the present invention, obtaining the initial feature set may include: obtaining a motion data set, wherein the motion data set includes motion data collected by an accelerometer; and extracting features from the motion data set using a time series data feature extraction tool to obtain the initial feature set.
[0046] It should be noted that the action data set may be action data collected by an accelerometer, and the present invention may use a time series data feature extraction tool to extract features from the action data set to obtain the initial feature set. The time series data feature extraction tool may include tools such as tsfresh.
[0047] Exemplarily, the present invention can use tsfresh to perform feature extraction, thereby obtaining a large number of features related to time series tasks, and then further select them. Among them, tsfresh is a computer programming language Python library for feature extraction, which is particularly suitable for time series data. Compared with traditional feature extraction methods, more relevant features can be taken into account in this way, and it is possible to find features that are difficult to obtain with traditional methods. Since the features extracted by tsfresh are more extensive and almost include the conventional features that can be extracted manually in time series, it is possible to obtain more important features by performing feature selection.
[0048] In some embodiments, the gradient information may include gradient information corresponding to each action feature. The present invention may determine the evaluation parameter corresponding to each action feature through the gradient information corresponding to each action feature.
[0049] Figure 2 FIG. 1 is a flow chart of a method for obtaining evaluation parameters provided by the present invention. Figure 2As shown, determining the evaluation parameter corresponding to each action feature in the initial feature set according to the gradient information of the trained neural network model may include the following steps 201 to 202.
[0050] Step 201: Obtain the gradient information corresponding to each action feature, where the gradient information corresponding to each action feature is the gradient information of the loss function of the trained neural network model with respect to each input action feature.
[0051] It should be noted that when training a model, in order to update the model, the gradient of the model parameters is calculated. However, when using attribution technology for feature selection, the model has been trained and does not need to calculate the gradient of the model parameters, but the gradient of the model input is calculated. For most deep learning tasks, since the output loss is often a scalar and the input dimension is high, the same result is less computationally intensive when calculated in reverse mode than in forward mode. Therefore, deep learning frameworks usually use reverse mode to calculate gradients. Among them, the neural network model is optimized based on the loss function, so the gradient of the input using the loss function is more representative. Among them, the method for obtaining the gradient information corresponding to each action feature can use a backpropagation algorithm to obtain the gradient information corresponding to each action feature.
[0052] For example, automatic differentiation in PyTorch generates a computational graph through tensor operations during forward propagation, and uses the computational graph to perform chain derivation to obtain the gradient during backward propagation. It should be noted that PyTorch defaults to cumulative gradients, that is, the previously calculated gradients will be added to the current gradients, so the gradients must be set to zero when calculating the gradients. When gradient calculations are not needed, the gradient calculations should be canceled to reduce memory usage and unnecessary computations.
[0053] Step 202: Determine the evaluation parameter corresponding to each action feature according to the gradient information corresponding to each action feature and the gradient information corresponding to all action features in the initial feature set.
[0054] It should be noted that there are many ways to determine the evaluation parameters corresponding to each action feature according to the gradient information corresponding to each action feature and the gradient information corresponding to all action features in the initial feature set. For example, the evaluation parameters corresponding to each action feature can be determined according to the size, position, and proportion of the gradient information corresponding to each action feature in the gradient information corresponding to all action features. The present invention does not limit the method of determining the evaluation parameters corresponding to each action feature according to the gradient information corresponding to each action feature and the gradient information corresponding to all action features in the initial feature set.
[0055] It should be noted that by obtaining the gradient information corresponding to each input action feature of the loss function of the trained neural network model, and determining the evaluation parameters according to the features corresponding to each action feature and the gradient information corresponding to all action features, the importance of each action feature can be accurately obtained, thereby performing accurate feature selection.
[0056] In some embodiments, the evaluation parameter may be obtained through the absolute value of the gradient corresponding to each action feature.
[0057] Figure 3 FIG. 2 is a flow chart of the method for obtaining evaluation parameters provided by the present invention. Figure 3 As shown, the gradient information includes a gradient absolute value, and obtaining the gradient information corresponding to each action feature may include: Step 301: Calculate the absolute value of the gradient of the loss function of the trained neural network model for each input action feature.
[0058] It should be noted that the description of step 301 can be similar to the description of step 201 in the aforementioned embodiment, and will not be repeated here.
[0059] Step 302: Calculate the proportion of the absolute gradient value corresponding to each action feature in the absolute gradient values corresponding to all action features to obtain the weight corresponding to each action feature, where the weight corresponding to each action feature is the evaluation parameter corresponding to each action feature.
[0060] Exemplarily, through the trained neural network model, the absolute value of the gradient of the loss function of the input features on all data is obtained and then summed up, and the gradient is normalized to obtain the weight corresponding to each action feature. The weight reflects the importance of each feature to the neural network model in completing the recognition task.
[0061] It should be noted that when calculating the gradient, the absolute value of the feature gradient obtained for each action feature needs to be taken. Because for a certain feature, no matter whether its gradient value is positive or negative, the larger its absolute value is, the greater the influence of the feature on the result, that is, the more important it is relatively. On the contrary, the closer its gradient value is to 0, the smaller its influence on the result is, that is, it is more likely to be a feature that needs to be removed. In addition, the present invention has also tried to use the output corresponding to the category predicted by the model to calculate the gradient of the input feature, but the effect is not good. Since the loss function uses a multi-classification cross entropy loss, which describes the difference between the data distribution and the model prediction distribution, and the model is optimized based on the loss function, it is more representative to use the gradient of the loss function to the input. Determining the evaluation parameters in the above manner can improve the accuracy of feature selection.
[0062] Furthermore, performing feature selection according to the evaluation parameters corresponding to each action feature to obtain the target feature subset may include: determining the target feature subset according to the size of the weight corresponding to each action feature.
[0063] Exemplarily, there are many ways to determine the target feature subset according to the size of the weight corresponding to each action feature. For example, one can start from the largest weight and select the largest 50 features to form the target feature subset, or one can select half of the features with the largest weight to form the target feature subset. The present invention does not limit the method for determining the target feature subset according to the size of the weight corresponding to each action feature.
[0064] It can be immediately seen that the method of determining the target feature subset according to the size of the weight is simple and convenient to operate, which can further improve the efficiency of feature extraction.
[0065] In some embodiments, after determining the evaluation parameter, a threshold of the evaluation parameter may also be determined, and feature selection may be performed based on the threshold of the evaluation parameter.
[0066] Figure 4 FIG. 2 is a flow chart of the method for obtaining motion features provided by the present invention. Figure 4 As shown, the action feature acquisition method may include the following steps: Step 401: Acquire an initial feature set, wherein the initial feature set includes a plurality of action features related to a time series task.
[0067] It should be noted that the description corresponding to step 401 can refer to the description of step 101 in the aforementioned embodiment, which will not be repeated here.
[0068] Step 402: When the initial feature set is input into the trained neural network model, an evaluation parameter corresponding to each action feature in the initial feature set is determined according to the gradient information of the trained neural network model, and the evaluation parameter is used to indicate the importance of the action feature. The trained neural network model is trained using a preset feature set, and the preset feature set includes multiple action features.
[0069] It should be noted that the description corresponding to step 402 can refer to the description of step 102 in the aforementioned embodiment, which will not be repeated here.
[0070] Step 403: Obtain parameter thresholds corresponding to the evaluation parameters.
[0071] It should be noted that there are many ways to obtain the parameter thresholds corresponding to the evaluation parameters. For example, the parameter thresholds for selecting features can be determined by other machine learning algorithms, or the parameter thresholds can be customized or received from other devices. The present invention does not limit the method for obtaining the parameter thresholds corresponding to the evaluation parameters.
[0072] Step 404: Obtain a target feature subset according to the evaluation parameter corresponding to each action feature and a parameter threshold corresponding to the evaluation parameter, wherein the parameter value indicated by the evaluation parameter corresponding to each action feature included in the target feature subset is greater than the parameter threshold.
[0073] It should be noted that after obtaining the parameter threshold, features whose parameter values indicated by the evaluation parameters are greater than the parameter threshold can be selected as values in the target feature subset.
[0074] It can be understood that the method of selecting features by using evaluation parameters and evaluation parameter thresholds can simply and conveniently select features, thereby speeding up the efficiency of feature selection.
[0075] Exemplarily, in order to prevent bias in feature selection of the neural network model, after determining the evaluation parameters of different features, the support vector machine (SVM) algorithm can be used to perform classification according to the selected feature subset, and remove features with lower values indicated by the evaluation parameters as much as possible when the change in prediction accuracy is small, so as to determine the parameter threshold corresponding to the evaluation parameter of the filtering feature.
[0076] In some embodiments, the action feature acquisition method can iteratively select features, and can adjust the trained neural network model and / or preset feature set according to the acquired feature selection results, and perform feature selection again to obtain the most valuable action features.
[0077] Figure 5 FIG. 3 is a flow chart of the method for obtaining action features provided by the present invention. Figure 5 As shown, the action feature acquisition method may include the following steps.
[0078] Step: 501: Obtain an initial feature set, wherein the initial feature set includes multiple action features related to the time series task.
[0079] It should be noted that the description corresponding to step 501 can refer to the description of step 101 in the aforementioned embodiment, which will not be repeated here.
[0080] Step 502: Determine a trained neural network model and / or a preset feature set according to a target evaluation result, wherein the target evaluation result is obtained by performing a classification accuracy evaluation on a candidate feature subset obtained in a previous round of feature selection.
[0081] It should be noted that before performing the current feature selection step, the classification accuracy can be evaluated based on the candidate feature subset obtained in the previous round of feature selection, and the trained neural network model and / or preset feature set currently used can be determined based on the evaluation results.
[0082] There are many ways to obtain the target evaluation results. For example, the accuracy of the feature subset on other traditional machine learning algorithms can be used as an evaluation criterion. The ability of the feature to distinguish different categories can also be evaluated by an unsupervised clustering algorithm. The present invention does not limit the method of determining the trained neural network model and / or the preset feature set according to the target evaluation results.
[0083] Step 503: When the initial feature set is input into the trained neural network model, an evaluation parameter corresponding to each action feature in the initial feature set is determined according to the gradient information of the trained neural network model, and the evaluation parameter is used to indicate the importance of the action feature. The trained neural network model is trained using a preset feature set, and the preset feature set includes multiple action features.
[0084] It should be noted that the description corresponding to step 503 can refer to the description of step 102 in the aforementioned embodiment, which will not be repeated here.
[0085] Step 504: performing feature selection according to the evaluation parameters corresponding to each action feature to obtain a target feature subset, wherein the number of action features included in the target feature subset is less than the number of action features included in the initial feature set.
[0086] It should be noted that the description corresponding to step 504 can refer to the description of step 103 in the aforementioned embodiment, which will not be repeated here.
[0087] It can be understood that determining the trained neural network model and the preset feature set based on the target evaluation results can determine the results of the current feature extraction, and updating or adjusting the trained neural network model based on the results can further improve the accuracy of feature selection.
[0088] Further, determining the trained neural network model and / or the preset feature set according to the target evaluation result may include: If the ability to distinguish feature categories indicated by the classification accuracy is lower than the ability parameter threshold, the trained neural network is replaced, or the trained neural network is retrained, or the preset feature set is replaced. If the ability to distinguish feature categories indicated by the classification accuracy is greater than or equal to the ability parameter threshold, and the number of action features included in the candidate feature subset is greater than the number threshold, the candidate feature subset is determined to be a preset feature set.
[0089] It can be understood that the present invention uses the gradient information of the trained neural network model for feature selection and compares it with the results of other methods. It adopts an iterative feature selection method, which can select valuable features from a large number of features and improve the accuracy of feature acquisition.
[0090] The following describes an exemplary application of the embodiments of the present application in a practical application scenario.
[0091] Figure 6 Schematic diagram of the scene of the action feature acquisition method provided by the present invention. Figure 6 As shown, the action feature acquisition method includes the following steps: Step 601: Obtain an extracted action feature set X, where the extracted action feature set X is an initial feature set, which is a feature extracted from initial feature data by tsfresh.
[0092] Step 602: Train a neural network classification model f(X) using the extracted action feature set X.
[0093] Step 603: Using the trained neural network classification model f(X), feature selection is performed through attribution technology to obtain a candidate feature subset X'. The attribution technology here is the step described in the above embodiment. Among them, the gradient information of the neural network is analyzed to understand the weights of the neural network for different inputs, so as to help perform feature selection, that is, attribution technology.
[0094] Step 604: Evaluate the classification accuracy of the candidate feature subset X'. If the evaluation is qualified, proceed to step 605. If the evaluation is unqualified, proceed to step 601 or 602. This embodiment uses the accuracy of the feature subset on other traditional machine learning algorithms as the evaluation standard. The present invention believes that the ability of the feature to distinguish different categories can also be evaluated by an unsupervised clustering algorithm. If the feature has a good distinguishing ability, the feature is used for clustering, and the same category tends to be clustered into the same cluster.
[0095] Among them, if the classification accuracy of the candidate feature X' is evaluated and it is found that its ability to distinguish different categories is weak, it may be necessary to replace the model or adjust the parameters for retraining. If satisfactory results are still not obtained after replacing the model, it may be necessary to consider whether the initially extracted feature X can complete the classification task. If the candidate feature X' can distinguish different categories well, but the number of its features is still too many, that is, the dimension is high, the candidate feature X' can be further used as the initial feature for model training, and a smaller feature subset can be further selected through attribution technology. Until the feature dimension cannot be further reduced, that is, the accuracy is significantly reduced after reducing the feature dimension. In this way, the final selected feature subset is obtained.
[0096] Step 605: Determine the qualified candidate features X' as the target feature subset.
[0097] It is understandable that the action feature acquisition method adopted by the present invention includes using tsfresh to perform system feature extraction, and using deep neural networks for feature selection. The action feature acquisition method will first use tsfresh to extract features related to time series tasks as widely as possible, so that the target features are covered as much as possible, but too many features usually bring difficulties to subsequent feature selection, making it difficult for conventional algorithms to complete the selection. Therefore, the action feature acquisition method will use attribution technology, use deep neural networks, and combine the two feature selection methods of wrapping and embedded to select the most valuable features from a large number of features, obtain the weights of different features through deep neural networks, and use other algorithms to determine the weight threshold of the selected features for feature selection.
[0098] Exemplarily, this method is used to obtain action features from a data set containing 1522 Taekwondo action data, 3680 features are extracted using tsfresh, and 31 features are selected from them using a neural network. The F1 score obtained using different classification algorithms such as SVM is 0.95, and this accuracy is not lower than the recognition accuracy of using 3860 features for recognition and other deep learning algorithms such as CNN and RNN. The present invention also uses this feature engineering on other public data sets and verifies its applicability through comparison. It can be seen that the feature extraction method provided by the present invention has good accuracy and applicability.
[0099] The action feature acquisition device provided by the present invention is described below. The action feature acquisition device described below and the feature extraction method described above can be referenced to each other.
[0100] Figure 7 Schematic diagram of the structure of the motion feature acquisition device provided by the present invention. Figure 7As shown, each module included in the action feature acquisition device 700, and each unit included in each module, can be implemented by a processor; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc. The action feature acquisition device includes an initial feature acquisition module 701, an evaluation parameter acquisition module 702 and a selection feature acquisition module 703. Among them, the initial feature acquisition module 701 is used to obtain an initial feature set, and the initial feature set includes multiple action features related to the time series task; An evaluation parameter acquisition module 702 is used to determine the evaluation parameter corresponding to each action feature in the initial feature set according to the gradient information of the trained neural network model when the initial feature set is input into the trained neural network model, wherein the evaluation parameter is used to indicate the importance of the action feature, and the trained neural network model is trained using a preset feature set, and the preset feature set includes a plurality of action features; The feature acquisition module 703 is selected to perform feature selection according to the evaluation parameters corresponding to each action feature to obtain a target feature subset, wherein the number of action features included in the target feature subset is less than the number of action features included in the initial feature set.
[0101] Based on the above embodiment, in this embodiment, the evaluation parameter acquisition module 702 includes a gradient acquisition unit and a parameter determination unit, wherein: The gradient acquisition unit is used to obtain the gradient information corresponding to each action feature, where the gradient information corresponding to each action feature is the gradient information of the loss function of the trained neural network model with respect to each input action feature; the parameter determination unit is used to determine the evaluation parameter corresponding to each action feature based on the gradient information corresponding to each action feature and the gradient information corresponding to all action features in the initial feature set.
[0102] Based on the above embodiment, in this embodiment, the gradient information corresponding to each action feature includes the gradient absolute value corresponding to each action feature, and the parameter determination unit is specifically used for: Calculate the proportion of the absolute value of the gradient corresponding to each action feature in the absolute values of the gradients corresponding to all action features to obtain a weight corresponding to each action feature, where the weight corresponding to each action feature is an evaluation parameter corresponding to each action feature; The feature acquisition module 703 is specifically used to determine the target feature subset according to the weight corresponding to each action feature.
[0103] Based on the above embodiment, in this embodiment, the device further includes a threshold value acquisition module, and the threshold value acquisition module is used to: Obtaining a parameter threshold corresponding to the evaluation parameter; The feature acquisition module 703 is selected to be specifically used for: A target feature subset is obtained according to the evaluation parameter corresponding to each action feature and a parameter threshold corresponding to the evaluation parameter, wherein a parameter value indicated by the evaluation parameter corresponding to each action feature included in the target feature subset is greater than the parameter threshold.
[0104] Based on the above embodiments, in this embodiment, the device also includes a model training determination module, wherein the model training determination module is used to: determine a trained neural network model and / or a preset feature set based on a target evaluation result, and the target evaluation result is obtained by performing a classification accuracy evaluation on a candidate feature subset obtained in a previous round of feature selection.
[0105] Based on the above embodiment, in this embodiment, the model training determination module is specifically used for: If the ability to distinguish feature categories indicated by the classification accuracy is lower than the ability parameter threshold, then replacing the trained neural network, or retraining the trained neural network, or replacing the preset feature set; If the ability to distinguish feature categories indicated by the classification accuracy is greater than or equal to the ability parameter threshold, and the number of action features included in the candidate feature subset is greater than the number threshold, the candidate feature subset is determined to be a preset feature set.
[0106] Based on the above embodiments, in this embodiment, the action features included in the preset feature set are part or all of the action features in the initial feature set.
[0107] Based on the above embodiments, in this embodiment, the initial feature acquisition module 701 is specifically used to: obtain a motion data set, the motion data set including motion data collected by an accelerometer; extract features from the motion data set using a time series data feature extraction tool to obtain the initial feature set.
[0108] In an embodiment of the present invention, the evaluation parameters corresponding to the action features are determined by the gradient information of the trained neural network model, and feature selection is performed based on the evaluation parameters, thereby achieving the selection of the most valuable action features from a large number of action features, thereby improving the accuracy of action feature acquisition.
[0109] Figure 8 It is a schematic diagram of the physical structure of the electronic device adopted by the present invention, such as Figure 8As shown, the electronic device may include: a processor 801, a communications interface 802, a memory 803 and a communication bus 804, wherein the processor 801, the communications interface 802 and the memory 803 communicate with each other via the communication bus 804. The processor 801 may call the logic instructions in the memory 803 to execute the action feature acquisition method, the method comprising: acquiring an initial feature set, the initial feature set comprising a plurality of action features related to a time series task; When the initial feature set is input into a trained neural network model, an evaluation parameter corresponding to each action feature in the initial feature set is determined according to gradient information of the trained neural network model, wherein the evaluation parameter is used to indicate the importance of the action feature, and the trained neural network model is trained using a preset feature set, and the preset feature set includes a plurality of action features; Feature selection is performed according to the evaluation parameters corresponding to each action feature to obtain a target feature subset, wherein the number of action features included in the target feature subset is less than the number of action features included in the initial feature set.
[0110] In addition, the logic instructions in the above-mentioned memory 803 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0111] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored in a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the action feature acquisition method provided by the above methods, the method comprising: obtaining an initial feature set, the initial feature set including a plurality of action features related to a time series task; When the initial feature set is input into a trained neural network model, an evaluation parameter corresponding to each action feature in the initial feature set is determined according to gradient information of the trained neural network model, wherein the evaluation parameter is used to indicate the importance of the action feature, and the trained neural network model is trained using a preset feature set, and the preset feature set includes a plurality of action features; Feature selection is performed according to the evaluation parameters corresponding to each action feature to obtain a target feature subset, wherein the number of action features included in the target feature subset is less than the number of action features included in the initial feature set.
[0112] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a server, or a data center to another website site, a computer, a server, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.
[0113] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for obtaining motion features provided by the above methods is implemented, and the method includes: Acquire an initial feature set, wherein the initial feature set includes a plurality of action features related to the time series task; When the initial feature set is input into a trained neural network model, an evaluation parameter corresponding to each action feature in the initial feature set is determined according to gradient information of the trained neural network model, wherein the evaluation parameter is used to indicate the importance of the action feature, and the trained neural network model is trained using a preset feature set, and the preset feature set includes a plurality of action features; Feature selection is performed according to the evaluation parameters corresponding to each action feature to obtain a target feature subset, wherein the number of action features included in the target feature subset is less than the number of action features included in the initial feature set.
[0114] The above-mentioned non-transitory computer-readable storage medium can adopt any combination of one or more computer-readable media. Computer-readable media can be computer-readable signal media or non-transitory computer-readable storage media. Non-transitory computer-readable storage media can be, for example, - but not limited to - electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples (non-exhaustive lists) of non-transitory computer-readable storage media include: electrical connections with one or more wires, portable computer disks, hard disks, random access memories (RAM), read-only memories (read only memory, ROM), erasable programmable read-only memories (erasableprogrammable read only memory, EPROM) or flash memory, optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In this document, non-transitory computer-readable storage media can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0115] Computer-readable signal media may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a non-transitory computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0116] The program code embodied on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wire, optical cable, radio frequency (RF), etc., or any suitable combination of the foregoing.
[0117] Computer program code for performing the operations of the present specification may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0118] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0119] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0120] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these 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 invention.
Claims
1. A method for acquiring motion features, It is characterized in that include: Acquire an initial feature set, wherein the initial feature set includes a plurality of action features related to the time series task; When the initial feature set is input into a trained neural network model, an evaluation parameter corresponding to each action feature in the initial feature set is determined according to gradient information of the trained neural network model, wherein the evaluation parameter is used to indicate the importance of the action feature, and the trained neural network model is trained using a preset feature set, and the preset feature set includes a plurality of action features; Feature selection is performed according to the evaluation parameters corresponding to each action feature to obtain a target feature subset, wherein the number of action features included in the target feature subset is less than the number of action features included in the initial feature set.
2. The motion feature acquisition method according to claim 1, It is characterized in that Determining the evaluation parameter corresponding to each action feature in the initial feature set according to the gradient information of the trained neural network model includes: Obtaining gradient information corresponding to each action feature, where the gradient information corresponding to each action feature is the gradient information of the loss function of the trained neural network model with respect to each input action feature; An evaluation parameter corresponding to each action feature is determined according to the gradient information corresponding to each action feature and the gradient information corresponding to all action features in the initial feature set.
3. The motion feature acquisition method according to claim 2, It is characterized in that The gradient information corresponding to each action feature includes the gradient absolute value corresponding to each action feature, and determining the evaluation parameter corresponding to each action feature according to the gradient information corresponding to each action feature and the gradient information corresponding to all action features in the initial feature set, including: Calculate the proportion of the absolute value of the gradient corresponding to each action feature in the absolute values of the gradients corresponding to all action features to obtain a weight corresponding to each action feature, where the weight corresponding to each action feature is an evaluation parameter corresponding to each action feature; The feature selection is performed according to the evaluation parameters corresponding to each action feature to obtain a target feature subset, including: According to the size of the weight corresponding to each action feature, a target feature subset is determined.
4. The motion feature acquisition method according to claim 1, It is characterized in that Before performing feature selection according to the evaluation parameters corresponding to each action feature to obtain a target feature subset, the method further includes: Obtaining a parameter threshold corresponding to the evaluation parameter; The feature selection is performed according to the evaluation parameters corresponding to each action feature to obtain a target feature subset, including: A target feature subset is obtained according to the evaluation parameter corresponding to each action feature and a parameter threshold corresponding to the evaluation parameter, wherein a parameter value indicated by the evaluation parameter corresponding to each action feature included in the target feature subset is greater than the parameter threshold.
5. The motion feature acquisition method according to claim 1, It is characterized in that Before determining the evaluation parameter corresponding to each action feature in the initial feature set according to the gradient information of the trained neural network model, the method further includes: The trained neural network model and / or preset feature set are determined according to the target evaluation result, which is obtained by evaluating the classification accuracy of the candidate feature subset obtained by the previous round of feature selection.
6. The motion feature acquisition method according to claim 5, It is characterized in that The step of determining the trained neural network model and / or the preset feature set according to the target evaluation result includes: If the ability to distinguish feature categories indicated by the classification accuracy is lower than the ability parameter threshold, then replacing the trained neural network, or retraining the trained neural network, or replacing the preset feature set; If the ability to distinguish feature categories indicated by the classification accuracy is greater than or equal to the ability parameter threshold, and the number of action features included in the candidate feature subset is greater than the number threshold, the candidate feature subset is determined to be a preset feature set.
7. An action feature acquisition device, It is characterized in that include: An initial feature acquisition module, used to acquire an initial feature set, wherein the initial feature set includes a plurality of action features related to the time series task; An evaluation parameter acquisition module, used for determining, when the initial feature set is input into a trained neural network model, an evaluation parameter corresponding to each action feature in the initial feature set according to gradient information of the trained neural network model, wherein the evaluation parameter is used to indicate the importance of the action feature, and the trained neural network model is trained using a preset feature set, and the preset feature set includes a plurality of action features; A feature acquisition module is selected to perform feature selection according to the evaluation parameters corresponding to each action feature to obtain a target feature subset, wherein the number of action features included in the target feature subset is less than the number of action features included in the initial feature set.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the steps of the motion feature acquisition method according to any one of claims 1 to 6 are implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the motion feature acquisition method according to any one of claims 1 to 6 are implemented.
10. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the motion feature acquisition method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Model training method, apparatus and device, and storage medium
CN111046959A
Model training method and device, storage medium and equipment
CN114757244A
Multi-task neural network model training method and device, equipment and medium
CN116168267A
Multi-target task machine learning model training method and device, medium and program product
CN117764200A
User identity recognition method and device, electronic equipment and storage medium
CN118055188A
Cited By
Scene-adaptive online learning for video post processing
US12707099B2
Scene-adaptive online learning for video post processing
US20260075255A1
