Age and gender estimation and model training method and system, and storage medium

CN115713798BActive Publication Date: 2026-08-07JIANGSU POLICE INST +3
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JIANGSU POLICE INST
Filing Date
2022-11-11
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

然而,由于人类衰老过程的随机性和面部外观与实际年龄之间的模糊映射,回归方法往往会出现过拟合问题,年龄预估的准确率不高

Benefits of technology

[0021]本发明实施例提供的年龄性别预估模型的训练方案,获取包含多个样本图像对的样本图像数据集。其中,样本图像对包含原始样本图像以及由原始样本图像转换得到的修整样本图像,而且,原始样本图像的清晰度比对应的修整样本图像的清晰度高。针对每个样本图像对,根据清晰度误差损失函数从原始样本图像和对应的修整样本图像中分别提取出各自符合预设的一致性要求的人脸特征数据。也就是说,从原始样本图像提取出的人脸特征数据与从对应的修整样本图像提取出的人脸特征数据相一致。而且。从人脸特征数据中分类出针对不同性别的性别人脸特征数据。再根据每个样本图像对对应的实际年龄信息转换得到年龄分布数据,该年龄分布数据表示年龄的变化与人脸长相的变化之间的关系。进而,根据样本图像数据集、性别人脸特征数据和年龄分布数据,对年龄性别预估模型进行训练。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115713798B_ABST
    Figure CN115713798B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a kind of age gender estimation model training method and system, method includes: the sample image data set obtained contains original sample image and the trimming sample image converted by original sample image, original sample image is clearer than corresponding trimming sample image;Face feature data is extracted from original sample image and corresponding trimming sample image;Different gender gender face feature data is classified;According to actual age information, age distribution data is converted;According to sample image data set, gender face feature data and age distribution data, age gender estimation model is trained.The embodiment of the present application highlights the influence of different stages of age change on the change of face appearance, improves the accuracy of age estimation.The influence of gender characteristics is added, which better estimates the age of different gender face images.Using multi-task framework, age and gender are estimated simultaneously.Low-definition face images can also be accurately estimated for age and gender.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a training method and system for an age and gender prediction model, an age and gender prediction method and system, and a computer-readable storage medium. Background Technology

[0002] Age prediction is a challenging and popular research topic, involving the estimation of an individual's age from a facial image. Age information, as a crucial human biometric, has numerous applications in human-computer interaction, including demographic data collection, business user management, and video security monitoring, and significantly impacts the performance of facial recognition systems. However, many factors in reality can affect the accuracy of age prediction. These include individual lifestyle habits, work environment, and genetic predisposition, all of which influence a person's perceived characteristics. Age prediction is also affected by factors such as lighting and image quality. Furthermore, the facial features of the same person, especially an adult, often show little change over several years, further complicating age prediction.

[0003] Currently, the primary age prediction method is regression. The idea behind regression for age prediction is to add extracted features to a fully connected layer with only one unit in the output, scaling the final result to a range of 0-100; the result is the predicted age value. Considering the continuity of age, regression methods predict age based on extracted features. However, due to the randomness of the human aging process and the ambiguous mapping between facial appearance and actual age, regression methods often suffer from overfitting, resulting in low accuracy in age prediction. Summary of the Invention

[0004] In view of the above problems, embodiments of the present invention are proposed to provide a training method and system for an age and gender prediction model that overcomes or at least partially solves the above problems, an age and gender prediction method and system, and a computer-readable storage medium.

[0005] To address the aforementioned problems, a first aspect of this invention discloses a training method for an age and gender prediction model. The method includes: acquiring a sample image dataset containing multiple sample image pairs, each sample image pair including an original sample image and a modified sample image converted from the original sample image, wherein the original sample image has higher clarity than the corresponding modified sample image; extracting facial feature data that meets consistency requirements for each sample image pair, and classifying gender-specific facial feature data from the facial feature data; converting actual age information corresponding to each sample image pair to obtain age distribution data, wherein the age distribution data represents the relationship between age changes and facial appearance changes; and training the age and gender prediction model based on the sample image dataset, the gender-specific facial feature data, and the age distribution data.

[0006] Optionally, the step of extracting facial feature data that meets the consistency requirements for each sample image pair and classifying gender-specific facial feature data from the facial feature data includes: for each sample image pair, extracting facial feature data that meets the consistency requirements from the original sample image and the corresponding modified sample image according to a preset sharpness error loss function, and classifying gender-specific facial feature data from the facial feature data.

[0007] Optionally, the step of converting the actual age information corresponding to each sample image to obtain age distribution data includes: converting the actual age information to obtain the age distribution data according to a preset age distribution function.

[0008] Optionally, the step of converting the actual age information into the age distribution data according to a preset age distribution function includes: calculating the age variance data of the actual age information according to a preset variable age variance function; and converting the actual age information into the age distribution data according to the age variance data, a preset age label range, and the age distribution function.

[0009] Optionally, training the age and gender prediction model based on the sample image dataset, the gender-specific facial feature data, and the age distribution data includes: extracting male gender-specific facial feature data for male sample images and female gender-specific facial feature data for female sample images from the sample image dataset; and training the age and gender prediction model based on the sample image dataset, the male gender-specific facial feature data, and the male age distribution data in the age distribution data, as well as the female gender-specific facial feature data and the female age distribution data in the age distribution data.

[0010] Optionally, the step of converting the original sample image into a trimmed sample image includes: performing random downsampling and image size adjustment processing on multiple original sample images to obtain the corresponding trimmed sample image.

[0011] A second aspect of the present invention discloses an age and gender prediction method, the method comprising: acquiring a face image to be predicted; inputting the face image into an age and gender prediction model trained according to the method described in the first aspect; and outputting the face age information and gender information of the face image.

[0012] A third aspect of this invention discloses a training system for an age and gender prediction model. The system includes: a sample dataset acquisition module for acquiring a sample image dataset, the sample image dataset containing multiple sample image pairs, each sample image pair containing an original sample image and a modified sample image converted from the original sample image, wherein the original sample image has higher clarity than the corresponding modified sample image; a gender-specific facial feature extraction module for extracting facial feature data that meets consistency requirements for each sample image pair, and classifying gender-specific facial feature data from the facial feature data; an age distribution conversion module for converting the actual age information corresponding to each sample image pair into age distribution data, the age distribution data representing the relationship between age changes and facial appearance changes; and an age and gender prediction model training module for training the age and gender prediction model based on the sample image dataset, the gender-specific facial feature data, and the age distribution data.

[0013] Optionally, the gender-specific facial feature extraction module is used to extract facial feature data that meet the consistency requirements from the original sample image and the corresponding modified sample image for each sample image pair according to a preset sharpness error loss function, and to classify the gender-specific facial feature data from the facial feature data.

[0014] Optionally, the age distribution conversion module is used to convert the actual age information into the age distribution data according to a preset age distribution function.

[0015] Optionally, the age distribution conversion module includes: a variance calculation module, used to calculate the age variance data of the actual age information according to a preset variable age variance function; and a distribution conversion module, used to convert the actual age information into the age distribution data according to the age variance data, a preset age label range, and the age distribution function.

[0016] Optionally, the age and gender prediction model training module includes: a feature extraction module, used to extract male-female facial feature data for male sample images and female-female facial feature data for female sample images from the sample image dataset; and a model training module, used to train the age and gender prediction model based on the sample image dataset, the male-female facial feature data and male age distribution data in the age distribution data, and the female-female facial feature data and female age distribution data in the age distribution data.

[0017] Optionally, the system further includes a conversion module, used to perform random downsampling and image resizing processing on multiple original sample images to obtain corresponding trimmed sample images.

[0018] A fourth aspect of the present invention discloses an age and gender prediction system, the system comprising: a face image acquisition module for acquiring a face image to be predicted; and a face age and gender prediction module for inputting the face image into an age and gender prediction model trained according to the method described in the first aspect, and outputting the face age information and gender information of the face image.

[0019] A fifth aspect of the present invention discloses a computer-readable storage medium storing a computer program that causes a processor to perform the method described in the first or second aspect.

[0020] The embodiments of the present invention have the following advantages:

