Image recognition model training method and device, and image recognition method and device

By using a generative adversarial network based on feature space distortion to expand the training data, the problem of insufficient training data and poor model generalization ability in human pose recognition technology is solved. The generative adversarial network algorithm is used to expand the data and the parameters are adjusted by combining the chaotic optimization algorithm, which improves the accuracy and robustness of human pose recognition.

CN119580358BActive Publication Date: 2025-11-07CHENGDU KAIYUAN COMPUTING ECOLOGICAL TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing human pose recognition technologies face problems such as insufficient training data, poor model generalization ability, and insufficient classification accuracy, especially in terms of recognition accuracy and robustness in multiple poses and multiple scene changes.

Method used

The original human pose training samples are expanded using a generative adversarial network algorithm model based on feature space distortion. The model is then combined with the initial image recognition model for image feature extraction, feature dimensionality reduction and classification. The model parameters are adjusted using a chaotic optimization algorithm until the training stopping condition is met.

Benefits of technology

It improves the generalization ability of the target image recognition model and the accuracy of human pose recognition, and enhances the model's recognition ability in diverse environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119580358B_ABST
    Figure CN119580358B_ABST
Patent Text Reader

Abstract

The present disclosure provides a kind of training method, device and image recognition method, device of image recognition model.The training method includes: using the generation of antithesis network algorithm model based on feature space distortion to original human body posture training sample is expanded, obtains target human body posture training sample, generation of antithesis network algorithm model includes generator and discriminator, generator includes distortion module, distortion module generates distortion image feature according to random noise vector and distortion module parameter according to preset feature deformation algorithm, target human body posture training sample is obtained based on distortion image feature;Target human body posture training sample is input initial image recognition model;According to the output of initial image recognition model in each training period, the initial image recognition model is adjusted, until the target image recognition model that meets the training stop condition is obtained, improve the generalization ability of target image recognition model and the accuracy of human body posture recognition.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure belongs to the technical field of human pose recognition, and particularly relates to a training method and device of an image recognition model and an image recognition method and device. BACKGROUND

[0002] With the rapid development of artificial intelligence and computer vision technology, human pose recognition has gradually become an important application in many fields, such as intelligent monitoring, virtual reality, motion analysis, and health monitoring. However, existing human pose recognition technology faces some challenges. First, collecting and labeling large-scale and diversified human pose image data requires a large amount of time and cost. In multi-view and complex environments, human pose image data collection is often insufficient, resulting in insufficient training data. This lack of training data can affect the training effect of the model, thereby affecting the accuracy of human pose recognition. Second, traditional feature extraction, feature dimension reduction, and classification algorithms may be affected by problems such as gradient disappearance, feature loss, and poor model generalization ability when dealing with complex pose changes. These problems can cause the recognition accuracy and robustness of the model in a diversified environment to decline. In addition, existing classifier models often do not have ideal classification accuracy when dealing with multi-class complex data. In particular, in recognition tasks involving multi-pose and multi-scene changes, existing classifier models have difficulty achieving stable classification results. Therefore, how to solve the above problems to improve the accuracy and robustness of human pose recognition is an important topic in the development of current human pose recognition technology. SUMMARY

[0003] In view of the above problems, the present disclosure provides a training method and device of 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 pose recognition.

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

[0005] obtaining an original human pose training sample, expanding the original human pose training sample using a generative adversarial network algorithm model based on feature space distortion to obtain a target human pose training sample, wherein the generative adversarial network algorithm model comprises a generator and a discriminator, the generator comprises 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 pose training sample is obtained 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 period, the initial image recognition model is 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 inputting of 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 for image feature extraction;

[0010] inputting the extracted image features into the initial autoencoder algorithm model for feature dimension reduction to obtain reduced image features, and the initial autoencoder algorithm model includes an initial encoder and an initial decoder;

[0011] inputting the reduced image features into the initial neural decision tree algorithm model to obtain the human posture class label of the target human posture training sample.

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

[0013] based on the output error amount of the initial feature extraction algorithm model in the previous training period, adjusting the learning rate of the initial feature extraction algorithm model in the current training period using a chaotic optimization algorithm, and then updating the weights of the initial feature extraction algorithm model according to the updated learning rate until a target feature extraction algorithm model that meets the stop model training condition is obtained;

[0014] In the current training period, dynamic routing decisions are made according to 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 utilizes features from different encoding layers for data reconstruction, the loss function of the initial autoencoder algorithm model is calculated by a back propagation algorithm to obtain the gradient of the parameters of the initial autoencoder algorithm model, the weights and biases of the initial autoencoder algorithm model are updated until a target autoencoder algorithm model that meets the stop model training condition is obtained;

[0015] In the current training cycle, during back propagation, 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 feature and the target output feature of the forward propagation process of the current decision node, until a target neural decision tree algorithm model that meets the stop model training condition is obtained.

[0016] Optionally, based on the output error amount 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 chaotic optimization algorithm, 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 stop model training condition is obtained, comprising:

[0017] Initializing the weight and bias of the initial feature extraction algorithm model;

[0018] Adjusting the learning rate of the initial feature extraction algorithm model in the current training cycle using a chaotic optimization algorithm according to the output error amount and the learning rate of the initial feature extraction algorithm model in the previous training cycle;

[0019] Adjusting the weight of the initial feature extraction algorithm model in the previous 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 in the previous training cycle, to obtain the weight in the current training cycle;

[0020] Dynamically adjusting the number of nodes in the hidden layer 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, to achieve regularization sparsity, wherein the node adjustment step of the hidden layer of the initial feature extraction algorithm model is calculated according to 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 feature of the previous layer activation function of the initial encoder and the feature importance score of the current layer, the initial decoder reconstructs data using features from different encoding layers, 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 a back propagation algorithm, the weight and bias of the initial autoencoder algorithm model are updated, until a target autoencoder algorithm model that meets the stop model training condition is obtained, comprising:

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

[0023] in the current training cycle, passing the extracted image features through each layer of the initial encoder, making a dynamic routing decision according to the output features of the previous layer activation function of the initial encoder and the feature importance score of the current layer, and the current layer activation function of the initial encoder selectively outputs the most informative features, wherein the feature importance score of the current layer is calculated according to the activation output of each neuron of the previous layer and the weight of its corresponding feature importance;

[0024] in the initial decoder, data reconstruction is performed using features from different encoding layers to obtain reconstructed image features;

[0025] According to the reconstruction error of the reconstructed image features and the extracted image features, the loss function of the initial autoencoder algorithm model is calculated;

