CN109670437B - Age estimation model training method, facial image recognition method and device - Google Patents

Age estimation model training method, facial image recognition method and device Download PDF

Info

Publication number
CN109670437B
CN109670437B CN201811532337.1A CN201811532337A CN109670437B CN 109670437 B CN109670437 B CN 109670437B CN 201811532337 A CN201811532337 A CN 201811532337A CN 109670437 B CN109670437 B CN 109670437B
Authority
CN
China
Prior art keywords
age
image
training
face
current stage
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811532337.1A
Other languages
Chinese (zh)
Other versions
CN109670437A (en
Inventor
贺珂珂
葛彦昊
汪铖杰
李季檩
吴永坚
黄飞跃
杨思骞
姚永强
朱敏
黄小明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201811532337.1A priority Critical patent/CN109670437B/en
Publication of CN109670437A publication Critical patent/CN109670437A/en
Application granted granted Critical
Publication of CN109670437B publication Critical patent/CN109670437B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/172Classification, e.g. identification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/178Human faces, e.g. facial parts, sketches or expressions estimating age from face image; using age information for improving recognition

Landscapes

  • Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)

Abstract

The application relates to an age estimation model training method, a facial image recognition method and a device, wherein the age estimation model training method comprises the following steps: acquiring a face sample image set corresponding to the current stage; for each face sample image in the face sample image set, adjusting image quality parameters to obtain parameter adjustment face images, and selecting age labeling values from corresponding age labeling ranges; adjusting the facial image and the selected age marking value according to the parameters, and performing the training of the current stage on the model to be trained until the training suspension condition of the current stage is met; determining the training suspension condition of the next stage according to the training suspension condition of the current stage; and taking the next stage as the current stage, returning to obtain the face sample image set corresponding to the current stage and continuing training until the training stopping condition of the next stage meets the training finishing condition to obtain the age estimation model. The scheme provided by the application improves the age estimation accuracy of the age estimation model.

Description

