CN112307796B - Age prediction method and device for infrared image - Google Patents

Age prediction method and device for infrared image Download PDF

Info

Publication number
CN112307796B
CN112307796B CN201910669644.2A CN201910669644A CN112307796B CN 112307796 B CN112307796 B CN 112307796B CN 201910669644 A CN201910669644 A CN 201910669644A CN 112307796 B CN112307796 B CN 112307796B
Authority
CN
China
Prior art keywords
age
infrared
image
neural network
network model
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
CN201910669644.2A
Other languages
Chinese (zh)
Other versions
CN112307796A (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.)
Momenta Suzhou Technology Co Ltd
Original Assignee
Momenta Suzhou Technology 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 Momenta Suzhou Technology Co Ltd filed Critical Momenta Suzhou Technology Co Ltd
Priority to CN201910669644.2A priority Critical patent/CN112307796B/en
Priority to PCT/CN2019/108078 priority patent/WO2021012383A1/en
Publication of CN112307796A publication Critical patent/CN112307796A/en
Application granted granted Critical
Publication of CN112307796B publication Critical patent/CN112307796B/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
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication
    • G06F21/32User authentication using biometric data, e.g. fingerprints, iris scans or voiceprints
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • 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/168Feature extraction; Face representation
    • G06V40/171Local features and components; Facial parts ; Occluding parts, e.g. glasses; Geometrical relationships
    • 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

Abstract

The embodiment of the invention discloses an age prediction method and device for an infrared image. The method comprises the following steps: acquiring an infrared image to be processed; detecting a first face area in the infrared image to be processed, and constructing a target image to be processed containing the first face area; inputting a target image to be processed into an infrared convolution neural network model to obtain a first predicted age distribution of a person corresponding to a first face area; the infrared convolution neural network model is obtained by adjusting parameters in the initial infrared convolution neural network model according to the difference value of the age distribution corresponding to each infrared sample image output by the initial infrared convolution neural network model and the Gaussian distribution generated by the corresponding age labeling result and the difference value of the expected value of the age distribution corresponding to each infrared sample image and the corresponding age labeling result after each infrared sample image is input into the initial infrared convolution neural network model. By applying the scheme provided by the embodiment of the invention, the age of the infrared image can be predicted.

Description

Age prediction method and device for infrared image
Technical Field
The invention relates to the technical field of image processing, in particular to an age prediction method and device for an infrared image.
Background
At present, a convolutional neural network method is mainly adopted for age prediction based on a monitored image. Specifically, a convolutional neural network model needs to be trained through a sample image and an accurate age labeling result, and then the age of the face in the image to be predicted can be predicted based on the trained convolutional neural network model.
However, the existing age-labeled image set is a color image set, and a convolutional neural network model trained based on the image set can only predict the age of a human face in the color image. For infrared images, due to the lack of age-labeled data sets, a convolutional neural network model for predicting the age of a human face in the infrared images cannot be trained. Therefore, in order to predict the age of the human face in the infrared image, an age prediction method for the infrared image is needed.
Disclosure of Invention
The invention provides an age prediction method and device for an infrared image, which are used for predicting the age of a human face in the infrared image. The specific technical scheme is as follows.
In a first aspect, an embodiment of the present invention provides an age prediction method for an infrared image, where the method includes:
acquiring an infrared image to be processed;
detecting a first face area in the infrared image to be processed, and constructing a target image to be processed containing the first face area; the size of the target image to be processed is a preset size;
inputting the target image to be processed into an infrared convolution neural network model obtained through pre-training to obtain a first predicted age distribution of a person corresponding to the first face area, wherein the first predicted age distribution obeys Gaussian distribution;
after each infrared sample image is input into an initial infrared convolutional neural network model, adjusting each parameter in the initial infrared convolutional neural network model according to the difference value of the age distribution corresponding to each infrared sample image output by the initial infrared convolutional neural network model and the Gaussian distribution generated by the corresponding age labeling result and the difference value of the expected value of the age distribution corresponding to each infrared sample image and the corresponding age labeling result, wherein the age distribution obeys the Gaussian distribution; the infrared sample image and the corresponding age labeling result are determined according to a convolutional neural network model obtained through pre-training, and the convolutional neural network model is obtained through color image training.
Optionally, the training process of the infrared convolutional neural network model includes:
constructing an initial infrared convolution neural network model, wherein the initial infrared convolution neural network model comprises the following steps: a convolution layer, a pooling layer, and a full-link layer;
determining each infrared sample image and an age labeling result corresponding to each infrared sample image;
generating Gaussian distribution of age labeling results corresponding to the infrared sample images;
inputting each infrared sample image into the initial infrared convolution neural network model to obtain the age distribution corresponding to each infrared sample image, calculating the difference value of the age distribution corresponding to each infrared sample image and the Gaussian distribution generated by the corresponding age labeling result, calculating the difference value of the expected value of the age distribution corresponding to each infrared sample image and the corresponding age labeling result, and adjusting each parameter in the initial infrared convolution neural network model according to the calculation result to obtain the infrared convolution neural network model.
Optionally, the determining each infrared sample image, and the age labeling result corresponding to each infrared sample image include:
acquiring a plurality of image sets, wherein the initial infrared images in each image set are different face images of the same person in the same period, and the number of the initial infrared images in each image set is greater than a preset number threshold;
detecting a second face area in each initial infrared image aiming at each image set, and constructing each initial target image containing each second face area;
inputting each initial target image into a convolutional neural network model obtained by pre-training to obtain second predicted age distribution of people corresponding to each second face area, and determining an age range corresponding to each second predicted age distribution; the convolutional neural network model is obtained by adjusting parameters in the initial convolutional neural network model to obtain a candidate neural network model and adjusting the candidate neural network model according to the difference value of the age distribution corresponding to each sample image output by the initial convolutional neural network model and the Gaussian distribution generated by the corresponding age labeling result and the difference value of the expected value of the age distribution corresponding to each sample image and the corresponding age labeling result after each sample image is input into the initial convolutional neural network model, the second predicted age distribution obeys Gaussian distribution, and each sample image is a color image;
and removing the initial target images with abnormal age ranges in the image set to obtain residual target images, calculating the normal age ranges corresponding to all the residual target images, taking the residual target images contained in the normal age ranges as infrared sample images, and taking the mean value of the age ranges corresponding to the infrared sample images as the age labeling result of the infrared sample images.
Optionally, for each image set, removing the initial target image with the abnormal age range in the image set to obtain the remaining target images includes:
for each image set, sequencing the initial target images according to the sequence of the minimum value of the age range corresponding to the initial target images in the image set from small to large;
determining a first age range located one quarter and a second age range located three quarters, and a minimum value of the first age range and a maximum value of the second age range;
and removing the initial target image with the age value smaller than the difference between the minimum value and the preset value and the initial target image with the age value larger than the sum of the maximum value and the preset value in the corresponding age range to obtain the residual target image.
Optionally, the calculating the normal age range corresponding to all the remaining target images includes:
calculating the mean value and the standard deviation of the age range corresponding to all the residual target images;
acquiring a preset hyper-parameter;
and calculating the product of the hyperparameter and the standard deviation, taking the difference between the mean value and the product as the minimum value of the normal age range, and taking the sum of the mean value and the product as the maximum value of the normal age range.
Optionally, the training process of the convolutional neural network model includes:
constructing an initial convolutional neural network model, wherein the initial convolutional neural network model comprises: a convolution layer, a pooling layer, and a full-link layer;
acquiring each sample image and an age labeling result corresponding to each sample image;
generating Gaussian distribution of age labeling results corresponding to the sample images;
inputting each sample image into the initial convolutional neural network model to obtain age distribution corresponding to each sample image, calculating a difference value of the age distribution corresponding to each sample image and Gaussian distribution generated by a corresponding age labeling result, and a difference value of an expected value of the age distribution corresponding to each sample image and the corresponding age labeling result, adjusting each parameter in the initial convolutional neural network model according to the calculation result to obtain a candidate neural network model, and adjusting the candidate neural network model to obtain the convolutional neural network model.
Optionally, the generating a gaussian distribution of the age labeling result corresponding to each sample image includes:
and constructing a Gaussian distribution taking the age labeling result corresponding to the sample image as the center and the preset standard deviation as the peak width as the Gaussian distribution of the age labeling result corresponding to the sample image for each sample image.
Optionally, after obtaining the infrared convolutional neural network model, the method further includes:
acquiring infrared test images and age labeling results corresponding to the infrared test images; the infrared test image is different from the infrared sample image;
determining the testing precision of the infrared convolution neural network model according to the infrared testing images and age labeling results corresponding to the infrared testing images;
and when the test precision is smaller than a preset precision threshold value, taking the current infrared convolution neural network model as an initial infrared convolution neural network model, returning to execute the step of determining each infrared sample image and the age marking result corresponding to each infrared sample image, and taking the current infrared convolution neural network model as a final infrared convolution neural network model when the test precision is not smaller than the preset precision threshold value.
Optionally, the constructing the target image to be processed including the first face region includes:
detecting key points of the first face area to obtain coordinate information of each target key point of the first face area; wherein, each target key point is a point for identifying the human face contour feature;
and according to the coordinate information of each target key point, after the first face area is aligned, obtaining a target image to be processed, which contains the first face area and is located at a preset position by each target key point.
Optionally, after the target image to be processed is input into an infrared convolutional neural network model obtained through pre-training, and a first predicted age distribution of a person corresponding to the first face region is obtained, the method further includes:
and calculating the sum of products of the age values and the corresponding probabilities in the first predicted age distribution, and taking the calculation result as the predicted age value of the person corresponding to the first face area.
In a second aspect, an embodiment of the present invention provides an age prediction apparatus for infrared images, where the apparatus includes:
the infrared image acquisition module is used for acquiring an infrared image to be processed;
the human face area detection module is used for detecting a first human face area in the infrared image to be processed and constructing a target image to be processed containing the first human face area; the size of the target image to be processed is a preset size;
the age prediction module is used for inputting the target image to be processed into an infrared convolution neural network model obtained through pre-training to obtain a first predicted age distribution of a person corresponding to the first face area, wherein the first predicted age distribution obeys Gaussian distribution; after each infrared sample image is input into an initial infrared convolutional neural network model, adjusting each parameter in the initial infrared convolutional neural network model according to the difference value of the age distribution corresponding to each infrared sample image output by the initial infrared convolutional neural network model and the Gaussian distribution generated by the corresponding age labeling result and the difference value of the expected value of the age distribution corresponding to each infrared sample image and the corresponding age labeling result, wherein the age distribution obeys the Gaussian distribution; the infrared sample image and the corresponding age labeling result are determined according to a convolutional neural network model obtained through pre-training, and the convolutional neural network model is obtained through color image training.
Optionally, the apparatus further comprises:
an infrared model building module, configured to build an initial infrared convolutional neural network model, where the initial infrared convolutional neural network model includes: a convolution layer, a pooling layer, and a full-link layer;
the infrared sample image determining module is used for determining each infrared sample image and an age labeling result corresponding to each infrared sample image;
the Gaussian distribution generating module is used for generating Gaussian distribution of the age labeling results corresponding to the infrared sample images;
and the infrared convolutional neural network model training module is used for inputting each infrared sample image into the initial infrared convolutional neural network model to obtain the age distribution corresponding to each infrared sample image, calculating the difference value of the Gaussian distribution generated by the age distribution corresponding to each infrared sample image and the corresponding age labeling result, and adjusting each parameter in the initial infrared convolutional neural network model according to the calculation result to obtain the infrared convolutional neural network model.
Optionally, the infrared sample image determining module includes:
the image set acquisition sub-module is used for acquiring a plurality of image sets, wherein the initial infrared images in each image set are different face images of the same person in the same period, and the number of the initial infrared images in each image set is greater than a preset number threshold;
the face region detection submodule is used for detecting a second face region in each initial infrared image aiming at each image set and constructing each initial target image containing each second face region;
the age range determining submodule is used for inputting each initial target image into a convolutional neural network model obtained through pre-training to obtain second predicted age distribution of people corresponding to each second face area and determining an age range corresponding to each second predicted age distribution; the convolutional neural network model is obtained by adjusting parameters in the initial convolutional neural network model to obtain a candidate neural network model and adjusting the candidate neural network model according to the difference value between the age distribution corresponding to each sample image output by the initial convolutional neural network model and the Gaussian distribution generated by the corresponding age labeling result and the difference value between the expected value of the age distribution corresponding to each sample image and the corresponding age labeling result after each sample image is input into the initial convolutional neural network model, wherein the second predicted age distribution obeys Gaussian distribution, and each sample image is a color image;
and the infrared sample determining submodule is used for removing the initial target images with abnormal age ranges in the image set aiming at each image set to obtain the residual target images, calculating the normal age ranges corresponding to all the residual target images, taking the residual target images contained in the normal age ranges as the infrared sample images, and taking the mean value of the age ranges corresponding to the infrared sample images as the age labeling result of the infrared sample images.
Optionally, the infrared sample determination sub-module is specifically configured to:
for each image set, sequencing the initial target images according to the sequence of the minimum value of the age range corresponding to the initial target images in the image set from small to large;
determining a first age range located one quarter and a second age range located three quarters, and a minimum value of the first age range and a maximum value of the second age range;
and removing the initial target image with the age value smaller than the difference between the minimum value and the preset value and the initial target image with the age value larger than the sum of the maximum value and the preset value in the corresponding age range to obtain the residual target image.
Optionally, the infrared sample determination sub-module is specifically configured to:
calculating the mean value and the standard deviation of the age range corresponding to all the residual target images;
acquiring a preset hyper-parameter;
and calculating the product of the hyperparameter and the standard deviation, taking the difference between the mean value and the product as the minimum value of the normal age range, and taking the sum of the mean value and the product as the maximum value of the normal age range.
Optionally, the infrared sample image determining module further includes:
a network model construction submodule for constructing an initial convolutional neural network model, the initial convolutional neural network model comprising: a convolution layer, a pooling layer, and a full-link layer;
the system comprises a sample image acquisition submodule and a data processing submodule, wherein the sample image acquisition submodule is used for acquiring each sample image and an age labeling result corresponding to each sample image;
the Gaussian distribution generation submodule is used for generating Gaussian distribution of the age labeling result corresponding to each sample image;
and the convolutional neural network model training submodule is used for inputting each sample image into the initial convolutional neural network model to obtain the age distribution corresponding to each sample image, calculating the difference value of the age distribution corresponding to each sample image and the Gaussian distribution generated by the corresponding age labeling result, and the difference value of the expected value of the age distribution corresponding to each sample image and the corresponding age labeling result, adjusting each parameter in the initial convolutional neural network model according to the calculation result to obtain a candidate neural network model, and adjusting the candidate neural network model to obtain the convolutional neural network model.
Optionally, the gaussian distribution generation submodule is specifically configured to:
and constructing a Gaussian distribution taking the age labeling result corresponding to the sample image as the center and the preset standard deviation as the peak width as the Gaussian distribution of the age labeling result corresponding to the sample image for each sample image.
Optionally, the apparatus further comprises:
the test image acquisition module is used for acquiring infrared test images and age labeling results corresponding to the infrared test images; the infrared test image is different from the infrared sample image;
the test precision determining module is used for determining the test precision of the infrared convolution neural network model according to the infrared test images and age labeling results corresponding to the infrared test images;
and the processing module is used for taking the current infrared convolutional neural network model as an initial infrared convolutional neural network model when the test precision is smaller than a preset precision threshold value, triggering the infrared sample image determining module, and taking the current infrared convolutional neural network model as a final infrared convolutional neural network model when the test precision is not smaller than the preset precision threshold value.
Optionally, the face region detection module includes:
the key point detection submodule is used for carrying out key point detection on the first face area to obtain coordinate information of each target key point of the first face area; wherein, each target key point is a point for identifying the human face contour feature;
and the target image construction sub-module is used for aligning the first face area according to the coordinate information of each target key point to obtain a target image to be processed, which contains the first face area and is located at a preset position by each target key point.
Optionally, the apparatus further comprises:
and the age value calculation module is used for calculating the sum of products of all age values and corresponding probabilities in the first predicted age distribution and taking the calculation result as the predicted age value of the person corresponding to the first face area.
As can be seen from the above, the method and the device for predicting the age of the face in the infrared image, provided by the embodiment of the present invention, can obtain the infrared image to be processed; detecting a first face area in the infrared image to be processed, and constructing a target image to be processed containing the first face area; the size of the target image to be processed is a preset size; inputting a target image to be processed into an infrared convolution neural network model obtained through pre-training to obtain a first predicted age distribution of a person corresponding to a first face area, wherein the first predicted age distribution obeys Gaussian distribution; the infrared convolutional neural network model is obtained by adjusting parameters in the initial infrared convolutional neural network model according to the difference value between the age distribution corresponding to each infrared sample image output by the initial infrared convolutional neural network model and the Gaussian distribution generated by the corresponding age labeling result and the difference value between the expected value of the age distribution corresponding to each infrared sample image and the corresponding age labeling result after each infrared sample image is input into the initial infrared convolutional neural network model, wherein the age distribution obeys the Gaussian distribution; the infrared sample image and the corresponding age labeling result are determined according to a convolutional neural network model obtained through pre-training, and the convolutional neural network model is obtained through color image training, so that the infrared sample image and the corresponding age labeling result can be determined based on the convolutional neural network model obtained through color image training, and the infrared convolutional neural network model capable of conducting age prediction on a face in the infrared image is obtained through training according to the determined infrared sample image and the corresponding age labeling result. And compared with the manual age calibration, the infrared sample image and the corresponding age labeling result are determined through the convolutional neural network model, so that the human resources can be saved, and the sample acquisition efficiency is improved. In addition, when the infrared convolution neural network model is trained, after the initial infrared convolution neural network model is input according to each infrared sample image, the difference value of the age distribution corresponding to each infrared sample image output by the initial infrared convolution neural network model and the Gaussian distribution generated by the corresponding age labeling result, and the difference value of the expected value of the age distribution corresponding to each infrared sample image and the corresponding age labeling result are adjusted, and each parameter in the initial infrared convolution neural network model is adjusted. Of course, not all of the advantages described above need to be achieved at the same time in the practice of any one product or method of the invention.
The innovation points of the embodiment of the invention comprise that:
1. and determining an infrared sample image and a corresponding age labeling result based on a convolutional neural network model obtained by color image training, and further training according to the determined infrared sample image and the corresponding age labeling result to obtain an infrared convolutional neural network model capable of carrying out age prediction on the face in the infrared image. And compared with the manual age calibration, the infrared sample image and the corresponding age labeling result are determined through the convolutional neural network model, so that the human resources can be saved, and the sample acquisition efficiency is improved. In addition, when the infrared convolution neural network model is trained, after the initial infrared convolution neural network model is input according to each infrared sample image, the difference value of the age distribution corresponding to each infrared sample image output by the initial infrared convolution neural network model and the Gaussian distribution generated by the corresponding age labeling result, and the difference value of the expected value of the age distribution corresponding to each infrared sample image and the corresponding age labeling result are adjusted, and each parameter in the initial infrared convolution neural network model is adjusted.
2. After each infrared sample image is input into the initial infrared convolution neural network model, the difference value of the age distribution corresponding to each infrared sample image output by the initial infrared convolution neural network model and the Gaussian distribution generated by the corresponding age labeling result, and the difference value of the expected value of the age distribution corresponding to each infrared sample image and the corresponding age labeling result are adjusted to obtain the infrared convolution neural network model.
3. The infrared sample image and the corresponding age labeling result are determined through the convolutional neural network model, and compared with manual age calibration, the method can save human resources and improve the sample acquisition efficiency.
4. According to the scheme that after the initial convolutional neural network model is input into each sample image, the difference value of the age distribution corresponding to each sample image output by the initial convolutional neural network model and the Gaussian distribution generated by the corresponding age labeling result and the difference value of the expected value of the age distribution corresponding to each sample image and the corresponding age labeling result are adjusted, all parameters in the initial convolutional neural network model are adjusted to obtain the convolutional neural network model.
5. The infrared convolution neural network model obtained through training is subjected to test precision detection through the test image, and when the test precision is low, the infrared convolution neural network model is updated through the infrared sample image again, so that the finally obtained test precision of the infrared convolution neural network can be ensured, and the accuracy of age prediction is improved.
6. The key point detection is carried out on the face area, then the face area is aligned to obtain a target image to be processed, the situations that a side face exists in the target image to be processed and the like can be avoided, the face in the target image to be processed is enabled to be clearer, and the accuracy of age prediction is improved.
7. And calculating a specific predicted age value according to the predicted age distribution so as to obtain an accurate age prediction result.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below. It is to be understood that the drawings in the following description are merely exemplary of some embodiments of the invention. For a person skilled in the art, without inventive effort, further figures can be obtained from these figures.
Fig. 1 is a schematic flowchart of an age prediction method for infrared images according to an embodiment of the present invention;
FIG. 2 is a schematic flowchart of another method for predicting age of infrared images according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of another age prediction method for infrared images according to an embodiment of the present invention;
FIG. 4 is a schematic flowchart of another method for predicting age of infrared images according to an embodiment of the present invention;
FIG. 5 is a schematic flowchart of another method for predicting age of infrared images according to an embodiment of the present invention;
FIG. 6 is a schematic flowchart of another method for predicting age of infrared images according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an age prediction apparatus for infrared images according to an embodiment of the present invention.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. It is to be understood that the described embodiments are merely a few embodiments of the invention, and not all embodiments. All other embodiments, which can be obtained by a person skilled in the art without inventive effort based on the embodiments of the present invention, are within the scope of the present invention.
It is to be noted that the terms "comprises" and "comprising" and any variations thereof in the embodiments and drawings of the present invention are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
The embodiment of the invention discloses an age prediction method and device for an infrared image, which can predict the age of a human face in the infrared image. The following provides a detailed description of embodiments of the invention.
Fig. 1 is a schematic flowchart of an age prediction method for infrared images according to an embodiment of the present invention. The method is applied to the electronic equipment. The method specifically comprises the following steps.
S110: and acquiring an infrared image to be processed.
The infrared image to be processed is an image containing a human face and needing age prediction. For example, the electronic device may receive an infrared image acquired by the monitoring device as an infrared image to be processed; or, an infrared image input by a user may be received as an infrared image to be processed, which is not limited in the embodiment of the present invention.
S120: detecting a first face area in the infrared image to be processed, and constructing a target image to be processed containing the first face area; the size of the target image to be processed is a preset size.
It can be understood that the infrared image to be processed may include other regions besides the human face region due to the large monitoring area of the monitoring device. In the case of age prediction, other regions may affect the result of age prediction.
Therefore, in the embodiment of the present invention, the electronic device may detect a face region in the infrared image to be processed, which may be referred to as a first face region, and construct a target image to be processed including the first face region. The size of the target image to be processed is a preset size.
For example, the first face Region in the infrared image to be processed may be detected by a fast Region-based Cellular Neural Network (fast Region Cellular Neural Network) face detection framework. Alternatively, any known target detection algorithm may be used to detect the first face region in the infrared image to be processed, which is not limited in the embodiment of the present invention.
S130: inputting a target image to be processed into an infrared convolution neural network model obtained through pre-training to obtain a first predicted age distribution of a person corresponding to a first face area, wherein the first predicted age distribution obeys Gaussian distribution; the infrared convolutional neural network model is obtained by adjusting parameters in the initial infrared convolutional neural network model according to the difference value between the age distribution corresponding to each infrared sample image output by the initial infrared convolutional neural network model and the Gaussian distribution generated by the corresponding age labeling result and the difference value between the expected value of the age distribution corresponding to each infrared sample image and the corresponding age labeling result after each infrared sample image is input into the initial infrared convolutional neural network model, wherein the age distribution obeys the Gaussian distribution; the infrared sample image and the corresponding age labeling result are determined according to a convolutional neural network model obtained through pre-training, and the convolutional neural network model is obtained through color image training.
In the embodiment of the invention, an infrared convolution neural network model for carrying out age prediction on the face in the infrared image can be constructed in advance. Specifically, a convolutional neural network model can be obtained according to color image training, and the convolutional neural network model can perform rough age prediction on the infrared image. And then determining infrared sample images and corresponding age labeling results based on the convolutional neural network model, inputting each infrared sample image into the initial infrared convolutional neural network model, and adjusting each parameter in the initial infrared convolutional neural network model according to the difference value of the age distribution corresponding to each infrared sample image output by the initial infrared convolutional neural network model and the Gaussian distribution generated by the corresponding age labeling result and the difference value of the expected value of the age distribution corresponding to each infrared sample image and the corresponding age labeling result to obtain the infrared convolutional neural network model.
And a gaussian distribution, i.e., a normal distribution. If the random variable X follows a normal distribution with mathematical expectation of μ and variance σ ^2, it is denoted as N (μ, σ ^ 2). Its expected value μ determines its position and its standard deviation σ determines the amplitude of the distribution. A normal distribution when μ ═ 0 and σ ═ 1 is a standard normal distribution.
The expected value of the age distribution corresponding to each infrared sample image is an expected value of gaussian distribution, that is, an age value with the highest probability in the age distribution corresponding to each infrared sample image is the most intermediate.
After a target image to be processed including a first face area is obtained, the target image to be processed can be input into the infrared convolution neural network model, and the infrared convolution neural network model can output a first predicted age distribution of a person corresponding to the first face area. Wherein the first predicted age distribution follows a gaussian distribution, i.e. follows a normal distribution.
The predicted age distribution includes a plurality of age values and corresponding probability values. Among the plurality of age values, the probability of the age value at the most middle is the largest, and the probabilities of the age values on both sides are reduced in order. And the sum of the probabilities for all age values is 1.
As can be seen from the above, the method for predicting the age of the face in the infrared image according to the embodiment of the present invention can determine the infrared sample image and the corresponding age labeling result based on the convolutional neural network model obtained by color image training, and further train the determined infrared sample image and the corresponding age labeling result to obtain the infrared convolutional neural network model capable of predicting the age of the face in the infrared image. And compared with the manual age calibration, the infrared sample image and the corresponding age labeling result are determined through the convolutional neural network model, so that the human resources can be saved, and the sample acquisition efficiency is improved. In addition, when the infrared convolution neural network model is trained, after the initial infrared convolution neural network model is input according to each infrared sample image, the difference value of the age distribution corresponding to each infrared sample image output by the initial infrared convolution neural network model and the Gaussian distribution generated by the corresponding age labeling result, and the difference value of the expected value of the age distribution corresponding to each infrared sample image and the corresponding age labeling result are adjusted, and each parameter in the initial infrared convolution neural network model is adjusted.
As an implementation manner of the embodiment of the present invention, as shown in fig. 2, a training process of the infrared convolutional neural network model according to the embodiment of the present invention may include the following steps.
S210: constructing an initial infrared convolution neural network model, wherein the initial infrared convolution neural network model comprises the following steps: a convolution layer, a pooling layer, and a full-link layer.
The initial infrared convolution neural network model in the embodiment of the invention can comprise data processing layers with parameters, such as convolution layers, pooling layers, full-connection layers and the like. The number of the convolutional layer, the pooling layer, and the fully-connected layer may be one or more layers, as long as the age prediction can be achieved, which is not limited in the embodiment of the present invention.
S220: and determining each infrared sample image and an age labeling result corresponding to each infrared sample image.
And determining each infrared sample image and an age labeling result corresponding to each infrared sample image, namely determining a data set for training an infrared convolution neural network model.
In one implementation, as shown in fig. 3, the process of determining each infrared sample image and the age labeling result corresponding to each infrared sample image may include the following steps.
S310: acquiring a plurality of image sets, wherein the initial infrared images in each image set are different face images of the same person in the same period, and the number of the initial infrared images in each image set is greater than a preset number threshold.
In the embodiment of the invention, a large number of infrared face images can be collected, and an infrared sample image which can be used for training an infrared convolution neural network model is determined.
Specifically, multiple infrared face images of different people at the same time can be acquired by designing an acquisition mode. For example, millions (e.g., 500, 600, 700, etc.) of infrared face images may be collected, and an average of about 100 persons may be used as the initial infrared image.
The same period may be a predetermined period, such as 1 day, 30 days, 60 days, etc., which is not limited in the embodiments of the present invention.
S320: and detecting a second face region in each initial infrared image aiming at each image set, and constructing each initial target image containing each second face region.
For example, the second face region in each initial infrared image included in each image set may be detected by the fast-RCNN face detection framework. Alternatively, any known target detection algorithm may be used to detect the second face region in each initial infrared image included in each image set, which is not limited in the embodiment of the present invention.
After the second face regions in the initial infrared images included in each image set are detected, initial target images including the second face regions can be constructed.
S330: inputting each initial target image into a convolutional neural network model obtained by pre-training to obtain second predicted age distribution of people corresponding to each second face area, and determining an age range corresponding to each second predicted age distribution; the convolutional neural network model is obtained by adjusting parameters in the initial convolutional neural network model to obtain a candidate neural network model and adjusting the candidate neural network model according to the difference value between the age distribution corresponding to each sample image output by the initial convolutional neural network model and the Gaussian distribution generated by the corresponding age labeling result and the difference value between the expected value of the age distribution corresponding to each sample image and the corresponding age labeling result after each sample image is input into the initial convolutional neural network model, the second predicted age distribution obeys the Gaussian distribution, and each sample image is a color image.
In the embodiment of the invention, a convolutional neural network model capable of predicting the age of the face in the infrared image can be constructed in advance. Specifically, the color image with the age labeled can be used as a sample image, and then, after each sample image is input into the initial convolutional neural network model, each parameter in the initial convolutional neural network model is adjusted to obtain a candidate neural network model according to a difference value between an age distribution corresponding to each sample image output by the initial convolutional neural network model and a gaussian distribution generated by a corresponding age labeling result, and a difference value between an expected value of the age distribution corresponding to each sample image and a corresponding age labeling result, wherein the candidate neural network model can predict the age of the color image; and then adjusting the candidate neural network model to obtain a convolutional neural network model capable of predicting the age of the infrared image.
After each initial target image including each second face region is obtained, each initial target image can be input into a convolutional neural network model obtained through pre-training, and the convolutional neural network model can output second predicted age distribution of a person corresponding to each second face region. Wherein each second predicted age distribution follows a gaussian distribution, i.e. follows a normal distribution.
It will be appreciated that the accuracy of the age predicted by the convolutional neural network model is not particularly high, since the infrared image and the color image have different characteristics. In the embodiment of the present invention, after the second predicted age distribution of the person corresponding to each second face region is obtained, the age range corresponding to each second predicted age distribution, that is, the age range included in each second predicted age distribution, may be determined.
S340: and removing the initial target images with abnormal age ranges in the image set to obtain residual target images, calculating the normal age ranges corresponding to all the residual target images, taking the residual target images contained in the normal age ranges as infrared sample images, and taking the mean value of the age ranges corresponding to the infrared sample images as the age labeling result of the infrared sample images.
It will be appreciated that the age prediction results of hundreds of images of the same person at the same time period should be the same, i.e. the age range of each image included in each image set should be the same. However, in practical applications, the age ranges of the images obtained in step S330 may not be identical due to the fact that the images of other people are mixed into the personal image set, or due to the influence of the angles, illumination, and the like of different images.
In the embodiment of the present invention, for each image set, the initial target image with an abnormal age range in the image set may be removed to obtain the remaining target images.
In one implementation, for each image set, a quartile range method may be used to remove an initial target image with an abnormal age range in the image set, so as to obtain remaining target images. Specifically, as shown in fig. 4, the process may include the following steps.
S410: and for each image set, sequencing the initial target images according to the sequence of the minimum value of the age range corresponding to the initial target images in the image set from small to large.
For example, when 100 initial target images are included in any image set, the age ranges of 10 initial target images are 15-25, 80 initial target images are 30-40, and 10 initial target images are 40-50, the initial target images can be sorted according to the order of the minimum value of the age ranges from small to large, namely the order of 15, 30 and 40.
S420: a first age range located one quarter and a second age range located three quarters are determined, as well as a minimum value for the first age range and a maximum value for the second age range.
In the above example, the first age range located at one quarter is the age range 30-40 corresponding to the 25 th initial target image, and the second age range located at three quarters is the age range 30-40 corresponding to the 75 th initial target image. The minimum value of the first age range is 30 and the maximum value of the second age range is 40.
S430: and removing the initial target image which contains the difference between the age value smaller than the minimum value and the preset value in the corresponding age range and the initial target image which contains the age value larger than the sum of the maximum value and the preset value to obtain the residual target image.
The preset value may be any preset number, such as 3, 5, 6, etc., and the embodiment of the present invention is not limited thereto.
For example, when the preset value is 3, in the above example, the difference between the minimum value and the preset value is 27, the sum of the maximum value and the preset value is 43, the initial target image with the age value smaller than the difference between the minimum value and the preset value in the age range is 10 initial target images with the age range of 15 to 25, the initial target image with the age value larger than the sum of the maximum value and the preset value in the age range is 10 initial target images with the age range of 40 to 50, and the determined initial target images are removed to obtain 80 initial target images with the age range of 30 to 40 as the remaining target images.
After the remaining target images are obtained, normal age ranges corresponding to all the remaining target images may be calculated, for example, a mean value and a standard deviation of the age ranges corresponding to all the remaining target images may be calculated; acquiring a preset hyper-parameter; and calculating the product of the hyperparameter and the standard deviation, taking the difference between the mean value and the product as the minimum value of the normal age range, and taking the sum of the mean value and the product as the maximum value of the normal age range.
For example, it can be assumed that the results [ x1, x2, x3,.. xn ] of images of the same person at any one time period, predicted by the convolutional neural network model, are gaussian-distributed as follows:
Figure BDA0002141257470000161
adopting a 4-minute distance method for [ x1, x2, x 3.. ·. xn ], removing obvious abnormal values to obtain the remaining m images and predicted values [ x1, x2, x 3..... xm ] of the m images, and calculating a statistical mean value u and a standard deviation s of the m images by using a Grubbs (Grubbs) detection method according to results of the m same people, and designing a hyper-parameter k by the following calculation formula:
μ-k*s≤xi≤μ+k*s
and (3) removing the images which are not in the range, obtaining the last [ x1, x2, x3,.. xh ] images in the range, counting the average value of the prediction range of the h images, and matching the average value with the h infrared images to form a new data set which is the infrared sample image as the age labeling result of the person.
The infrared sample image and the corresponding age labeling result are determined through the convolutional neural network model, and compared with manual age calibration, the method can save human resources and improve the sample acquisition efficiency.
S230: and generating Gaussian distribution of the age labeling result corresponding to each infrared sample image.
For example, a gaussian distribution with the age labeling result corresponding to the infrared sample image as the center and the preset standard deviation as the peak width may be constructed for each infrared sample image as the gaussian distribution of the age labeling result corresponding to the infrared sample image.
The preset standard deviation may be a preset value, and the specific value thereof is not limited in the embodiment of the present invention. It is understood that the smaller the above-mentioned preset standard deviation is, the sharper the peak of the gaussian distribution is generated, and the more concentrated the respective age values included therein are.
S240: inputting each infrared sample image into the initial infrared convolution neural network model to obtain age distribution corresponding to each infrared sample image, calculating the difference value of the age distribution corresponding to each infrared sample image and Gaussian distribution generated by the corresponding age labeling result, and the difference value of the expected value of the age distribution corresponding to each infrared sample image and the corresponding age labeling result, and adjusting each parameter in the initial infrared convolution neural network model according to the calculation result to obtain the infrared convolution neural network model.
And after the infrared sample image, the corresponding age labeling result and the Gaussian distribution of the age labeling result are obtained, the infrared convolution neural network model capable of carrying out age prediction on the infrared image can be trained. Specifically, each infrared sample image may be input into the initial infrared convolutional neural network model to obtain age distribution corresponding to each infrared sample image, a difference between the age distribution corresponding to each infrared sample image and a gaussian distribution generated by a corresponding age labeling result and a difference between an expected value of the age distribution corresponding to each infrared sample image and a corresponding age labeling result are calculated, and each parameter in the initial infrared convolutional neural network model is adjusted according to the calculation result to obtain the infrared convolutional neural network model.
Specifically, the loss function based on Gaussian distribution estimation and expected age estimation is constructed, face age labeling is converted into designed Gaussian distribution which is used as a label, the designed Gaussian distribution is compared with prediction generated by a model to generate a returned error, and each parameter in an initial infrared convolution neural network model is adjusted to obtain the infrared convolution neural network model.
After each infrared sample image is input into the initial infrared convolution neural network model, the difference value of the age distribution corresponding to each infrared sample image output by the initial infrared convolution neural network model and the Gaussian distribution generated by the corresponding age labeling result, and the difference value of the expected value of the age distribution corresponding to each infrared sample image and the corresponding age labeling result are adjusted to obtain the infrared convolution neural network model.
As an implementation manner of the embodiment of the present invention, in order to ensure accuracy of infrared image age prediction, precision detection may be performed on an infrared convolutional neural network model obtained through training.
Specifically, after obtaining the infrared convolution neural network model, as shown in fig. 5, the following steps may be further performed.
S510: acquiring infrared test images and age labeling results corresponding to the infrared test images; the infrared test image is different from the infrared sample image.
For example, a small number of infrared images containing a human face may be acquired as the infrared test image. And moreover, accurate age labeling is carried out on the infrared test image manually.
S520: and determining the testing precision of the infrared convolution neural network model according to the infrared testing images and the age labeling results corresponding to the infrared testing images.
For example, the infrared test image may be input into the infrared convolutional neural network model, and after the infrared convolutional neural network model outputs the age distribution of each infrared test image, the age expected value included in the age distribution may be compared with the age labeling result corresponding to each infrared test image, and the accuracy may be calculated and determined as the test accuracy of the infrared convolutional neural network.
When the accuracy is calculated, the difference between the expected age value included in the age distribution of any infrared test image and the corresponding age labeling result is calculated, and the difference is divided by the age labeling result to obtain an error rate. The value of 1 minus the error rate is then calculated as the accuracy of the infrared test image. And taking the average value of the accuracy rate of each infrared test image as the test precision of the infrared convolution neural network.
S530: and when the test precision is smaller than a preset precision threshold value, taking the current infrared convolution neural network model as an initial infrared convolution neural network model, returning to the step of determining each infrared sample image and the age marking result corresponding to each infrared sample image, and taking the current infrared convolution neural network model as a final infrared convolution neural network model until the test precision is not smaller than the preset precision threshold value.
And when the test precision is smaller than the preset precision threshold value, the age prediction precision of the infrared convolutional neural network model obtained by current training is low, and under the condition, the infrared convolutional neural network model can be updated, so that the precision is improved.
Specifically, the current infrared convolutional neural network model may be used as the initial infrared convolutional neural network model, and the steps of determining each infrared sample image and the age labeling result corresponding to each infrared sample image, that is, steps S220 to S240, are returned. And the infrared convolutional neural network model obtained by current training is used as a final infrared convolutional neural network model until the test precision meets the requirement.
The infrared convolution neural network model obtained through training is subjected to test precision detection through the test image, and when the test precision is low, the infrared convolution neural network model is updated through the infrared sample image again, so that the finally obtained test precision of the infrared convolution neural network can be ensured, and the accuracy of age prediction is improved.
In one implementation, as shown in fig. 6, the training process of the convolutional neural network model described above may include the following steps.
S610: constructing an initial convolutional neural network model, wherein the initial convolutional neural network model comprises the following steps: convolution layer, pooling layer, full-link layer.
The initial convolutional neural network model in the embodiment of the present invention may include data processing layers with parameters, such as convolutional layers, pooling layers, full-link layers, and the like. The number of the convolutional layer, the pooling layer, and the fully-connected layer may be one or more layers, as long as the age prediction can be achieved, which is not limited in the embodiment of the present invention.
The initial convolutional neural network model and the initial infrared convolutional neural network model may have the same or different structures, which is not limited in the embodiment of the present invention.
S620: and acquiring each sample image and an age labeling result corresponding to each sample image.
For example, a color image with an age given to the public data set may be used as a sample image, and the age given to the color image may be used as an age given result corresponding to each sample image.
The public data set may be, for example, AFAD: (Asian Face Age Dataset), a public Asian Face image Dataset, containing Face images around 160k and their Age labels; alternatively, the Face image data set may be a published asian Face image data set containing Face images of around 45k and their age labels.
S630: and generating the Gaussian distribution of the age labeling result corresponding to each sample image.
For example, a gaussian distribution having a preset standard deviation as a peak width centered on the age labeling result corresponding to the sample image may be constructed for each sample image as the gaussian distribution of the age labeling result corresponding to the sample image.
The preset standard deviation may be a preset value, and the specific value thereof is not limited in the embodiment of the present invention. It is understood that the smaller the above-mentioned preset standard deviation is, the sharper the peak of the gaussian distribution is generated, and the more concentrated the respective age values included therein are.
S640: inputting each sample image into the initial convolutional neural network model to obtain age distribution corresponding to each sample image, calculating a difference value of the age distribution corresponding to each sample image and Gaussian distribution generated by a corresponding age labeling result, and a difference value of an expected value of the age distribution corresponding to each sample image and a corresponding age labeling result, adjusting each parameter in the initial convolutional neural network model according to the calculation result to obtain a candidate neural network model, and adjusting the candidate neural network model to obtain the convolutional neural network model.
And after the sample image, the corresponding age labeling result and the Gaussian distribution of the age labeling result are obtained, the convolutional neural network model capable of carrying out age prediction on the infrared image can be trained. Specifically, each sample image may be input into the initial convolutional neural network model, a difference between an age distribution corresponding to each sample image output by the initial convolutional neural network model and a gaussian distribution generated by a corresponding age labeling result, and a difference between an expected value of the age distribution corresponding to each sample image and a corresponding age labeling result, each parameter in the initial convolutional neural network model is adjusted to obtain a candidate neural network model, and the candidate neural network model may perform age prediction on the color image; and then adjusting the candidate neural network model to obtain a convolutional neural network model capable of predicting the age of the infrared image.
Specifically, the loss function based on Gaussian distribution estimation and expected age estimation is constructed, face age labeling is converted into designed Gaussian distribution which is used as a label, the designed Gaussian distribution is compared with prediction generated by a model to generate a returned error, and each parameter in an initial convolutional neural network model is adjusted to obtain a candidate convolutional neural network model. Furthermore, the candidate convolutional neural network model is adjusted to a model capable of carrying out age prediction on the single-channel infrared image, and the convolutional neural network model is obtained.
According to the method, after each sample image is input into an initial convolutional neural network model, the difference value of the age distribution corresponding to each sample image output by the initial convolutional neural network model and the Gaussian distribution generated by the corresponding age labeling result and the difference value of the expected value of the age distribution corresponding to each sample image and the corresponding age labeling result are adjusted to obtain the convolutional neural network model.
It can be understood that in the to-be-processed image acquired by the electronic device, the face of the person may face forward, and there may be a case where the face of the person is not facing forward, such as a side face. When the face is not facing forward, the accuracy of the age prediction result may be affected.
As an implementation manner of the embodiment of the present invention, when the electronic device constructs a target image to be processed including a first face region, key point detection may be performed on the first face region first to obtain coordinate information of each target key point of the first face region; wherein, each target key point is a point for identifying the human face contour feature; and then, according to the coordinate information of each target key point, aligning the first face area to obtain a target image to be processed, which comprises the first face area and is located at a preset position by each target key point.
For example, the key point detection may be performed on the first face region based on MTCNN (Multi-task Convolutional Neural Network), and the coordinate information in the coordinate system constructed in the image to be processed by each target key point may be determined as the coordinate information of each target key point.
In one implementation, the key points may include, for example, key points of an eye region. Therefore, the target image to be processed, which comprises the first face area and each key point of the eye area is located at the preset position, can be constructed.
The key point detection is carried out on the face area, then the face area is aligned to obtain a target image to be processed, the situations that a side face exists in the target image to be processed and the like can be avoided, the face in the target image to be processed is enabled to be clearer, and the accuracy of age prediction is improved.
As an implementation manner of the embodiment of the present invention, after the electronic device inputs the target image to be processed into the infrared convolutional neural network model obtained through pre-training, and obtains the first predicted age distribution of the person corresponding to the first face region, the electronic device may further calculate a sum of products of each age value and the corresponding probability in the first predicted age distribution, and use the calculation result as the predicted age value of the person corresponding to the first face region.
And calculating a specific predicted age value according to the predicted age distribution so as to obtain an accurate age prediction result.
As shown in fig. 7, an age prediction apparatus for infrared images according to an embodiment of the present invention includes:
an infrared image obtaining module 710, configured to obtain an infrared image to be processed;
a face region detection module 720, configured to detect a first face region in the infrared image to be processed, and construct a target image to be processed including the first face region; the size of the target image to be processed is a preset size;
the age prediction module 730 is configured to input the target image to be processed into a pre-trained infrared convolutional neural network model to obtain a first predicted age distribution of a person corresponding to the first face region, where the first predicted age distribution obeys gaussian distribution; after each infrared sample image is input into an initial infrared convolutional neural network model, adjusting each parameter in the initial infrared convolutional neural network model according to the difference value of the age distribution corresponding to each infrared sample image output by the initial infrared convolutional neural network model and the Gaussian distribution generated by the corresponding age labeling result and the difference value of the expected value of the age distribution corresponding to each infrared sample image and the corresponding age labeling result, wherein the age distribution obeys the Gaussian distribution; the infrared sample image and the corresponding age labeling result are determined according to a convolutional neural network model obtained through pre-training, and the convolutional neural network model is obtained through color image training.
As can be seen from the above, the apparatus for predicting the age of the face in the infrared image according to the embodiment of the present invention can determine the infrared sample image and the corresponding age labeling result based on the convolutional neural network model obtained by color image training, and further train the infrared convolutional neural network model capable of predicting the age of the face in the infrared image according to the determined infrared sample image and the corresponding age labeling result. And compared with the manual age calibration, the infrared sample image and the corresponding age labeling result are determined through the convolutional neural network model, so that the human resources can be saved, and the sample acquisition efficiency is improved. In addition, when the infrared convolution neural network model is trained, after the initial infrared convolution neural network model is input according to each infrared sample image, the difference value of the age distribution corresponding to each infrared sample image output by the initial infrared convolution neural network model and the Gaussian distribution generated by the corresponding age labeling result, and the difference value of the expected value of the age distribution corresponding to each infrared sample image and the corresponding age labeling result are adjusted, and each parameter in the initial infrared convolution neural network model is adjusted.
Optionally, the apparatus further comprises:
an infrared model building module, configured to build an initial infrared convolutional neural network model, where the initial infrared convolutional neural network model includes: a convolution layer, a pooling layer, and a full-link layer;
the infrared sample image determining module is used for determining each infrared sample image and an age labeling result corresponding to each infrared sample image;
the Gaussian distribution generating module is used for generating Gaussian distribution of the age labeling result corresponding to each infrared sample image;
and the infrared convolutional neural network model training module is used for inputting each infrared sample image into the initial infrared convolutional neural network model to obtain the age distribution corresponding to each infrared sample image, calculating the difference value of the Gaussian distribution generated by the age distribution corresponding to each infrared sample image and the corresponding age labeling result, and adjusting each parameter in the initial infrared convolutional neural network model according to the calculation result to obtain the infrared convolutional neural network model.
Optionally, the infrared sample image determining module includes:
the image set acquisition sub-module is used for acquiring a plurality of image sets, wherein the initial infrared images in each image set are different face images of the same person in the same period, and the number of the initial infrared images in each image set is greater than a preset number threshold;
the face region detection submodule is used for detecting a second face region in each initial infrared image aiming at each image set and constructing each initial target image containing each second face region;
the age range determining submodule is used for inputting each initial target image into a convolutional neural network model obtained through pre-training to obtain second predicted age distribution of people corresponding to each second face area and determining an age range corresponding to each second predicted age distribution; the convolutional neural network model is obtained by adjusting parameters in the initial convolutional neural network model to obtain a candidate neural network model and adjusting the candidate neural network model according to the difference value between the age distribution corresponding to each sample image output by the initial convolutional neural network model and the Gaussian distribution generated by the corresponding age labeling result and the difference value between the expected value of the age distribution corresponding to each sample image and the corresponding age labeling result after each sample image is input into the initial convolutional neural network model, wherein the second predicted age distribution obeys Gaussian distribution, and each sample image is a color image;
and the infrared sample determining submodule is used for removing the initial target images with abnormal age ranges in the image set aiming at each image set to obtain the residual target images, calculating the normal age ranges corresponding to all the residual target images, taking the residual target images contained in the normal age ranges as the infrared sample images, and taking the mean value of the age ranges corresponding to the infrared sample images as the age labeling result of the infrared sample images.
Optionally, the infrared sample determination sub-module is specifically configured to:
for each image set, sequencing the initial target images according to the sequence of the minimum value of the age range corresponding to the initial target images in the image set from small to large;
determining a first age range located one quarter and a second age range located three quarters, and a minimum value of the first age range and a maximum value of the second age range;
and removing the initial target image with the age value smaller than the difference between the minimum value and the preset value and the initial target image with the age value larger than the sum of the maximum value and the preset value in the corresponding age range to obtain the residual target image.
Optionally, the infrared sample determination sub-module is specifically configured to:
calculating the mean value and the standard deviation of the age range corresponding to all the residual target images;
acquiring a preset hyper-parameter;
and calculating the product of the hyperparameter and the standard deviation, taking the difference between the mean value and the product as the minimum value of the normal age range, and taking the sum of the mean value and the product as the maximum value of the normal age range.
Optionally, the infrared sample image determining module further includes:
a network model construction submodule for constructing an initial convolutional neural network model, the initial convolutional neural network model comprising: a convolution layer, a pooling layer, and a full-link layer;
the system comprises a sample image acquisition submodule and a data processing submodule, wherein the sample image acquisition submodule is used for acquiring each sample image and an age labeling result corresponding to each sample image;
the Gaussian distribution generation submodule is used for generating Gaussian distribution of the age labeling result corresponding to each sample image;
and the convolutional neural network model training submodule is used for inputting each sample image into the initial convolutional neural network model to obtain the age distribution corresponding to each sample image, calculating the difference value of the age distribution corresponding to each sample image and the Gaussian distribution generated by the corresponding age labeling result, and the difference value of the expected value of the age distribution corresponding to each sample image and the corresponding age labeling result, adjusting each parameter in the initial convolutional neural network model according to the calculation result to obtain a candidate neural network model, and adjusting the candidate neural network model to obtain the convolutional neural network model.
Optionally, the gaussian distribution generation submodule is specifically configured to:
and constructing a Gaussian distribution taking the age labeling result corresponding to the sample image as the center and the preset standard deviation as the peak width as the Gaussian distribution of the age labeling result corresponding to the sample image for each sample image.
Optionally, the apparatus further comprises:
the test image acquisition module is used for acquiring infrared test images and age labeling results corresponding to the infrared test images; the infrared test image is different from the infrared sample image;
the test precision determining module is used for determining the test precision of the infrared convolution neural network model according to the infrared test images and age labeling results corresponding to the infrared test images;
and the processing module is used for taking the current infrared convolutional neural network model as an initial infrared convolutional neural network model when the test precision is smaller than a preset precision threshold value, triggering the infrared sample image determining module, and taking the current infrared convolutional neural network model as a final infrared convolutional neural network model when the test precision is not smaller than the preset precision threshold value.
Optionally, the face region detecting module 720 includes:
the key point detection submodule is used for carrying out key point detection on the first face area to obtain coordinate information of each target key point of the first face area; wherein, each target key point is a point for identifying the human face contour feature;
and the target image construction submodule is used for aligning the first face area according to the coordinate information of each target key point to obtain a target image to be processed, which contains the first face area and is located at a preset position by each target key point.
Optionally, the apparatus further comprises:
and the age value calculation module is used for calculating the sum of products of all age values and corresponding probabilities in the first predicted age distribution and taking the calculation result as the predicted age value of the person corresponding to the first face area.
The above device embodiment corresponds to the method embodiment, and has the same technical effect as the method embodiment, and for the specific description, refer to the method embodiment. The device embodiment is obtained based on the method embodiment, and for specific description, reference may be made to the method embodiment section, which is not described herein again.
Those of ordinary skill in the art will understand that: the figures are merely schematic representations of one embodiment, and the blocks or flow diagrams in the figures are not necessarily required to practice the present invention.
Those of ordinary skill in the art will understand that: modules in the devices in the embodiments may be distributed in the devices in the embodiments according to the description of the embodiments, or may be located in one or more devices different from the embodiments with corresponding changes. The modules of the above embodiments may be combined into one module, or further split into multiple sub-modules.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (8)

1. An age prediction method for infrared images, the method comprising:
acquiring an infrared image to be processed;
detecting a first face area in the infrared image to be processed, and constructing a target image to be processed containing the first face area; the size of the target image to be processed is a preset size;
inputting the target image to be processed into an infrared convolution neural network model obtained through pre-training to obtain a first predicted age distribution of a person corresponding to the first face area, wherein the first predicted age distribution obeys Gaussian distribution;
after each infrared sample image is input into an initial infrared convolutional neural network model, adjusting each parameter in the initial infrared convolutional neural network model according to a difference value between an age distribution corresponding to each infrared sample image output by the initial infrared convolutional neural network model and a Gaussian distribution generated by a corresponding age labeling result and a difference value between an expected value of the age distribution corresponding to each infrared sample image and a corresponding age labeling result, wherein the age distribution corresponding to each infrared sample image is obtained by means of adjusting the parameters in the initial infrared convolutional neural network model; the infrared sample image and the corresponding age labeling result are determined according to a convolutional neural network model obtained through pre-training, and the convolutional neural network model obtained through pre-training is obtained through color image training;
the method for determining the infrared sample image and the corresponding age labeling result comprises the following steps:
acquiring a plurality of image sets, wherein the initial infrared images in each image set are different face images of the same person in the same period, and the number of the initial infrared images in each image set is greater than a preset number threshold;
detecting a second face region in each initial infrared image aiming at each image set, and constructing each initial target image containing each second face region;
inputting each initial target image into a convolutional neural network model obtained by pre-training to obtain second predicted age distribution of people corresponding to each second face area, and determining an age range corresponding to each second predicted age distribution; after each sample image is input into an initial convolutional neural network model, adjusting each parameter in the initial convolutional neural network model to obtain a candidate neural network model according to a difference value between an age distribution corresponding to each sample image output by the initial convolutional neural network model and a Gaussian distribution generated by a corresponding age labeling result and a difference value between an expected value of the age distribution corresponding to each sample image and the corresponding age labeling result, and obtaining the second predicted age distribution Gaussian distribution, wherein each sample image is a color image;
for each image set, sequencing the initial target images according to the sequence of the minimum value of the age range corresponding to the initial target images in the image set from small to large;
determining a first age range located one quarter and a second age range located three quarters, and a minimum value of the first age range and a maximum value of the second age range;
removing the initial target image in the corresponding age range, wherein the initial target image comprises the difference between the minimum value of the age value smaller than the first age range and a preset value, and the initial target image comprises the age value larger than the sum of the maximum value and the preset value, so as to obtain the residual target image;
and calculating the normal age range corresponding to all the residual target images, taking the residual target images contained in the normal age range as infrared sample images, and taking the average value of the age range corresponding to each infrared sample image as the age labeling result of each infrared sample image.
2. The method of claim 1, wherein the training process of the pre-training of the obtained infrared convolutional neural network model comprises:
constructing an initial infrared convolution neural network model, wherein the initial infrared convolution neural network model comprises the following steps: a convolution layer, a pooling layer, and a full-link layer;
determining each infrared sample image and an age labeling result corresponding to each infrared sample image;
generating Gaussian distribution of age labeling results corresponding to the infrared sample images;
inputting each infrared sample image into the initial infrared convolution neural network model to obtain the age distribution corresponding to each infrared sample image, calculating the difference value of the age distribution corresponding to each infrared sample image and the Gaussian distribution generated by the corresponding age labeling result, and the difference value of the expected value of the age distribution corresponding to each infrared sample image and the corresponding age labeling result, and adjusting each parameter in the initial infrared convolution neural network model according to the calculation result to obtain the infrared convolution neural network model obtained by pre-training.
3. The method of claim 1, wherein the calculating the normal age range for all remaining target images comprises:
calculating the mean value and the standard deviation of the age range corresponding to all the residual target images;
acquiring a preset hyper-parameter;
and calculating the product of the hyperparameter and the standard deviation, taking the difference between the mean value and the product as the minimum value of the normal age range, and taking the sum of the mean value and the product as the maximum value of the normal age range.
4. The method of claim 1, wherein the training process of the pre-trained convolutional neural network model comprises:
constructing an initial convolutional neural network model, wherein the initial convolutional neural network model comprises: a convolution layer, a pooling layer, a full-link layer;
acquiring each sample image and an age labeling result corresponding to each sample image;
generating Gaussian distribution of age labeling results corresponding to the sample images;
inputting each sample image into the initial convolutional neural network model to obtain age distribution corresponding to each sample image, calculating a difference value of the age distribution corresponding to each sample image and Gaussian distribution generated by a corresponding age labeling result, and a difference value of an expected value of the age distribution corresponding to each sample image and the corresponding age labeling result, adjusting each parameter in the initial convolutional neural network model according to the calculation result to obtain a candidate neural network model, and adjusting the candidate neural network model to obtain the convolutional neural network model.
5. The method of claim 4, wherein the generating the Gaussian distribution of the age labeling result corresponding to each sample image comprises:
and constructing Gaussian distribution taking the age labeling result corresponding to the sample image as the center and the preset standard deviation as the peak width as the Gaussian distribution of the age labeling result corresponding to the sample image for each sample image in the sample images.
6. The method of claim 2, wherein after obtaining the pre-trained infrared convolutional neural network model, the method further comprises:
acquiring infrared test images and age labeling results corresponding to the infrared test images; the infrared test image is different from the infrared sample image;
determining the testing precision of the infrared convolution neural network model obtained by pre-training according to the infrared testing images and the age labeling results corresponding to the infrared testing images;
and when the test precision is smaller than a preset precision threshold value, taking the current infrared convolution neural network model as an initial infrared convolution neural network model, returning to execute the steps of determining each infrared sample image and the age labeling result corresponding to each infrared sample image, and taking the current infrared convolution neural network model as a final infrared convolution neural network model when the test precision is not smaller than the preset precision threshold value.
7. The method according to any one of claims 1 to 6, wherein the constructing the target image to be processed including the first face region includes:
detecting key points of the first face area to obtain coordinate information of each target key point of the first face area; wherein, each target key point is a point for identifying the human face contour feature;
and according to the coordinate information of each target key point, after the first face area is aligned, obtaining a target image to be processed, which contains the first face area and is located at a preset position by each target key point.
8. An age prediction apparatus for infrared images, the apparatus comprising:
the infrared image acquisition module is used for acquiring an infrared image to be processed;
the human face area detection module is used for detecting a first human face area in the infrared image to be processed and constructing a target image to be processed containing the first human face area; the size of the target image to be processed is a preset size;
the age prediction module is used for inputting the target image to be processed into an infrared convolution neural network model obtained through pre-training to obtain a first predicted age distribution of a person corresponding to the first face area, wherein the first predicted age distribution obeys Gaussian distribution; after each infrared sample image is input into an initial infrared convolutional neural network model, adjusting each parameter in the initial infrared convolutional neural network model according to a difference value between an age distribution corresponding to each infrared sample image output by the initial infrared convolutional neural network model and a Gaussian distribution generated by a corresponding age labeling result and a difference value between an expected value of the age distribution corresponding to each infrared sample image and a corresponding age labeling result, wherein the age distribution corresponding to each infrared sample image is obtained by means of adjusting the parameters in the initial infrared convolutional neural network model; the infrared sample image and the corresponding age labeling result are determined according to a convolutional neural network model obtained through pre-training, and the convolutional neural network model obtained through pre-training is obtained through color image training;
the device further comprises:
the infrared sample image determining module is used for determining each infrared sample image and an age labeling result corresponding to each infrared sample image;
the infrared sample image determination module includes:
the image set acquisition sub-module is used for acquiring a plurality of image sets, wherein the initial infrared images in each image set are different face images of the same person in the same period, and the number of the initial infrared images in each image set is greater than a preset number threshold;
the face region detection submodule is used for detecting a second face region in each initial infrared image aiming at each image set and constructing each initial target image containing each second face region;
the age range determining submodule is used for inputting each initial target image into a convolutional neural network model obtained through pre-training to obtain second predicted age distribution of people corresponding to each second face area and determining an age range corresponding to each second predicted age distribution; after each sample image is input into an initial convolutional neural network model, adjusting each parameter in the initial convolutional neural network model to obtain a candidate neural network model according to a difference value between an age distribution corresponding to each sample image output by the initial convolutional neural network model and a Gaussian distribution generated by a corresponding age labeling result and a difference value between an expected value of the age distribution corresponding to each sample image and the corresponding age labeling result, and obtaining the second predicted age distribution Gaussian distribution, wherein each sample image is a color image;
the infrared sample determining submodule is used for removing the initial target images with abnormal age ranges in the image set aiming at each image set to obtain residual target images, calculating the normal age ranges corresponding to all the residual target images, taking the residual target images contained in the normal age ranges as the infrared sample images, and taking the mean value of the age ranges corresponding to the infrared sample images as the age labeling result of the infrared sample images;
the infrared sample determination submodule is specifically configured to:
for each image set, sequencing the initial target images according to the sequence of the minimum value of the age range corresponding to the initial target images in the image set from small to large;
determining a first age range located one quarter and a second age range located three quarters, and a minimum value of the first age range and a maximum value of the second age range;
and removing the initial target image in the corresponding age range, wherein the initial target image comprises the difference between the minimum value of the age value smaller than the first age range and a preset value, and the initial target image comprises the age value larger than the sum of the maximum value and the preset value, so as to obtain the residual target image.
CN201910669644.2A 2019-07-24 2019-07-24 Age prediction method and device for infrared image Active CN112307796B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910669644.2A CN112307796B (en) 2019-07-24 2019-07-24 Age prediction method and device for infrared image
PCT/CN2019/108078 WO2021012383A1 (en) 2019-07-24 2019-09-26 Age prediction method and device for infrared image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910669644.2A CN112307796B (en) 2019-07-24 2019-07-24 Age prediction method and device for infrared image

Publications (2)

Publication Number Publication Date
CN112307796A CN112307796A (en) 2021-02-02
CN112307796B true CN112307796B (en) 2022-06-24

Family

ID=74193104

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910669644.2A Active CN112307796B (en) 2019-07-24 2019-07-24 Age prediction method and device for infrared image

Country Status (2)

Country Link
CN (1) CN112307796B (en)
WO (1) WO2021012383A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112950631B (en) * 2021-04-13 2023-06-30 西安交通大学口腔医院 Age estimation method based on saliency map constraint and X-ray head cranium positioning side image
CN113435118A (en) * 2021-06-25 2021-09-24 上海眼控科技股份有限公司 Irradiance determination method, irradiance determination device, irradiance determination equipment and storage medium
CN113456031A (en) * 2021-08-09 2021-10-01 首都医科大学附属北京天坛医院 Training device and prediction device of brain state prediction model and electronic equipment
CN117409450A (en) * 2022-07-05 2024-01-16 华为技术有限公司 Age identification method and device, electronic equipment and storage medium
CN115862118B (en) * 2023-01-29 2023-05-23 南京开为网络科技有限公司 Face age estimation method and device based on Gaussian distribution hypothesis and MAE loss

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106503623A (en) * 2016-09-27 2017-03-15 中国科学院自动化研究所 Facial image age estimation method based on convolutional neural networks
CN107169454A (en) * 2017-05-16 2017-09-15 中国科学院深圳先进技术研究院 A kind of facial image age estimation method, device and its terminal device

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7694887B2 (en) * 2001-12-24 2010-04-13 L-1 Secure Credentialing, Inc. Optically variable personalized indicia for identification documents
US20190034706A1 (en) * 2010-06-07 2019-01-31 Affectiva, Inc. Facial tracking with classifiers for query evaluation
US10779761B2 (en) * 2010-06-07 2020-09-22 Affectiva, Inc. Sporadic collection of affect data within a vehicle
KR101754154B1 (en) * 2016-01-25 2017-07-05 주식회사 에스원 Fever Patient Monitering Syatem at Public Place by Using Multiple Band Camera and Statistical Sampling and Method thereof
CN106485235B (en) * 2016-10-24 2019-05-03 厦门美图之家科技有限公司 A kind of convolutional neural networks generation method, age recognition methods and relevant apparatus
CN108537026A (en) * 2018-03-30 2018-09-14 百度在线网络技术(北京)有限公司 application control method, device and server
CN108446676B (en) * 2018-05-03 2020-08-25 南京信息工程大学 Face image age discrimination method based on ordered coding and multilayer random projection
CN108960061A (en) * 2018-06-01 2018-12-07 Oppo广东移动通信有限公司 Control method, control device, electronic device, computer equipment and storage medium
CN109190449A (en) * 2018-07-09 2019-01-11 北京达佳互联信息技术有限公司 Age recognition methods, device, electronic equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106503623A (en) * 2016-09-27 2017-03-15 中国科学院自动化研究所 Facial image age estimation method based on convolutional neural networks
CN107169454A (en) * 2017-05-16 2017-09-15 中国科学院深圳先进技术研究院 A kind of facial image age estimation method, device and its terminal device