[0021] The training scheme for the age and gender prediction model provided in this invention involves acquiring a sample image dataset containing multiple sample image pairs. Each sample image pair includes an original sample image and a modified sample image converted from the original sample image. The original sample image has higher resolution than the corresponding modified sample image. For each sample image pair, facial feature data meeting preset consistency requirements is extracted from both the original sample image and the corresponding modified sample image according to a resolution error loss function. In other words, the facial feature data extracted from the original sample image is consistent with the facial feature data extracted from the corresponding modified sample image. Furthermore, gender-specific facial feature data is categorized from the facial feature data. Then, age distribution data is obtained based on the actual age information corresponding to each sample image pair. This age distribution data represents the relationship between age changes and facial appearance changes. Finally, the age and gender prediction model is trained based on the sample image dataset, gender-specific facial feature data, and age distribution data.

[0022] In the training process of the age and gender prediction model, this invention incorporates age distribution data to correlate age changes with facial appearance changes, highlighting the impact of age changes at different stages on facial appearance changes, thereby improving the accuracy of age prediction. It also introduces gender-specific facial feature data, incorporating the influence of gender features to achieve better age prediction for facial images of different genders. The age and gender prediction model uses a multi-task framework, enabling simultaneous prediction of age and gender. Furthermore, the sample image dataset includes sample images of varying resolutions, allowing the model to accurately predict age and gender even for low-resolution facial images. Attached Figure Description

[0023] Figure 1 This is a flowchart illustrating the steps of training a gender prediction model according to an embodiment of the present invention.

[0024] Figure 2 This is a schematic diagram of the age variance data in an embodiment of the present invention;

[0025] Figure 3(a) is a schematic diagram of the age distribution data of males in the present invention when their actual age is 3, 4, and 5 years old;

[0026] Figure 3(b) is a schematic diagram of the age distribution data of males in an embodiment of the present invention when their actual age is 16, 17, and 18 years old;

[0027] Figure 3(c) is a schematic diagram of the age distribution data of women in the present invention when they are 16, 17, and 18 years old.

[0028] Figure 3(d) is a schematic diagram of the age distribution data of women in the present invention when their actual age is 29, 30, and 31 years old;

[0029] Figure 4 This is a schematic diagram of the framework of a face detection model according to an embodiment of the present invention;

[0030] Figure 5 This is a schematic diagram of the framework of the age and gender prediction model trained according to an embodiment of the present invention;

[0031] Figure 6 This is a flowchart illustrating the steps of an age and gender prediction method according to an embodiment of the present invention.

[0032] Figure 7 This is a data processing flowchart of an age and gender prediction method according to an embodiment of the present invention;

[0033] Figure 8 This is a structural block diagram of a training system for an age and gender prediction model according to an embodiment of the present invention;

[0034] Figure 9 This is a structural block diagram of an age and gender prediction system according to an embodiment of the present invention. Detailed Implementation

[0035] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0036] This invention uses target detection technology to automatically determine the location of faces in an image, and uses image processing methods to filter out target regions containing faces. By judging the key points of the target regions, face alignment is performed. Based on the face-aligned image, facial feature data is extracted for different genders to predict the probability of each age and gender.

[0037] Reference Figure 1 The diagram illustrates a flowchart of the training method for an age and gender prediction model according to an embodiment of the present invention. The training method for this age and gender prediction model specifically includes the following steps:

[0038] Step 101: Obtain the sample image dataset.

[0039] In embodiments of the present invention, the sample image dataset may contain multiple sample image pairs. Each sample image pair includes an original sample image and a modified sample image converted from the original sample image, wherein the original sample image has higher resolution than the corresponding modified sample image. The original sample image may contain a face or not. Furthermore, for images containing faces, the sample image dataset may also include an age label. This age label may be the actual age information corresponding to the face in the original sample image. In practical applications, the sample image dataset may include a face detection dataset and an age prediction dataset. The face detection dataset may use datasets such as Widerface (a benchmark dataset for face detection). The age prediction dataset may use datasets such as ms1m, utk-face, segaface, and webface (ms1m, utk-face, segaface, and webface are all commonly used face age datasets). The face detection dataset can be used to train the face detection model in the age and gender prediction model. The age prediction dataset can be used to train the face age prediction model in the age and gender prediction model.

[0040] Step 102: Extract facial feature data that meets the consistency requirements for each sample image pair, and classify gender-specific facial feature data from the facial feature data.

[0041] In an embodiment of the present invention, the facial feature data extracted from the original sample image meets the consistency requirement with the facial feature data extracted from the corresponding modified sample image, that is, the facial feature data extracted from the original sample image is consistent with the facial feature data extracted from the corresponding modified sample image.

[0042] In embodiments of the present invention, when obtaining gender-specific facial feature data, each original sample image can first be classified according to gender. That is, original sample images belonging to the same gender are grouped into one category, and correspondingly, the modified sample images corresponding to the original sample images are also grouped into the same category. In other words, the gender of the faces in the original sample images is not changed during the conversion of the original sample images into modified sample images. The gender of the faces in the original sample images is the same as the gender of the faces in the corresponding modified sample images. If a face in an original sample image is male, the facial feature data extracted from that original sample image belongs to male gender-specific facial feature data; if a face in an original sample image is female, the facial feature data extracted from that original sample image belongs to female gender-specific facial feature data.

[0043] Step 103: Convert the actual age information of each sample image to obtain age distribution data.

[0044] In embodiments of the present invention, based on real-world observations, facial features vary more significantly at younger ages and less at older ages. For example, the differences in facial features between 2-5 year olds are significantly greater than those between 35-38 year olds. Therefore, it is necessary to convert actual age information into age distribution data. This actual age information can be understood as the age corresponding to the face itself or an age value. This age distribution data represents the relationship between changes in age and changes in facial features.

[0045] Step 103 can be executed in parallel with step 102, or sequentially. This embodiment of the invention does not impose specific restrictions on the execution order of steps 103 and 102. Step 104: Train the age and gender prediction model based on the sample image dataset, gender facial feature data, and age distribution data.

[0046] In embodiments of the present invention, the face detection model in the age and gender prediction model can be trained based on the face detection dataset and gender face feature data, and the face age and gender prediction model in the age and gender prediction model can be trained based on the age prediction dataset and age distribution data.

[0047] The training scheme for the age and gender prediction model provided in this embodiment of the invention.

[0048] A sample image dataset containing multiple sample image pairs is obtained. Each sample image pair includes the original sample image and a retouched sample image derived from the original sample image, with the original sample image having higher resolution than the corresponding retouched sample image. For each sample image pair, facial feature data meeting consistency requirements is extracted. That is, the facial feature data extracted from the original sample image is consistent with the facial feature data extracted from the corresponding retouched sample image. Furthermore, gender-specific facial feature data is categorized from the facial feature data. Then, age distribution data is obtained based on the actual age information corresponding to each sample image pair, representing the relationship between age changes and facial appearance changes. Finally, an age and gender prediction model is trained using the sample image dataset, gender-specific facial feature data, and age distribution data.

[0049] In the training process of the age and gender prediction model, this invention incorporates age distribution data to correlate age changes with facial appearance changes, highlighting the impact of age changes at different stages on facial appearance changes, thereby improving the accuracy of age prediction. It also introduces gender-specific facial feature data, incorporating the influence of gender features to achieve better age prediction for facial images of different genders. The age and gender prediction model uses a multi-task framework, enabling simultaneous prediction of age and gender. Furthermore, the sample image dataset includes sample images of varying resolutions, allowing the model to accurately predict age and gender even for low-resolution facial images.

[0050] In one exemplary embodiment of the present invention, for each sample image pair, facial feature data meeting consistency requirements is extracted. One implementation method for classifying gender-specific facial feature data from the facial feature data involves extracting, for each sample image pair, facial feature data meeting consistency requirements from the original sample image and the corresponding retouched sample image according to a preset sharpness error loss function, and classifying gender-specific facial feature data from the facial feature data. The preset sharpness error loss function can be an L2 loss function. Using the L2 loss function to extract facial feature data ensures that the facial feature data extracted from the original sample image is consistent with the facial feature data extracted from the corresponding retouched sample image.

[0051] In an exemplary embodiment of the present invention, one method for converting the actual age information corresponding to each sample image into age distribution data is as follows: the actual age information is converted into age distribution data according to a preset age distribution function. In practical applications, the preset age distribution function can be a Gaussian distribution function. Specifically, the age variance data of the actual age information can be calculated according to a preset variable age variance function; the actual age information is converted into age distribution data according to the age variance data, the preset age label range, and the age distribution function.

[0052] The Gaussian distribution function mentioned above can be:

[0053]

[0054] Where x represents the age label range, μ represents the actual age information, σ represents the age standard deviation data, and f(x) represents the age distribution data.

[0055] The variable age variance function described above can be: 2 + 4 * (mean (log(age)); where age represents the actual age information, and 2 + 4 * (mean (log(age))) represents the age variance data. (Refer to...) Figure 2 The graph shows a schematic representation of the age variance data. Figure 2 In the graph, the horizontal axis represents actual age (age), and the vertical axis represents age variance (variance). Actual age ranges from 0 to 100, and age variance ranges from 2 to 6. The curve represents the age variance data. Figure 2 As can be seen, the younger the actual age, the smaller the age variance; conversely, the older the actual age, the larger the age variance. Furthermore, the age variance varies considerably for actual ages between 0 and 20, while it varies less for actual ages between 20 and 100.

[0056] The age range mentioned above can be set to 1-100.

[0057] In practical applications, the age variance data of actual age information can be calculated first using a variable age variance function, and then the age variance data can be converted into age standard deviation data. The age standard deviation data, actual age information, and age label range are input into a Gaussian distribution function to output age distribution data. Referring to Figures 3(a), 3(b), 3(c), and 3(d), several sets of age distribution data curves are shown. In Figures 3(a), 3(b), 3(c), and 3(d), the horizontal axis represents actual age information (age), the vertical axis represents the probability of age distribution, and the curves represent age distribution data. Figure 3(a) shows the age distribution data for men at actual ages of 3, 4, and 5. Figure 3(b) shows the age distribution data for men at actual ages of 16, 17, and 18. Figure 3(c) shows the age distribution data for women at actual ages of 16, 17, and 18. Figure 3(d) shows the age distribution data for women at actual ages of 29, 30, and 31. As can be seen from Figures 3(a), 3(b), 3(c), and 3(d), the smaller the age, the greater the variation in the age distribution data; and the larger the age, the smaller the variation in the age distribution data.

[0058] In one exemplary embodiment of the present invention, one method for training an age and gender prediction model based on a sample image dataset, gender-specific facial feature data, and age distribution data involves extracting male gender-specific facial feature data for male sample images and female age feature data for female sample images from the sample image dataset. The age and gender prediction model is then trained using male age distribution data from the sample image dataset, male gender-specific facial feature data, and age distribution data, as well as female age distribution data from the female gender-specific facial feature data and age distribution data. The male sample images consist of original sample images containing male faces and corresponding retouched sample images. The female sample images consist of original sample images containing female faces and corresponding retouched sample images. The male age distribution data is obtained by converting the actual age information corresponding to the male sample images. The female age distribution data is obtained by converting the actual age information corresponding to the female sample images. In practical applications, the face detection model can be divided into two sub-networks, used to extract male age feature data from male sample images and female age feature data from female sample images, respectively. The facial age prediction model can also be divided into two sub-networks: one for predicting the probability of male ages based on male age feature data and male age distribution data, and the other for predicting the probability of female ages based on female age feature data and female age distribution data. During training, backpropagation is only performed on the sub-network of the corresponding gender's face detection model. For example, if the input image is a male sample image, only the male face detection model sub-network is trained. Additionally, intermediate features are output by the face detection model sub-network to determine gender. During use, the predicted gender is used to input the intermediate features into the corresponding facial age prediction model sub-network for age estimation. This makes the obtained ages more gender-specific, resulting in better age prediction performance for input images that are either male or female.

[0059] In one exemplary embodiment of the present invention, one implementation of the step of converting the original sample image into a trimmed sample image involves performing random downsampling and image resizing processing on multiple original sample images to obtain the corresponding trimmed sample images. In other words, this embodiment of the present invention can obtain trimmed sample images with lower resolution by converting the original sample images when only the original sample images are available, without needing to directly acquire original sample images of various resolutions, thus reducing the requirements for acquiring sample image datasets.

[0060] When predicting the age and gender of facial images, the clarity of the images affects the final prediction result. For example, the prediction result for a blurry facial image differs significantly from that for a clearer one. To address this issue, this invention employs a mixed clarity training method. The original sample image is randomly downsampled and then resized back to its original size to alter its clarity. During training, separate clarity error loss functions are set for the original sample images and their corresponding resized images at different clarity levels. This ensures that the original and resized images output similar or identical facial feature data. In other words, the facial feature data extracted from the relatively low-clarity resized image is consistent with the facial feature data extracted from the relatively high-clarity original image using the same feature extractor. This significantly reduces the impact of low-clarity images on the age and gender prediction results, thereby lowering the clarity requirement for the facial image being predicted and improving the adaptability of the age and gender prediction model.

[0061] Based on the above explanation of the training method for an age and gender prediction model, the following describes a training method for a face detection model and a face age prediction model. Since the detected faces need to be aligned, the face detection model can employ a YOLO model incorporating keypoint regression. (Refer to...) Figure 4 This diagram illustrates the framework of a face detection model. Figure 4 In the middle, the sample image ( Figure 4 The sample image (which can represent the original sample image) is input into the face detection model. Facial feature data is extracted from the sample image, and convolution processing is performed on the facial feature data to output a bounding box, key points, and confidence score. The confidence score represents the probability that the bounding box contains a face. In practical applications, a confidence threshold can be set; for example, a confidence threshold of 0.5. If the confidence score is greater than 0.5, the bounding box is considered to contain a face; if the confidence score is less than or equal to 0.5, the bounding box is considered not to contain a face. Furthermore, to achieve accurate face alignment, this embodiment of the invention can use five key points for face alignment. Specific key points may include, but are not limited to, the eyes, nose, and the two corners of the mouth.

[0062] It should be noted that, to obtain more balanced sample images, random sampling can be used. The specific process is as follows: 1) Divide the sample images into different data subsets based on age. 2) Randomly select different age values. 3) Use the randomly selected age values ​​to randomly sample from the corresponding data subsets. Random sampling ensures that sample images of different ages have an equal or approximately equal probability of being sampled.

[0063] Reference Figure 5 This diagram illustrates the framework of the age and gender prediction model trained according to an embodiment of the present invention. Figure 5 In this process, facial feature data are extracted from both the original sample image and the revised sample image derived from the original sample image. Gender is predicted based on the facial feature data, and the age-gender prediction model is trained using a loss function (BCE_loss) to ensure consistency between the predicted and actual genders. Convolution processing is performed on the facial feature data from both the original and revised sample images, and then the age-gender prediction model is trained using a loss function (L2_loss) to ensure that the facial feature data from the original and revised sample images are as consistent as possible. The age prediction result output by the age-gender prediction model is... Figure 5 The data is represented as a bar chart. Age variance data is calculated based on the actual age information in the sample image dataset, and then Gaussian distribution processing is applied to the age variance data to obtain the age distribution data. The age distribution data is... Figure 5 The curve is represented as a parabola. Finally, the age prediction results and age distribution data are used to train the age and gender prediction model using a loss function (KL_loss).

[0064] Reference Figure 6 The diagram illustrates a flowchart of an age and gender prediction method according to an embodiment of the present invention. This age and gender prediction method specifically includes the following steps:

[0065] Step 601: Obtain the face image to be estimated.

[0066] In the embodiments of the present invention, the face image to be estimated can be an image of any format, any resolution, and any size. The embodiments of the present invention do not impose specific restrictions on the face image.

[0067] Step 602: Input the face image into the age and gender prediction model and output the face age information and gender information.

[0068] In embodiments of the present invention, the age and gender prediction model can be trained using the training method described above. The output facial age information can include the probability values ​​of each predicted age. The output gender information can be the probability value of the predicted gender or the gender itself.

[0069] Reference Figure 7 The diagram shows a data processing flowchart of an age and gender prediction method according to the present invention.

[0070] A face image is input into a face detection model, which outputs bounding boxes and key points. Face alignment and cropping are performed based on the bounding boxes and key points to obtain face region images. Facial feature data is extracted from these face region images. A face age prediction model outputs gender and age information based on the facial feature data. It should be noted that a face image can contain one or more faces. When a face image contains multiple faces, it can output the gender and age information for all faces. For example, if a face image contains two faces, the prediction result will be the face region images of both faces, along with the gender and age information for each face region image.

[0071] In this embodiment of the invention, when performing Gaussian distribution processing, variable age variance data is used according to different ages. The age variance data is converted into age standard deviation data and input into the Gaussian distribution function, making the age prediction results for young facial images more accurate. Moreover, when performing Gaussian distribution processing, integral calculation methods are avoided, resulting in lower computational cost and optimizing the structure of the age and gender prediction model.