Age estimation model training method, facial image recognition method and device
Technical Field
The present application relates to the field of image processing technologies, and in particular, to an age estimation model training method, a facial image recognition device, a computer-readable storage medium, and a computer device.
Background
With the development of data processing technology, image processing technology has also been developed rapidly, so that the application fields of image processing technology are quite wide, for example, many application fields such as traffic monitoring and target identification, and in the target identification, the target object in the image can be identified through image processing.
However, in the current image processing technology, the age corresponding to the face image can be determined by identifying the face image, and in the traditional method of identifying the age by the face image, the identification result is easily affected by the environmental factors during image acquisition, so that the accuracy of identifying the age by the face image is low.
Disclosure of Invention
Based on this, it is necessary to provide an age estimation model training method, a face image recognition method, an apparatus, a computer-readable storage medium, and a computer device for solving a technical problem that accuracy of age recognition by a face image is low.
An age estimation model training method comprises the following steps:
acquiring a face sample image set corresponding to the current stage;
for each face sample image in the face sample image set, adjusting image quality parameters to obtain parameter adjustment face images, and selecting age labeling values from corresponding age labeling ranges;
adjusting the facial image and the selected age marking value according to the parameters, and performing the training of the current stage on the model to be trained until the training suspension condition of the current stage is met;
determining the training suspension condition of the next stage according to the training suspension condition of the current stage;
and taking the next stage as the current stage, returning to the face sample image set corresponding to the current stage to continue training the model to be trained until the training stopping condition of the next stage meets the training completing condition, and obtaining the age estimation model.
An age estimation model training device, the device comprising:
the sample image acquisition module is used for acquiring a face sample image set corresponding to the current stage;
the quality parameter adjusting module is used for adjusting image quality parameters of each face sample image in the face sample image set to obtain parameter adjustment face images and selecting age labeling values from corresponding age labeling ranges;
the model training module is used for adjusting the facial image and the selected age marking value according to the parameters and carrying out training of the model to be trained in the current stage until the training suspension condition of the current stage is met;
a stopping condition determining module, configured to determine a training stopping condition of a next stage according to the training stopping condition of the current stage;
and the training circulation module is used for informing the sample image acquisition module to acquire a face sample image set corresponding to the current stage by taking the next stage as the current stage so as to continue training the model to be trained until the training stopping condition of the next stage meets the training completing condition, and obtaining the age estimation model.
A computer device comprising a memory and a processor, the memory having stored therein a computer program that, when executed by the processor, causes the processor to perform the steps of:
acquiring a face sample image set corresponding to the current stage;
for each face sample image in the face sample image set, adjusting image quality parameters to obtain parameter adjustment face images, and selecting age labeling values from corresponding age labeling ranges;
adjusting the facial image and the selected age marking value according to the parameters, and performing the training of the current stage on the model to be trained until the training suspension condition of the current stage is met;
determining the training suspension condition of the next stage according to the training suspension condition of the current stage;
and taking the next stage as the current stage, returning to the face sample image set corresponding to the current stage to continue training the model to be trained until the training stopping condition of the next stage meets the training completing condition, and obtaining the age estimation model.
A storage medium storing a computer program which, when executed by a processor, causes the processor to perform the steps of:
acquiring a face sample image set corresponding to the current stage;
for each face sample image in the face sample image set, adjusting image quality parameters to obtain parameter adjustment face images, and selecting age labeling values from corresponding age labeling ranges;
adjusting the facial image and the selected age marking value according to the parameters, and performing the training of the current stage on the model to be trained until the training suspension condition of the current stage is met;
determining the training suspension condition of the next stage according to the training suspension condition of the current stage;
and taking the next stage as the current stage, returning to the face sample image set corresponding to the current stage to continue training the model to be trained until the training stopping condition of the next stage meets the training completing condition, and obtaining the age estimation model.
According to the age estimation model training method, the age estimation model training device, the computer readable storage medium and the computer equipment, for each face sample image in a face sample image set corresponding to the current stage, image quality parameters are adjusted to obtain parameter adjustment face images, age marking values are selected from corresponding age marking ranges, and training of the current stage is carried out according to the parameter adjustment face images and the selected age marking values. In the training process, the influence of environmental factors on the image quality is fully considered by the trained model through adjusting the image quality parameters, so that the influence of the image quality on the model identification result is considered, and the age estimation accuracy of the trained age estimation model is improved after the training in multiple stages.
An age estimation model training method comprises the following steps:
acquiring a face image;
obtaining probability values corresponding to all preset age groups output by the age estimation model through the age estimation model of the face image;
determining expected age values according to the probability values corresponding to the preset age groups respectively;
and taking the age estimated value corresponding to the age estimated value as the age estimated value of the face image.
A facial image recognition apparatus, the apparatus comprising:
the face image acquisition module is used for acquiring a face image;
the facial image identification module is used for estimating the age of the facial image to obtain the probability values respectively corresponding to all the preset age groups output by the age estimation model;
the age expectation determining module is used for determining age expectation values according to the probability values corresponding to the preset age groups respectively;
and the age estimation module is used for taking the age estimation value corresponding to the age estimation value as the age estimation value of the face image.
A computer device comprising a memory and a processor, the memory having stored therein a computer program that, when executed by the processor, causes the processor to perform the steps of:
acquiring a face image;
obtaining probability values corresponding to all preset age groups output by the age estimation model through the age estimation model of the face image;
determining expected age values according to the probability values corresponding to the preset age groups respectively;
and taking the age estimated value corresponding to the age estimated value as the age estimated value of the face image.
A storage medium storing a computer program which, when executed by a processor, causes the processor to perform the steps of:
acquiring a face image;
obtaining probability values corresponding to all preset age groups output by the age estimation model through the age estimation model of the face image;
determining expected age values according to the probability values corresponding to the preset age groups respectively;
and taking the age estimated value corresponding to the age estimated value as the age estimated value of the face image.
According to the facial image identification method, the facial image identification device, the computer readable storage medium and the computer equipment, the age of the acquired facial image is identified according to the age estimation model considering the influence of environmental factors on the acquired facial image, and the accuracy of the probability value corresponding to each preset age group is improved. And then, the expected age value is calculated according to the probability value corresponding to each preset age group, so that the expected age value is obtained according to the expected age value, and the accuracy of the estimated age value is further improved.
Drawings
FIG. 1 is a diagram of an exemplary embodiment of a training method for an age estimation model;
FIG. 2 is a schematic flow chart diagram illustrating a method for training an age estimation model according to an embodiment;
FIG. 3 is a flowchart illustrating the steps of obtaining a face sample image set in one embodiment;
FIG. 4 is a flowchart illustrating the steps of adjusting image quality parameters according to one embodiment;
FIG. 5 is a schematic diagram of age labeling of a face sample image in one embodiment;
FIG. 6 is a schematic flowchart of a training method for age estimation models according to another embodiment;
FIG. 7 is a diagram illustrating adjustment of an image quality parameter according to one embodiment;
FIG. 8 is a flow diagram that illustrates a method for facial image recognition, according to one embodiment;
FIG. 9 is a schematic diagram illustrating age identification of a facial image in one embodiment;
FIG. 10 is a flowchart illustrating the steps of obtaining a face image in one embodiment;
FIG. 11 is a schematic diagram showing customer details in one embodiment;
FIG. 12 is a diagram illustrating customer access statistics in one embodiment;
FIG. 13 is a block diagram showing the structure of an age estimation model training apparatus according to an embodiment;
FIG. 14 is a block diagram showing the configuration of a face image recognition apparatus according to an embodiment;
FIG. 15 is a block diagram showing the configuration of a computer device according to one embodiment;
fig. 16 is a block diagram showing a configuration of a computer device in another embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
FIG. 1 is a diagram of an embodiment of an application environment of a method for training an age estimation model. Referring to fig. 1, the age estimation model training method is applied to an age estimation model training system. The age estimation model training system comprises a terminal 110 and a server 120. The terminal 110 and the server 120 are connected through a network. The terminal 110 may specifically be a desktop terminal or a mobile terminal, and the mobile terminal may specifically be at least one of a mobile phone, a tablet computer, a notebook computer, and the like. The server 120 may be implemented as a stand-alone server or a server cluster composed of a plurality of servers.
In one embodiment, as shown in FIG. 2, an age estimation model training method is provided. The embodiment is mainly illustrated by applying the method to the server 120 in fig. 1, and may also be applied to the terminal 110 in fig. 1. Referring to fig. 2, the age estimation model training method specifically includes the following steps:
s202, obtaining a face sample image set corresponding to the current stage.
The server is provided with a database for storing sample image training sets, and each sample image training set comprises face sample images corresponding to all age groups. The face sample image set corresponding to the current stage is the set of face sample images required by the current model training stage. The face sample image is an image obtained by image-capturing a face of the target object, and the face sample image may be a human face sample image.
Specifically, the server receives a model training instruction sent by the terminal, accesses a database storing a sample image training set according to the model training instruction, and extracts a face sample image corresponding to the current stage from the database to obtain a face sample image set corresponding to the current stage.
In one embodiment, the server obtains the number of preset images corresponding to the current stage, and screens the face sample images from the stored sample image training set according to the number of the preset images, so that the screened face sample images serve as the face sample image set corresponding to the current stage.
And S204, for each face sample image in the face sample image set, adjusting the image quality parameters to obtain parameter adjustment face images, and selecting age labeling values from corresponding age labeling ranges.
The image quality parameter represents a parameter of image quality of the face sample image, and the image quality parameter may specifically include an image blur degree and an image brightness, and may further include the number of pixels, a resolution, a transparency, and the like. Each face sample image in the face sample image set is labeled with an age labeling range, for example, the age labeling range may be 2-4 years old, and the age labels in the age labeling range of 2-3 years old are 2 years old, 3 years old and 4 years old.
Specifically, the server reads each face sample image in the face sample image set, acquires image quality parameters of the read face sample image, and adjusts each parameter in the acquired image quality parameters to be larger or smaller, so as to obtain a parameter-adjusted face image. The server extracts an age labeling range corresponding to the read face sample image, determines age labeling values in the extracted age labeling range, and selects an age labeling value from the determined age labeling values. The age labeling range extracted by the server corresponds to the read facial sample image, the parameter adjustment facial image corresponds to the read facial sample image, and the age labeling range and the parameter adjustment facial image corresponding to the same facial sample image correspond to each other.
And S206, adjusting the facial image and the selected age label value according to the parameters, and performing the training of the current stage on the model to be trained until the training suspension condition of the current stage is met.
The training suspension condition of the current stage is a condition to be met by suspending the current stage and entering the next stage.
Specifically, the server adjusts the face image and the selected age label value according to the parameters corresponding to the same face sample image, and the adjusted face image and the selected age label value are respectively used as the input and the output of the model to be trained to perform the training of the current stage until the training suspension condition of the current stage is met.
In one embodiment, the training suspension condition of the current stage may be a training suspension duration, the server performs training of the current stage by using a facial sample image set corresponding to the current stage and parameters corresponding to each facial sample image respectively to adjust the facial image and the selected age label value, respectively as input and output of the model to be trained, and calculates a training consumed duration, and when the calculated training consumed duration is equal to the training suspension duration corresponding to the current stage, the training suspension condition of the current stage is satisfied, and the model training of the current stage is stopped.
And S208, determining the training stopping condition of the next stage according to the training stopping condition of the current stage.
Wherein the training suspension condition of the next stage depends on the training suspension condition of the current stage.
Specifically, when the training suspension condition is the number of training suspension rounds, and when the counted number of training rounds corresponding to the current stage is equal to the number of training suspension rounds corresponding to the current stage, the server suspends model training corresponding to the current stage, and adjusts the number of training suspension rounds corresponding to the current stage according to a preset suspension condition adjustment mode to obtain the number of training suspension rounds of the next stage.
In one embodiment, when the training suspension condition is a training suspension duration, and when the counted training consumed duration corresponding to the current stage is equal to the training suspension duration corresponding to the current stage, the server suspends the model training corresponding to the current stage, and adjusts the training suspension duration corresponding to the current stage according to a preset suspension condition adjustment mode to obtain the training suspension duration of the next stage.
For example, if the training suspension duration corresponding to the current stage is 100 minutes, the preset suspension condition adjustment mode is to perform 10% reduction adjustment, and then perform 10% reduction adjustment on 100 minutes, so as to obtain 90 minutes, and then 90 minutes is the training suspension duration corresponding to the next stage.
And S210, taking the next stage as the current stage, returning to obtain the face sample image set corresponding to the current stage, and continuing training the model to be trained until the training stopping condition of the next stage meets the training completing condition to obtain the age estimation model.
Specifically, the server returns to step S202 to re-acquire the face sample image set corresponding to the current stage as the current stage, continues training the model to be trained according to the re-acquired face sample image set, and stops training when the training suspension condition corresponding to the next stage meets the training completion condition, and takes the trained model as the age estimation model.
In one embodiment, when the training suspension condition is a training suspension duration, the training suspension duration of the next stage is determined according to the training suspension duration of the current stage, and the training completion condition is satisfied when the training suspension duration of the next stage is equal to a preset training completion duration. The preset training completion time period may be 0.
In this embodiment, for each face sample image in the face sample image set corresponding to the current stage, the image quality parameter is adjusted to obtain a parameter-adjusted face image, an age label value is selected from a corresponding age label range, and the training of the current stage is performed according to the parameter-adjusted face image and the selected age label value. In the training process, the influence of environmental factors on the image quality is fully considered by the trained model through adjusting the image quality parameters, so that the influence of the image quality on the model identification result is considered, and the age estimation accuracy of the trained age estimation model is improved after the training in multiple stages.
As shown in fig. 3, in one embodiment, S202 specifically includes a step of obtaining a face sample image set, which specifically includes the following steps:
s302, acquiring the number of preset samples and the sample age ratio of each age group.
The preset sample number is the number of the face sample images included in the face sample image set. The sample age ratio of each age group is a ratio of the number of face sample images of each age group in the face sample image set.
Specifically, after receiving a training start instruction sent by the terminal, the server analyzes the training start instruction, and extracts the preset sample number and the sample age ratio of each age group in the training start instruction through analysis.
For example, the age groups may include three age groups of 0 to 12 years, 13 to 65 years and more than 65 years, and the ratio of the sample ages of the three age groups of 0 to 12 years, 13 to 65 years and more than 65 years is 1:3:1, which means that the number of face sample images of the age group of 0 to 12 years accounts for 1/5, the number of face sample images of the age group of 13 to 65 years accounts for 3/5, and the number of face sample images of the age group of more than 65 years accounts for 1/5. Each age group may be divided into other age groups.
S304, determining the number of image samples corresponding to each age group according to the preset number of samples and the sample proportion of each age group.
Specifically, after the server obtains the preset sample number and the sample proportion of each age, the sample proportion corresponding to each age is determined according to the sample proportion of each age, and the image sample number respectively corresponding to each age is determined according to the sample proportion corresponding to each age and the preset sample number.
For example, if the age groups include three age groups of 0-12, 13-65, and greater than 65, and the sample age ratio of the three age groups of 0-12, 13-65, and greater than 65 is 1:3:1, the sample proportions for the three age groups of 0-12, 13-65, and greater than 65 are determined to be 1/5, 3/5, and 1/5, respectively. If the preset number of samples is 1000, the number of image samples corresponding to the age group of 0 to 12 years old is 1000 × 1/5 to 200, the number of image samples corresponding to the age group of 13 to 65 is 1000 × 3/5 to 600, and the number of image samples corresponding to the age group of more than 65 years old is 1000 × 1/5 to 200.
S306, screening the face sample images from the face sample training set according to the number of the image samples corresponding to each age group to obtain a face sample image set corresponding to the current stage.
Specifically, the server screens the face sample images of the respective age groups, which are matched with the image sample numbers respectively corresponding to the respective age groups, from the face sample training set according to the image sample numbers respectively corresponding to the respective age groups, and the face sample image sets corresponding to the current stage are formed by the screened face sample images.
In one embodiment, the server determines the face sample images respectively belonging to each age group according to the age labeling range of each face sample image in the face sample training set, and screens the face sample images from the face sample images respectively belonging to each age group according to the number of image samples respectively corresponding to each age group to obtain a face sample image set corresponding to the current stage.
In this embodiment, the number of image samples respectively corresponding to each age group is determined according to the preset sample number and the sample age ratio of each age group, and the number of image samples respectively corresponding to each age group is selected according to the preset sample number and the sample age ratio of each age group, so that accurate distribution of ages corresponding to the face sample images in the face sample image set is ensured, and accuracy of an age estimation model trained according to the face sample image set is further improved.
As shown in fig. 4, in an embodiment, the step S204 further includes a step of adjusting the image quality parameter, where the step includes the following steps:
s402, each face sample image in the face sample image set is read.
Specifically, the server reads each face sample image in the face sample image set after screening the face sample image set corresponding to the current stage.
In one embodiment, the server reads the face sample images matching the parallel image processing number from the face sample image set corresponding to the current stage according to the parallel image processing number, and takes the read face sample images as the face sample images corresponding to the current round.
S404, acquiring image quality parameters and age labeling ranges corresponding to the read face sample images.
The image quality parameter is a parameter indicating image quality. The image quality parameters may include image brightness and image blur. The age label range is an age range labeled on the face sample image.
Specifically, the server analyzes parameters of the read face sample image after reading the face sample image, and obtains image quality parameters from the parameters of the read face sample image through analysis. And the server extracts the image identification of the read face sample image and inquires an age labeling range corresponding to the extracted image identification.
And S406, determining a parameter adjusting mode corresponding to each image quality parameter in the acquired image quality parameters.
Specifically, the image quality parameters read by the server include various image quality parameters, and the parameter adjustment modes corresponding to the image quality parameters are different. And the server determines the parameter type of the image quality parameter in the acquired image quality parameters, and inquires the parameter adjusting mode corresponding to the determined parameter type.
And S408, adjusting the image quality parameters according to the determined parameter adjusting mode to obtain a parameter adjusting face image.
Specifically, when the determined parameter adjustment mode is random adjustment, the server determines a parameter range corresponding to each image quality parameter, randomly selects an image quality parameter within the parameter range corresponding to each image quality parameter, and adjusts the read face sample image according to the selected image quality parameter to obtain a parameter-adjusted face image.
In one embodiment, when the determined parameter adjustment mode is random adjustment, the server determines a parameter candidate set corresponding to each image quality parameter, and randomly selects an image quality parameter from the parameter candidate set.
In one embodiment, the image quality parameters include image brightness and image blur. And when the parameter adjustment mode corresponding to the image brightness is random adjustment, the server determines the parameter range of the image brightness and randomly selects the image brightness in the determined parameter range. And when the parameter adjusting mode corresponding to the image fuzziness is a pixel adjusting mode, randomly generating sampling parameters, performing down-sampling or up-sampling processing on the pixels of the read face sample image according to the randomly generated sampling parameters to obtain a sampled face sample image, and adjusting the sampled face sample image according to the randomly selected image brightness to obtain a parameter adjusting face image.
In one embodiment, the server sets, for each face sample image, a face image set corresponding to the face sample image, the face image set storing a plurality of parameter-adjusted face images corresponding to the face sample image, and each parameter-adjusted face image having different image quality parameters. And the server selects a parameter adjustment facial image from the facial image set corresponding to the read facial sample image.
And S410, selecting an age marking value from the age marking range as an age marking value corresponding to the parameter adjustment face image.
Specifically, the server determines age labeling values in an age labeling range corresponding to the read facial sample image, randomly selects one age labeling value from the determined age labeling values, and adjusts the age labeling value corresponding to the facial image by using the selected age labeling value as a parameter.
For example, reference may be made to fig. 5, where fig. 5 is a schematic diagram of age labeling of a face sample image in one embodiment. The face sample image in fig. 5 corresponds to an age label range of 2-4 years, and the age label values corresponding to the age label range of 2-4 years include 2 years, 3 years and 4 years, and one of the age label values is selected from 2 years, 3 years and 4 years during training.
In the embodiment, the image quality parameters of the read facial sample image are adjusted to obtain the parameter adjustment image, the age marking value is selected from the corresponding age marking range to serve as the age marking value corresponding to the parameter adjustment facial image, the model is trained according to the parameter adjustment facial image and the corresponding age marking value, the image parameter change and the age change are considered in the trained model, and the accuracy of the trained model is improved.
In one embodiment, S410 specifically includes the following: determining the selection probability corresponding to each age marking value in the age marking range; selecting age marking values from the age marking values according to the determined selection probability; and adjusting the age marking value corresponding to the facial image by taking the selected age marking value as a parameter.
For example, if the age label range corresponding to the face sample image is 2 to 4 years old, the age label values corresponding to the age label range of 2 to 4 years old include 2 years old, 3 years old and 4 years old, each age label value is provided with a corresponding selection probability, and if the selection probabilities corresponding to the age standard values are 1/3, the server randomly selects one age label value from the 2 years old, the 3 years old and the 4 years old; the probability of picking the 3 year old is the highest if the picking probability value for 2 years old is 1/5, the picking probability value for 3 years old is 3/5 and the picking probability value for 4 years old is 1/5.
As shown in fig. 6, in an embodiment, an age estimation model training method is provided, where the training suspension condition is a target training round number; the method specifically comprises the following steps:
s602, obtaining a face sample image set corresponding to the current stage.
S604, for each face sample image in the face sample image set, adjusting image quality parameters to obtain parameter adjustment face images, and selecting age labeling values from corresponding age labeling ranges.
Specifically, the server reads the face sample images corresponding to the current training round according to the parallel image processing quantity from the face sample image set corresponding to the current stage, adjusts image quality parameters for each of the read face sample images to obtain parameter adjustment face images, and selects age labeling values from corresponding age labeling ranges.
For example, fig. 7 is a diagram illustrating an embodiment of adjusting an image quality parameter. The image quality parameters comprise image fuzziness and image brightness, and the server randomly adjusts the image fuzziness and the image brightness of the read face sample image to obtain a parameter adjustment face image. Referring to fig. 7, various adjustment results for randomly adjusting the brightness or blur of an image are illustrated in fig. 7.
And S606, taking the parameter adjustment face image as input and the selected age marking value as output, and performing current-stage training on the model to be trained.
Specifically, for the parameter adjustment face image and the selected age marking value corresponding to each page sample image in the face sample image set, the server takes the parameter adjustment face image as the input of the model to be trained and takes the selected age marking value as the output of the model to be trained, and the model to be trained is trained.
In one embodiment, the server reads the face sample images corresponding to the current training round, adjusts the face images according to the parameters corresponding to each read face sample image to serve as input, and outputs the selected age mark value, the training of the current training round is carried out on the model to be trained, and after the training is finished according to the face sample images corresponding to the current training round, the face sample images corresponding to the next training round are read from the face sample image set corresponding to the current training round to continue training the model to be trained.
In one embodiment, the server extracts parameters to adjust image features in the facial image, inputs the extracted image features into an input layer of the model to be trained, obtains training output values output by output nodes in an output layer of the model to be trained according to the extracted image features, constructs a loss function according to the obtained training output values and the selected age label value, and adjusts parameters of the model to be trained according to the loss function.
In one embodiment, the server obtains a training output value output by each output node in an output layer of the model to be trained according to the extracted image features, and normalizes the training output value output by each output node to obtain a normalization value corresponding to each output node. And the server constructs a loss function according to the normalization value respectively corresponding to each output node and the selected age marking value.
In one embodiment, the training output values output by each output node may be normalized by the following formula:
Figure GDA0002945129810000131
wherein, aiFor the normalized value, z, corresponding to the ith output nodeiTraining output values corresponding to the ith output node, e is a natural constant, and k is the number of the output nodes;
the loss function can be constructed by the following formula:
Figure GDA0002945129810000132
where C denotes a loss function, i denotes the ith output node, aiFor the normalized value, y, corresponding to the ith output nodeiAnd indicating the age label value corresponding to the ith output node.
And S608, counting the number of training rounds corresponding to the current stage.
Specifically, when the server trains the model according to the face sample image set at the current stage, a preset number of face sample images are read each time, and the training process of training the model according to the read sample images is completed, that is, a round of training at the current stage is completed. And when the server trains the model according to the face sample image set at the current stage, counting the number of training rounds corresponding to the current stage.
S610, stopping training in the current stage when the counted number of training rounds is larger than or equal to the target number of training rounds in the current stage.
Specifically, the server obtains the number of target training rounds at the current stage, compares the counted number of training rounds with the number of target training rounds at the current stage, and stops training at the current stage when the counted number of training rounds is greater than or equal to the number of target training rounds at the current stage; and when the counted number of training rounds is less than the target number of training rounds at the current stage, continuing training the model to be trained according to the face sample images in the face sample image set corresponding to the current stage.
And S612, determining the target training round number of the next stage according to the preset round number reduction proportion and the target training round number of the current stage.
The preset turn number reduction proportion is the proportion of reduction of the number of training turns relative to the number of target training turns corresponding to the current stage.
Specifically, the server multiplies the preset round number reduction ratio by the target training round number of the current stage to obtain a reduction round number, and performs subtraction operation on the target training data of the current stage and the reduction round number to obtain the target training round number of the next stage.
For example, the preset round number reduction ratio is 20%, if the target training round number corresponding to the current stage is 5000 rounds, the reduction round number is 5000 × 20%, 1000 rounds, and the target training round number of the next stage is 5000-.
S614, when the number of target training rounds at the next stage is more than 0, taking the next stage as the current stage; returning to S602.
Specifically, after determining the number of target training rounds at the next stage, the server compares the number of target training rounds at the next stage with 0, and when the number of target training rounds at the next stage is greater than 0, it indicates that the training completion condition is not met, and the next stage is taken as the current stage, and returns to S602 to re-acquire the face sample image set corresponding to the current stage, and continues to train the model to be trained according to the re-acquired face sample image set.
And S616, when the number of target training rounds at the next stage is equal to 0, the training completion condition is met, and the age estimation model is obtained.
Specifically, when the number of target training rounds at the next stage is equal to 0, the training completion condition is met, the server stops model training, and the model trained at the current stage is used as the age estimation model.
In the embodiment, the target training round number of the next stage is controlled by the preset round number reduction proportion, so that the reduction speed in the training process is increased, and the time consumed by model training is saved. And in each stage, the face sample image set needs to be reselected, and the model is continuously trained according to the reselected face sample image set, so that the phenomenon that the trained model excessively fits the images in the face sample image set is avoided, and the accuracy of the trained age estimation model is reduced.
As shown in fig. 8, in one embodiment, a facial image recognition method is provided. The embodiment is mainly illustrated by applying the method to the terminal 110 in fig. 1, and may also be applied to the server 120 in fig. 1. The age estimation model is obtained by training according to an age estimation model training method. Referring to fig. 8, the facial image recognition method specifically includes the steps of:
s802, acquiring a face image.
Specifically, an image acquisition device is installed in the terminal, the image acquisition device is called to acquire an image of the face of the target object, and the image of the face is acquired by calling the image acquisition device.
In one embodiment, the terminal and the image acquisition device are connected through a network. The image acquisition equipment acquires images of a target object in a target scene and sends the acquired images to the terminal. The terminal receives the image sent by the image acquisition equipment and extracts a face image from the acquired image.
In one embodiment, an image library is arranged in the terminal, the terminal acquires a triggered image selection instruction, and the face image is selected from the image library according to the image selection instruction.
S804, the face image is input into the age estimation model, and probability values corresponding to all preset age groups output by the age estimation model are obtained.
Specifically, after the terminal acquires the face image, the image features of the face image are extracted, the extracted image features are input into an input layer of the age estimation model, and probability values corresponding to preset age groups output by the age estimation model according to the extracted image features are acquired.
For example, fig. 9 is a schematic diagram illustrating age identification of a face image in one embodiment. Referring to fig. 9, the face image is input to the age estimation model, and the probability values corresponding to the age groups shown in fig. 9 are input and output to the age estimation model, for example, the probability value corresponding to 0 year is 0.01, the probability value corresponding to 1 year is 0.09, … …, the probability value corresponding to 64 years is 0.002, and the probability value corresponding to 65 years is 0.001, wherein 65 years may mean 65 years or more.
In an embodiment, S804 further includes the following contents: extracting image features in the face image; inputting the extracted image characteristics to an input layer in an age estimation model; acquiring output values output by an output layer and respectively corresponding to all preset age groups; and carrying out normalization processing on the obtained output value to obtain probability values respectively corresponding to all the preset age groups.
Specifically, the terminal extracts image features from a face image and inputs the extracted image features to each input node of an input layer in an age estimation model. And the terminal acquires output values output by each output node of an output layer in the age estimation model and respectively corresponding to each preset age group, and normalizes the acquired probability values to obtain the probability values respectively corresponding to each preset age group.
In one embodiment, the terminal adds the output values corresponding to the preset age groups to obtain a sum of the output values, and divides the output value corresponding to each preset age group by the sum of the output values to obtain a probability value corresponding to each preset age group.
In one embodiment, the output values corresponding to the preset age groups can be normalized through the following formula:
Figure GDA0002945129810000161
wherein, aiFor the normalization value, z, corresponding to the ith predetermined age groupiAnd e is a natural constant, and k is the number of the preset age groups.
And S806, determining expected age values according to the probability values corresponding to the preset age groups.
Specifically, after the terminal obtains the probability values corresponding to the preset age groups, the terminal multiplies the preset age groups by the corresponding probability values to obtain products corresponding to the preset age groups, and sums the products corresponding to the preset age groups to obtain the age expectation values.
In one embodiment, the age expectation value may be calculated according to the following formula:
expected age value ═ Σ m × p (m)
Wherein m represents the age group, and p (m) represents the probability value corresponding to the age group m.
S808, an age estimated value corresponding to the age expectation value is used as the age estimated value of the face image.
Specifically, the terminal determines an expected age value, extracts an integer from the determined expected age value, and takes the extracted integer as an age estimated value of the face image. For example, if the expected age value is 23.24 and 23 is obtained by rounding, 23 is an estimated age value of the face image; the expected age value is 24.68, and if the value is 24, 24 is an estimated age value of the face image.
In one real-time example, after the terminal determines the expected age value, the determined age value is rounded, and the rounded age value is used as the age estimated value of the face image. For example, if the expected age value is 23.24, and 23 is obtained by rounding 23.24, 23 is an estimated age value of the face image; the expected age value is 24.68, rounding off 24.68 yields 25, and 25 is an estimated age value for the face image.
In this embodiment, according to the age estimation model considering the influence of environmental factors on the acquired face image, the age of the acquired face image is identified, and the accuracy of the probability value corresponding to each preset age group is improved. And then, the expected age value is calculated according to the probability value corresponding to each preset age group, so that the expected age value is obtained according to the expected age value, and the accuracy of the estimated age value is further improved.
As shown in fig. 10, in one embodiment, S802 specifically includes a step of obtaining a face image, which specifically includes the following:
and S1002, acquiring a video image.
Specifically, the terminal is connected with the image acquisition device through a network, the image acquisition device acquires video images of a scene where the image acquisition device is located, and the acquired video images are acquired and sent to the terminal. And the terminal receives the video image sent by the image acquisition equipment. The scene of the image acquisition equipment can be applied to intelligent shops, vending machines, intelligent robots and the like.
S1004, a face region in the video image is identified.
Specifically, the terminal identifies a video frame in a video image, extracts image features in the video frame, analyzes the image features, determines whether facial features exist, and determines a facial area in the video frame if the facial features exist.
In one embodiment, S1004 further includes: inputting the collected video image into a face recognition model to obtain a face recognition result; determining a video frame containing a face area according to a face recognition result in the acquired video image; and labeling the determined face region in the video frame.
Specifically, a face recognition model is arranged in the terminal and used for recognizing face images in video images. The terminal inputs the collected video image into the face recognition model, and obtains a face recognition result output by the face recognition model, wherein the face recognition result comprises the position of the face image. The terminal extracts a video frame comprising a face image from the collected video image according to the face recognition result, determines a face area in the video frame according to the face recognition result, and adds a label to the determined face area in the video frame. The adding of the label can specifically be adding a box with a closed boundary, which can label the face region, and can be a box.
S1006, the recognized face area is cut out from the video image to obtain a face image.
Specifically, after recognizing a face area in a video frame in a video image, the terminal cuts out a partial image from the video frame according to the recognized face area, and takes the cut-out partial image as a face image.
In the embodiment, the facial area in the video image is identified by acquiring the video image, the identified facial area is intercepted from the video image, the facial image is extracted, and the facial area in the video image is identified, so that the acquisition efficiency and accuracy of the facial image are improved.
It should be understood that the steps in the flowcharts are shown in order as indicated by the arrows, but the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in each flowchart may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
In one embodiment, the facial image recognition method is applied to an intelligent store, and the image acquisition equipment acquires the facial image of each customer and transmits the facial image to the terminal. The terminal identifies the collected face image, can obtain the age corresponding to the face image, and can extract the store presence information corresponding to the collected face image from the database.
For example, FIG. 11 is a schematic diagram illustrating customer details in one embodiment. Referring to fig. 11, the terminal identifies the face image, obtains customer details, and displays the customer details, wherein the customer details comprise the face image, the type of the common customer, the face number FaceID 41865, the gender of the male, the age of the male, the first arrival time of the male, 2018-09-2313:49:58, and the historical arrival times of 318.
FIG. 12 is a diagram illustrating customer access statistics, in one embodiment. Referring to fig. 12, the ratio of the male and female visiting in each age group within a preset time period may be counted according to the recognition result of the facial image. In the figure, the dark part is male, the light part is female, and the percentage marks the proportion of the tasks visited in each year segment, for example, the proportion of the visitors of young men is 27.3%, and the proportion of the visitors of young women is 30.2% in fig. 12.
As shown in fig. 13, in one embodiment, an age estimation model training apparatus 1300 is provided, which specifically includes the following: a sample image acquisition module 1302, a quality parameter adjustment module 1304, a model training module 1306, a stop condition determination module 1308, and a training loop module 1310.
A sample image obtaining module 1302, configured to obtain a face sample image set corresponding to the current stage.
And the quality parameter adjusting module 1304 is configured to, for each face sample image in the face sample image set, adjust the image quality parameter to obtain a parameter-adjusted face image, and select an age label value from a corresponding age label range.
And the model training module 1306 is configured to adjust the facial image and the selected age label value according to the parameters, and perform training of the current stage on the model to be trained until a training suspension condition of the current stage is met.
A stopping condition determining module 1308, configured to determine a training stopping condition of a next stage according to the training stopping condition of the current stage.
The training loop module 1310 is configured to notify the sample image obtaining module 1302 to obtain a face sample image set corresponding to the current stage, so as to continue training the model to be trained, until the training suspension condition of the next stage meets the training completion condition, and obtain the age estimation model.
In one embodiment, the sample image obtaining module 1302 is further configured to obtain a preset sample number and a sample age ratio of each age group; determining the number of image samples corresponding to each age group according to the preset number of samples and the sample proportion of each age group; and screening the face sample images from the face sample training set according to the number of the image samples corresponding to each age group to obtain a face sample image set corresponding to the current stage.
In one embodiment, the quality parameter adjustment module 1304 is also for reading each face sample image in the set of face sample images; acquiring image quality parameters and age labeling ranges corresponding to the read face sample images; determining a parameter adjusting mode corresponding to each image quality parameter in the acquired image quality parameters; adjusting the image quality parameters according to the determined parameter adjustment mode to obtain a parameter adjustment face image; and selecting an age marking value from the age marking range as an age marking value corresponding to the parameter adjustment face image.
In one embodiment, the quality parameter adjusting module 1304 is further configured to determine a selection probability corresponding to each age label value in the age label range; selecting age marking values from the age marking values according to the determined selection probability; and adjusting the age marking value corresponding to the facial image by taking the selected age marking value as a parameter.
In one embodiment, the training suspension condition is a target number of training rounds; the model training module 1306 is further configured to perform training of the current stage on the model to be trained by using the parameter-adjusted facial image as input and using the selected age label value as output; counting the number of training rounds corresponding to the current stage; and stopping the training in the current stage when the counted number of training rounds is greater than or equal to the target number of training rounds in the current stage.
In one embodiment, the stopping condition determining module 1308 is further configured to determine a target training round number of a next stage according to the preset round number decreasing ratio and the target training round number of the current stage.
In one embodiment, the training loop module 1310 is further configured to notify the sample image obtaining module 1302 to obtain the face sample image set corresponding to the current stage by taking the next stage as the current stage when the number of target training rounds of the next stage is greater than 0, so as to continue training the model to be trained; and when the number of target training rounds at the next stage is equal to 0, the training completion condition is met, and the age estimation model is obtained.
In this embodiment, for each face sample image in the face sample image set corresponding to the current stage, the image quality parameter is adjusted to obtain a parameter-adjusted face image, an age label value is selected from a corresponding age label range, and the training of the current stage is performed according to the parameter-adjusted face image and the selected age label value. In the training process, the influence of environmental factors on the image quality is fully considered by the trained model through adjusting the image quality parameters, so that the influence of the image quality on the model identification result is considered, and the age estimation accuracy of the trained age estimation model is improved after the training in multiple stages.
As shown in fig. 14, in one embodiment, a facial image recognition apparatus 1400 is provided, which specifically includes the following: a facial image acquisition module 1402, a facial image recognition module 1404, an age expectation determination module 1406, and an age estimation module 1408.
A face image obtaining module 1402, configured to obtain a face image.
The facial image recognition module 1404 is configured to predict the age of the facial image according to the model, and obtain probability values corresponding to preset age groups output by the age prediction model.
The age expectation determining module 1406 is configured to determine an age expectation value according to the probability values corresponding to the preset age groups, respectively.
An age estimation module 1408, configured to use an age estimation value corresponding to the age estimation value as an age estimation value of the face image.
In one embodiment, the facial image acquisition module 1402 is further configured to capture video images; identifying a face region in a video image; and intercepting the identified face area from the video image to obtain a face image.
In one embodiment, the facial image obtaining module 1402 is further configured to input the collected video image into a facial recognition model to obtain a facial recognition result; determining a video frame containing a face area according to a face recognition result in the acquired video image; and labeling the determined face region in the video frame.
In one embodiment, the facial image recognition module 1404 is also used to extract image features in the facial image; inputting the extracted image characteristics to an input layer in an age estimation model; acquiring output values output by an output layer and respectively corresponding to all preset age groups; and carrying out normalization processing on the obtained output value to obtain probability values respectively corresponding to all the preset age groups.
In this embodiment, according to the age estimation model considering the influence of environmental factors on the acquired face image, the age of the acquired face image is identified, and the accuracy of the probability value corresponding to each preset age group is improved. And then, the expected age value is calculated according to the probability value corresponding to each preset age group, so that the expected age value is obtained according to the expected age value, and the accuracy of the estimated age value is further improved.
FIG. 15 is a diagram showing an internal structure of a computer device in one embodiment. The computer device may specifically be the server 120 in fig. 1. As shown in fig. 15, the computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program that, when executed by the processor, causes the processor to implement the age estimation model training method. The internal memory may also have a computer program stored therein, which when executed by the processor, causes the processor to perform a method of training an age estimation model.
Fig. 16 is a diagram showing an internal structure of a computer device in another embodiment. The computer device may specifically be the terminal 140 in fig. 1. As shown in fig. 16, the computer apparatus includes a processor, a memory, a network interface, an input device, and a display screen connected through a system bus. Wherein the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program that, when executed by the processor, causes the processor to implement the facial image recognition method. The internal memory may also have stored therein a computer program that, when executed by the processor, causes the processor to perform a facial image recognition method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the configurations shown in fig. 15 and 16 are block diagrams of only some of the configurations relevant to the present application, and do not constitute a limitation on the computing devices to which the present application may be applied, and that a particular computing device may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, the age estimation model training apparatus provided in the present application may be implemented in the form of a computer program, and the computer program may be executed on a computer device as shown in fig. 15. The memory of the computer device may store various program modules constituting the age estimation model training apparatus, such as the sample image acquisition module 1302, the quality parameter adjustment module 1304, the model training module 1306, the stop condition determination module 1308, and the training loop module 1310 shown in fig. 13. The program modules constitute computer programs to make the processors execute the steps of the age estimation model training method of the embodiments of the present application described in the specification.
For example, the computer device shown in fig. 15 may acquire the face sample image set corresponding to the current stage through the sample image acquisition module 1302 in the age estimation model training apparatus shown in fig. 13. The computer device may adjust the image quality parameters to obtain parameter adjusted facial images for each facial sample image in the facial sample image set via the quality parameter adjustment module 1304, and select an age label value from the corresponding age label range. The computer device may adjust the facial image and the selected age label value according to the parameters through the model training module 1306, and perform the training of the current stage on the model to be trained until the training suspension condition of the current stage is satisfied. The computer device may determine the training abort condition for the next stage from the training abort condition for the current stage by the stop condition determination module 1308. The computer device may use the next stage of the training cycle module 1310 as the current stage to notify the sample image obtaining module 1302 to obtain the face sample image set corresponding to the current stage, so as to continue training the model to be trained until the training stopping condition of the next stage meets the training completing condition, thereby obtaining the age estimation model.
In one embodiment, the age estimation model training apparatus provided in the present application may be implemented in the form of a computer program, and the computer program may be executed on a computer device as shown in fig. 16. The memory of the computer device may store various program modules constituting the face image recognition apparatus, such as a face image acquisition module 1402, a face image recognition module 1404, an age expectation determination module 1406, and an age estimation module 1408 shown in fig. 14. The respective program modules constitute computer programs that cause a processor to execute the steps in the face image recognition methods of the respective embodiments of the present application described in the present specification.
For example, the computer device shown in fig. 16 may acquire a face image by the face image acquisition module 1402 in the face image recognition apparatus shown in fig. 14. The computer device can use the facial image identification module 1404 to predict the age of the facial image to obtain the probability values corresponding to the preset age groups output by the age prediction model. The computer device can determine the expected age value according to the probability value corresponding to each preset age group through the expected age determining module 1406. The computer device may use the age estimation value corresponding to the age estimation value as the age estimation value of the face image through the age estimation module 1408.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to perform the steps of the age estimation model training method described above. Here, the steps of the age estimation model training method may be the steps of the age estimation model training methods of the above embodiments.
In one embodiment, a computer readable storage medium is provided, storing a computer program which, when executed by a processor, causes the processor to perform the steps of the age estimation model training method described above. Here, the steps of the age estimation model training method may be the steps of the age estimation model training methods of the above embodiments.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to perform the steps of the above-described facial image recognition method. Here, the steps of the face image recognition method may be the steps in the face image recognition methods of the respective embodiments described above.
In one embodiment, a computer-readable storage medium is provided, storing a computer program that, when executed by a processor, causes the processor to perform the steps of the above-described facial image recognition method. Here, the steps of the face image recognition method may be the steps in the face image recognition methods of the respective embodiments described above.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (15)