[0026] 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, the weights and biases of the current layer of the initial autoencoder algorithm model are updated when the sparsity of the current layer neurons of the initial autoencoder algorithm model is less than the sparsity pruning threshold, and the weights of the current layer of the initial autoencoder algorithm model are pruned when the sparsity of the current layer neurons of the initial autoencoder algorithm model is greater than or equal to the sparsity pruning threshold.

[0027] Optionally, in the current training cycle, according to the output features of the previous layer activation function of the initial encoder and the feature importance score of the current layer, making a dynamic routing decision, in the initial decoder, data reconstruction is performed using features from different encoding layers, 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 initial autoencoder algorithm model are updated until the target autoencoder algorithm model satisfying the stop model training condition 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, 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 last decision node, and 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 in the forward propagation process of the current decision node, until a target neural decision tree algorithm model that meets the stop model training condition is obtained, comprising:

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

[0031] In the current training cycle, during the forward propagation process of the reduced image feature, the 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] The probability of model prediction is calculated according to the output feature of the decision node, and the loss function of the initial neural decision tree algorithm model is calculated according to the one-hot encoding of the model prediction probability and the real label;

[0033] In the back propagation process, the weight update amount of the current decision node is calculated 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 last decision node;

[0034] 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 in the forward propagation process of the current decision node.

[0035] Optionally, before the training method further comprises:

[0036] Obtaining an image training sample;

[0037] The image training sample is input into an 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.

[0038] Optionally, the initial generative adversarial network algorithm model comprises an initial generator and an initial discriminator, the initial generator comprises 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 period until the generative adversarial network algorithm model satisfying the training stop condition is obtained, comprising:

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

[0040] In the current training period, 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 the distortion module parameters according to a preset feature deformation algorithm, and the initial generator generates a generated image similar to the real image;

[0041] The real image and the generated image are input into the initial discriminator respectively, and the initial discriminator generates a discrimination result of the real image and a discrimination result of the generated image;

[0042] According to the content loss and the style loss of the real image and the generated image, a loss function of the initial generator is calculated;

[0043] According to the discrimination result of the real image and the discrimination result of the generated image, a loss function of the initial discriminator is calculated;

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

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

[0046] Obtaining human posture image data;

[0047] The human posture image data is input into a target image recognition model trained according to the training method, and the human posture image data is output by the target image recognition model. The human posture image data corresponds to the human posture category label.

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

[0049] The training sample expansion unit is configured to obtain original human posture training samples, expand the original human posture training samples by using a generative adversarial network algorithm model based on feature space distortion, and 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.

[0050] The model training unit is configured 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 the initial image recognition model is adjusted according to the output of the initial image recognition model in each training cycle until a target image recognition model that meets a training stop condition is obtained.

[0051] According to a fourth aspect of the present disclosure, an image recognition device is provided, and the device comprises:

[0052] The image data acquisition unit is configured to obtain human posture image data.

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

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

[0055] According to a sixth aspect of the present disclosure, a storage medium is provided, and the storage medium stores a computer program or instructions, and the computer program or instructions are executed by a processor to implement the steps of the method described above.

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

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

[0058] Other features and advantages of the present disclosure will be set forth in the following description, and in part will become apparent from the description, or can be learned by practice of the present disclosure. The objects and other advantages of the present disclosure will be realized and achieved by the structures particularly pointed out in the description and the accompanying drawings.

[0059] In order to make the above-mentioned objects, features and advantages of the present disclosure more obvious and easy to understand, the following preferred embodiments are specifically described below, and the accompanying drawings are described in detail as follows. BRIEF DESCRIPTION OF DRAWINGS

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

[0061] Figure 1 A flowchart of a training method of an image recognition model is shown according to an embodiment of the present disclosure;

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

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

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

[0065] Figure 5 A flowchart of model training of a self-encoder algorithm model is shown according to an embodiment of the present disclosure;

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

[0067] Figure 7 FIG. 1 shows a flowchart of an image recognition method according to an embodiment of the present disclosure;

[0068] Figure 8 FIG. 2 shows a schematic diagram of a training device of an image recognition model according to an embodiment of the present disclosure;

[0069] Figure 9 FIG. 3 shows a schematic diagram of an image recognition device according to an embodiment of the present disclosure;

[0070] Figure 10 FIG. 4 shows a structural schematic diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

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

[0072] The following terms are used herein:

[0073] Human pose recognition is an important research direction in the field of computer vision, and its goal is to detect and recognize the structural information of human body, i.e., the pose of human body, such as standing, running, sitting, etc., from images or videos. This usually involves recognizing and locating key parts of the human body, such as the head, hands, feet, etc., and determining the spatial relationship between these parts.

[0074] Figure 1 FIG. 5 shows a flowchart of a training method of an image recognition model according to an embodiment of the present disclosure. As shown in FIG. 5, the training method of the present embodiment can include: Figure 1

[0075] In step S110, an original human pose training sample is obtained, and a generative adversarial network algorithm model based on feature space distortion is used to expand the original human pose training sample to obtain a target human pose training sample. 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 pose training sample is obtained based on the distorted image features.

[0076] In some embodiments, the source of the original human pose training sample can be a public data set, and can also be images captured by a high-resolution camera system in multiple perspectives and multiple environmental conditions in an actual environment. Figure 2 ​A schematic diagram of a raw human pose training sample is shown according to an embodiment of the present disclosure. As shown in Figure 2 The raw human pose training sample includes key parts of the human body, such as the head, hands, feet, etc. By determining the spatial relationship between these parts, the pose of the human body can be identified, such as standing, running, sitting, etc. The raw human pose training sample can be stored in a binary file format, and each image file contains raw pixel data and related metadata. The specific storage format is as follows:

[0077]

[0078] wherein Rij represents the pixel value of the i-th row and j-th column in the image. aij

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

[0080] In some embodiments, the generative adversarial network algorithm model is trained before step S110. Figure 3 A flowchart of training a generative adversarial network algorithm model is shown according to an embodiment of the present disclosure. As shown in Figure 3 The method for training the generative adversarial network algorithm model of the present embodiment can include:

[0081] In step S310, an image training sample is obtained.

[0082] ​Since the process of collecting and labeling image training samples can refer to the relevant collection and labeling process of the original human pose training samples, details are not repeated here.

[0083] In step S320, the image training sample is input into an 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 period until the generative adversarial network algorithm model satisfying the training stop condition is obtained.

[0084] 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.

[0085] In some embodiments, the initial weight of the initial generative adversarial network algorithm model is represented as:

[0086]

[0087] Wherein, W c,init represents the initial weight of the initial generator and the initial discriminator, n c is the number of neurons of the previous layer of the initial generative adversarial network algorithm model, represents a normal distribution with a mean of 0 and a variance of 1.

[0088] In some embodiments, in the current training period, 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 the distortion module parameters according to the preset feature deformation algorithm, and the initial generator generates a generated image similar to the real image.

[0089] In some embodiments, in the current training period, in the adversarial training cycle stage, a random noise vector is input into the initial generator G c , and the initial generator G c generates a generated image x c,real similar to the real image x c,gen . The calculation formula is as follows:

[0090] x c,gen =G c (x c ;φ c ) (2)

[0091] Wherein, x c,gen represents the generated image generated by the initial generator G c , φ c is the parameter of the initial generator G c , and xc x represents a distorted image feature, G c is an initial generator function.

[0092] In some embodiments, the initial distortion module Δ c is generated according to a random noise vector z c and a distortion module parameter θ c According to the preset feature deformation algorithm, the calculation formula of the distorted image feature x c is as follows:

[0093] x c = G c (z c , Δ c ((z c ; θ c )) (3)

[0094] Δ c (z c ; θ c ) = z c ·(1+∈ c sin(β c z c )) (4)

[0095] wherein x c represents a distorted image feature, z c is a random noise vector, θ c is a distortion module parameter, ∈ c is a distortion degree control parameter, β c is a distortion frequency control parameter, G c is an initial generator function.

[0096] In some embodiments, the calculation formula of the distortion degree control parameter is as follows:

[0097]

[0098] The calculation formula of the distortion frequency control parameter is as follows:

[0099]

[0100] wherein α c is a control parameter of the sensitivity of the distortion intensity, σ c is a first parameter of the dependence relationship for adjusting the distortion frequency, δ c is a second parameter of the dependence relationship for adjusting the distortion frequency, ||z c || represents the length of the random noise vector, and || || represents the L2 norm.

[0101] 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.

[0102] In some embodiments, the real image x c,real Input initial discriminator D c By the initial discriminator D c Generate a discrimination result y for the real image. c,real The calculation formula is as follows:

[0103] y c,real =D c (x c,real ; ψ c (7)

[0104] The generated image x c,gen Input initial discriminator D c By the initial discriminator D c Generate a discrimination result y for the generated image. c,gen The calculation formula is as follows:

[0105] y c,gen =D c (x c,gen ;ψ c (8)

[0106] Among them, y c,real and y c,gen Let ψ represent the discrimination results for the real image and the generated image, respectively. c For the initial discriminator D c The parameter, D c () is the initial discriminator function.

[0107] 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 results of the real image and the discrimination results of the generated image.

[0108] In some embodiments, the initial generator G c loss function The calculation formula is as follows:

[0109]

[0110] in, For the initial generator G c The loss function; λ represents the square of the L2 norm. c and γc are weight coefficients of content loss and style loss respectively, D c (G c (x c )) is the discrimination result of the generated image, x c,real is the real image, x c,gen is the generated image, represents the content loss function, represents the style loss function.

[0111] In some embodiments, the style loss function is calculated as follows:

[0112]

[0113] wherein Cs represents a selected layer set, λ c,l is the weight of the lth layer of the initial generator, G l represents the Gram matrix of the lth layer of the initial generator, || || F represents the Frobenius norm, x c,real is the real image, x c,gen is the generated image.

[0114] In some embodiments, the loss function c of the initial discriminator D is calculated as follows:

[0115]

[0116] wherein, is the loss function of the initial discriminator D c , D c (x c,real ) and D c (x c,gen ) represent the discrimination results of the real image and the generated image respectively.

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

[0118] In some embodiments, the distortion module parameters θ c of the initial generator G c are adjusted according to the feedback information of the initial discriminator D c , so as to optimize the quality and diversity of the generated image, ensure that the generated image can better cover the diversity of human body poses, and the calculation formula of the adjusted distortion module parameters θ is as follows:

[0119]

[0120] wherein, denotes the updated distortion module parameters, η c (t) is the learning rate of the distortion module at the t-th training cycle (i.e. the t-th iteration), denotes the gradient of the distortion module parameters θ c , η c,0 is the initial learning rate, κ c is a control parameter of the speed of learning rate decay, w c and μ c are control parameters of the momentum factor and the update rate, respectively, v c,prev is the gradient momentum of the previous training cycle, β c is the momentum decay factor, is the loss function of the initial generator G c , is the loss function value of the initial generator G c of the previous training cycle.

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

[0122] In step S120, the target human pose 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 pose training sample.

[0123] 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 pose training sample is input into the initial feature extraction algorithm model for image feature extraction, the extracted image features are input into the initial autoencoder algorithm model for feature dimension reduction, and the dimension-reduced image features are obtained. The initial autoencoder algorithm model includes an initial encoder and an initial decoder, and the dimension-reduced image features are input into the initial neural decision tree algorithm model to obtain the human pose class label of the target human pose training sample.

[0124] In step S130, 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 satisfying a training stop condition is obtained.

[0125] In some embodiments, based on the output error amount of the initial feature extraction algorithm model in the last training period, the learning rate of the initial feature extraction algorithm model in the current training period is adjusted by using a chaotic optimization algorithm, and then the weights of the initial feature extraction algorithm model are updated according to the updated learning rate until a target feature extraction algorithm model satisfying the stop model training condition is obtained. Figure 4 A flowchart of model training of a feature extraction algorithm model according to one embodiment of the present disclosure is shown. As shown in Figure 4 The method of model training of the feature extraction algorithm model according to the embodiment of the present disclosure can include:

[0126] In step S410, the weights and biases of the initial feature extraction algorithm model are initialized.

[0127] In some embodiments, the calculation formula of the initialized weights of the initial feature extraction algorithm model is as follows:

[0128] W p,0 = μ p + σ p · N(0, I) (15)

[0129] The calculation formula of the initialized biases of the initial feature extraction algorithm model is as follows:

[0130] b p,0 = v p · N(0, I) (16)

[0131] wherein W p,0 is the initial value of the weights of the neural network of the initial feature extraction algorithm model; b p,0 is the initial value of the biases of the neural network of the initial feature extraction algorithm model; μ p is the mean value offset of the weights; v p is the mean value offset of the biases; σ p is the standard deviation of the weight initialization; N(0, I) represents a normal distribution with a mean value of 0 and a standard deviation of a unit matrix, and I is a unit matrix. In one embodiment, μ p is set to 0.01, v p is set to 0.05, and σ p is set to 0.001.

[0132] In step S420, the learning rate of the initial feature extraction algorithm model in the current training period is adjusted using the chaotic optimization algorithm according to the output error quantity of the initial feature extraction algorithm model in the last training period and the learning rate, the weight of the initial feature extraction algorithm model in the last training period is adjusted according to the learning rate in the current training period and the partial derivative of the output error quantity of the initial feature extraction algorithm model in the last training period with respect to the weight of the last training period, and the weight in the current training period is obtained.

[0133] In some embodiments, during the training process, the output error quantity of the initial feature extraction algorithm model in the last training period is evaluated, and the learning rate of the current training period is adjusted through a chaotic feedback mechanism to avoid overfitting or underfitting. The calculation formula of the learning rate of the initial feature extraction algorithm model in the current training period is as follows:

[0134] η p,t = η p,t-1 · exp(- γ p · ΔE p,t-1 ) (17)

[0135] wherein η p,t is the learning rate of the initial feature extraction algorithm model in the tth training period; η p,t-1 is the learning rate of the initial feature extraction algorithm model in the (t-1)th training period; γ p is the adjustment factor of the neural network, which controls the sensitivity of the learning rate change; ΔE p,t-1 is the output error quantity of the initial feature extraction algorithm model in the last training period.

[0136] In some embodiments, according to the updated learning rate, the weight is updated, and the calculation formula of the weight of the initial feature extraction algorithm model in the current training period is as follows:

[0137]

[0138] wherein W p,t is the weight of the initial feature extraction algorithm model in the tth training period; η p,t is the learning rate of the initial feature extraction algorithm model in the tth training period, W p,t-1 is the weight of the initial feature extraction algorithm model in the (t-1)th training period; ΔE p,t-1 is the output error quantity of the initial feature extraction algorithm model in the last training period, which is calculated by a preset Softmax function on the output features of the last layer of the neural network; is the partial derivative symbol.

[0139] It can be understood that, in the training process, the learning rate of the initial feature extraction algorithm model is adjusted based on the output error amount of the initial feature extraction algorithm model in the last training period by using the chaotic optimization algorithm, and then the weights of the initial feature extraction algorithm model are updated according to the updated learning rate. Since the fully connected neural network of the initial feature extraction algorithm model optimized by using the chaotic optimization algorithm utilizes the sensitivity in the chaos theory to allow the weight update strategy to be dynamically adjusted according to the output error of the initial feature extraction algorithm model in the last training period, the gradient vanishing or explosion problem that may be encountered by the traditional neural network in the feature extraction stage is reduced, the response capability of the target feature extraction algorithm model to the initial state and parameter change is improved, the training stability and model performance are improved, and thus the accuracy and robustness of the human posture recognition are improved.

[0140] In step S430, the number of nodes in the hidden layer in the current training period is dynamically adjusted to achieve regularization sparsity according to the node adjustment step of the hidden layer of the initial feature extraction algorithm model, the output error amount in the last training period, and the number of nodes in the hidden layer. The node adjustment step of the hidden layer of the initial feature extraction algorithm model is calculated according to the adjustment influence coefficient of the node adjustment step and the network layer depth.

[0141] In some embodiments, in the training process, overfitting is prevented by adopting a regularization strategy to ensure the generalization capability of the initial feature extraction algorithm model. Specifically, regularization sparsity is performed by dynamically adjusting the number of nodes in the hidden layer of the initial feature extraction algorithm model. The calculation formula of the number of nodes in the hidden layer in the current training period is as follows:

[0142] N p,t = N p,t-1 + sgn(ΔE p,t-1 )·β p (19)

[0143] wherein N p,t is the number of nodes in the hidden layer of the initial feature extraction algorithm model in the tth training period; N p,t-1 is the number of nodes in the hidden layer of the initial feature extraction algorithm model in the (t-1)th training period; β p is the node adjustment step of the hidden layer of the initial feature extraction algorithm model; sgn() is a sign function of the output error amount of the initial feature extraction algorithm model in the last training period, which is used to determine whether to increase or decrease the number of nodes, i.e., for sgn(ΔE p,t-1 ), when ΔE p,t-1 is greater than zero, sgn(ΔE p,t-1 ) is 1, and when ΔE p,t-1 is less than or equal to zero, sgn(ΔE p,t-1 ) is -1.

[0144] In some embodiments, the node adjustment step 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 of the hidden layer is as follows:

[0145]

[0146] wherein, Int cs () is the rounding operation; a p is the adjustment influence coefficient of the node adjustment step; d p is the depth of the current network level. In one embodiment, d p is set to 6, and a p is set to 2.5.

[0147] In step S440, the above model training cycle is repeated until the 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 stop model training condition is that the preset maximum iteration number (for example, 1000 times) is reached.

[0148] In some embodiments, in the current training cycle, the dynamic routing decision is made according to the output features of the previous layer activation function of the initial encoder and the feature importance score of the current layer, the initial decoder utilizes the features from different encoding layers for data reconstruction, 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 the target autoencoder algorithm model that meets the stop model training condition is obtained. Figure 5 A flowchart of model training of an autoencoder algorithm model according to one embodiment of the present disclosure is shown. As Figure 5 shown, the method of model training of the autoencoder algorithm model according to the embodiment of the present disclosure can include:

[0149] In step S510, the weights and biases of the initial autoencoder algorithm model are initialized.

[0150] In some embodiments, the initial autoencoder algorithm model based on dynamic routing is used for feature dimension reduction, and the initial autoencoder algorithm model is composed of a symmetric initial encoder and an initial decoder. The calculation formula of the initialization weight of the initial autoencoder algorithm model can be as follows:

[0151]

[0152] The calculation formula of the initialization bias of the initial autoencoder algorithm model can be as follows:

[0153]

[0154] wherein, is the initial weight of the i-th layer of the initial autoencoder algorithm model; is the initial bias of the i-th layer of the initial autoencoder algorithm model; n r,i is the number of neurons of the i-th layer of the initial autoencoder algorithm model; n r,i-1 is the number of neurons of the i-1-th layer of the initial autoencoder algorithm model; randn(n r,i , n r,i-1 ) is used to generate a standard normal distribution random number with the shape of n r,i x n r,i-1 ; zeros(n r,i ) is used to generate a zero vector with the length of n r,i .

[0155] In step S520, in the current training cycle, the extracted image features are transmitted through each layer of the initial encoder, and 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, and the current layer activation function of the initial encoder selectively outputs the feature with the most information amount, wherein the feature importance score of the current layer is calculated according to the activation output of each neuron of the previous layer and the weight of the corresponding feature importance.

[0156] In some embodiments, the calculation formula of the feature with the most information amount selectively output by the current layer activation function of the initial encoder is as follows:

[0157] z r,i = W r,i · x r,i + b r,i (23)

[0158] a r,i = Re(z r,i ) (24)

[0159] x r,i = route(a r,i-1 , imp(a r,i-1 )) (25)

[0160] wherein, z r,i is the linear transformation input of the i-th layer activation function of the initial autoencoder algorithm model; a r,i is the output feature of the i-th layer activation function of the initial autoencoder algorithm model; W r,i is the weight of the i-th layer of the initial autoencoder algorithm model; b r,i is the bias of the i-th layer of the initial autoencoder algorithm model; Re() is the ReLU activation function; xr,i is the input feature of the activation function of the i-th layer of the initial autoencoder algorithm model; route() represents a function of dynamic routing decision based on the feature importance score; imp(ai-1) is a feature importance score function for calculating the output feature of the activation function of the i-1-th layer of the initial autoencoder algorithm model, which can also be considered as the feature importance score of the i-th layer; ai-1 is the output feature of the activation function of the i-1-th layer of the initial autoencoder algorithm model. r,i-1 r,i-1 is the output feature of the activation function of the i-1-th layer of the initial autoencoder algorithm model.

[0161] In some embodiments, the dynamic routing decision function integrates the activation outputs of various features by means of weighted average, wherein the weight of the output feature of the activation function of the i-1-th layer of the initial autoencoder algorithm model is determined by the feature importance score of the feature. The calculation formula of the dynamic routing decision according to the output feature of the activation function of the previous layer of the initial encoder and the feature importance score of the current layer is as follows:

[0162]

[0163] The calculation formula of the feature importance score of the activation function output feature of the initial autoencoder algorithm model is represented as:

[0164]

[0165] In the formula, ai-1j is the activation output of the j-th neuron of the i-1-th layer of the initial autoencoder algorithm model; ai-1k is the activation output of the k-th neuron of the i-1-th layer of the initial autoencoder algorithm model; wj is the weight corresponding to the feature importance, which is obtained by training, representing the importance of the j-th feature; wk is the weight corresponding to the feature importance, which is obtained by training, representing the importance of the k-th feature; n is the total number of neurons of the i-1-th layer of the initial autoencoder algorithm model. r,i-1,j r,i-1,k r,imp,j r,imp,k r,i-1

[0166] It can be understood that during the training process, the extracted image features are passed through each layer of the initial encoder, and the dynamic routing decision is made according to the output feature of the activation function of the previous layer of the initial encoder and the feature importance score of the current layer. The activation function of the current layer of the initial encoder selectively outputs the feature with the most information amount. The initial autoencoder of the dynamic routing mechanism reduces the information loss of the original data in the feature dimension reduction process and enhances the reconstruction ability of the model to the data.

[0167] ​​​​​​In step S530, the initial decoder reconstructs data using features from different encoding layers to obtain reconstructed image features, and calculates a loss function of the initial autoencoder algorithm model according to a reconstruction error of the extracted image features and the reconstructed image features.

[0168] In some embodiments, in the decoder stage, the reconstructed image features are calculated by reconstructing data using features from different encoding layers. The loss function of the initial autoencoder algorithm model is calculated according to a reconstruction error of the extracted image features and the reconstructed image features. In the training process, the calculation formula of the loss function of the initial autoencoder algorithm model is represented as:

[0169]

[0170] wherein L r is the loss function of the initial autoencoder algorithm model; m r is the number of samples (i.e., the extracted image features) input in the current batch; is the jth sample (i.e., the extracted image features) input to the initial autoencoder algorithm model; xr r,j is the reconstructed jth sample (i.e., the reconstructed image features).

[0171] 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 a backpropagation algorithm, the weights and biases of the current layer of the initial autoencoder algorithm model are updated when the sparsity of the neurons in the current layer of the initial autoencoder algorithm model is less than a sparsity pruning threshold, and the weights of the current layer of the initial autoencoder algorithm model 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.

[0172] In some embodiments, the gradient of the loss function with respect to each parameter of the initial autoencoder algorithm model is calculated by a backpropagation algorithm, and the weights and biases of the initial autoencoder algorithm model are updated. The update increment of the weights of the ith layer of the initial autoencoder algorithm model can be represented as:

[0173]

[0174] The update increment of the bias of the ith layer can be represented as:

[0175]

[0176] The updated weights of the ith layer can be represented as:

[0177]

[0178] The updated bias of the ith layer can be represented as:

[0179]

[0180] wherein, ΔW r,i is an update increment of the weight of the i-th layer of the initial autoencoder algorithm model; Δb r,i is an update increment of the bias of the i-th layer of the initial autoencoder algorithm model; η r is a learning rate of the initial autoencoder algorithm model; is the updated weight of the i-th layer; is the updated bias of the i-th layer; S r,i is the sparsity of the i-th layer neuron of the initial autoencoder algorithm model; λ r,s is the sparsity pruning threshold; is an indicator function, which takes 1 when the condition in the bracket is true, and 0 otherwise. In one example, λ r,s is set to 0.8, indicating that the weight and bias of the current layer of the initial autoencoder algorithm model are updated when the sparsity of the neuron of the current layer is less than 80%, and the weight of the current layer is pruned when the sparsity of the neuron of the current layer is greater than or equal to 80%.

[0181] In some embodiments, the computational efficiency and generalization ability of the model are improved by dynamically pruning redundant weights, i.e. the weights corresponding to neurons with small activation values in most cases will be dynamically pruned, thereby simplifying the model structure. Specifically, the importance of neurons is determined by the sparsity of the activation values. In some embodiments, the sparsity of the neuron of 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 the i-th layer neuron of the initial autoencoder algorithm model is represented as:

[0182]

[0183] wherein, S r,i is the sparsity of the i-th layer neuron; a r,i,j is the activation output of the j-th neuron of the i-th layer; τ r is the sparsity threshold. In one example, τ r is set to 0.1.

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

[0185] 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 last decision node, 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, until a target neural decision tree algorithm model satisfying the stop model training condition is obtained. Figure 6 A flowchart of model training of a neural decision tree algorithm model according to an embodiment of the present disclosure is shown. As shown in Figure 6 The method of model training of a neural decision tree algorithm model according to an embodiment of the present disclosure can include:

[0186] In step S610, the weight and bias of each decision node in the initial neural decision tree algorithm model are initialized.

[0187] In some embodiments, the reduced dimension image features are input into a classifier for training of a classifier model, a neural decision tree algorithm based on a bidirectional learning process is used as the classifier model, a reverse training mechanism from the output node to the input node is used, in addition to the conventional forward propagation and back propagation, an information feedback process from the output direction to the input direction is used to optimize the decision boundary of each node, so as to more accurately classify complex data structures. In some embodiments, all decision nodes are initialized, including random allocation of weights and thresholds of the neural decision tree. Specifically, for each decision node N u,i The initialization weight can be represented as:

[0188]

[0189] The initialization bias can be represented as:

[0190]

[0191] wherein, represents a normal distribution with a mean of 0 and a standard deviation of 0.01; W u,i is the weight of the i-th decision node; b u,i is the bias of the i-th decision node.

[0192] In step S620, in the current training cycle, during the forward propagation process of the reduced dimension image features, the data is processed node by node from the input decision node to the output decision node, 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.

[0193] In some embodiments, during the forward propagation of the reduced dimension image features, data is processed node by node from the input decision node to the output decision node, and each decision node calculates and forwards an output feature according to the weight and threshold of the decision node. The output feature y u,i of each decision node is obtained by processing the input feature x u,i through an activation function, and the output feature y u,i of each decision node can be represented as:

[0194] y u,i = Sig(W u,i ·x u,i +b u,i ) (36)

[0195] wherein Sig() is a Sigmoid activation function; x u,i is the input feature of the i-th decision node; and y u,i is the output feature of the i-th decision node.

[0196] In step S630, a probability predicted by the model is calculated according to the output feature of the decision node, and a 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 real label.

[0197] In some embodiments, the loss function of the initial neural decision tree algorithm model is calculated, an error is fed back according to the classification effect of the initial neural decision tree algorithm model, and a bidirectional learning process is started. The loss function L u of the initial neural decision tree algorithm model is represented as:

[0198]

[0199] wherein L u is the loss function of the initial neural decision tree algorithm model, t u,j is the one-hot encoding of the real label of the j-th decision node, p u,j is the probability predicted by the model of the j-th decision node, and C is the total number of classes.

[0200] In some embodiments, the probability predicted by the model is calculated through a softmax function, and the probability predicted by the model can be represented as:

[0201]

[0202] wherein C is the total number of classes, p u,j is the probability predicted by the model of the j-th decision node, y u,j is the output feature of the j-th decision node, and y u,k is the output feature of the k-th decision node.

[0203] In step S640, during the back propagation, the weight update amount of the current decision node is calculated 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 last decision node.

[0204] In some embodiments, in the back learning process, the adjustment of the node weight not only depends on the standard gradient descent, but also adopts the gradient adjustment from the output decision node to the input decision node. The weight update amount of the current decision node is represented as:

[0205]

[0206] wherein, ΔW u,i is the weight update amount of the i-th decision node, a is the influence coefficient of the back learning, η is the learning rate of the initial neural decision tree algorithm model, W u,i is the weight of the i-th decision node, W u,i-1 is the weight of the (i-1)-th decision node, L u is the loss function of the initial neural decision tree algorithm model. It can be understood that the loss function L u of the initial neural decision tree algorithm model is the difference between the output of the i-th decision node and the target output of the i-th decision node. u,i-1 The partial derivative of the loss function L u,i of the initial neural decision tree algorithm model with respect to the weight W u of the i-th decision node increases the response of the model to the error of the last decision node, and improves the error correction efficiency.

[0207] In some embodiments, for the weight W u,i of the i-th decision node of the initial neural decision tree algorithm model, the calculation formula of the partial derivative of the loss function L u of the initial neural decision tree algorithm model with respect to the weight W u,i of the i-th decision node is represented as:

[0208]

[0209] wherein, Sig'( ) is the derivative of the Sigmoid activation function, y u,i is the output feature of the forward propagation of the i-th decision node; t u,i is the corresponding target output feature of the forward propagation of the i-th decision node; x u,i is the input feature of the i-th decision node; z u,i is the input feature of the activation function of the i-th decision node.

[0210] In some embodiments, the calculation formula of the input feature of the activation function of the i-th decision node is represented as:

[0211] z u,i = Wu,i ·x u,i +b u,i (41)

[0212] Among them, z u,i x is the input feature of the activation function of the i-th decision node; u,i W represents the input features of the i-th decision node. u,i b is the weight of the i-th decision node; u,i Let be the bias of the i-th decision node.

[0213] In some embodiments, the loss function L of the initial neural decision tree algorithm model u The weight W of the (i-1)th decision node u,i-1 The formula for calculating the partial derivative is expressed as:

[0214]

[0215] Where, α u,i It is the adjustment factor in the reverse learning process, z u,i-1 The input features of the activation function of the (i-1)th decision node are denoted by sig′(), which is the derivative of the sigmoid activation function. u It is the loss function of the initial neural decision tree algorithm model; y u,i-1 Let be the output feature of the (i-1)th decision node.

[0216] In step S650, the learning rate of the initial neural decision tree algorithm model is adjusted based on the difference between the actual output features and the target output features of the forward propagation process of the current decision node.

[0217] In some embodiments, 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 nodes. The update amount of the learning rate of the initial neural decision tree algorithm model can be expressed as:

[0218] Δη=γ·tanh(||y u,i -t u,i ||-θ) (43)

[0219] Where Δη 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 size of the learning rate η to enhance the model's sensitivity to error and adjustment speed; y u,i It is the output feature of the forward propagation of the i-th decision node; t u,i γ is the target output feature corresponding to the forward propagation of the i-th decision node; tanh() is the hyperbolic tangent function. In one embodiment, γ is set to 0.1 and θ is set to 0.5.

[0220] In step S660, the above model training cycle is repeated until a target neural decision tree algorithm model satisfying a training stop condition is obtained. In an embodiment, the model training cycle of steps S620 to S650 is repeated, and the stop model training condition is that a preset maximum iteration number (e.g., 1000 times) is reached.

[0221] It can be understood that, by using the neural decision tree algorithm model based on the bidirectional learning process, the decision boundary of each decision node is optimized through the information feedback process from the input decision node to the output decision node, and the classification accuracy of complex data structures in the face of variable actual application environments is improved.

[0222] Figure 7 A flowchart of an image recognition method according to an embodiment of the present disclosure is shown. As shown in the figure, Figure 7 the image recognition method of the embodiment of the present disclosure can include:

[0223] In step S710, human posture image data is obtained.

[0224] In step S720, the human posture image data is input into a target image recognition model trained by the training method, and a human posture category label corresponding to the human posture image data is output by the target image recognition model.

[0225] In some embodiments, the target feature extraction algorithm model, the target autoencoder algorithm model, and the target neural decision tree algorithm model trained are applied to new human posture image data to realize real-time image recognition, and a human posture category label corresponding to the human posture image data is obtained.

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

[0227] The training sample expansion unit 810 is configured to obtain original human posture training samples, expand the original human posture training samples by using a generative adversarial network algorithm model based on feature space distortion, and 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.

[0228] The model training unit 820 is configured to input the target human posture training sample into an initial image recognition model, where the initial image recognition model performs image feature extraction, feature dimension reduction, and classification processing on the target human posture training sample; and according to the output of the initial image recognition model in each training period, the initial image recognition model is adjusted until a target image recognition model satisfying a training stop condition is obtained.

[0229] Since the process of model training of the initial image recognition model using the training method of the embodiments of the present disclosure has been described in the method embodiments above, further description is omitted here.

[0230] Figure 9 A schematic diagram of an image recognition apparatus according to an embodiment of the present disclosure is shown. As shown in the figure, Figure 9 The image recognition apparatus 900 includes an image data acquisition unit 910 and an image recognition unit 920.

[0231] The image data acquisition unit 910 is configured to acquire human posture image data.

[0232] The image recognition unit 920 is configured to input the human posture image data into the target image recognition model trained by the training method, and output a human posture category label corresponding to the human posture image data by the target image recognition model.

[0233] Since the process of image recognition using the image recognition model of the embodiments of the present disclosure has been described in the method embodiments above, further description is omitted here.

[0234] The embodiments of the present disclosure also provide an electronic device 1000, as shown in the figure, Figure 10 which includes a memory 1020, a processor 1010, and a program stored in the memory 1020 and executable on the processor 1010. The program, when executed by the processor 1010, can implement the processes of each of the embodiments of the above model training method and / or image recognition method, and achieve the same technical effects. To avoid repetition, further description is omitted here.

[0235] Those skilled in the art can understand that all or part of the steps of the various methods of the above embodiments can be completed by instructions, or by instructions controlling relevant hardware. The instructions can be stored in a computer-readable storage medium and loaded and executed by a processor. Therefore, the embodiments of the present disclosure also provide a storage medium having a computer program or instructions stored thereon, which, when executed by a processor, can implement the processes of each of the embodiments of the above model training method and / or image recognition method.

[0236] Due to the instructions stored in the storage medium, the steps in the model training method and / or the image recognition method provided by the embodiments of the present disclosure can be performed, thus the beneficial effects that can be achieved by the model training method and / or the image recognition method provided by the embodiments of the present disclosure can be achieved. Details are described in the foregoing embodiments, which will not be repeated here. The specific implementation of each operation can refer to the foregoing embodiments, which will not be repeated here.

[0237] To sum up, the training method provided by the present disclosure adopts a generative adversarial network algorithm model based on feature space distortion to expand the original human pose training samples to obtain target human pose 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 pose training samples are obtained based on the distorted image features. Since the distortion module can simulate different data changes such as pose transformation and occlusion by dynamically adjusting the distribution of data features, the diversity of the images generated by the generator is increased, so that the target human pose training samples can cover more diverse human poses and environmental conditions, and the generalization ability of the image recognition model obtained by training and the accuracy of human pose recognition are improved.

[0238] Finally, it should be noted that: obviously, the above embodiments are only examples for clearly illustrating the present disclosure, and are not limitations on the embodiments. Based on the above description, those skilled in the art can make other different forms of changes or modifications. Here, all the embodiments need not and cannot be exhausted. The obvious changes or modifications derived therefrom are still within the protection scope of the present disclosure.

Claims

1. A training method for an image recognition model, characterized in that, The training method comprises: obtaining an original human posture training sample, expanding the original human posture training sample by using a feature space distortion-based generative adversarial network algorithm model to obtain a target human posture training sample, wherein the generative adversarial network algorithm model comprises a generator and a discriminator, the generator comprises a distortion module, the distortion module generates a distorted image feature according to a random noise vector and a distortion module parameter according to a preset feature deformation algorithm, and the target human posture training sample is obtained based on the distorted image feature; 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, and the initial image recognition model comprises an initial feature extraction algorithm model, an initial autoencoder algorithm model and an initial neural decision tree algorithm model; according to the output of the initial image recognition model in each training period, adjusting the initial image recognition model until a target image recognition model satisfying a training stop condition is obtained, wherein the initial feature extraction algorithm model dynamically adjusts a learning rate and dynamically adjusts the number of nodes in a hidden layer by using a chaotic optimization algorithm to realize regularization sparseness, the initial autoencoder algorithm model selectively outputs features with the most information amount by using a dynamic routing decision mechanism, and dynamically prunes redundant weights by using a sparseness pruning threshold, and the initial neural decision tree algorithm model uses an information feedback process from an output direction to an input direction in addition to regular forward propagation and backward propagation by using a reverse training mechanism from the output node to the input node to optimize the decision boundary of each node.

2. The training method of claim 1, wherein, The inputting of the target human posture training sample into the initial image recognition model comprises: inputting the target human posture training sample into the initial feature extraction algorithm model to perform image feature extraction; inputting the extracted image features into the initial autoencoder algorithm model to perform feature dimension reduction to obtain reduced image features, wherein the initial autoencoder algorithm model comprises an initial encoder and an initial decoder; inputting the reduced image features into the initial neural decision tree algorithm model to obtain a human posture category label of the target human posture training sample.

3. The training method of claim 2, wherein, The adjusting of the initial image recognition model according to the output of the initial image recognition model in each training period until a target image recognition model satisfying a training stop condition is obtained comprises: based on the output error amount of the initial feature extraction algorithm model in the last training period, adjusting the learning rate of the initial feature extraction algorithm model in the current training period by using a chaotic optimization algorithm, and then updating the weights of the initial feature extraction algorithm model according to the updated learning rate until a target feature extraction algorithm model satisfying a stop model training condition is obtained. In the current training period, according to the output features of the previous layer activation function of the initial encoder and the feature importance score of the current layer, a dynamic routing decision is made, the initial decoder reconstructs data by using features from different encoding layers, 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 using the back propagation algorithm, the weights and biases of the initial autoencoder algorithm model are updated, and the target autoencoder algorithm model is obtained until the stop model training condition is met. In the current training period, 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 features and the target output features of the forward propagation process of the current decision node, until the target neural decision tree algorithm model is obtained that meets the stop model training condition.

4. The training method of claim 3, wherein, The output error of the initial feature extraction algorithm model based on the previous training period is used to adjust the learning rate of the initial feature extraction algorithm model in the current training period by using a chaotic optimization algorithm, and then the weights of the initial feature extraction algorithm model are updated according to the updated learning rate, until the target feature extraction algorithm model is obtained that meets the stop model training condition, including: initializing the weights and biases of the initial feature extraction algorithm model; adjusting the learning rate of the initial feature extraction algorithm model in the current training period by using a chaotic optimization algorithm according to the output error and the learning rate of the initial feature extraction algorithm model in the previous training period; adjusting the weights of the initial feature extraction algorithm model in the previous training period according to the learning rate in the current training period and the partial derivative of the output error in the previous training period with respect to the weights in the previous training period, to obtain the weights in the current training period; dynamically adjusting the number of nodes in the hidden layer in the current training period to achieve regularization sparsity according to the node adjustment step of the hidden layer of the initial feature extraction algorithm model, the output error in the previous training period, and the number of nodes in the hidden layer, wherein the node adjustment step of the hidden layer of the initial feature extraction algorithm model is calculated according to the adjustment influence coefficient of the node adjustment step and the network layer depth.

5. The training method of claim 3, wherein, In the current training period, according to the output features of the previous layer activation function of the initial encoder and the feature importance score of the current layer, a dynamic routing decision is made, the initial decoder reconstructs data by using features from different encoding layers, 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 using the back propagation algorithm, the weights and biases of the initial autoencoder algorithm model are updated, and the target autoencoder algorithm model is obtained until the stop model training condition is met. initializing the weights and biases of the initial autoencoder algorithm model; In the current training cycle, the extracted image features are passed through each layer of the initial encoder, and 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, and 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 according to the activation output of each neuron of the previous layer and the weight of its corresponding feature importance; The initial decoder reconstructs data using features from different encoding layers to obtain reconstructed image features; According to the reconstruction error of the reconstructed image features and the extracted image features, the loss function of the initial autoencoder algorithm model is calculated; 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 backpropagation algorithm, and the weights and biases of the current layer of the initial autoencoder algorithm model are updated when the sparsity of the current layer of the initial autoencoder algorithm model is less than the sparsity pruning threshold, and the weights of the current layer of the initial autoencoder algorithm model are pruned when the sparsity of the current layer of the initial autoencoder algorithm model is greater than or equal to the sparsity pruning threshold.

6. The training method of claim 5, wherein, In the current training cycle, the extracted image features are passed through each layer of the initial encoder, and 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, and 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 according to the activation output of each neuron of the previous layer and the weight of its corresponding feature importance; The sparsity of 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.

7. The training method of claim 3, wherein, In the current training cycle, during the backpropagation 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 feature and the target output feature of the forward propagation process of the current decision node, until a target neural decision tree algorithm model that satisfies the stop model training condition is obtained, including: Initializing the weights and biases of each decision node in the initial neural decision tree algorithm model; In the current training cycle, during the forward propagation process of the reduced dimension 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 according to the weight and bias of the decision node, and the output feature is passed forward; The probability of model prediction is calculated according to the output feature of the decision node, and the loss function of the initial neural decision tree algorithm model is calculated according to the one-hot encoding of the model predicted probability and the true label; The probability of model prediction is calculated according to the output feature of the decision node, and the loss function of the initial neural decision tree algorithm model is calculated according to the one-hot encoding of the model predicted probability and the true label; In the back propagation process, a weight update amount of the current decision node is calculated according to a partial derivative of a loss function of the initial neural decision tree algorithm model with respect to a weight of the current decision node and a partial derivative of the loss function of the initial neural decision tree algorithm model with respect to a weight of a previous decision node; According to a difference between an actual output feature and a target output feature of the forward propagation process of the current decision node, a learning rate of the initial neural decision tree algorithm model is adjusted.

8. The training method of claim 1, wherein, Before the acquiring the original human posture training sample and the expanding the original human posture training sample by using the generative adversarial network algorithm model based on feature space distortion to obtain the target human posture training sample, the training method further comprises: Acquiring image training samples; The image training samples are input into an initial generative adversarial network algorithm model, and the initial generative adversarial network algorithm model is adjusted according to an output of the initial generative adversarial network algorithm model in each training period until the generative adversarial network algorithm model meeting a training stop condition is obtained.

9. The training method of claim 8, wherein, The initial generative adversarial network algorithm model comprises an initial generator and an initial discriminator, the initial generator comprises an initial distortion module, and the image training samples are input into the initial generative adversarial network algorithm model, and the initial generative adversarial network algorithm model is adjusted according to an output of the initial generative adversarial network algorithm model in each training period until the generative adversarial network algorithm model meeting a training stop condition is obtained, which comprises: Initializing weights of the initial generative adversarial network algorithm model; In a current training period, in an adversarial training loop stage, a random noise vector is input into the initial generator, distortion image features are generated according to the random noise vector and distortion module parameters according to a preset feature deformation algorithm by using the initial distortion module, and a generated image similar to a real image is generated by the initial generator; The real image and the generated image are input into the initial discriminator respectively, and a discrimination result of the real image and a discrimination result of the generated image are generated by the initial discriminator; A loss function of the initial generator is calculated according to content loss and style loss of the real image and the generated image; A loss function of the initial discriminator is calculated 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 of the initial discriminator.

10. An image recognition method characterized by, Comprise: Acquiring human posture image data; The human posture image data is input into a target image recognition model trained according to the training method in any one of claims 1 to 9, and a human posture category label corresponding to the human posture image data is output by the target image recognition model.

11. A training device for an image recognition model, characterized in that, The training device comprises: The training sample expansion unit is configured to obtain original human posture training samples, expand the original human posture training samples by using a generative adversarial network algorithm model based on feature space distortion, and obtain target human posture training samples, wherein the generative adversarial network algorithm model comprises a generator and a discriminator, the generator comprises 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; The model training unit is configured 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; the initial image recognition model is adjusted according to the output of the initial image recognition model in each training period until a target image recognition model that meets a training stop condition is obtained; the initial image recognition model comprises an initial feature extraction algorithm model, an initial autoencoder algorithm model, and an initial neural decision tree algorithm model, wherein the initial feature extraction algorithm model dynamically adjusts the learning rate and the number of nodes in the hidden layer by using a chaotic optimization algorithm to realize regularization sparseness; the initial autoencoder algorithm model selectively outputs the most information features by using a dynamic routing decision mechanism and dynamically prunes redundant weights by using a sparseness pruning threshold; and the initial neural decision tree algorithm model uses an information feedback process from the output direction to the input direction in addition to the regular forward propagation and backward propagation by using a reverse training mechanism from the output nodes to the input nodes, so as to optimize the decision boundary of each node.

12. An image recognition apparatus characterized by comprising: Comprise: The image data acquisition unit is configured to obtain human posture image data; The image recognition unit is configured to input the human posture image data into a target image recognition model trained according to the training method in any one of claims 1 to 9, and output a human posture category label corresponding to the human posture image data by using the target image recognition model.

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

14. A storage medium, wherein the storage medium stores a computer program or instructions, and when the computer program or instructions are executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.

Citation Information

Patent Citations

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

    CN111582141A

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

    CN118537816A