[0072] In this embodiment of the invention, the face detection model of the age and gender prediction model includes a key point regression component, instead of treating face detection and key point regression as two separate models. This enriches the functionality of the face detection model while simplifying the structure of the age and gender prediction model.

[0073] In this embodiment of the invention, five key points are used for face alignment during key point regression. Compared with the traditional method of using only three key points to determine the face region, the face alignment effect of this embodiment is better, thereby highlighting the face region, avoiding the face region from containing too many interference items, and improving the face detection effect.

[0074] In this embodiment of the invention, the original sample image is converted into a modified sample image with lower resolution. The feature extractor in the age and gender prediction model is trained using the resolution error loss function. This ensures that the facial feature data of the original sample images and the corresponding modified sample images with different resolutions are consistent, which greatly reduces the impact of low-resolution sample images on the age and gender prediction results. This reduces the resolution requirement of the face image to be predicted and improves the adaptability of the age and gender prediction model.

[0075] This invention provides age prediction for facial images of different genders, and can output gender while estimating age, thereby improving the accuracy of age estimation.

[0076] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.

[0077] Reference Figure 8 The diagram shows a structural block diagram of a training system for an age and gender prediction model according to an embodiment of the present invention. The training system for the age and gender prediction model may specifically include the following modules.

[0078] The sample dataset acquisition module 81 is used to acquire a sample image dataset, which contains multiple sample image pairs. Each sample image pair contains an original sample image and a modified sample image converted from the original sample image. The original sample image has a higher resolution than the corresponding modified sample image.

[0079] The gender-specific facial feature extraction module 82 is used to extract facial feature data that meets the consistency requirements for each sample image pair, and to classify gender-specific facial feature data from the facial feature data.

[0080] The age distribution conversion module 83 is used to convert the corresponding actual age information of each sample image to obtain age distribution data, wherein the age distribution data represents the relationship between age changes and facial appearance changes.

[0081] The age and gender prediction model training module 84 is used to train the age and gender prediction model based on the sample image dataset, the gender facial feature data, and the age distribution data.

[0082] In an exemplary embodiment of the present invention, the gender-specific facial feature extraction module 82 is used to extract facial feature data that meet the consistency requirements from the original sample image and the corresponding modified sample image for each sample image pair according to a preset sharpness error loss function, and to classify the gender-specific facial feature data of different genders from the facial feature data.

[0083] In an exemplary embodiment of the present invention, the age distribution conversion module 83 is used to convert the actual age information into the age distribution data according to a preset age distribution function.

[0084] In an exemplary embodiment of the present invention, the age distribution conversion module 83 includes:

[0085] The variance calculation module is used to calculate the age variance data of the actual age information according to a preset variable age variance function;

[0086] The distribution conversion module is used to convert the actual age information into the age distribution data based on the age variance data, the preset age label range, and the age distribution function.

[0087] In an exemplary embodiment of the present invention, the age and gender prediction model training module 84 includes:

[0088] The feature extraction module is used to extract male-female facial feature data for male sample images and female-female facial feature data for female sample images from the sample image dataset.

[0089] The model training module is used to train the age and gender prediction model based on the sample image dataset, the male gender facial feature data and the male age distribution data in the age distribution data, and the female gender facial feature data and the female age distribution data in the age distribution data.

[0090] In one exemplary embodiment of the present invention, the system further includes:

[0091] The conversion module is used to perform random downsampling and image size adjustment processing on multiple original sample images to obtain the corresponding trimmed sample images.

[0092] Reference Figure 9 The diagram shows a structural block diagram of an age and gender prediction system according to an embodiment of the present invention. The age and gender prediction system may specifically include the following modules.

[0093] The face image acquisition module 91 is used to acquire the face image to be estimated;

[0094] The face age and gender prediction module 92 is used to input the face image into the age and gender prediction model trained according to the above-mentioned age and gender prediction model training method, and output the face age information and gender information of the face image.

[0095] As the system implementation is basically similar to the method implementation, it is described in a relatively simple way. For relevant details, please refer to the description of the method implementation.

[0096] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0097] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0098] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0099] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0100] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0101] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the present invention.

[0102] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0103] The training method and system for an age and gender prediction model, as well as an age and gender prediction method and system provided by the present invention, have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A training method for an age and gender prediction model, characterized in that, The method includes: Obtain a sample image dataset, which contains multiple sample image pairs. Each sample image pair includes an original sample image and a trimmed sample image converted from the original sample image. The original sample image has higher resolution than the corresponding trimmed sample image. For each sample image pair, extract facial feature data that meets the consistency requirements, and classify gender-specific facial feature data from the facial feature data. Age distribution data is obtained by converting the actual age information corresponding to each sample image, and the age distribution data represents the relationship between changes in age and changes in facial appearance. The age and gender prediction model is trained based on the sample image dataset, the gender facial feature data, and the age distribution data; the age and gender prediction model includes a face detection model, which is a model incorporating keypoint regression. The step involves extracting facial feature data that meets consistency requirements for each sample image pair, and classifying gender-specific facial feature data from the facial feature data, including: For each pair of sample images, facial feature data that meets the consistency requirements is extracted from the original sample image and the corresponding modified sample image according to a preset sharpness error loss function, and gender-specific facial feature data is classified from the facial feature data. The step of converting the corresponding actual age information for each sample image to obtain age distribution data includes: The age variance data of the actual age information is calculated based on a preset variable age variance function; Based on the age variance data, the preset age label range, and the age distribution function, the actual age information is converted into the age distribution data.

2. The method according to claim 1, characterized in that, The step of training the age and gender prediction model based on the sample image dataset, the gender facial feature data, and the age distribution data includes: Extract male-specific facial feature data for male sample images and female-specific facial feature data for female sample images from the sample image dataset; The age and gender prediction model is trained based on the sample image dataset, the male gender facial feature data and the male age distribution data in the age distribution data, and the female gender facial feature data and the female age distribution data in the age distribution data.

3. The method according to claim 1, characterized in that, The steps for obtaining the trimmed sample image from the original sample image include: The corresponding trimmed sample images are obtained by performing random downsampling and image resizing processing on multiple original sample images respectively.

4. A method for predicting age and gender, characterized in that, The method includes: Obtain the face image to be estimated; The face image is input into the age and gender prediction model trained by the method according to any one of claims 1 to 3, and the face age information and gender information of the face image are output.

5. A training system for an age and gender prediction model, characterized in that, The system includes: A sample dataset acquisition module is used to acquire a sample image dataset, which contains multiple sample image pairs. Each sample image pair includes an original sample image and a modified sample image converted from the original sample image. The original sample image has higher resolution than the corresponding modified sample image. A gender-specific facial feature extraction module is used to extract facial feature data that meets the consistency requirements for each sample image pair, and to classify gender-specific facial feature data from the facial feature data; specifically, it is used to: for each sample image pair, extract facial feature data that meets the consistency requirements from the original sample image and the corresponding modified sample image according to a preset sharpness error loss function, and classify gender-specific facial feature data from the facial feature data; The age distribution conversion module is used to convert the corresponding actual age information of each sample image to obtain age distribution data, which represents the relationship between age changes and facial appearance changes. An age and gender prediction model training module is used to train an age and gender prediction model based on the sample image dataset, the gender facial feature data, and the age distribution data; the age and gender prediction model includes a face detection model, which is a model incorporating keypoint regression. The age distribution conversion module includes: The variance calculation module is used to calculate the age variance data of the actual age information according to a preset variable age variance function; The distribution conversion module is used to convert the actual age information into the age distribution data based on the age variance data, the preset age label range, and the age distribution function.

6. An age and gender prediction system, characterized in that, The system includes: The face image acquisition module is used to acquire the face image to be estimated; The facial age and gender prediction module is used to input the facial image into the age and gender prediction model trained by the method according to any one of claims 1 to 3, and output the facial age information and gender information of the facial image.

7. A computer-readable storage medium, characterized in that, The stored computer program causes the processor to execute the training method of the age and sex prediction model as described in any one of claims 1 to 3 or the age and sex prediction method as described in claim 4.

Citation Information

Patent Citations

  • Age prediction system and method based on voiceprint and facial image feature fusion

    CN108460334A

  • Training method of gender and age recognition model, recognition method, medium and equipment

    CN112329693A

  • Image deblurring method, system and device and storage medium

    CN113269695A