1. An age estimation model training method comprises the following steps:
acquiring a face sample image set corresponding to the current stage; the face sample image set comprises face sample images screened from face sample images respectively corresponding to all age groups according to a preset sample age ratio and the number of image samples corresponding to all age groups; labeling the selected face sample image with age labeling ranges corresponding to all age groups;
acquiring image quality parameters and corresponding parameter adjustment modes of all the facial sample images in the facial sample image set, adjusting the image quality parameters of the screened facial sample images according to the parameter adjustment modes to obtain parameter adjustment facial images, selecting age label values from age label ranges corresponding to all the parameter adjustment facial images according to the determined selection probability, and taking the selected age label values as the age label values of all the parameter adjustment facial images;
taking the parameter adjustment facial image as the input of the model to be trained, taking the selected age marking value as the output of the model to be trained, constructing a loss function according to the normalized value obtained by normalizing the training output value output by each output node in the model to be trained and the selected age marking value, and adjusting the parameters of the model to be trained according to the loss function so as to train the model to be trained at the current stage until the training suspension condition of the current stage is met;
adjusting the training suspension condition of the current stage according to a preset suspension condition adjusting mode to obtain the training suspension condition of the next stage; the training suspension condition of the next stage depends on the training suspension condition of the current stage;
and taking the next stage as the current stage, returning to the step of obtaining the face sample image set corresponding to the current stage, and continuing to train the model to be trained until the training stopping condition of the next stage meets the training completing condition to obtain the age estimation model.
2. The method of claim 1, wherein the obtaining the set of face sample images corresponding to the current stage comprises:
acquiring the number of preset samples and the sample age ratio of each age group;
determining the number of image samples corresponding to each age group according to the preset sample number and the sample proportion of each age group;
and screening the face sample images from the face sample training set according to the number of the image samples corresponding to each age group to obtain a face sample image set corresponding to the current stage.
3. The method according to claim 1, wherein the obtaining of the image quality parameter of each of the face sample images in the face sample image set and the corresponding parameter adjustment manner, and the adjusting of the image quality parameter of the screened face sample image according to the parameter adjustment manner to obtain a parameter-adjusted face image, comprises:
reading each face sample image in the set of face sample images;
acquiring image quality parameters and age labeling ranges corresponding to the read face sample images;
determining a parameter adjusting mode corresponding to each image quality parameter in the acquired image quality parameters;
and adjusting the image quality parameters of the screened face sample image according to the determined parameter adjustment mode to obtain a parameter adjustment face image.
4. The method of claim 1, wherein selecting an age label value from an age label range corresponding to each of the parameter-adjusted facial images according to the determined selection probability, and using the selected age label value as the age label value of each of the parameter-adjusted facial images comprises:
determining the selection probability corresponding to each age marking value in the age marking range;
selecting age marking values from the age marking values according to the determined selection probability;
and taking the selected age marking value as the age marking value corresponding to the parameter adjustment face image.
5. The method of claim 1, wherein the training the model to be trained in the current stage until the training suspension condition in the current stage is met comprises:
taking the parameter adjustment face image as input and the selected age marking value as output, and performing the training of the current stage on the model to be trained;
counting the number of training rounds corresponding to the current stage;
and stopping the training in the current stage when the counted number of training rounds is greater than or equal to the target number of training rounds in the current stage.
6. The method of claim 5, wherein the adjusting the training suspension condition of the current stage according to the preset suspension condition adjustment manner comprises:
determining the target training round number of the next stage according to a preset round number reduction ratio and the target training round number of the current stage;
taking the following stage as the current stage, returning to the step of obtaining the face sample image set corresponding to the current stage to continue training the model to be trained until the training stopping condition of the next stage meets the training completing condition, and obtaining the age estimation model comprises the following steps:
when the number of target training rounds at the next stage is greater than 0, taking the next stage as the current stage, and returning to the face sample image set corresponding to the current stage to continue training the model to be trained;
and when the number of target training rounds at the next stage is equal to 0, the training completion condition is met, and the age estimation model is obtained.
7. A facial image recognition method, comprising:
acquiring a face image;
inputting the facial image into a trained age estimation model to obtain probability values respectively corresponding to all preset age groups output by the age estimation model;
determining expected age values according to the probability values corresponding to the preset age groups respectively; taking an age estimated value corresponding to the age expected value as an age estimated value of the face image;
the age estimation model is obtained by training through the age estimation model training method of any one of claims 1 to 6.
8. The method of claim 7, wherein the acquiring the facial image comprises:
collecting a video image;
identifying a face region in the video image;
and intercepting the identified face area from the video image to obtain a face image.
9. The method of claim 8, wherein the identifying the face region in the video image comprises:
inputting the collected video image into a face recognition model to obtain a face recognition result;
determining a video frame containing a face area according to a face recognition result in the acquired video image;
and labeling the determined face region in the video frame.
10. The method of claim 7, wherein inputting the facial image into a trained age estimation model, and obtaining probability values corresponding to preset age groups output by the age estimation model comprises:
extracting image features in the facial image;
inputting the extracted image characteristics to an input layer in an age estimation model;
acquiring output values output by an output layer and respectively corresponding to all preset age groups;
and carrying out normalization processing on the obtained output value to obtain probability values respectively corresponding to all the preset age groups.
11. An age estimation model training device, characterized in that the device comprises:
the sample image acquisition module is used for acquiring a face sample image set corresponding to the current stage; the face sample image set comprises face sample images screened from face sample images respectively corresponding to all age groups according to a preset sample age ratio and the number of image samples corresponding to all age groups; labeling the selected face sample image with age labeling ranges corresponding to all age groups;
the quality parameter adjusting module is used for acquiring image quality parameters and corresponding parameter adjusting modes of all the facial sample images in the facial sample image set, adjusting the image quality parameters of the screened facial sample images according to the parameter adjusting modes to obtain parameter adjusting facial images, selecting age labeling values from age labeling ranges corresponding to all the parameter adjusting facial images according to the determined selection probability, and taking the selected age labeling values as the age labeling values of all the parameter adjusting facial images;
the model training module is used for taking the parameter adjustment facial image as the input of a model to be trained, taking the selected age marking value as the output of the model to be trained, establishing a loss function according to a normalized value obtained by normalizing the training output value output by each output node in the model to be trained and the selected age marking value, and adjusting the parameters of the model to be trained according to the loss function so as to train the model to be trained at the current stage until the training suspension condition of the current stage is met;
the stopping condition determining module is used for adjusting the training stopping condition of the current stage according to a preset stopping condition adjusting mode to obtain the training stopping condition of the next stage; the training suspension condition of the next stage depends on the training suspension condition of the current stage;
and the training circulation module is used for informing the sample image acquisition module of the step of acquiring the face sample image set corresponding to the current stage by taking the next stage as the current stage so as to continue training the model to be trained until the training stopping condition of the next stage meets the training completing condition, and obtaining the age estimation model.
12. The apparatus of claim 11, wherein the quality parameter adjustment module is further configured to read each face sample image in the set of face sample images; acquiring image quality parameters and age labeling ranges corresponding to the read face sample images; determining a parameter adjusting mode corresponding to each image quality parameter in the acquired image quality parameters; and adjusting the image quality parameters according to the determined parameter adjustment mode to obtain a parameter adjustment face image.
13. A facial image recognition apparatus, characterized in that the apparatus comprises:
the face image acquisition module is used for acquiring a face image;
the facial image recognition module is used for inputting the facial image to the trained age estimation model to obtain probability values corresponding to all preset age groups output by the age estimation model;
the age expectation determining module is used for determining age expectation values according to the probability values corresponding to the preset age groups respectively;
the age estimation module is used for taking an age estimation value corresponding to the age estimation value as an age estimation value of the face image; the age estimation model is obtained by training through the age estimation model training method of any one of claims 1 to 6.
14. A computer-readable storage medium, storing a computer program which, when executed by a processor, causes the processor to carry out the steps of the method according to any one of claims 1 to 10.
15. A computer device comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the method according to any one of claims 1 to 10.
CN201811532337.1A 2018-12-14 2018-12-14 Age estimation model training method, facial image recognition method and device Active CN109670437B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811532337.1A CN109670437B (en) 2018-12-14 2018-12-14 Age estimation model training method, facial image recognition method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811532337.1A CN109670437B (en) 2018-12-14 2018-12-14 Age estimation model training method, facial image recognition method and device

Publications (2)

Publication Number Publication Date
CN109670437A CN109670437A (en) 2019-04-23
CN109670437B true CN109670437B (en) 2021-05-07

Family

ID=66143908

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811532337.1A Active CN109670437B (en) 2018-12-14 2018-12-14 Age estimation model training method, facial image recognition method and device

Country Status (1)

Country Link
CN (1) CN109670437B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110287942B (en) * 2019-07-03 2021-09-17 成都旷视金智科技有限公司 Training method of age estimation model, age estimation method and corresponding device
CN110378306B (en) * 2019-07-25 2021-11-02 厦门美图之家科技有限公司 Age prediction method and device and image processing equipment
CN110674397B (en) * 2019-08-30 2022-05-27 北京百度网讯科技有限公司 Method, device, equipment and readable medium for training age point prediction model
CN110889457B (en) * 2019-12-03 2022-08-19 深圳奇迹智慧网络有限公司 Sample image classification training method and device, computer equipment and storage medium
CN111144344B (en) * 2019-12-30 2023-09-22 广州市百果园网络科技有限公司 Method, device, equipment and storage medium for determining person age
CN111444945A (en) * 2020-03-20 2020-07-24 北京每日优鲜电子商务有限公司 Sample information filtering method and device, computer equipment and storage medium
CN111931586A (en) * 2020-07-14 2020-11-13 珠海市卓轩科技有限公司 Face age identification method and device and storage medium
CN112241761B (en) * 2020-10-15 2024-03-26 北京字跳网络技术有限公司 Model training method and device and electronic equipment
CN112329693B (en) * 2020-11-17 2024-01-19 汇纳科技股份有限公司 Training method, identification method, medium and equipment for gender and age identification model

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102508907A (en) * 2011-11-11 2012-06-20 北京航空航天大学 Dynamic recommendation method based on training set optimization for recommendation system
CN107977633A (en) * 2017-12-06 2018-05-01 平安科技(深圳)有限公司 Age recognition methods, device and the storage medium of facial image

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104463241A (en) * 2014-10-31 2015-03-25 北京理工大学 Vehicle type recognition method in intelligent transportation monitoring system
CN107545245A (en) * 2017-08-14 2018-01-05 中国科学院半导体研究所 A kind of age estimation method and equipment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102508907A (en) * 2011-11-11 2012-06-20 北京航空航天大学 Dynamic recommendation method based on training set optimization for recommendation system
CN107977633A (en) * 2017-12-06 2018-05-01 平安科技(深圳)有限公司 Age recognition methods, device and the storage medium of facial image

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
深度学习中常用的图像数据增强方法-纯干货;腾讯云+社区;《https://cloud.tencent.com/developer/news/314001》;20180913;全文 *

Also Published As

Publication number Publication date
CN109670437A (en) 2019-04-23

Similar Documents

Publication Publication Date Title
CN109670437B (en) Age estimation model training method, facial image recognition method and device
CN111667011B (en) Damage detection model training and vehicle damage detection method, device, equipment and medium
US11216690B2 (en) System and method for performing image processing based on a damage assessment image judgement model
CN112232293B (en) Image processing model training method, image processing method and related equipment
CN110807385B (en) Target detection method, target detection device, electronic equipment and storage medium
CN111160275B (en) Pedestrian re-recognition model training method, device, computer equipment and storage medium
CN108447061B (en) Commodity information processing method and device, computer equipment and storage medium
CN110827236B (en) Brain tissue layering method, device and computer equipment based on neural network
CN111666922A (en) Video matching method and device, computer equipment and storage medium
CN113269149B (en) Method and device for detecting living body face image, computer equipment and storage medium
CN113496208B (en) Video scene classification method and device, storage medium and terminal
CN113706481A (en) Sperm quality detection method, sperm quality detection device, computer equipment and storage medium
CN113780145A (en) Sperm morphology detection method, sperm morphology detection device, computer equipment and storage medium
CN113034514A (en) Sky region segmentation method and device, computer equipment and storage medium
CN110796039B (en) Face flaw detection method and device, electronic equipment and storage medium
CN116863522A (en) Acne grading method, device, equipment and medium
CN109784379B (en) Updating method and device of textile picture feature library
CN113283388B (en) Training method, device, equipment and storage medium of living body face detection model
CN112348011B (en) Vehicle damage assessment method and device and storage medium
CN113065553A (en) Data processing method and device, three-dimensional scanning system and electronic device
JP6405603B2 (en) Information processing apparatus, information processing system, and program
CN112699809B (en) Vaccinia category identification method, device, computer equipment and storage medium
CN114399699A (en) Target recommendation object determination method and device, electronic equipment and storage medium
CN109241864A (en) Emotion prediction technique, device, computer equipment and storage medium
CN114066564A (en) Service recommendation time determination method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant