Training method and device of image recognition model and image recognition method and device

By using feature spatial distortions to generate adversarial network expansion training samples in human posture recognition and performing model training, the problems of insufficient data and poor generalization capabilities are solved, and the accuracy and robustness of the recognition are improved.

CN119580358AActive Publication Date: 2025-03-07CHENGDU KAIYUAN COMPUTING ECOLOGICAL TECHNOLOGY CO LTD

Patent Information

Application Number
CN202411880279.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-03-07
Estimated Expiration
2044-12-19

AI Technical Summary

Technical Problem

The existing human posture recognition technology faces problems such as insufficient data, poor model generalization ability, gradient vanishing and feature loss, resulting in a decrease in recognition accuracy and robustness.

Method used

The original human pose training sample is expanded based on feature spatial distortion, the target human pose training sample is generated, and the initial image recognition model is input to the initial image recognition model for training, and the parameters are adjusted to meet the training stop condition.

Benefits of technology

By expanding the training samples, the generalization ability of the model and the accuracy of human posture recognition are improved, the problems of gradient vanishing and feature loss are reduced, and the recognition ability of the model in a diverse environment is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119580358A_ABST
    Figure CN119580358A_ABST
Patent Text Reader

Abstract

The invention provides an image recognition model training method and device and an image recognition method and device. The training method comprises the steps that a generative adversarial network algorithm model based on feature space distortion is adopted to expand an original human body posture training sample to obtain a target human body posture training sample, the generative adversarial network algorithm model comprises a generator and a discriminator, the generator comprises a distortion module, and the discriminator comprises a discriminator; a distortion module generates distortion image features according to the random noise vector and the distortion module parameters and a preset feature deformation algorithm, and obtains a target human body posture training sample based on the distortion image features; inputting the target human body posture training sample into the initial image recognition model; and according to the output of the initial image recognition model in each training period, parameter adjustment is performed on the initial image recognition model until the target image recognition model meeting the training stop condition is obtained, so that the generalization ability of the target image recognition model and the accuracy of human body posture recognition are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of human posture recognition, and in particular to a training method and device for an image recognition model, and an image recognition method and device. Background Art

[0002] With the rapid development of artificial intelligence and computer vision technology, human posture recognition has gradually become an important application in many fields, such as intelligent monitoring, virtual reality, motion analysis and health monitoring. However, existing human posture recognition technology faces some challenges. First, it takes a lot of time and cost to collect and annotate large-scale and diverse human posture image data. In multi-view and complex environments, the collection of human posture image data is often insufficient, resulting in insufficient training data. This problem of insufficient training data may affect the training effect of the model, thereby affecting the accuracy of human posture recognition. Secondly, traditional feature extraction, feature dimensionality reduction and classification algorithms may be affected by gradient disappearance, feature loss, poor model generalization ability and other problems when dealing with complex posture changes. These problems may cause the recognition accuracy and robustness of the model to decrease in diverse environments. In addition, the classification accuracy of existing classifier models is often not ideal when dealing with multi-category complex data. In particular, in recognition tasks involving multi-posture and multi-scene changes, existing classifier models are difficult to achieve stable classification effects. Therefore, how to solve the above problems to improve the accuracy and robustness of human posture recognition is an important topic in the current development of human posture recognition technology. Summary of the invention

[0003] In view of the above problems, the present disclosure provides a training method and device for an image recognition model, and an image recognition method and device, aiming to improve the generalization ability of the target image recognition model and the accuracy of human posture recognition.

[0004] According to a first aspect of the present disclosure, a training method for an image recognition model is provided, wherein the training method comprises:

[0005] Acquire original human posture training samples, and expand the original human posture training samples using a generative adversarial network algorithm model based on feature space distortion to obtain target human posture training samples, wherein the generative adversarial network algorithm model includes a generator and a discriminator, the generator includes a distortion module, the distortion module generates distorted image features according to a preset feature deformation algorithm based on a random noise vector and distortion module parameters, and obtains the target human posture training samples based on the distorted image features;

[0006] Inputting the target human posture training sample into an initial image recognition model, wherein the initial image recognition model performs image feature extraction, feature dimension reduction and classification processing on the target human posture training sample;

[0007] According to the output of the initial image recognition model in each training cycle, the parameters of the initial image recognition model are adjusted until a target image recognition model that meets the training stop condition is obtained.

[0008] Optionally, the initial image recognition model includes an initial feature extraction algorithm model, an initial autoencoder algorithm model and an initial neural decision tree algorithm model, and the step of inputting the target human posture training sample into the initial image recognition model includes:

[0009] Inputting the target human posture training sample into the initial feature extraction algorithm model to extract image features;

[0010] Inputting the extracted image features into the initial autoencoder algorithm model to perform feature dimensionality reduction to obtain image features after dimensionality reduction, wherein the initial autoencoder algorithm model includes an initial encoder and an initial decoder;

[0011] The reduced-dimensional image features are input into the initial neural decision tree algorithm model to obtain the human posture category labels of the target human posture training samples.

[0012] Optionally, adjusting the parameters of the initial image recognition model according to the output of the initial image recognition model in each training cycle until a target image recognition model that meets the training stop condition is obtained includes:

[0013] Based on the output error of the initial feature extraction algorithm model in the previous training cycle, a chaotic optimization algorithm is used to adjust the learning rate of the initial feature extraction algorithm model in the current training cycle, and then the weight of the initial feature extraction algorithm model is updated according to the updated learning rate until a target feature extraction algorithm model that meets the condition for stopping model training is obtained;

[0014] In the current training cycle, a dynamic routing decision is made according to the output features of the activation function of the previous layer of the initial encoder and the feature importance score of the current layer, data is reconstructed in the initial decoder using features from different encoding layers, the gradient of the loss function of the initial autoencoder algorithm model to the parameters of the initial autoencoder algorithm model is calculated by a back propagation algorithm, and the weights and biases of the initial autoencoder algorithm model are updated until a target autoencoder algorithm model that meets the conditions for stopping model training is obtained;

[0015] In the current training cycle, during the back propagation process, the weight of the current decision node is adjusted according to the partial derivative of the loss function of the initial neural decision tree algorithm model with respect to the weight of the current decision node and the partial derivative of the loss function of the initial neural decision tree algorithm model with respect to the weight of the previous decision node, and the learning rate of the initial neural decision tree algorithm model is adjusted according to the difference between the actual output characteristics and the target output characteristics of the forward propagation process of the current decision node, until a target neural decision tree algorithm model that meets the conditions for stopping model training is obtained.

[0016] Optionally, the output error amount of the initial feature extraction algorithm model in the previous training cycle is based on the chaotic optimization algorithm, and the learning rate of the initial feature extraction algorithm model in the current training cycle is adjusted, and then the weight of the initial feature extraction algorithm model is updated according to the updated learning rate until a target feature extraction algorithm model that meets the condition for stopping model training is obtained, including:

[0017] Initializing weights and biases of the initial feature extraction algorithm model;

[0018] According to the output error amount and learning rate of the initial feature extraction algorithm model in the previous training cycle, using a chaos optimization algorithm to adjust the learning rate of the initial feature extraction algorithm model in the current training cycle;

[0019] According to the learning rate in the current training cycle and the partial derivative of the output error amount in the previous training cycle with respect to the weight of the previous training cycle, the weight of the initial feature extraction algorithm model in the previous training cycle is adjusted to obtain the weight in the current training cycle;

[0020] According to the node adjustment step of the hidden layer of the initial feature extraction algorithm model, the output error amount in the previous training cycle and the number of nodes in the hidden layer, the number of nodes in the hidden layer in the current training cycle is dynamically adjusted to achieve regularized sparsity, wherein the node adjustment step of the hidden layer of the initial feature extraction algorithm model is calculated based on the adjustment influence coefficient of the node adjustment step and the network layer depth.

[0021] Optionally, in the current training cycle, dynamic routing decisions are made according to the output features of the activation function of the previous layer of the initial encoder and the feature importance score of the current layer, data is reconstructed in the initial decoder using features from different encoding layers, the gradient of the loss function of the initial autoencoder algorithm model to the parameters of the initial autoencoder algorithm model is calculated by a back propagation algorithm, and the weights and biases of the initial autoencoder algorithm model are updated until a target autoencoder algorithm model that meets the conditions for stopping model training is obtained, including:

[0022] Initializing the weights and biases of the initial autoencoder algorithm model;

[0023] In the current training cycle, the extracted image features are transmitted in each layer of the initial encoder, and dynamic routing decisions are made according to the output features of the activation function of the previous layer of the initial encoder and the feature importance scores of the current layer, and the activation function of the current layer of the initial encoder selectively outputs the most informative features, wherein the feature importance scores of the current layer are calculated according to the activation output of each neuron in the previous layer and the weight of the corresponding feature importance;

[0024] At the initial decoder, data is reconstructed using features from different coding layers to obtain reconstructed image features;

[0025] Calculating the loss function of the initial autoencoder algorithm model according to the reconstructed image features and the reconstruction errors of the extracted image features;

[0026] The gradient of the loss function of the initial autoencoder algorithm model to the parameters of the initial autoencoder algorithm model is calculated by the back-propagation algorithm, and the weights and biases of the layer are updated when the sparsity of the neurons in the current layer of the initial autoencoder algorithm model is less than the sparsity pruning threshold. The weights of the layer are pruned when the sparsity of the neurons in the current layer of the initial autoencoder algorithm model is greater than or equal to the sparsity pruning threshold.

[0027] Optionally, in the current training cycle, dynamic routing decisions are made according to the output features of the activation function of the previous layer of the initial encoder and the feature importance score of the current layer, the initial decoder uses features from different encoding layers to reconstruct data, and the gradient of the loss function of the initial autoencoder algorithm model to the parameters of the initial autoencoder algorithm model is calculated by a back propagation algorithm, and the weights and biases of the initial autoencoder algorithm model are updated until a target autoencoder algorithm model that meets the conditions for stopping model training is obtained, further comprising:

[0028] The sparsity of the current layer neurons of the initial autoencoder algorithm model is calculated by counting the number of samples whose output features of the current layer activation function of the initial encoder are less than the sparsity threshold.

[0029] Optionally, in the current training cycle, in the back propagation process, according to the partial derivative of the loss function of the initial neural decision tree algorithm model with respect to the weight of the current decision node and the partial derivative of the loss function of the initial neural decision tree algorithm model with respect to the weight of the previous decision node, the weight of the current decision node is adjusted, and according to the difference between the actual output feature and the target output feature of the forward propagation process of the current decision node, the learning rate of the initial neural decision tree algorithm model is adjusted until a target neural decision tree algorithm model that meets the condition for stopping model training is obtained, including:

[0030] Initializing the weight and bias of each decision node in the initial neural decision tree algorithm model;

[0031] In the current training cycle, in the forward propagation process of the image features after dimension reduction, data is processed node by node from the input decision node to the output decision node, and for each decision node, the output feature is calculated according to the weight and bias of the decision node, and the output feature is passed forward;

[0032] Calculate the probability predicted by the model according to the output features of the decision nodes, and calculate the loss function of the initial neural decision tree algorithm model according to the probability predicted by the model and the one-hot encoding of the true label;

[0033] In the back propagation process, according to the partial derivative of the loss function of the initial neural decision tree algorithm model with respect to the weight of the current decision node and the partial derivative of the loss function of the initial neural decision tree algorithm model with respect to the weight of the previous decision node, the weight update amount of the current decision node is calculated;

[0034] According to the difference between the actual output feature and the target output feature of the forward propagation process of the current decision node, the learning rate of the initial neural decision tree algorithm model is adjusted.

[0035] Optionally, before obtaining the original human posture training samples and expanding the original human posture training samples using a generative adversarial network algorithm model based on feature space distortion to obtain the target human posture training samples, the training method further includes:

[0036] Obtain image training samples;

[0037] The image training samples are input into an initial generative adversarial network algorithm model, and the parameters of the initial generative adversarial network algorithm model are adjusted according to the output of the initial generative adversarial network algorithm model in each training cycle until the generative adversarial network algorithm model that meets the training stop condition is obtained.

[0038] Optionally, the initial generative adversarial network algorithm model includes an initial generator and an initial discriminator, the initial generator includes an initial distortion module, the image training sample is input into the initial generative adversarial network algorithm model, and the initial generative adversarial network algorithm model is adjusted according to the output of the initial generative adversarial network algorithm model in each training cycle until the generative adversarial network algorithm model that meets the training stop condition is obtained, including:

[0039] Initializing the weights of the initial generative adversarial network algorithm model;

[0040] In the current training cycle, in the adversarial training cycle stage, a random noise vector is input into the initial generator, and the initial distortion module is used to generate distorted image features according to the random noise vector and distortion module parameters according to a preset feature deformation algorithm, and the initial generator generates a generated image similar to the real image;

[0041] Inputting the real image and the generated image into the initial discriminator respectively, and generating a discrimination result of the real image and a discrimination result of the generated image by the initial discriminator;

[0042] Calculate the loss function of the initial generator according to the content loss and style loss of the real image and the generated image;

[0043] Calculate the loss function of the initial discriminator according to the discrimination result of the real image and the discrimination result of the generated image;

[0044] The distortion module parameters are adjusted based on feedback information from the initial discriminator.

[0045] According to a second aspect of the present disclosure, there is provided an image recognition method, characterized by comprising:

[0046] Acquire human body posture image data;

[0047] The human body posture image data is input into a target image recognition model trained according to the training method described above, and the target image recognition model outputs a human body posture category label corresponding to the human body posture image data.

[0048] According to a third aspect of the present disclosure, a training device for an image recognition model is provided, wherein the training device comprises:

[0049] A training sample expansion unit is used to obtain original human posture training samples, and expand the original human posture training samples using a generative adversarial network algorithm model based on feature space distortion to obtain target human posture training samples, wherein the generative adversarial network algorithm model includes a generator and a discriminator, the generator includes a distortion module, the distortion module generates distorted image features according to a preset feature deformation algorithm based on a random noise vector and distortion module parameters, and obtains the target human posture training samples based on the distorted image features;

[0050] The model training unit is used to input the target human posture training samples into an initial image recognition model, wherein the initial image recognition model performs image feature extraction, feature dimension reduction and classification processing on the target human posture training samples; and adjusts the parameters of the initial image recognition model according to the output of the initial image recognition model in each training cycle until a target image recognition model that meets the training stop condition is obtained.

[0051] According to a fourth aspect of the present disclosure, there is provided an image recognition device, characterized in that it comprises:

[0052] An image data acquisition unit, used for acquiring human body posture image data;

[0053] The image recognition unit is used to input the human posture image data into a target image recognition model trained according to the training method as described above, and the target image recognition model outputs a human posture category label corresponding to the human posture image data.

[0054] According to a fifth aspect of the present disclosure, an electronic device is provided, comprising a memory, a processor, and a program stored in the memory and executable on the processor, wherein the program can implement the above method when executed by the processor.

[0055] According to a sixth aspect of the present disclosure, a storage medium is provided, on which a computer program or instruction is stored, and the computer program or instruction, when executed by a processor, implements the steps of the method described above.

[0056] The present disclosure brings the following beneficial effects:

[0057] The training method provided by the present invention adopts a generative adversarial network algorithm model based on feature space distortion to expand the original human posture training samples to obtain target human posture training samples, wherein the generative adversarial network algorithm model includes a generator and a discriminator, the generator includes a distortion module, the distortion module generates distorted image features according to a preset feature deformation algorithm based on a random noise vector and distortion module parameters, and obtains the target human posture training samples based on the distorted image features. Since the distortion module can simulate different data change situations, such as posture transformation, occlusion, etc., by dynamically adjusting the distribution of data features, the diversity of images generated by the generator is increased, so that the target human posture training samples can cover more diverse human postures and environmental conditions, thereby improving the generalization ability of the target image recognition model and the accuracy of human posture recognition.

[0058] Other features and advantages of the present disclosure will be described in the following description, and partly become apparent from the description, or understood by practicing the present disclosure. The purpose and other advantages of the present disclosure are realized and obtained by the structures particularly pointed out in the description and the drawings.

[0059] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:

[0061] Figure 1 A schematic diagram showing a flow chart of a method for training an image recognition model provided according to an embodiment of the present disclosure;

[0062] Figure 2 A schematic diagram showing an original human body posture training sample provided according to an embodiment of the present disclosure;

[0063] Figure 3 A schematic diagram of a process for training a generative adversarial network algorithm model according to an embodiment of the present disclosure is shown;

[0064] Figure 4 A schematic diagram of a process for training a feature extraction algorithm model according to an embodiment of the present disclosure is shown;

[0065] Figure 5 A schematic diagram of a process for training an autoencoder algorithm model according to an embodiment of the present disclosure is shown;

[0066] Figure 6 A schematic diagram of a process for training a neural decision tree algorithm model according to an embodiment of the present disclosure is shown;

[0067] Figure 7 A schematic diagram showing a flow chart of an image recognition method provided according to an embodiment of the present disclosure;

[0068] Figure 8 A schematic diagram showing a training device for an image recognition model provided according to an embodiment of the present disclosure;

[0069] Fig. 9 A schematic diagram showing an image recognition device provided according to an embodiment of the present disclosure;

[0070] Fig.10 A schematic structural diagram of an electronic device provided according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0071] Various embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. In each of the accompanying drawings, the same elements are represented by the same or similar reference numerals. For the sake of clarity, the various parts in the accompanying drawings are not drawn to scale.

[0072] The following terms are used in this article: Human posture recognition is an important research direction in the field of computer vision. Its goal is to detect and identify the structural information of the human body from images or videos, that is, the posture of the human body, such as standing, running, sitting, etc. This usually involves identifying and locating key parts of the human body, such as the head, hands, feet, etc., and determining the spatial relationship between these parts.

[0073] Figure 1 A flow chart of a method for training an image recognition model according to an embodiment of the present disclosure is shown. Figure 1 As shown, the training method of the embodiment of the present disclosure may include: In step S110, original human posture training samples are obtained, and the original human posture training samples are expanded using a generative adversarial network algorithm model based on feature space distortion to obtain target human posture training samples, wherein the generative adversarial network algorithm model includes a generator and a discriminator, the generator includes a distortion module, the distortion module generates distorted image features according to a random noise vector and distortion module parameters according to a preset feature deformation algorithm, and the target human posture training samples are obtained based on the distorted image features.

[0074] In some embodiments, the source of the original human posture training samples may be a public dataset, or may be images captured in an actual environment by a high-resolution camera system under multi-viewing angles and multi-environment conditions. Figure 2 FIG. 1 is a schematic diagram showing an original human posture training sample provided according to an embodiment of the present disclosure. Figure 2As shown in the figure, the original human posture training samples include key parts of the human body, such as the head, hands, feet, etc. By determining the spatial relationship between these parts, the human body posture can be recognized, such as standing, running, sitting, etc. The original human posture training samples can be stored in a binary file format, and each image file contains the original pixel data and related metadata. The specific storage format is as follows: ,in, Represents the pixel value of the i-th row and j-th column in the image.

[0075] In some embodiments, the collected original human posture training samples are annotated by manual annotation, and each collected sample is given a unique label. In one embodiment, the annotated categories include: standing, sitting, walking, running, jumping, bending, squatting, lying, side-lying, supine, leaning forward, and leaning back, a total of 12 categories. It is easy to understand that manually collecting and annotating large-scale and diverse original human posture training samples requires a lot of time and cost, and insufficient training samples are likely to lead to poor model generalization ability and affect the accuracy of the model. In some embodiments, the original human posture training samples can be expanded using a generative adversarial network algorithm model based on feature space distortion to obtain target human posture training samples. The generative adversarial network algorithm model includes a generator and a discriminator. The generator is responsible for generating a new image that is as similar as possible to the real image, and the discriminator is responsible for distinguishing whether the data input to the discriminator is real or generated by the generator. The generator includes a distortion module, which generates distorted image features according to a preset feature deformation algorithm based on a random noise vector and distortion module parameters. In this way, the distortion module simulates different data changes, such as posture change, occlusion, etc., by dynamically adjusting the distribution of data features, thereby increasing the diversity of images generated by the generator.

[0076] In some embodiments, before step S110, model training is performed on the generative adversarial network algorithm model. Figure 3 FIG. 1 is a flow chart showing a process of training a generative adversarial network algorithm model according to an embodiment of the present disclosure. Figure 3 As shown, the method for training a generative adversarial network algorithm model according to an embodiment of the present disclosure may include: In step S310, image training samples are obtained.

[0077] Since the process of collecting and labeling image training samples can refer to the relevant collection and labeling process of original human posture training samples, it will not be repeated here.

[0078] In step S320, the image training sample is input into the initial generative adversarial network algorithm model, and the parameters of the initial generative adversarial network algorithm model are adjusted according to the output of the initial generative adversarial network algorithm model in each training cycle until the generative adversarial network algorithm model that meets the training stop condition is obtained.

[0079] In some embodiments, the weight of the initial generative adversarial network algorithm model is initialized. The initial generative adversarial network algorithm model includes an initial generator and an initial discriminator, and the initial generator includes an initial distortion module.

[0080] In some embodiments, the initial weights of the initial generative adversarial network algorithm model are expressed as: (1) in, represents the initial weights of the initial generator and the initial discriminator, is the number of neurons in the first layer of the initial generative adversarial network algorithm model, represents a normal distribution with mean 0 and variance 1.

[0081] In some embodiments, in the current training cycle, in the adversarial training loop stage, a random noise vector is input into the initial generator, and the initial distortion module is used to generate distorted image features according to a preset feature deformation algorithm based on the random noise vector and distortion module parameters, and the initial generator generates a generated image similar to the real image.

[0082] In some embodiments, in the current training cycle, during the adversarial training loop phase, a random noise vector is input into the initial generator , by the initial generator Generated and real images Similar generated images The calculation formula is as follows: (2) in, Represents the initial generator The generated image is generated, For the initial generator Parameters, represents the distorted image features, is the initial generator function.

[0083] In some embodiments, using the initial distortion module , according to the random noise vector And distortion module parameters Generate distorted image features according to the preset feature deformation algorithm The calculation formula is as follows: (3) (4) in, represents the distorted image features, is a random noise vector, is the distortion module parameter, is the distortion control parameter, is the distortion frequency control parameter, is the initial generator function.

[0084] In some embodiments, the calculation formula of the distortion degree control parameter is as follows: (5) The calculation formula of the distortion frequency control parameter is as follows: (6) in, is the control parameter of the sensitivity of the distortion intensity, is the first parameter that adjusts the distortion frequency dependency, The second parameter for adjusting the frequency dependence of the distortion is represents the modulus of the random noise vector, represents the L2 norm.

[0085] In some embodiments, the real image and the generated image are respectively input into the initial discriminator, and the initial discriminator generates a discrimination result for the real image and a discrimination result for the generated image.

[0086] In some embodiments, the real image Input initial discriminator , by the initial discriminator Generate discrimination results for real images The calculation formula is as follows: (7) Will generate an image Input initial discriminator , by the initial discriminator Generate the discriminant results of the generated image The calculation formula is as follows: (8) in, and Respectively represent the discrimination results of real images and generated images, is the initial discriminator Parameters, is the initial discriminator function.

[0087] In some embodiments, the loss function of the initial generator is calculated based on the content loss and style loss of the real image and the generated image, and the loss function of the initial discriminator is calculated based on the discrimination result of the real image and the discrimination result of the generated image.

[0088] In some embodiments, the initial generator The loss function The calculation formula is as follows: (9) in, For the initial generator The loss function of represents the square of L2 norm; and are the weights of content loss and style loss respectively. is the judgment result of the generated image, is a real image, To generate the image, represents the content loss function, represents the style loss function.

[0089] In some embodiments, the style loss function The calculation formula is as follows: (10) in, represents the set of selected layers, is the initial generator The weight of the layer, Represents the initial generator The Gram matrix of the layer, represents the Frobenius norm, is a real image, To generate images.

[0090] In some embodiments, the initial discriminator The loss function The calculation formula is as follows: (11) in, is the initial discriminator The loss function is and and Represent the discrimination results of real images and generated images respectively.

[0091] In some embodiments, the distortion module parameters are adjusted based on feedback information from the initial discriminator.

[0092] In some embodiments, according to the initial discriminator Feedback information adjusts the initial generator Distortion module parameters , optimize the quality and diversity of generated images, ensure that the generated images can better cover the diversity of human postures, and adjust the parameters of the post-distortion module The calculation formula is as follows: (12) (13) (14) in, represents the updated distortion module parameters, is the learning rate of the distortion module in the tth training cycle (i.e., the tth iteration), Indicates the distortion module parameters The gradient of is the initial learning rate, is the control parameter for the speed at which the learning rate decays, and are the control parameters of momentum factor and update rate, respectively. is the gradient momentum of the previous training cycle, is the momentum decay factor, For the initial generator The loss function is is the initial generator of the previous training cycle The loss function value of .

[0093] In some embodiments, the above model training cycle is repeated until a generative adversarial network algorithm model that meets the training stop condition is obtained. In one embodiment, the model training stop condition is reaching a preset maximum number of iterations (e.g., 1000 times).

[0094] In step S120, the target human posture training sample is input into an initial image recognition model, wherein the initial image recognition model performs image feature extraction, feature dimension reduction and classification processing on the target human posture training sample.

[0095] In some embodiments, the initial image recognition model includes an initial feature extraction algorithm model, an initial autoencoder algorithm model, and an initial neural decision tree algorithm model. The target human posture training sample is input into the initial feature extraction algorithm model for image feature extraction, and the extracted image features are input into the initial autoencoder algorithm model for feature dimension reduction to obtain the image features after dimension reduction. The initial autoencoder algorithm model includes an initial encoder and an initial decoder. The image features after dimension reduction are input into the initial neural decision tree algorithm model to obtain the human posture category label of the target human posture training sample.

[0096] In step S130, the parameters of the initial image recognition model are adjusted according to the output of the initial image recognition model in each training cycle until a target image recognition model that meets the training stop condition is obtained.

[0097] In some embodiments, based on the output error of the initial feature extraction algorithm model in the previous training cycle, a chaotic optimization algorithm is used to adjust the learning rate of the initial feature extraction algorithm model in the current training cycle, and then the weight of the initial feature extraction algorithm model is updated according to the updated learning rate until a target feature extraction algorithm model that meets the conditions for stopping model training is obtained. Figure 4 FIG. 2 is a flow chart showing a process of training a feature extraction algorithm model according to an embodiment of the present disclosure. Figure 4 As shown, the method for training a feature extraction algorithm model in an embodiment of the present disclosure may include: In step S410, the weights and biases of the initial feature extraction algorithm model are initialized.

[0098] In some embodiments, the calculation formula of the initialization weight of the initial feature extraction algorithm model is as follows: (15) The calculation formula for the initialization bias of the initial feature extraction algorithm model is as follows: (16) in, The initial value of the weight of the neural network of the initial feature extraction algorithm model; The initial value of the bias of the neural network of the initial feature extraction algorithm model; is the mean shift of the weight; is the mean shift of the bias; is the standard deviation of the weight initialization; represents a normal distribution with a mean of 0 and a standard deviation of the identity matrix, is the identity matrix. In one embodiment, Set to 0.01, Set to 0.05, Set to 0.001.

[0099] In step S420, based on the output error and learning rate of the initial feature extraction algorithm model in the previous training cycle, the learning rate of the initial feature extraction algorithm model in the current training cycle is adjusted using a chaos optimization algorithm, and based on the learning rate in the current training cycle and the partial derivative of the output error in the previous training cycle with respect to the weight of the previous training cycle, the weight of the initial feature extraction algorithm model in the previous training cycle is adjusted to obtain the weight in the current training cycle.

[0100] In some embodiments, during the training process, the output error of the initial feature extraction algorithm model in the previous training cycle is evaluated, and the learning rate of the current training cycle is adjusted through a chaotic feedback mechanism to avoid overfitting or underfitting. The calculation formula for the learning rate of the initial feature extraction algorithm model in the current training cycle is as follows: (17) in, For the The learning rate of the initial feature extraction algorithm model for training cycles; for - The learning rate of the initial feature extraction algorithm model for 1 training cycle; It is the regulating factor of the neural network, controlling the sensitivity of changes in the learning rate; is the output error of the initial feature extraction algorithm model in the previous training cycle.

[0101] In some embodiments, the weights are updated according to the updated learning rate, and the calculation formula for the weights of the initial feature extraction algorithm model in the current training cycle is as follows: (18) in, yes The weights of the initial feature extraction algorithm model for training cycles; for The learning rate of the initial feature extraction algorithm model for training cycles, yes -The weights of the initial feature extraction algorithm model for 1 training cycle; It is the output error of the initial feature extraction algorithm model in the previous training cycle, which is calculated by the preset Softmax function on the output features of the last layer of the neural network; is the symbol of partial derivative.

[0102] It can be understood that during the training process, based on the output error of the initial feature extraction algorithm model in the previous training cycle, the learning rate of the initial feature extraction algorithm model is adjusted using the chaos optimization algorithm, and then the weight of the initial feature extraction algorithm model is updated according to the updated learning rate. Since the fully connected neural network of the initial feature extraction algorithm model optimized by the chaos optimization algorithm utilizes the sensitivity in chaos theory, it allows the weight update strategy to be dynamically adjusted according to the output error of the initial feature extraction algorithm model in the previous training cycle, thereby reducing the gradient vanishing or explosion problems that may be encountered by traditional neural networks in the feature extraction stage, improving the target feature extraction algorithm model's ability to respond to initial states and parameter changes, improving training stability and model performance, and thus improving the accuracy and robustness of human posture recognition.

[0103] In step S430, according to the node adjustment step of the hidden layer of the initial feature extraction algorithm model, the output error amount in the previous training cycle and the number of nodes in the hidden layer, the number of nodes in the hidden layer in the current training cycle is dynamically adjusted to achieve regularized sparsity, wherein the node adjustment step of the hidden layer of the initial feature extraction algorithm model is calculated based on the adjustment influence coefficient of the node adjustment step and the network layer depth.

[0104] In some embodiments, during the training process, a regularization strategy is adopted to prevent overfitting and ensure the generalization ability of the initial feature extraction algorithm model. Specifically, regularization sparsification is performed by dynamically adjusting the number of nodes in the hidden layer of the initial feature extraction algorithm model. The calculation formula for the number of nodes in the hidden layer of the current training cycle is as follows: (19) in, yes The number of nodes in the hidden layer of the initial feature extraction algorithm model for the training cycle; yes -The number of nodes in the hidden layer of the initial feature extraction algorithm model for 1 training cycle; is the node adjustment step size of the hidden layer of the initial feature extraction algorithm model; is the sign function of the output error of the initial feature extraction algorithm model in the previous training cycle, which is used to decide whether to increase or decrease the number of nodes, that is, for ,when When greater than zero, is 1, when When it is less than or equal to zero, for .

[0105] In some embodiments, the node adjustment step size of the hidden layer of the initial feature extraction algorithm model depends on the network level, and the calculation formula of the node adjustment step size of the hidden layer is as follows: (20) in, For rounding operation; is the adjustment influence coefficient of the node adjustment step; is the depth of the current network layer. In one embodiment, Set to 6, Set to 2.5.

[0106] In step S440, the above model training cycle is repeated until a target feature extraction algorithm model that meets the training stop condition is obtained. In one embodiment, the model training cycle of steps S420 to S430 is repeated, and the model training stop condition is to reach a preset maximum number of iterations (for example, 1000 times).

[0107] In some embodiments, in the current training cycle, dynamic routing decisions are made based on the output features of the previous layer activation function of the initial encoder and the feature importance scores of the current layer, the initial decoder uses features from different encoding layers to reconstruct data, and the gradient of the loss function of the initial autoencoder algorithm model with respect to the parameters of the initial autoencoder algorithm model is calculated through the back propagation algorithm, and the weights and biases of the initial autoencoder algorithm model are updated until a target autoencoder algorithm model that meets the conditions for stopping model training is obtained. Figure 5 FIG. 2 is a flow chart showing a process of training an autoencoder algorithm model according to an embodiment of the present disclosure. Figure 5 As shown, the method for training the autoencoder algorithm model in the embodiment of the present disclosure may include: In step S510, the weights and biases of the initial autoencoder algorithm model are initialized.

[0108] In some embodiments, an initial autoencoder algorithm model based on dynamic routing is used for feature dimensionality reduction, and the initial autoencoder algorithm model is composed of a symmetrical initial encoder and an initial decoder. The calculation formula of the initialization weight of the initial autoencoder algorithm model can be as follows: (twenty one) The calculation formula for the initial bias of the initial autoencoder algorithm model can be shown as follows: (twenty two) In the formula, is the initial autoencoder algorithm model The initial weights of the layer; is the initial autoencoder algorithm model The initial bias of the layer; is the initial autoencoder algorithm model The number of neurons in the layer; is the initial autoencoder algorithm model The number of neurons in the layer; To generate the shape Standard normal distribution random numbers; The generated length is The zero vector of .

[0109] In step S520, in the current training cycle, the extracted image features are transmitted in each layer of the initial encoder, and dynamic routing decisions are made based on the output features of the activation function of the previous layer of the initial encoder and the feature importance scores of the current layer. The activation function of the current layer of the initial encoder selectively outputs the most informative features, wherein the feature importance score of the current layer is calculated based on the activation output of each neuron in the previous layer and the weight of its corresponding feature importance.

[0110] In some embodiments, the calculation formula for the most informative feature selectively output by the current layer activation function of the initial encoder is as follows: (twenty three) (twenty four) (25) in, is the initial autoencoder algorithm model Linearly transformed input to layer activation function; is the initial autoencoder algorithm model The output features of the layer’s activation function; is the initial autoencoder algorithm model The weight of the layer; is the initial autoencoder algorithm model Bias of the layer; is the ReLU activation function; is the initial autoencoder algorithm model Input features of the layer activation function; A function representing a dynamic routing decision based on feature importance scores; is used to calculate the initial autoencoder algorithm model The feature importance scoring function of the output feature of the layer activation function can also be considered as the first The feature importance scores of the layers, is the initial autoencoder algorithm model The output features of the layer’s activation function.

[0111] In some embodiments, the dynamic routing decision function integrates the activation outputs of each feature by weighted average, wherein the first The weight of the output feature of the layer's activation function is determined by the feature's feature importance score. The calculation formula for dynamic routing decisions based on the output features of the previous layer's activation function of the initial encoder and the feature importance score of the current layer is as follows: (26) The calculation formula for the feature importance score of the activation function output feature of the initial autoencoder algorithm model is expressed as: (27) In the formula, is the initial autoencoder algorithm model Tier The activation output of a neuron, is the initial autoencoder algorithm model Tier The activation output of each neuron; is the weight of the corresponding feature importance, obtained through training, indicating the The importance of each feature; is the weight of the corresponding feature importance, obtained through training, indicating the The importance of a feature; is the initial autoencoder algorithm model The total number of neurons in the layer.

[0112] It can be understood that during the training process, the extracted image features are transmitted in each layer of the initial encoder, and dynamic routing decisions are made based on the output features of the activation function of the previous layer of the initial encoder and the feature importance score of the current layer. The current layer activation function of the initial encoder selectively outputs the most informative features. The initial autoencoder of the dynamic routing mechanism reduces the information loss of the original data during the feature dimensionality reduction process and enhances the model's ability to reconstruct data.

[0113] In step S530, the initial decoder uses features from different coding layers to reconstruct data to obtain reconstructed image features, and calculates the loss function of the initial autoencoder algorithm model based on the reconstruction errors of the reconstructed image features and the extracted image features.

[0114] In some embodiments, at the decoder stage, features from different coding layers are used to reconstruct data and calculate reconstructed image features. The loss function of the initial autoencoder algorithm model is calculated based on the reconstruction error of the reconstructed image features and the extracted image features. During the training process, the calculation formula of the loss function of the initial autoencoder algorithm model is expressed as: (28) in, is the loss function of the initial autoencoder algorithm model; The number of samples (i.e. extracted image features) input for the current batch; is the first samples (i.e. extracted image features); is the jth sample after reconstruction (i.e., the reconstructed image feature).

[0115] In step S540, the gradient of the loss function of the initial autoencoder algorithm model with respect to the parameters of the initial autoencoder algorithm model is calculated by the back-propagation algorithm, and the weights and biases of the layer are updated when the sparsity of the neurons in the current layer of the initial autoencoder algorithm model is less than the sparsity pruning threshold. The weights of the layer are pruned when the sparsity of the neurons in the current layer of the initial autoencoder algorithm model is greater than or equal to the sparsity pruning threshold.

[0116] In some embodiments, the gradient of the loss function to each parameter of the initial autoencoder algorithm model is calculated by a back propagation algorithm, and the weights and biases of the initial autoencoder algorithm model are updated. The update increment of the layer weight can be expressed as: (29) No. The update increment of the layer bias can be expressed as: (30) No. The updated weights of the layer can be expressed as: (31) No. The updated bias of the layer can be expressed as: (32) in, is the initial autoencoder algorithm model The update increment of the layer weights; is the initial autoencoder algorithm model The update increment of the layer's bias; is the learning rate of the initial autoencoder algorithm model; For the The updated weights of the layer; For the The updated bias of the layer; is the initial autoencoder algorithm model The sparsity of layer neurons; is the sparsity pruning threshold; is an indicator function that takes 1 if the condition in the brackets is true, and takes 0 otherwise. In one example, It is set to 0.8, which means that the weights and biases of the layer are updated when the sparsity of the neurons in the current layer of the initial autoencoder algorithm model is less than 80%, and the weights of the layer are pruned when the sparsity of the neurons in the current layer of the initial autoencoder algorithm model is greater than or equal to 80%.

[0117] In some embodiments, the computational efficiency and generalization ability of the model are improved by dynamically pruning redundant weights, that is, the weights corresponding to neurons with smaller activation values ​​in most cases will be dynamically pruned, thereby simplifying the model structure. Specifically, the importance of neurons is judged by counting the sparsity of activation values. In some embodiments, the sparsity of neurons in the current layer of the initial autoencoder algorithm model is calculated by counting the number of samples whose output features of the activation function of the current layer of the initial encoder are less than the sparsity threshold. The calculation method of the sparsity of layer neurons is expressed as: (33) in, For the The sparsity of layer neurons; It is Tier The activation output of each neuron; is the sparsity threshold. In one example, Set to 0.1.

[0118] In step S550, the above model training cycle is repeated until a target autoencoder algorithm model that satisfies the training stop condition is obtained. In one embodiment, the model training cycle of steps S520 to S540 is repeated, and the model training stop condition is to reach a preset maximum number of iterations (e.g., 1000 times).

[0119] In some embodiments, in the current training cycle, during the back propagation process, the weight of the current decision node is adjusted according to the partial derivative of the loss function of the initial neural decision tree algorithm model with respect to the weight of the current decision node and the partial derivative of the loss function of the initial neural decision tree algorithm model with respect to the weight of the previous decision node, and the learning rate of the initial neural decision tree algorithm model is adjusted according to the difference between the actual output characteristics and the target output characteristics of the forward propagation process of the current decision node until the target neural decision tree algorithm model that meets the conditions for stopping model training is obtained. Figure 6 FIG. 2 is a flow chart showing a process of training a neural decision tree algorithm model according to an embodiment of the present disclosure. Figure 6 As shown, the method for training a neural decision tree algorithm model according to an embodiment of the present disclosure may include: In step S610, the weight and bias of each decision node in the initial neural decision tree algorithm model are initialized.

[0120] In some embodiments, the reduced-dimensional image features are input into a classifier to train the classifier model, a neural decision tree algorithm based on a bidirectional learning process is used as the classifier model, and a reverse training mechanism from output nodes to input nodes is used. In addition to conventional forward propagation and back propagation, an information feedback process from the output direction to the input direction is also used to optimize the decision boundary of each node to more accurately classify complex data structures. In some embodiments, all decision nodes are initialized, including the random allocation of weights and thresholds of the neural decision tree. Specifically, for each decision node , its initialization weight can be expressed as: (34) The initialization bias can be expressed as: (35) in, represents a normal distribution with a mean of 0 and a standard deviation of 0.01; For the The weight of the decision nodes; For the The bias of a decision node.

[0121] In step S620, in the current training cycle, during the forward propagation of the reduced-dimensional image features, data is processed node by node from the input decision node to the output decision node, and for each decision node, the output feature is calculated based on the weight and bias of the decision node, and the output feature is passed forward.

[0122] In some embodiments, during the forward propagation of the reduced-dimensional image features, data is processed node by node from the input decision node to the output decision node, and each decision node calculates the output feature according to the weight and threshold of the decision node and passes it forward. The output feature of each decision node The input features are processed by the activation function After processing, the output features of each decision node are obtained. It can be expressed as: (36) in, is the Sigmoid activation function; For the The input features of the decision nodes; For the The output features of a decision node.

[0123] In step S630, the probability predicted by the model is calculated according to the output features of the decision nodes, and the loss function of the initial neural decision tree algorithm model is calculated according to the probability predicted by the model and the one-hot encoding of the true label.

[0124] In some embodiments, the loss function of the initial neural decision tree algorithm model is calculated, and the error feedback based on the classification effect of the initial neural decision tree algorithm model is used to start the two-way learning process. It is expressed as: (37) in, is the one-hot encoding of the true label of the j-th decision node, is the probability predicted by the model at the jth decision node, is the total number of categories.

[0125] In some embodiments, the probability predicted by the model is calculated by a softmax function, and the probability predicted by the model can be expressed as: (38) in, is the total number of categories, is the probability predicted by the model at the jth decision node, is the output feature of the jth decision node, is the output feature of the kth decision node.

[0126] In step S640, during the back propagation process, the weight update amount of the current decision node is calculated based on the partial derivative of the loss function of the initial neural decision tree algorithm model with respect to the weight of the current decision node and the partial derivative of the loss function of the initial neural decision tree algorithm model with respect to the weight of the previous decision node.

[0127] In some embodiments, in the reverse learning process, the adjustment of node weights not only relies on standard gradient descent, but also uses gradient adjustment from the output decision node to the input decision node. The weight update amount of the current decision node is expressed as: (39) in, is the influence coefficient of reverse learning, is the learning rate of the initial neural decision tree algorithm model, For the The weight of the decision nodes, For the -1 decision node weight, It is understandable that the loss function of the initial neural decision tree algorithm model is About - Weight of 1 decision node The partial derivative of increases the model’s response to the error of the previous decision node and improves the efficiency of error correction.

[0128] In some embodiments, for the initial neural decision tree algorithm model The weight of the decision node , the loss function of the initial neural decision tree algorithm model About The weight of the decision node The calculation formula of the partial derivative is expressed as: (40) in, is the derivative of the Sigmoid activation function, It is The output features of the forward propagation of the decision nodes; It is The corresponding target output features of the forward propagation of the decision nodes; For the The input features of the decision nodes; It is The input features of the activation function of the decision node.

[0129] In some embodiments, The calculation formula of the input feature of the activation function of a decision node is expressed as: (41) in, It is The input features of the activation function of the decision node; For the The input features of the decision nodes; For the The weight of the decision nodes; For the The bias of a decision node.

[0130] In some embodiments, the loss function of the initial neural decision tree algorithm model is About - Weight of 1 decision node The calculation formula of the partial derivative is expressed as: (42) in, is the adjustment factor in the reverse learning process, It is The input features of the activation function of the decision node, is the derivative of the Sigmoid activation function, is the loss function of the initial neural decision tree algorithm model; For the -1 output feature of the decision node.

[0131] In step S650, the learning rate of the initial neural decision tree algorithm model is adjusted according to the difference between the actual output feature and the target output feature of the forward propagation process of the current decision node.

[0132] In some embodiments, the perceptual difference adjustment is performed, and the learning rate of the initial neural decision tree algorithm model is adjusted according to the actual performance of the output features of the decision node. The update amount of the learning rate of the initial neural decision tree algorithm model can be expressed as: (43) in, is the update amount of the learning rate of the initial neural decision tree algorithm model, is the adjustment rate of the learning rate of the initial neural decision tree algorithm model; is the error threshold, used to adjust the learning rate The size of , enhances the model's sensitivity to errors and adjustment speed; It is The output features of the forward propagation of the decision nodes; It is The corresponding target output features of the forward propagation of the decision nodes; is the hyperbolic tangent function. In one embodiment, Set to 0.1, Set to 0.5.

[0133] In step S660, the above model training cycle is repeated until a target neural decision tree algorithm model that satisfies the training stop condition is obtained. In one embodiment, the model training cycle of steps 620 to S650 is repeated, and the model training stop condition is to reach a preset maximum number of iterations (e.g., 1000 times).

[0134] It can be understood that the neural decision tree algorithm model based on the two-way learning process optimizes the decision boundary of each decision node through the information feedback process from the input decision node to the output decision node, thereby improving the classification accuracy of complex data structures when facing a changing actual application environment.

[0135] Figure 7 FIG. 1 is a flow chart showing an image recognition method according to an embodiment of the present disclosure. Figure 7 As shown, the image recognition method of the embodiment of the present disclosure may include: In step S710, human body posture image data is acquired.

[0136] In step S720, the human body posture image data is input into a target image recognition model trained according to the training method as described in any one of claims 1 to 9, and the target image recognition model outputs a human body posture category label corresponding to the human body posture image data.

[0137] In some embodiments, the trained target feature extraction algorithm model, target autoencoder algorithm model and target neural decision tree algorithm model are applied to new human posture image data to achieve real-time image recognition, and obtain human posture category labels corresponding to the human posture image data.

[0138] Figure 8 A schematic diagram of a training device for an image recognition model provided according to an embodiment of the present disclosure is shown. Figure 8 As shown, the training device 800 includes a training sample expansion unit 810 and a model training unit 820.

[0139] The training sample expansion unit 810 is used to obtain original human posture training samples, and expand the original human posture training samples using a generative adversarial network algorithm model based on feature space distortion to obtain target human posture training samples, wherein the generative adversarial network algorithm model includes a generator and a discriminator, and the generator includes a distortion module. The distortion module generates distorted image features according to a preset feature deformation algorithm based on a random noise vector and distortion module parameters, and obtains the target human posture training samples based on the distorted image features.

[0140] The model training unit 820 is used to input the target human posture training samples into the initial image recognition model, wherein the initial image recognition model performs image feature extraction, feature dimension reduction and classification processing on the target human posture training samples; according to the output of the initial image recognition model in each training cycle, the initial image recognition model is adjusted until a target image recognition model that meets the training stop conditions is obtained.

[0141] Since the process of training the initial image recognition model using the training method of the embodiment of the present disclosure has been described in detail in the method embodiment above, it will not be repeated here.

[0142] Fig. 9 FIG. 1 is a schematic diagram of an image recognition device provided according to an embodiment of the present disclosure. Fig. 9 As shown, the image recognition device 900 includes an image data acquisition unit 910 and an image recognition unit 920 .

[0143] The image data acquisition unit 910 is used to acquire human body posture image data.

[0144] The image recognition unit 920 is used to input the human posture image data into a target image recognition model trained according to the training method as described in any one of claims 1 to 9, and the target image recognition model outputs a human posture category label corresponding to the human posture image data.

[0145] Since the process of performing image recognition using the image recognition model of the embodiment of the present disclosure has been described in detail in the method embodiment above, it will not be repeated here.

[0146] The present disclosure also provides an electronic device 1000, such as Fig.10 As shown, it includes a memory 1020, a processor 1010, and a program stored in the memory 1020 and executable on the processor 1010. When the program is executed by the processor 1010, each process of each embodiment of the above-mentioned model training method and / or image recognition method can be implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0147] Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions, or by controlling related hardware through instructions, and the instructions can be stored in a computer-readable storage medium and loaded and executed by a processor. To this end, the embodiments of the present disclosure also provide a storage medium, on which a computer program or instruction is stored, and when the computer program or instruction is executed by the processor, each process of each embodiment of the above model training method and / or image recognition method can be implemented.

[0148] Since the instructions stored in the storage medium can execute the steps in the model training method and / or image recognition method provided in the embodiment of the present disclosure, the beneficial effects that can be achieved by the model training method and / or image recognition method provided in the embodiment of the present disclosure can be achieved. For details, please refer to the previous embodiments, which will not be repeated here. The specific implementation of each of the above operations can be referred to the previous embodiments, which will not be repeated here.

[0149] In summary, the training method provided by the present invention adopts a generative adversarial network algorithm model based on feature space distortion to expand the original human posture training samples to obtain target human posture training samples, wherein the generative adversarial network algorithm model includes a generator and a discriminator, the generator includes a distortion module, the distortion module generates distorted image features according to a preset feature deformation algorithm based on a random noise vector and distortion module parameters, and obtains the target human posture training samples based on the distorted image features. Since the distortion module can simulate different data changes by dynamically adjusting the distribution of data features, such as posture change, occlusion, etc., thereby increasing the diversity of images generated by the generator, the target human posture training samples can cover more diverse human postures and environmental conditions, thereby improving the generalization ability of the trained image recognition model and the accuracy of human posture recognition.

[0150] Finally, it should be noted that: Obviously, the above embodiments are only examples for clearly illustrating the present disclosure, and are not intended to limit the implementation methods. For ordinary technicians in the relevant field, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived from this are still within the scope of protection of the present disclosure.

Claims

1. A training method for an image recognition model, characterized in that: The training method comprises: Acquire original human posture training samples, and expand the original human posture training samples using a generative adversarial network algorithm model based on feature space distortion to obtain target human posture training samples, wherein the generative adversarial network algorithm model includes a generator and a discriminator, the generator includes a distortion module, the distortion module generates distorted image features according to a preset feature deformation algorithm based on a random noise vector and distortion module parameters, and obtains the target human posture training samples based on the distorted image features; Inputting the target human posture training sample into an initial image recognition model, wherein the initial image recognition model performs image feature extraction, feature dimension reduction and classification processing on the target human posture training sample; According to the output of the initial image recognition model in each training cycle, the parameters of the initial image recognition model are adjusted until a target image recognition model that meets the training stop condition is obtained.

2. The training method according to claim 1, characterized in that: The initial image recognition model includes an initial feature extraction algorithm model, an initial autoencoder algorithm model and an initial neural decision tree algorithm model, and the step of inputting the target human posture training sample into the initial image recognition model includes: Inputting the target human posture training sample into the initial feature extraction algorithm model to extract image features; Inputting the extracted image features into the initial autoencoder algorithm model to perform feature dimensionality reduction to obtain image features after dimensionality reduction, wherein the initial autoencoder algorithm model includes an initial encoder and an initial decoder; The reduced-dimensional image features are input into the initial neural decision tree algorithm model to obtain the human posture category labels of the target human posture training samples.

3. The training method according to claim 2, characterized in that: The step of adjusting the parameters of the initial image recognition model according to the output of the initial image recognition model in each training cycle until a target image recognition model that meets the training stop condition is obtained includes: Based on the output error of the initial feature extraction algorithm model in the previous training cycle, a chaotic optimization algorithm is used to adjust the learning rate of the initial feature extraction algorithm model in the current training cycle, and then the weight of the initial feature extraction algorithm model is updated according to the updated learning rate until a target feature extraction algorithm model that meets the condition for stopping model training is obtained; In the current training cycle, a dynamic routing decision is made according to the output features of the activation function of the previous layer of the initial encoder and the feature importance score of the current layer, data is reconstructed in the initial decoder using features from different encoding layers, the gradient of the loss function of the initial autoencoder algorithm model to the parameters of the initial autoencoder algorithm model is calculated by a back propagation algorithm, and the weights and biases of the initial autoencoder algorithm model are updated until a target autoencoder algorithm model that meets the conditions for stopping model training is obtained; In the current training cycle, during the back propagation process, the weight of the current decision node is adjusted according to the partial derivative of the loss function of the initial neural decision tree algorithm model with respect to the weight of the current decision node and the partial derivative of the loss function of the initial neural decision tree algorithm model with respect to the weight of the previous decision node, and the learning rate of the initial neural decision tree algorithm model is adjusted according to the difference between the actual output characteristics and the target output characteristics of the forward propagation process of the current decision node, until a target neural decision tree algorithm model that meets the conditions for stopping model training is obtained.

4. The training method according to claim 3, characterized in that: The output error amount of the initial feature extraction algorithm model based on the previous training cycle, adjusting the learning rate of the initial feature extraction algorithm model in the current training cycle using a chaotic optimization algorithm, and then updating the weight of the initial feature extraction algorithm model according to the updated learning rate until a target feature extraction algorithm model that meets the condition for stopping model training is obtained, includes: Initializing weights and biases of the initial feature extraction algorithm model; According to the output error amount and learning rate of the initial feature extraction algorithm model in the previous training cycle, using a chaos optimization algorithm to adjust the learning rate of the initial feature extraction algorithm model in the current training cycle; According to the learning rate in the current training cycle and the partial derivative of the output error amount in the previous training cycle with respect to the weight of the previous training cycle, the weight of the initial feature extraction algorithm model in the previous training cycle is adjusted to obtain the weight in the current training cycle; According to the node adjustment step of the hidden layer of the initial feature extraction algorithm model, the output error amount in the previous training cycle and the number of nodes in the hidden layer, the number of nodes in the hidden layer in the current training cycle is dynamically adjusted to achieve regularized sparsity, wherein the node adjustment step of the hidden layer of the initial feature extraction algorithm model is calculated based on the adjustment influence coefficient of the node adjustment step and the network layer depth.

5. The training method according to claim 3, characterized in that: In the current training cycle, dynamic routing decisions are made according to the output features of the activation function of the previous layer of the initial encoder and the feature importance score of the current layer, data is reconstructed using features from different encoding layers in the initial decoder, the gradient of the loss function of the initial autoencoder algorithm model to the parameters of the initial autoencoder algorithm model is calculated by the back propagation algorithm, and the weights and biases of the initial autoencoder algorithm model are updated until a target autoencoder algorithm model that meets the conditions for stopping model training is obtained, including: Initializing the weights and biases of the initial autoencoder algorithm model; In the current training cycle, the extracted image features are transmitted in each layer of the initial encoder, and dynamic routing decisions are made according to the output features of the activation function of the previous layer of the initial encoder and the feature importance scores of the current layer, and the activation function of the current layer of the initial encoder selectively outputs the most informative features, wherein the feature importance scores of the current layer are calculated according to the activation output of each neuron in the previous layer and the weight of the corresponding feature importance; At the initial decoder, data is reconstructed using features from different coding layers to obtain reconstructed image features; Calculating the loss function of the initial autoencoder algorithm model according to the reconstructed image features and the reconstruction errors of the extracted image features; The gradient of the loss function of the initial autoencoder algorithm model to the parameters of the initial autoencoder algorithm model is calculated by the back-propagation algorithm, and the weights and biases of the layer are updated when the sparsity of the neurons in the current layer of the initial autoencoder algorithm model is less than the sparsity pruning threshold. The weights of the layer are pruned when the sparsity of the neurons in the current layer of the initial autoencoder algorithm model is greater than or equal to the sparsity pruning threshold.

6. The training method according to claim 5, characterized in that: In the current training cycle, dynamic routing decisions are made according to the output features of the activation function of the previous layer of the initial encoder and the feature importance score of the current layer, data is reconstructed in the initial decoder using features from different encoding layers, the gradient of the loss function of the initial autoencoder algorithm model to the parameters of the initial autoencoder algorithm model is calculated by the back propagation algorithm, and the weights and biases of the initial autoencoder algorithm model are updated until a target autoencoder algorithm model that meets the conditions for stopping model training is obtained, further comprising: The sparsity of the current layer neurons of the initial autoencoder algorithm model is calculated by counting the number of samples whose output features of the current layer activation function of the initial encoder are less than the sparsity threshold.

7. The training method according to claim 3, characterized in that: In the current training cycle, in the back propagation process, according to the partial derivative of the loss function of the initial neural decision tree algorithm model with respect to the weight of the current decision node and the partial derivative of the loss function of the initial neural decision tree algorithm model with respect to the weight of the previous decision node, the weight of the current decision node is adjusted, and according to the difference between the actual output feature and the target output feature of the forward propagation process of the current decision node, the learning rate of the initial neural decision tree algorithm model is adjusted until a target neural decision tree algorithm model that meets the condition for stopping model training is obtained, including: Initializing the weight and bias of each decision node in the initial neural decision tree algorithm model; In the current training cycle, in the forward propagation process of the image features after dimension reduction, data is processed node by node from the input decision node to the output decision node, and for each decision node, the output feature is calculated according to the weight and bias of the decision node, and the output feature is passed forward; Calculate the probability predicted by the model according to the output features of the decision nodes, and calculate the loss function of the initial neural decision tree algorithm model according to the probability predicted by the model and the one-hot encoding of the true label; In the back propagation process, according to the partial derivative of the loss function of the initial neural decision tree algorithm model with respect to the weight of the current decision node and the partial derivative of the loss function of the initial neural decision tree algorithm model with respect to the weight of the previous decision node, the weight update amount of the current decision node is calculated; The learning rate of the initial neural decision tree algorithm model is adjusted according to the difference between the actual output feature and the target output feature of the forward propagation process of the current decision node.

8. The training method according to claim 1, characterized in that: Before obtaining the original human posture training samples and expanding the original human posture training samples using a generative adversarial network algorithm model based on feature space distortion to obtain the target human posture training samples, the training method further includes: Obtain image training samples; The image training samples are input into an initial generative adversarial network algorithm model, and the parameters of the initial generative adversarial network algorithm model are adjusted according to the output of the initial generative adversarial network algorithm model in each training cycle until the generative adversarial network algorithm model that meets the training stop condition is obtained.

9. The training method according to claim 8, characterized in that: The initial generative adversarial network algorithm model includes an initial generator and an initial discriminator, the initial generator includes an initial distortion module, the image training sample is input into the initial generative adversarial network algorithm model, and the initial generative adversarial network algorithm model is adjusted according to the output of the initial generative adversarial network algorithm model in each training cycle until the generative adversarial network algorithm model that meets the training stop condition is obtained, including: Initializing the weights of the initial generative adversarial network algorithm model; In the current training cycle, in the adversarial training cycle stage, a random noise vector is input into the initial generator, and the initial distortion module is used to generate distorted image features according to the random noise vector and distortion module parameters according to a preset feature deformation algorithm, and the initial generator generates a generated image similar to the real image; Inputting the real image and the generated image into the initial discriminator respectively, and generating a discrimination result of the real image and a discrimination result of the generated image by the initial discriminator; Calculate the loss function of the initial generator according to the content loss and style loss of the real image and the generated image; Calculate the loss function of the initial discriminator according to the discrimination result of the real image and the discrimination result of the generated image; The distortion module parameters are adjusted based on feedback information from the initial discriminator.

10. An image recognition method, characterized in that: include: Acquire human body posture image data; The human body posture image data is input into a target image recognition model trained according to the training method as described in any one of claims 1 to 9, and the target image recognition model outputs a human body posture category label corresponding to the human body posture image data.

11. A training device for an image recognition model, characterized in that: The training device comprises: A training sample expansion unit is used to obtain original human posture training samples, and expand the original human posture training samples using a generative adversarial network algorithm model based on feature space distortion to obtain target human posture training samples, wherein the generative adversarial network algorithm model includes a generator and a discriminator, the generator includes a distortion module, the distortion module generates distorted image features according to a preset feature deformation algorithm based on a random noise vector and distortion module parameters, and obtains the target human posture training samples based on the distorted image features; The model training unit is used to input the target human posture training samples into an initial image recognition model, wherein the initial image recognition model performs image feature extraction, feature dimension reduction and classification processing on the target human posture training samples; and adjusts the parameters of the initial image recognition model according to the output of the initial image recognition model in each training cycle until a target image recognition model that meets the training stop condition is obtained.

12. An image recognition device, characterized in that: include: An image data acquisition unit, used for acquiring human body posture image data; An image recognition unit is used to input the human posture image data into a target image recognition model trained according to the training method as described in any one of claims 1 to 9, and the target image recognition model outputs a human posture category label corresponding to the human posture image data.

13. An electronic device, comprising a memory, a processor, and a program stored in the memory and executable on the processor, wherein the program can implement the method according to any one of claims 1 to 10 when executed by the processor.

14. A storage medium having a computer program or instruction stored thereon, wherein the computer program or instruction, when executed by a processor, implements the steps of the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Face recognition model training method, face recognition method and device

    CN111582141A

  • Pedestrian re-identification data set attitude data augmentation method based on generative adversarial network

    CN112613411A

  • Real-time human body 3D posture estimation method and device, computer equipment and storage medium

    CN113762177A

  • Human body posture recognition method and device based on electric digital data processing

    CN117216644A

  • Intelligent image recognition method based on computer vision and machine learning

    CN118537816A

Cited By

  • Model training method, driver state monitoring method and system

    CN119723232A

  • Model training methods, driver state monitoring methods and systems

    CN119723232B

  • Picture copying detection method and device, electronic equipment and storage medium

    CN121366322A

  • Picture replication detection method and device, electronic equipment and storage medium

    CN121366322B