Also Published As

Publication number Publication date
CN112307796A (en) 2021-02-02
WO2021012383A1 (en) 2021-01-28

Similar Documents

Publication Publication Date Title
CN112307796B (en) Age prediction method and device for infrared image
US10223582B2 (en) Gait recognition method based on deep learning
CN110070029B (en) Gait recognition method and device
US11113597B2 (en) Artificial neural network and method of training an artificial neural network with epigenetic neurogenesis
CN108053025B (en) Multi-column neural network medical image analysis method and device
CN106612511B (en) Wireless network throughput evaluation method and device based on support vector machine
CN113642431A (en) Training method and device of target detection model, electronic equipment and storage medium
CN114297036A (en) Data processing method and device, electronic equipment and readable storage medium
Berthomier et al. Cloud cover nowcasting with deep learning
CN115496740A (en) Lens defect detection method and system based on convolutional neural network
CN108470194B (en) Feature screening method and device
CN112287726B (en) Infrared sample image acquisition method and device
CN114722958A (en) Network training and target detection method and device, electronic equipment and storage medium
CN112200173A (en) Multi-network model training method, image labeling method and face image recognition method
Pessa et al. Mapping images into ordinal networks
Segú et al. A general framework for uncertainty estimation in deep learning
EP4009236A1 (en) Method for determining a semantic segmentation of an environment of a vehicle
Yong et al. Coalitional Bayesian autoencoders: Towards explainable unsupervised deep learning with applications to condition monitoring under covariate shift
CN111949530B (en) Test result prediction method and device, computer equipment and storage medium
Yong et al. Complex number‐based image quality assessment using singular value decomposition
CN113808088A (en) Pollution detection method and system
US11250319B1 (en) Circuit architecture with biased randomization
Chen et al. Class‐wise boundary regression by uncertainty in temporal action detection
CN111132052A (en) Intelligent safety campus positioning method, system, equipment and readable storage medium
Peng et al. LITHIUM‐ION BATTERY REMAINING USEFUL LIFE ESTIMATION BASED ON ENSEMBLE LEARNING WITH LS‐SVM ALGORITHM

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20211125

Address after: 215100 floor 23, Tiancheng Times Business Plaza, No. 58, qinglonggang Road, high speed rail new town, Xiangcheng District, Suzhou, Jiangsu Province

Applicant after: MOMENTA (SUZHOU) TECHNOLOGY Co.,Ltd.

Address before: Room 601-a32, Tiancheng information building, No. 88, South Tiancheng Road, high speed rail new town, Xiangcheng District, Suzhou City, Jiangsu Province

Applicant before: MOMENTA (SUZHOU) TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant