Age prediction model training method and apparatus, device, and storage medium

By constructing a sample training set with age category labels, using a neural network model to determine the age prediction probability and considering the tolerance error value, the problem of inaccurate age prediction in existing technologies is solved, and more accurate age prediction is achieved.

CN115293260BActive Publication Date: 2026-04-07GUANGDONG LVAN IND & COMMERCE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-03
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

In existing technologies, age prediction network models ignore the continuity and dynamism of age during training, resulting in inaccurate predictions.

Method used

By constructing a sample training set with age category labels, a neural network model is trained to determine the probability of age prediction, and the predicted age value is determined based on the tolerance error value of each age category. The neural network model is then trained to improve prediction accuracy.

Benefits of technology

The continuity and distribution of age were considered in the process of determining the age prediction value, which improved the training accuracy and prediction accuracy of the age prediction network model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115293260B_ABST
    Figure CN115293260B_ABST
Patent Text Reader

Abstract

The application discloses an age prediction model training method and device, equipment and a storage medium. The method comprises the following steps: constructing a sample training set with age category labels; inputting the sample training set into a pre-constructed neural network model for training to obtain age prediction probabilities corresponding to each training sample in the sample training set; determining age prediction values according to the age prediction probabilities and tolerance error values corresponding to each age category; training the neural network model according to the age prediction values, and obtaining an age prediction model according to the trained neural network model. The embodiment of the application improves the prediction accuracy of the age prediction network model.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, and particularly relates to an age prediction model training method and device, equipment and a storage medium. BACKGROUND

[0002] With the growth of age, the process of people aging has randomness and fuzziness, so it is a challenging task to predict the age of a person.

[0003] In the prior art, the training process of the age prediction network model is usually regarded as the training problem of the classification model, that is, each age value is regarded as a class. However, age has continuity, and the classification model is completely independent between classes in training, ignoring the continuity and dynamics of age and other features, and cannot effectively solve the distribution problem of age, thereby causing the training of the age prediction network model to be not accurate enough. SUMMARY

[0004] The present application provides an age prediction model training method and device, equipment and a storage medium to improve the prediction accuracy of the age prediction network model.

[0005] According to an aspect of the present application, an age prediction model training method is provided, which comprises:

[0006] constructing a sample training set with age category labels;

[0007] inputting the sample training set into a pre-constructed neural network model for training to obtain an age prediction probability corresponding to each training sample in the sample training set;

[0008] determining an age prediction value according to each age prediction probability and a tolerance error value corresponding to each age category;

[0009] training the neural network model according to the age prediction value, and obtaining an age prediction model according to the trained neural network model.

[0010] According to another aspect of the present application, an age prediction model training device is provided, which comprises:

[0011] a sample training set construction module for constructing a sample training set with age category labels;

[0012] a network model training module for inputting the sample training set into a pre-constructed neural network model for training to obtain an age prediction probability corresponding to each training sample in the sample training set;

[0013] An age prediction value determination module is configured to determine an age prediction value according to the age prediction probability and the tolerance error value corresponding to each age category.

[0014] An age prediction model determination module is configured to train the neural network model according to the age prediction value, and obtain an age prediction model according to the trained neural network model.

[0015] According to another aspect of the present application, an electronic device is provided, which comprises:

[0016] at least one processor; and

[0017] a memory connected with the at least one processor; wherein

[0018] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the age prediction model training method according to any one of the embodiments of the present application.

[0019] According to another aspect of the present application, a computer readable storage medium is provided, which stores computer instructions for enabling a processor to execute the age prediction model training method according to any one of the embodiments of the present application.

[0020] The embodiments of the present application input the constructed sample training set into the pre-constructed neural network model for training to obtain the age prediction probability corresponding to each training sample in the sample training set; determine the age prediction value according to the age prediction probability and the tolerance error value corresponding to each age category; train the neural network model according to the age prediction value, and obtain the age prediction model according to the trained neural network model. The above scheme considers the tolerance error value corresponding to the age category in the process of determining the age prediction, realizes the consideration of the continuity and distribution of the age in the process of determining the age prediction value, effectively solves the distribution problem of the age, realizes the accurate determination of the age prediction value, and thus improves the training accuracy of the age prediction network model, and further improves the prediction accuracy of the subsequent age prediction according to the age prediction network model.

[0021] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present application, nor to limit the scope of the present application. Other features of the present application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed in the embodiment description. Obviously, the drawings in the following description only show some embodiments of the present application, and other drawings can be obtained by those of ordinary skill in the art without any creative effort.

[0023] Figure 1 is a flow chart of an age prediction model training method according to an embodiment of the present application;

[0024] Figure 2 is a flow chart of an age prediction model training method according to an embodiment of the present application;

[0025] Figure 3 is a structural schematic diagram of an age prediction model training device according to an embodiment of the present application;

[0026] Figure 4 is a structural schematic diagram of an electronic device implementing the age prediction model training method according to an embodiment of the present application. DETAILED DESCRIPTION

[0027] In order to make the person skilled in the art better understand the present application, the following will combine the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without any creative effort should be within the scope of the present application.

[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily mean a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0029] Embodiment one

[0030] Figure 1A flowchart of an age prediction model training method is provided for Embodiment One of the present application. The present embodiment can be applied to the training of a network model for age prediction. The method can be performed by an age prediction model training apparatus, which can be implemented in the form of hardware and / or software, and can be configured in an electronic device. As shown in Figure 1 , the method comprises:

[0031] S110, constructing a sample training set with age category labels.

[0032] Each training sample in the sample training set can be a face image. The age category labels can be pre-labeled by a skilled person for each training sample. The age category label can be an age value corresponding to the training sample. For example, the age category label can have a value range of {0, 1,..., L}. Where L can be the maximum age value that the age category label can take. For example, L can be 100, indicating that the maximum age value corresponding to the age category label is 100 years old.

[0033] For example, if there are training sample A, training sample B and training sample C, if the age of training sample A is 3 years old, then add age category label 3 to training sample A, indicating that the face image of training sample A corresponds to an age of 3 years old. Similarly, if the age of training sample B is 49 years old, then add age category label 49 to training sample B, indicating that the face image of training sample B corresponds to an age of 49 years old. If the age of training sample C is 80 years old, then add age category label 80 to training sample C, indicating that the face image of training sample C corresponds to an age of 80 years old.

[0034] For example, the representation of the sample training set can be I i ∈{I1,I2,…,I n}, where I i may represent the i-th training sample in the sample training set. N can represent the number of training samples in the sample training set.

[0035] S120, inputting the sample training set into a pre-constructed neural network model for training to obtain the age prediction probability corresponding to each training sample in the sample training set.

[0036] The neural network model can be pre-constructed by a skilled person. The constructed neural network model includes a feature extraction part network for feature extraction, and a fully connected layer for obtaining a model training output result.

[0037] The age prediction probability can be a probability set, and the probability set includes prediction probability values corresponding to each age category, respectively. For example, if the value range of the age category label is {0, 1,..., L}, and for the i th training sample in the training sample set, the corresponding age prediction probability probability set can be {P0, P1, P2, P3,..., PL}. Wherein, P0 represents the prediction probability value of the training sample being predicted as 0 years old, P1 represents the prediction probability value of the training sample being predicted as 1 year old, P2 represents the prediction probability value of the training sample being predicted as 2 years old, and PL represents the prediction probability value of the training sample being predicted as L years old. i ,.,P L}. i ,.,P L}. i ,.,P L}.

[0038] The feature extraction part of the neural network model is M θ (.) for example, where θ is the trainable weight parameter of the part of the network, and the initial value of θ can be preset and updated continuously with the iteration of the network model. The feature vector x i can be expressed as follows:

[0039] x i =M θ (I i );

[0040] If the trainable weight parameter of the fully connected layer is W, the output result z i of the fully connected layer can be determined by the following formula:

[0041] z i =x i .W;

[0042] Wherein, W is the trainable weight parameter of the fully connected layer, and the initial value of W can be preset and updated continuously with the iteration of the network model.

[0043] The age prediction probability of each training sample in the training sample set can be obtained based on the softmax function, and the specific determination method can be as follows:

[0044]

[0045] Wherein, p i,j represents the probability value of the i th training sample in the j th age category, z i,j is the j th number in the output result z i , and L is the maximum value of the age category.

[0046] Exemplarily, the sample training set is input into a pre-constructed neural network model for iterative training to obtain a feature vector output by a feature extraction part of the network; and the feature vector is input into a full connection layer to obtain an age prediction probability corresponding to each training sample output by the full connection layer based on a softmax function.

[0047] In S130, an age prediction value is determined according to each age prediction probability and a tolerance error value corresponding to each age category.

[0048] It should be noted that, since age has characteristics such as continuity, if the age prediction probability corresponding to the training sample is selected as the age prediction value with the maximum prediction probability, it is inaccurate, that is, the age prediction problem is regarded as a complete classification problem, which cannot reflect the continuity and distribution characteristics of age. Therefore, when determining the age prediction value, the tolerance error value is introduced, which can consider the continuity of age and other characteristics in the process of determining the age prediction value, so that the obtained age prediction value is more accurate.

[0049] The tolerance error value can be pre-set by a relevant technical person, and when the subsequent loss value converges, the set tolerance error value is updated, and the neural network model is adjusted according to the updated tolerance error value.

[0050] Exemplarily, a corresponding tolerance error value is set for each age category, and the pre-set tolerance error values for each age category can be the same or different, which can be set by a relevant technical person according to the age characteristics. The tolerance error value can include a tolerance error upper limit value and a tolerance error lower limit value. For example, the tolerance error upper limit value and the tolerance error upper limit value corresponding to each age category can be set to 5.

[0051] In an optional embodiment, the age prediction value is determined according to each age prediction probability and a tolerance error value corresponding to each age category, including: selecting a prediction probability value with a larger value from each prediction probability value in the age prediction probability as a first prediction probability value; determining the index position of the first prediction probability value in the age prediction probability; determining the first tolerance error value corresponding to the age category at the index position; and determining the age prediction value according to the first tolerance error value and the age prediction probability.

[0052] For any training sample, the age prediction probability corresponding thereto is a probability set, and the set contains prediction probability values corresponding to each age category. The first prediction probability value can be a prediction probability value with a larger value (for example, the maximum) in the probability set. Exemplarily, for example, for the training sample A, the age prediction probability corresponding thereto is {P A1 ,P A2 ,…,P Ai ,…,P An}, and the maximum value is P A1 .Ai The first prediction probability value can be P Ai .

[0053] For example, continuing the previous example, the first prediction probability value P Ai The index position in the age prediction probability can be P Ai The position in the probability set {P A1 , P A2 , …, P Ai , …, P An}, that is, the index position is the i-th. The age category corresponding to the first tolerance error value at the index position is determined, that is, the tolerance error value corresponding to the age category at the i-th position is taken as the first tolerance error value. For example, the age category at the i-th position is 20 years old, and according to the pre-set corresponding relationship between the age category and the tolerance error value, the tolerance error value corresponding to 20 years old is determined as the first tolerance error value.

[0054] For example, according to the first tolerance error value and the age prediction probability, the way to determine the age prediction value of each training sample can be as follows:

[0055]

[0056] where j max is the position index j corresponding to the maximum prediction probability value in p i,j , that is, the index position of the first prediction probability value in the age prediction probability (p i,j ). Where p i,j represents the j-th prediction probability value in the age prediction probability of the i-th training sample. and are the upper limit value and the lower limit value of the tolerance error corresponding to the age category at the j max index position.

[0057] This optional embodiment determines the age prediction value in a continuous range interval by considering the tolerance error value corresponding to each age category when determining the age prediction value of the training sample, and considers the continuity of age and other features in the determination process, thereby improving the determination accuracy of the age prediction value of the training sample.

[0058] S140, training the neural network model according to the age prediction value, and obtaining an age prediction model according to the trained neural network model.

[0059] According to the age prediction value and the age true value corresponding to the age category label of the training sample, the neural network model can be trained based on a preset loss function, the neural network model can be iteratively updated by using a preset gradient descent algorithm, and the converged neural network model can be used as the age prediction model when a model convergence condition is met. The model convergence condition can be preset by a related technical person, for example, the model convergence condition can be that the loss value calculated by the loss function tends to be stable.

[0060] The use process of the age prediction model can be that a face image to be predicted for age is input into the age prediction model to obtain an age value predicted for the face image.

[0061] The embodiments of the present application can obtain the age prediction probability corresponding to each training sample in the sample training set by inputting the constructed sample training set into the pre-constructed neural network model for training, determine the age prediction value according to the age prediction probability and the tolerance error value corresponding to each age category, train the neural network model according to the age prediction value, and obtain the age prediction model according to the trained neural network model. The above scheme considers the tolerance error value corresponding to the age category in the process of determining the age prediction value, realizes the consideration of the continuity and distribution of the age in the process of determining the age prediction value, effectively solves the distribution problem of the age, realizes the accurate determination of the age prediction value, thereby improves the training accuracy of the age prediction network model, and further improves the prediction accuracy of the subsequent age prediction according to the age prediction network model.

[0062] Embodiment two

[0063] Figure 2 A flowchart of an age prediction model training method provided by the second embodiment of the present application is provided, and the present embodiment is optimized and improved on the basis of the above technical solutions.

[0064] Further, the step of training the neural network model according to the age prediction value and obtaining the age prediction model according to the trained neural network model is refined as training the neural network model by using the age prediction value and updating the tolerance error values, and adjusting the trained neural network model according to the updated tolerance error values to obtain the age prediction model, so as to improve the training method of the age prediction model.

[0065] As shown in the method shown in the figure, the method comprises the following specific steps: Figure 2

[0066] S210, a sample training set with age category labels is constructed.

[0067] ​S220, inputting the sample training set into the pre-constructed neural network model for training to obtain an age prediction probability corresponding to each training sample in the sample training set.

[0068] S230, determining an age prediction value according to each age prediction probability and a tolerance error value corresponding to each age category.

[0069] S240, training the neural network model using the age prediction value and updating each tolerance error value.

[0070] For example, the neural network model can be trained based on a preset loss function according to the age prediction value corresponding to the training sample and the age true value in the age category label corresponding to the training sample. The loss function can be preset by a related technical person, for example, the loss function can be a classification loss function, a regression loss function, etc. It can also be a combination of a classification loss function and a regression loss function, which is not limited in the embodiment.

[0071] According to the age prediction value and the age true value, the loss value can be determined based on the loss function; according to the loss value and the preset gradient descent algorithm, the trainable parameter weight in the neural network model is iteratively updated until the model convergence condition is met. The model convergence condition can be that the loss value tends to be stable. After the model convergence condition is met, the trainable parameter weight is used to update the tolerance error value corresponding to each age category, thereby obtaining the updated tolerance error value.

[0072] In an optional embodiment, the neural network model is trained using the age prediction value and the tolerance error value is updated, including: determining a mean loss value according to the age prediction value and the age true value under the age category label; determining a tail loss value according to the age prediction probability; determining a classification loss value according to the age prediction probability and each tolerance error value; determining a target loss value according to at least one of the mean loss value, the tail loss value and the classification loss value; iteratively training the neural network model according to the target loss value and updating each tolerance error value.

[0073] The loss function used to determine the mean loss value can be preset by a related technical person, for example, the mean loss function used to determine the mean loss value can be as follows:

[0074]

[0075] Wherein, N represents the number of training samples in batch processing; is the age prediction value of the i-th training sample; y i is the age true value of the i-th training sample under the age category label. Wherein, L mean The loss function used to determine the mean loss value can be

[0076] The tail loss value can be determined according to the age prediction probability, and specifically can be determined according to an order of numerical values of each prediction probability value in the probability set of the age prediction probability.

[0077] In an optional embodiment, the tail loss value is determined according to the age prediction probability, including: determining a prediction probability ranking result according to numerical values of each prediction probability value in the age prediction probability; determining a target prediction probability set according to the prediction probability ranking result; and determining the tail loss value according to an index position corresponding to each age prediction probability in the target prediction probability set in combination with the age prediction probability.

[0078] It should be noted that the difference between the age category corresponding to the maximum prediction probability value in the age prediction probability of the training sample obtained by training the neural network model and the real age category in the age category label of the training sample can be large. For example, the age category corresponding to the maximum prediction probability value in the age prediction probability of the training sample A is 20 years old, and the real age category in the age category label of the training sample is 25 years old. Therefore, in the calculation of the tail loss value, to ensure that the real age category 25 years old is always optimized in the age prediction probability and is not punished by mistake, the adaptive change of the index position needs to be considered in the determination of the tail loss value.

[0079] For example, for any training sample, the prediction probability values are sorted from large to small according to the data size of each prediction probability value in the age prediction probability corresponding to the training sample, to obtain a prediction probability ranking result of the prediction probability values from large to small. The position of the prediction probability value corresponding to the real age category in the age category label of the training sample in the prediction probability ranking is determined, to determine a target prediction probability set. For example, if the prediction probability ranking result of the age prediction probability of the training sample A obtained by sorting the probability values from large to small is {P A1 ,P A2 ,…,P Ai ,…,P An}; if the real age of the age category label corresponding to the training sample A is 20 years old, the index position corresponding to the real age 20 years old in the prediction probability ranking result is determined. For example, the real age 20 years old corresponds to the 5th ranking, and the target prediction probability set is {P A1 ,P A2 ,P A3 ,P A4 ,P A5}.

[0080] The tail loss value can be determined according to the age prediction probability, and specifically can be determined according to an order of numerical values of each prediction probability value in the probability set of the age prediction probability.

[0081]

[0082] wherein, N represents the number of training samples of the batch; p i,j represents the jth prediction probability value in the age prediction probability of the ith training sample; is the p i,j th prediction probability value corresponding to the position index j in the first K i prediction probability values. Wherein, L tail may be a tail loss function used to determine the tail loss value.

[0083] It should be noted that, in order to ensure that the age prediction probability value corresponding to the true age class of the training sample is always optimized and will not be punished, K i adaptively changes, and the value is as follows:

[0084]

[0085] wherein, is the ranking position in the prediction probability ranking result in p i,j . Wherein, is the age prediction probability value corresponding to the true age class y i of the training sample i. Wherein, k is a constant, which can be pre-set by relevant technical personnel according to actual needs, for example, k can be set to 2.

[0086] The optional embodiment can consider that the age prediction probability value corresponding to the true age class of the training sample can always be optimized, i.e. the entropy of the tail prediction probability is punished, dynamically adjust the true value label to always be optimized and will not be punished, so that the position index set can be adaptively adjusted in the process of determining the tail loss value, and the age characteristics are considered in the process of determining the loss value, and the determination accuracy of the tail loss value is improved.

[0087] For example, according to the age prediction probability corresponding to the training sample and the tolerance error value corresponding to each training sample, the classification loss value is determined.

[0088] In an optional embodiment, the classification loss value is determined according to the age prediction probability and the tolerance error value, comprising: selecting the second prediction probability value corresponding to the age class of the training sample from the age prediction probability; determining the second tolerance error value corresponding to the second prediction probability value; determining the classification loss value according to the second tolerance error value and the age prediction probability.

[0089] For example, the predicted probability value corresponding to the age category of the training sample in the age prediction probability is used as the second predicted probability value, and the second tolerance error value corresponding to the second predicted probability value is determined, that is, the tolerance error value corresponding to the age category of the training sample.

[0090] The classification loss value can be determined based on the second tolerance error value and the age prediction probability as follows:

[0091]

[0092] Where N represents the number of training samples in the batch; where, and For y i The upper and lower bounds of the tolerance error corresponding to the age category at the index position, i.e., the age category y of training sample i. i The corresponding upper and lower limits of tolerance error. i,j Let L represent the j-th predicted probability value in the predicted age probability of the i-th training sample. cls This can be a classification loss function used to determine the classification loss value.

[0093] The target loss value is determined based on at least one of the mean loss value, tail loss value, and classification loss value.

[0094] For example, the target loss value can be a weighted sum of the mean loss value, the tail loss value, and the classification loss value. For instance, the target loss value can be determined as follows:

[0095] L sum =L cls +λ1L mean +λ2L tail ;

[0096] Among them, L sum This can be a function used to determine the target loss value. λ1 and λ2 can be balancing factors, which can be preset by relevant technical personnel according to actual needs.

[0097] In one optional embodiment, the neural network model is iteratively trained based on the target loss value, and the tolerance error values ​​are updated accordingly. This includes: iteratively training the neural network model based on the target loss value until the target loss value reaches a preset model convergence condition; determining the similarity between different age categories based on the weight parameters corresponding to the fully connected layers of the neural network model that meets the model convergence condition; and updating the tolerance error values ​​based on the similarity. The model convergence condition can be preset by those skilled in the art. For example, the model convergence condition could be that the target loss value tends to stabilize.

[0098] For example, when the target loss function reaches the preset model convergence condition, the age category label is y. i The feature vector x of the training samples i Distributed in the weight vector The vicinity of. Here, K is the dimension of the feature vector. Therefore, the weight vector can be... As category y i The cluster center eigenvectors of all eigenvectors. This is calculated by... i Cluster center feature vector With y i Neighboring cluster center feature vector Update using cosine similarity and The value equals 0, and n takes the values ​​{1, 2, ..., i} sequentially. When... and When the cosine similarity is greater than or equal to the preset threshold S, Update to n until and When the cosine similarity is less than the preset threshold S, If not updated, n stops taking values. Similarly, The value equals 0, and n takes the values ​​{1, 2, ..., Li} sequentially. When... and When the cosine similarity is greater than or equal to the preset threshold S, Update to n until and When the cosine similarity is less than the preset threshold S, If no update is made, n stops taking values. The preset threshold S can be pre-set by relevant technical personnel; for example, the preset threshold S can be set to 0.6.

[0099] This optional embodiment determines the similarity between different age categories based on the weight parameters corresponding to the fully connected layers of the neural network model that meet the model convergence condition; and updates each tolerance error value based on the similarity, thereby improving the prediction accuracy of the model after fine-tuning the neural network model based on the updated tolerance error value.

[0100] S250. Based on the updated tolerance error values, adjust the trained neural network model to obtain the age prediction model.

[0101] For example, the trained neural network model can be fine-tuned based on the updated tolerance error values, and the fine-tuned neural network model can then be used as the age prediction model. For instance, the neural network model can be iteratively updated again using the updated tolerance error values ​​to obtain the age prediction model. It should be noted that the process of fine-tuning the trained neural network model using the updated tolerance error values ​​can be implemented using existing model fine-tuning techniques, and this embodiment does not limit this approach.

[0102] This invention employs age prediction values ​​to train a neural network model and updates various tolerance error values. Based on the updated tolerance error values, the trained neural network model is adjusted to obtain an age prediction model. Fine-tuning the neural network using the updated tolerance error values ​​improves the training accuracy of the age prediction model. During training, the model automatically updates the age ranges corresponding to different ages, making the trained age prediction model more robust and practical. By considering the tolerance error values ​​corresponding to age categories in the age prediction process, the continuity and distribution of age are taken into account, effectively solving the age distribution problem and achieving accurate determination of age prediction values. This improves the training accuracy of the age prediction network model and, consequently, the accuracy of subsequent age predictions based on the age prediction network model.

[0103] Example 3

[0104] Figure 3 This is a schematic diagram of the structure of an age prediction model training device provided in Embodiment 3 of the present invention. The age prediction model training device provided in this embodiment of the present invention is applicable to training network models used for age prediction. This age prediction model training device can be implemented in hardware and / or software, such as... Figure 3 As shown, the device specifically includes: a sample training set construction module 301, a network model training module 302, an age prediction value determination module 303, and an age prediction model determination module 304. Among them,

[0105] Sample training set construction module 301 is used to construct a sample training set with age category labels;

[0106] The network model training module 302 is used to input the sample training set into a pre-built neural network model for training, and obtain the age prediction probability corresponding to each training sample in the sample training set.

[0107] The age prediction value determination module 303 is used to determine the age prediction value based on the prediction probability of each age and the tolerance error value corresponding to each age category.

[0108] The age prediction model determination module 304 is used to train the neural network model based on the predicted age value, and to obtain the age prediction model based on the trained neural network model.

[0109] This invention, in its embodiments, trains a pre-constructed neural network model by inputting a constructed sample training set into the model to obtain the age prediction probability corresponding to each training sample in the training set. Based on each age prediction probability and the tolerance error value corresponding to each age category, the predicted age value is determined. The neural network model is then trained using the predicted age values, and an age prediction model is obtained based on the trained neural network model. This approach, by considering the tolerance error value corresponding to the age category during the age prediction process, takes into account the continuity and distribution characteristics of age, effectively solving the age distribution problem and achieving accurate determination of the predicted age value. This improves the training accuracy of the age prediction network model and, consequently, the accuracy of subsequent age predictions based on the age prediction network model.

[0110] Optionally, the age prediction value determination module 303 includes:

[0111] The first prediction probability value determination unit is used to select the prediction probability value with the larger value from the prediction probability values ​​in the age prediction probability as the first prediction probability value.

[0112] An index position determination unit is used to determine the index position of the first predicted probability value in the age predicted probability;

[0113] The first tolerance error value determination unit is used to determine the first tolerance error value corresponding to the age category at the index position;

[0114] An age prediction value determination unit is used to determine the age prediction value based on the first tolerance error value and the age prediction probability.

[0115] Optionally, the age prediction model determination module 304 includes:

[0116] The tolerance error value update unit is used to train the neural network model using the age prediction value and update each of the tolerance error values;

[0117] An age prediction model determination unit is used to adjust the trained neural network model based on the updated tolerance error values ​​to obtain an age prediction model.

[0118] Optionally, the tolerance error value update unit includes:

[0119] The mean loss value determination subunit is used to determine the mean loss value based on the predicted age value and the actual age value under the age category label;

[0120] The tail loss value determination subunit is used to determine the tail loss value based on the predicted probability of the age.

[0121] The classification loss value determination subunit is used to determine the classification loss value based on the predicted probability of the age and each of the tolerance error values;

[0122] The target loss value determination subunit is used to determine a target loss value based on at least one of the mean loss value, the tail loss value, and the classification loss value.

[0123] The tolerance error value update subunit is used to iteratively train the neural network model based on the target loss value and update each tolerance error value.

[0124] Optionally, the tail loss value determination subunit is specifically used for:

[0125] The ranking of prediction probabilities is determined based on the magnitude of each prediction probability value in the age prediction probability.

[0126] Based on the predicted probability sorting results, determine the target predicted probability set;

[0127] The tail loss value is determined based on the index position corresponding to each age prediction probability in the target prediction probability set and in combination with the age prediction probability.

[0128] Optionally, the classification loss value determination subunit is specifically used for:

[0129] From the predicted age probabilities, select the second predicted probability value corresponding to the age category of the training sample;

[0130] Determine the second tolerance error value corresponding to the second predicted probability value;

[0131] The classification loss value is determined based on the second tolerance error value and the age prediction probability.

[0132] Optionally, the tolerance error value update subunit is specifically used for:

[0133] Based on the target loss value, the neural network model is iteratively trained until the target loss value reaches the preset model convergence condition;

[0134] Based on the weight parameters of the fully connected layers of the neural network model that meets the model convergence condition, the similarity between different age categories is determined.

[0135] Update each of the tolerance error values ​​based on the similarity.

[0136] The age prediction model training device provided in this embodiment of the invention can execute the age prediction model training method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0137] Example 4

[0138] Figure 4 A schematic diagram of a server 40 that can be used to implement embodiments of the present invention is shown. The server is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The server can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0139] like Figure 4 As shown, server 40 includes at least one processor 41 and memory, such as read-only memory (ROM) 42 and random access memory (RAM) 43, communicatively connected to at least one processor 41. The memory stores computer programs executable by at least one processor. Processor 41 can perform various appropriate actions and processes based on the computer program stored in ROM 42 or loaded into RAM 43 from storage unit 48. RAM 43 may also store various programs and data required for the operation of server 40. Processor 41, ROM 42, and RAM 43 are interconnected via bus 44. Input / output (I / O) interface 45 is also connected to bus 44.

[0140] Multiple components in server 40 are connected to I / O interface 45, including: input unit 46, such as keyboard, mouse, etc.; output unit 47, such as various types of monitors, speakers, etc.; storage unit 48, such as disk, optical disk, etc.; and communication unit 49, such as network card, modem, wireless transceiver, etc. Communication unit 49 allows server 40 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0141] Processor 41 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 41 performs the various methods and processes described above, such as age prediction model training methods.

[0142] In some embodiments, the age prediction model training method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 48. In some embodiments, part or all of the computer program may be loaded and / or installed on server 40 via ROM 42 and / or communication unit 49. When the computer program is loaded into RAM 43 and executed by processor 41, one or more steps of the age prediction model training method described above may be performed. Alternatively, in other embodiments, processor 41 may be configured to perform the age prediction model training method by any other suitable means (e.g., by means of firmware).

[0143] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0144] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0145] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0146] To provide interaction with the user, the systems and techniques described herein can be implemented on a server having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the server. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0147] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0148] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0149] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0150] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for training an age prediction model, characterized in that, include: Construct a sample training set with age category labels; The sample training set is input into a pre-built neural network model for training to obtain the age prediction probability corresponding to each training sample in the sample training set. The predicted age value is determined based on the predicted probability of each age and the tolerance error value corresponding to each age category. Based on the predicted age value, the neural network model is trained, and based on the trained neural network model, an age prediction model is obtained; The step of determining the predicted age value based on the predicted probability of each age and the tolerance error value corresponding to each age category includes: From the predicted probability values ​​in the age prediction probability, select the prediction probability value with the larger value as the first prediction probability value; Determine the index position of the first predicted probability value in the age predicted probability; Determine the first tolerance error value corresponding to the age category at the index position; The predicted age value is determined based on the first tolerance error value and the predicted age probability. The predicted age value is determined using the following formula: in, for The position index j corresponding to the highest predicted probability value, i.e., the first predicted probability value in the age prediction probability... The index position in; where, This represents the j-th predicted probability value in the predicted age probability of the i-th training sample; and for The upper and lower limits of tolerance error for the age category at the index position; The step of training the neural network model based on the predicted age value, and obtaining the age prediction model based on the trained neural network model, includes: The neural network model is trained using the predicted age values, and each of the tolerance error values ​​is updated. Based on the updated tolerance error values, the trained neural network model is adjusted to obtain the age prediction model.

2. The method according to claim 1, characterized in that, The step of training the neural network model using the predicted age value and updating each of the tolerance error values ​​includes: The mean loss value is determined based on the predicted age value and the actual age value under the age category label; The tail loss value is determined based on the predicted probability of the age. The classification loss value is determined based on the predicted probability of age and each of the tolerance error values; The target loss value is determined based on at least one of the mean loss value, the tail loss value, and the classification loss value; The neural network model is iteratively trained based on the target loss value, and each tolerance error value is updated.

3. The method according to claim 2, characterized in that, The step of determining the tail loss value based on the predicted probability of age includes: The ranking of prediction probabilities is determined based on the magnitude of each prediction probability value in the age prediction probability. Based on the predicted probability sorting results, determine the target predicted probability set; The tail loss value is determined based on the index position corresponding to each age prediction probability value in the target prediction probability set and in combination with the age prediction probability.

4. The method according to claim 2, characterized in that, The step of determining the classification loss value based on the predicted probability of age and each of the tolerance error values ​​includes: From the predicted age probabilities, select the second predicted probability value corresponding to the age category of the training sample; Determine the second tolerance error value corresponding to the second predicted probability value; The classification loss value is determined based on the second tolerance error value and the age prediction probability.

5. The method according to claim 2, characterized in that, The step of iteratively training the neural network model based on the target loss value and updating each of the tolerance error values ​​includes: Based on the target loss value, the neural network model is iteratively trained until the target loss value reaches the preset model convergence condition; Based on the weight parameters of the fully connected layers of the neural network model that meets the model convergence condition, the similarity between different age categories is determined. Update each of the tolerance error values ​​based on the similarity.

6. An age prediction model training device, characterized in that, include: The sample training set construction module is used to construct a sample training set with age category labels; The network model training module is used to input the sample training set into a pre-built neural network model for training, and to obtain the age prediction probability corresponding to each training sample in the sample training set. The age prediction value determination module is used to determine the age prediction value based on the prediction probability of each age and the tolerance error value corresponding to each age category. An age prediction model determination module is used to train the neural network model based on the predicted age value, and to obtain an age prediction model based on the trained neural network model. The age prediction value determination module includes: The first prediction probability value determination unit is used to select the prediction probability value with the larger value from the prediction probability values ​​in the age prediction probability as the first prediction probability value. An index position determination unit is used to determine the index position of the first predicted probability value in the age predicted probability; The first tolerance error value determination unit is used to determine the first tolerance error value corresponding to the age category at the index position; An age prediction value determination unit is used to determine the age prediction value based on the first tolerance error value and the age prediction probability; The predicted age value is determined using the following formula: in, for The position index j corresponding to the highest predicted probability value, i.e., the first predicted probability value in the age prediction probability... The index position in; where, This represents the j-th predicted probability value in the predicted age probability of the i-th training sample; and for The upper and lower limits of tolerance error for the age category at the index position; The age prediction model determination module includes: The tolerance error value update unit is used to train the neural network model using the age prediction value and update each of the tolerance error values; An age prediction model determination unit is used to adjust the trained neural network model based on the updated tolerance error values ​​to obtain an age prediction model.

7. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the age prediction model training method according to any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the age prediction model training method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Age estimation method and device, electronic equipment and computer readable storage medium

    CN112613379A