Human face age estimation method and device based on artificial intelligence
By introducing a gender judgment model and corresponding age identification method into the face age estimation method, combining gender judgment to improve the accuracy and efficiency of age estimation, the problem of poor combination of age recognition and gender judgment in the prior art is solved.
Patent Information
- Application Number
- CN202411470132.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2025-02-07
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing artificial intelligence-based face age estimation method fails to effectively combine age recognition and gender judgment, resulting in an increase in estimation result bias and computational data.
By introducing a gender judgment model, gender judgment is performed on the facial information of the face image, and the corresponding male or female age identification method is selected for age judgment based on the gender results, or a comprehensive age judgment method is adopted.
It improves the accuracy and efficiency of face age estimation, reduces the increase in computational data, and can recognize images as non-portraits when gender or age cannot be judged, enhancing the reliability of the system.
Smart Images

Figure CN119399811A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of age recognition, and in particular to a method and device for estimating human face age based on artificial intelligence. Background Art
[0002] With the continuous development of society and the rapid improvement of science and technology, a safe, reliable and portable identity authentication has become a common demand of society. Compared with traditional identity authentication methods (such as password authentication, smart card authentication, dynamic password authentication, etc.), biometric technology provides higher security, more complex anti-counterfeiting and better portability. The estimation of facial age has broad application prospects in security monitoring, human-computer interaction, marketing and other fields. In the lottery industry, ensuring compliance is crucial, especially preventing minors from buying lottery tickets, which is an important technical application.
[0003] However, when it comes to facial age recognition, many existing age estimation models do not fully consider gender differences. There are significant differences in the facial feature changes and aging process between men and women. Ignoring this factor may lead to deviations in the estimation results and a sudden increase in the amount of calculated data. Summary of the invention
[0004] In view of the problems existing in the existing artificial intelligence-based face age estimation and devices, the present invention is proposed.
[0005] Therefore, the problem to be solved by the present invention is that age recognition and gender cannot be effectively combined.
[0006] In order to solve the above technical problems, the present invention provides the following technical solutions: In a first aspect, an embodiment of the present invention provides a method for estimating the age of a human face based on artificial intelligence, which comprises the following steps: Collecting face images and extracting face information from the face images; A gender judgment model is introduced to judge the facial information of the human face and obtain the gender corresponding to the facial image; Based on the age recognition model, combined with the gender corresponding to the face image, the age corresponding to the face image is obtained; The age recognition model uses a male age recognition method, a female age recognition method, or a combination of the male age recognition method and the female age recognition method for output according to the gender corresponding to the face image.
[0007] As a preferred solution of the method for estimating human face age based on artificial intelligence of the present invention, when extracting facial information of a human face image, the specific steps include: Preprocessing of face images; Extracting line information of the preprocessed face image, and obtaining the contour of the face image according to the line information; Acquire local features of the face within the contour of the face image; Combine local features of the face to form complete facial information; The local features of the face include eyes, eyebrows, nose, mouth, and facial shape.
[0008] As a preferred solution of the method for estimating human face age based on artificial intelligence of the present invention, wherein: the gender determination model includes a facial shape determination method, an eye and eyebrow determination method, and a nose and mouth determination method; The facial shape determination method comprises: Obtain the distinguishing features of forehead width between men and women, and determine whether the forehead width in the facial information belongs to a male feature or a female feature; Obtain the distinguishing features of the difference in the length of the three parts of the face between men and women, and determine whether the difference in the length of the three parts of the face in the facial information belongs to male characteristics or female characteristics; Obtain the distinguishing features of the chin of men and women, and determine whether the chin difference in the facial information belongs to male or female characteristics; Combining the three sets of judgment results, the output result of the facial shape judgment method is given; The eyes and eyebrows judgment method includes: Obtain the distinguishing features of eye size between males and females, and determine whether the eye size in the facial information belongs to male or female features; Obtain the distinguishing features of eyelid curvature between men and women, and determine whether the eyelid curvature in the facial information belongs to male or female features; Obtain the distinguishing features of eyebrow thickness between men and women, and determine whether the eyebrow thickness in the facial information belongs to male or female characteristics; Combining the three sets of judgment results, the output results of the eye and eyebrow judgment method are given; The nose and mouth judgment method includes: Obtain the distinguishing features of nose size between males and females, and determine whether the nose size in the facial information belongs to male or female features; Obtain the distinguishing features of the width of the mouth of men and women, and determine whether the width of the mouth in the facial information is a male feature or a female feature; Combining the two sets of judgment results, the output results of the nose and mouth judgment methods are given.
[0009] As a preferred solution of the method for estimating human face age based on artificial intelligence of the present invention, the operation step of the gender determination model further includes: Set the initial score; Set the maximum scores for the facial shape judgment method, the eyes and eyebrows judgment method, and the nose and mouth judgment method; According to each judgment result in the facial shape judgment method, the corresponding score is given, and finally the total score is calculated; According to each judgment result in the eye and eyebrow judgment method, give the corresponding score, and finally calculate the total score; According to each judgment result of the nose and mouth judgment method, give the corresponding score, and finally calculate the total score; Then add the total scores of the three groups together to obtain the output score of the gender judgment model; Compare the output score of the gender judgment model with the initial score. When the output score of the gender judgment model is greater than the judgment threshold N, the output result is male. When the output score of the gender judgment model is less than the judgment threshold V, the output result is female. When the output score of the gender judgment model is less than the judgment threshold N and greater than the judgment threshold V, the gender judgment model does not output a result. Among them, the facial shape judgment method, the eyes and eyebrows judgment method, and the nose and mouth judgment method have positive scores when the characteristics are judged as male, and positive scores when the characteristics are judged as female.
[0010] As a preferred solution of the method for estimating human face age based on artificial intelligence of the present invention, the operation steps of the age recognition model include: The output result of the gender judgment model is obtained. When the result is output as male, it is judged by the male age identification method. When the result is output as female, it is judged by the female age identification method. When no result is output, it is judged by the male age identification method and the female age identification method respectively, and the judgment results are output comprehensively.
[0011] As a preferred solution of the artificial intelligence-based face age estimation method of the present invention, the operation steps of the male age identification method include: Get the maximum age of males; Select a male photo of any age from the database, compare the features of the selected male photo and the collected face image, and when the comparison result is that the features of the collected face image are older than the features of the selected male photo, calculate the middle number between the selected age and the maximum male age, and make a judgment once, and when the comparison result is that the features of the collected face image are younger than the features of the selected male photo, output half of the selected age, and make a second judgment, and when the comparison result is that the features of the collected face image are equal to the features of the selected male photo, output the age of the selected male photo as the age of the collected face image; The one-time judgment includes selecting a male photo of an intermediate age from a database, and then comparing the selected male photo with the collected face image. When the comparison result shows that the feature of the collected face image is older than the feature of the selected male photo, the middle number between the selected age and the maximum male age is calculated, and then the judgment is repeated until the feature of the collected face image is younger than or equal to the feature of the selected male photo; when the comparison result shows that the feature of the collected face image is younger than the feature of the selected male photo, the middle value of the two selected ages is output, and the judgment is repeated until the feature of the collected face image is equal to the feature of the selected male photo; when the comparison result shows that the feature of the collected face image is equal to the feature of the selected male photo, the age of the selected male photo is output as the age of the collected face image; The secondary judgment includes selecting a male photo of half the age from the database, and then comparing the selected male photo with the collected face image. When the comparison result shows that the feature of the collected face image is younger than the feature of the selected male photo, half of the selected age is output, and then the judgment is repeated until the feature of the collected face image is older than or equal to the feature of the selected male photo; when the comparison result shows that the feature of the collected face image is older than the feature of the selected male photo, the middle value of the two selected ages is output, and the judgment is repeated until the feature of the collected face image is equal to the feature of the selected male photo; when the comparison result shows that the feature of the collected face image is equal to the feature of the selected male photo, the age of the selected male photo is output as the age of the collected face image; The operation steps of the female age identification method include: Get the maximum age of female; Select a female photo of any age from the database, compare the features of the selected female photo and the collected face image, and when the comparison result is that the features of the collected face image are older than the features of the selected female photo, calculate the middle number between the selected age and the maximum female age, and make a judgment once, and when the comparison result is that the features of the collected face image are younger than the features of the selected female photo, output half of the selected age, and make a second judgment, and when the comparison result is that the features of the collected face image are equal to the features of the selected female photo, output the age of the selected female photo as the age of the collected face image; The one-time judgment includes selecting a female photo of an intermediate age from a database, and then comparing the features of the selected female photo and the collected face image; when the comparison result is that the features of the collected face image are older than the features of the selected female photo, the middle number between the selected age and the maximum female age is calculated, and then the judgment is repeated until the features of the collected face image are younger than or equal to the features of the selected female photo; when the comparison result is that the features of the collected face image are younger than the features of the selected female photo, the middle value of the twice selected ages is output, and the judgment is repeated until the features of the collected face image are equal to the features of the selected female photo; when the comparison result is that the features of the collected face image are equal to the features of the selected female photo, the age of the selected female photo is output as the age of the collected face image; The secondary judgment includes selecting a female photo of half the age from a database, and then comparing the features of the selected female photo and the collected facial image; when the comparison result is that the features of the collected facial image are younger than the features of the selected female photo, half of the selected age is output, and then the judgment is made again until the features of the collected facial image are older than or equal to the features of the selected female photo; when the comparison result is that the features of the collected facial image are older than the features of the selected female photo, the middle value of the two selected ages is output, and the judgment is made again until the features of the collected facial image are equal to the features of the selected female photo; when the comparison result is that the features of the collected facial image are equal to the features of the selected female photo, the age of the selected female photo is output as the age of the collected facial image.
[0012] As a preferred solution of the face age estimation method based on artificial intelligence of the present invention, the steps of making judgments respectively by the male age identification method and the female age identification method and outputting the judgment results comprehensively include: The collected face images are used to output the first-level age through the male age identification method; The collected face images are used to output the secondary age through the female age identification method; The median values of the primary age and the secondary age are calculated, and multiple groups of male photos and multiple groups of female photos with the median age are extracted from the database; The collected facial images are compared with multiple groups of male photos and multiple groups of female photos respectively. When the comparison result shows that the overlap is greater than a preset value, the middle age is output as the age of the collected facial image. When the comparison result shows that the overlap is not greater than a preset value, the image is output as unrecognizable and an abnormal log is generated.
[0013] In a second aspect, an embodiment of the present invention provides a face age estimation device based on artificial intelligence, which includes: a collection module, a gender judgment module, and an age recognition module; The acquisition module is used to acquire face images and extract face information from the face images; The gender determination module is used to determine the gender of a person's facial information; The age recognition module is used to judge the age of a person based on facial information.
[0014] In a third aspect, an embodiment of the present invention provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, wherein: when the processor executes the computer program, any step of the above-mentioned artificial intelligence-based face age estimation method is implemented.
[0015] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, any step of the above-mentioned artificial intelligence-based face age estimation method is implemented.
[0016] The beneficial effects of the present invention are as follows: through the use of a gender judgment model, the gender of a facial image can be accurately judged, and based on the gender distinction, the corresponding male age identification method and female age identification method are selected to judge the age of the facial image, which can reduce the calculation of data, and combined with the gender distinction, the calculation of age can be more accurate. For some facial images whose gender cannot be judged, a comprehensive age judgment is used. When the age still cannot be judged, it indicates that the inserted facial image cannot be recognized, which also means that the photo is most likely not a portrait photo. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them: Figure 1 The flowchart of the face age estimation method based on artificial intelligence.
[0018] Figure 2 Diagram of the facial image preprocessing steps for the artificial intelligence-based facial age estimation method. DETAILED DESCRIPTION
[0019] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.
[0020] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0021] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.
[0022] The present invention is described in detail with reference to schematic diagrams. When describing the embodiments of the present invention, for the sake of convenience, the cross-sectional diagrams showing the device structure will not be partially enlarged according to the general scale, and the schematic diagrams are only examples, which should not limit the scope of protection of the present invention. In addition, in actual production, the three-dimensional dimensions of length, width and depth should be included.
[0023] At the same time, in the description of the present invention, it should be noted that the directions or positional relationships indicated by the terms "upper, lower, inner and outer" are based on the directions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as limiting the present invention. In addition, the terms "first, second or third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0024] In the present invention, unless otherwise clearly specified and limited, the terms "install, connect, connect" should be understood in a broad sense, for example: it can be a fixed connection, a detachable connection or an integral connection; it can also be a mechanical connection, an electrical connection or a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0025] Example 1 Reference Figure 1 and Figure 2, which is the first embodiment of the present invention, and provides a method for estimating the age of a human face based on artificial intelligence, comprising the following steps: S1. Collecting a face image and extracting face information from the face image.
[0026] like Figure 2 As shown, when extracting facial information from a face image, the specific steps include: Preprocessing of face images; Extracting line information of the preprocessed face image, and obtaining the contour of the face image according to the line information; Acquire local features of the face within the contour of the face image; Combine local features of the face to form complete facial information; The local features of the face include eyes, eyebrows, nose, mouth, and facial shape.
[0027] S1. Introduce a gender judgment model to judge the facial information of the face and obtain the gender corresponding to the face image.
[0028] The gender judgment model includes a facial shape judgment method, an eye and eyebrow judgment method, and a nose and mouth judgment method; The facial shape determination method comprises: Obtain the distinguishing features of forehead width between men and women, and determine whether the forehead width in the facial information belongs to a male feature or a female feature; Obtain the distinguishing features of the difference in the length of the three parts of the face between men and women, and determine whether the difference in the length of the three parts of the face in the facial information belongs to male characteristics or female characteristics; Obtain the distinguishing features of the chin of men and women, and determine whether the chin difference in the facial information belongs to male or female characteristics; Combining the three sets of judgment results, the output result of the facial shape judgment method is given; The eyes and eyebrows judgment method includes: Obtain the distinguishing features of eye size between males and females, and determine whether the eye size in the facial information belongs to male or female features; Obtain the distinguishing features of eyelid curvature between men and women, and determine whether the eyelid curvature in the facial information belongs to male or female features; Obtain the distinguishing features of eyebrow thickness between men and women, and determine whether the eyebrow thickness in the facial information belongs to male or female characteristics; Combining the three sets of judgment results, the output results of the eye and eyebrow judgment method are given; The nose and mouth judgment method includes: Obtain the distinguishing features of nose size between males and females, and determine whether the nose size in the facial information belongs to male or female features; Obtain the distinguishing features of the width of the mouth of men and women, and determine whether the width of the mouth in the facial information is a male feature or a female feature; Combining the two sets of judgment results, the output results of the nose and mouth judgment methods are given.
[0029] The operation steps of the gender determination model also include: Set the initial score; Set the maximum scores for the facial shape judgment method, the eyes and eyebrows judgment method, and the nose and mouth judgment method; According to each judgment result in the facial shape judgment method, the corresponding score is given, and finally the total score is calculated; According to each judgment result in the eye and eyebrow judgment method, give the corresponding score, and finally calculate the total score; According to each judgment result of the nose and mouth judgment method, give the corresponding score, and finally calculate the total score; Then add the total scores of the three groups together to obtain the output score of the gender judgment model; Compare the output score of the gender judgment model with the initial score. When the output score of the gender judgment model is greater than the judgment threshold N, the output result is male. When the output score of the gender judgment model is less than the judgment threshold V, the output result is female. When the output score of the gender judgment model is less than the judgment threshold N and greater than the judgment threshold V, the gender judgment model does not output a result. Among them, the facial shape judgment method, the eyes and eyebrows judgment method, and the nose and mouth judgment method have positive scores when the characteristics are judged as male, and positive scores when the characteristics are judged as female.
[0030] In this embodiment, a face image (RGB color image of 256*256 pixels) is input, and the initial score is set to 50; For example, in the facial shape judgment method, by collecting historical data, we can know: Forehead width: 8 cm for male characteristics and 6 cm for female characteristics; Difference in length of the three parts: Calculate the length of the three parts (forehead, nose, chin to jaw), with the ratio of male characteristics being 2:1:1 and female characteristics being 1:1:1; Chin shape: square chin for men and pointed chin for women; When judging the results, the forehead width of the face image is 6.5 cm, so it is judged as a female feature and scored -4; the ratio of the three parts is 1:1:1.2, the output is a female feature, the score is -4; the chin is wide, the output is a male feature, the score is +4; Then the comprehensive score of the facial shape judgment method was calculated to be -4 points.
[0031] In the eye and eyebrow judgment method, historical data is collected to show that: Eye size: Male characteristics are large eyes, female characteristics are small eyes; Eyelid curvature: flat in males and curved in females; Eyebrow thickness: Men have thick eyebrows, while women have thin eyebrows. When judging the results, if the eye size is small, the output is a female feature and the score is -4; if the eyelid curvature is obvious, the output is a female feature and the score is -4; if the eyebrows are thin, the output is a female feature and the score is -4; The combined score of the eye and eyebrow judgment method was then calculated to be -12 points.
[0032] In the nose and mouth judgment method, historical data is collected, and it can be known that: Nose size: Males have large noses, females have small noses; Mouth width: Male features a wide mouth, female features a narrow mouth; When judging the results, the nose size is a big nose, the output is a male feature, and the score is +6; the mouth width is a narrow mouth, the output is a female feature, and the score is -6; Then the combined score of the nose and mouth judgment method is calculated as 0 points.
[0033] Finally, the three sets of judgment results are combined to be: 50 + (-4) + (-12) + (0) = 34; Set the threshold N=60, set the threshold V=40, and after judgment, 34<40, so the gender of the face image output is female.
[0034] S1. Based on an age recognition model and in combination with the gender corresponding to the face image, the age corresponding to the face image is obtained.
[0035] The operation steps of the age recognition model include: The output result of the gender judgment model is obtained. When the result is output as male, it is judged by the male age identification method. When the result is output as female, it is judged by the female age identification method. When no result is output, it is judged by the male age identification method and the female age identification method respectively, and the judgment results are output comprehensively.
[0036] The operation steps of the male age identification method include: Get the maximum age of males; Select a male photo of any age from the database, compare the features of the selected male photo and the collected face image, and when the comparison result is that the features of the collected face image are older than the features of the selected male photo, calculate the middle number between the selected age and the maximum male age, and make a judgment once, and when the comparison result is that the features of the collected face image are younger than the features of the selected male photo, output half of the selected age, and make a second judgment, and when the comparison result is that the features of the collected face image are equal to the features of the selected male photo, output the age of the selected male photo as the age of the collected face image; The one-time judgment includes selecting a male photo of an intermediate age from a database, and then comparing the selected male photo with the collected face image. When the comparison result shows that the feature of the collected face image is older than the feature of the selected male photo, the middle number between the selected age and the maximum male age is calculated, and then the judgment is repeated until the feature of the collected face image is younger than or equal to the feature of the selected male photo; when the comparison result shows that the feature of the collected face image is younger than the feature of the selected male photo, the middle value of the two selected ages is output, and the judgment is repeated until the feature of the collected face image is equal to the feature of the selected male photo; when the comparison result shows that the feature of the collected face image is equal to the feature of the selected male photo, the age of the selected male photo is output as the age of the collected face image; The secondary judgment includes selecting a male photo of half the age from the database, and then comparing the features of the selected male photo and the collected face image. When the comparison result is that the features of the collected face image are younger than the features of the selected male photo, half of the selected age is output, and then the judgment is made again until the features of the collected face image are older than or equal to the features of the selected male photo; when the comparison result is that the features of the collected face image are older than the features of the selected male photo, the middle value of the two selected ages is output, and the judgment is made again until the features of the collected face image are equal to the features of the selected male photo; when the comparison result is that the features of the collected face image are equal to the features of the selected male photo, the age of the selected male photo is output as the age of the collected face image.
[0037] In this example, it is assumed that the maximum age of males in the database is 80 years old; A male photo is randomly selected from the database. Assume that the selected photo is a 40-year-old male photo. The features of the collected face image are compared with the selected 40-year-old male photo. Assume that the comparison result is: the features of the collected face image are older than the features of the 40-year-old male photo; Then calculate the middle number: the maximum value is 80 years old, and the selected number is 40 years old, so the result is 60 years old. Then select a 60-year-old male photo from the database and perform feature comparison again. Assuming that the comparison result is: the features of the collected face image are younger than the features of the 60-year-old male photo, calculate the middle number between 60 and 40 again, that is, the result is 50 years old; Then select a 50-year-old male photo from the database and perform feature comparison again. Assuming the comparison result is: the collected facial image features are equal to the features of the 50-year-old male photo, the age output of the facial image is 50 years old.
[0038] The operation steps of the female age identification method include: Get the maximum age of female; Select a female photo of any age from the database, compare the features of the selected female photo and the collected face image, and when the comparison result is that the features of the collected face image are older than the features of the selected female photo, calculate the middle number between the selected age and the maximum female age, and make a judgment once, and when the comparison result is that the features of the collected face image are younger than the features of the selected female photo, output half of the selected age, and make a second judgment, and when the comparison result is that the features of the collected face image are equal to the features of the selected female photo, output the age of the selected female photo as the age of the collected face image; The one-time judgment includes selecting a female photo of an intermediate age from a database, and then comparing the features of the selected female photo and the collected face image; when the comparison result is that the features of the collected face image are older than the features of the selected female photo, the middle number between the selected age and the maximum female age is calculated, and then the judgment is repeated until the features of the collected face image are younger than or equal to the features of the selected female photo; when the comparison result is that the features of the collected face image are younger than the features of the selected female photo, the middle value of the twice selected ages is output, and the judgment is repeated until the features of the collected face image are equal to the features of the selected female photo; when the comparison result is that the features of the collected face image are equal to the features of the selected female photo, the age of the selected female photo is output as the age of the collected face image; The secondary judgment includes selecting a female photo of half the age from a database, and then comparing the features of the selected female photo and the collected facial image; when the comparison result is that the features of the collected facial image are younger than the features of the selected female photo, half of the selected age is output, and then the judgment is made again until the features of the collected facial image are older than or equal to the features of the selected female photo; when the comparison result is that the features of the collected facial image are older than the features of the selected female photo, the middle value of the two selected ages is output, and the judgment is made again until the features of the collected facial image are equal to the features of the selected female photo; when the comparison result is that the features of the collected facial image are equal to the features of the selected female photo, the age of the selected female photo is output as the age of the collected facial image.
[0039] In this example, it is assumed that the maximum age of women in the database is 100 years old; A female photo is randomly selected from the database. Assume that the selected photo is a 50-year-old female photo. The features of the collected face image are compared with the selected 50-year-old female photo. Assume that the comparison result is: the features of the collected face image are younger than the features of the 50-year-old female photo; Then calculate the new selected age: the selected number is 50 years old, calculate half of the selected number, and the result is 25 years old. Then select a 25-year-old female photo from the database and perform feature comparison again. Assuming that the comparison result is: the collected facial image features are younger than the features of the 25-year-old female photo, calculate half of 25 years old again, that is, the result is 13 years old; Then select a 13-year-old female photo from the database and perform feature comparison again. Assuming that the comparison result is: the features of the collected face image are older than the features of the 13-year-old female photo, then recalculate the new selected age; Calculate the middle number between 13 and 25, which is 19, and perform feature comparison again. Assume that the comparison result is: the collected facial image features are equal to the features of the photo of a 19-year-old female, then the age output of the facial image is 19. For people whose age is 19, they can buy lottery tickets normally. If the output age is 16, then the person is under 18 years old, and the staff will be reminded that the user may not be able to buy lottery tickets, so further verification is required.
[0040] The steps of respectively judging by the male age identification method and the female age identification method and outputting the judgment results comprehensively include: The collected face images are used to output the first-level age through the male age identification method; The collected face images are used to output the secondary age through the female age identification method; The median values of the primary age and the secondary age are calculated, and multiple groups of male photos and multiple groups of female photos with the median age are extracted from the database; The collected facial images are compared with multiple groups of male photos and multiple groups of female photos respectively. When the comparison result shows that the overlap is greater than a preset value, the middle age is output as the age of the collected facial image. When the comparison result shows that the overlap is not greater than a preset value, the image is output as unrecognizable and an abnormal log is generated.
[0041] In this embodiment, it is assumed that the collected face image is judged to be 40 years old through the male age identification method, which is the first-level age; and the collected face image is judged to be 35 years old through the female age identification method, which is the second-level age; Calculate the median value between 40 and 35: (40 + 35) / 2 = 37.5 years old, and round it off to 38 years old. Extract 50 photos of men and 50 photos of women aged 38 from the database, and compare the features of the collected face images with the male and female photos in the database. If the overlap of feature comparison is greater than a preset value (for example, the overlap is greater than 75%), 38 years old is output as the age of the collected facial image; if the overlap of feature comparison is not greater than the preset value, it is considered that the gender and age cannot be accurately determined, the output is "image cannot be recognized", and an exception log is generated.
[0042] In summary, by using the gender judgment model, the gender of the face image can be accurately judged. According to the gender distinction, the corresponding male age identification method and female age identification method are selected to judge the age of the face image, which can reduce the calculation of data. Combined with the gender distinction, the age calculation can be more accurate. For some face images whose gender cannot be judged, comprehensive age judgment is used. When the age cannot be judged, it indicates that the inserted face image cannot be recognized, which also means that the photo is most likely not a portrait photo.
[0043] Example 2 On the basis of the first embodiment, this embodiment further provides a face age estimation device based on artificial intelligence, including a collection module, a gender judgment module, and an age recognition module; The acquisition module is used to acquire face images and extract face information from the face images; The gender determination module is used to determine the gender of a person's facial information; The age recognition module is used to judge the age of a person based on facial information.
[0044] This embodiment also provides a computer device, which is suitable for the case of an artificial intelligence-based face age estimation method, including a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute computer-executable instructions to implement the artificial intelligence-based face age estimation method proposed in the above embodiment.
[0045] The computer device may be a terminal, and the computer device includes a processor, a memory, a communication interface, a display screen and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covering the display screen, or a key, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.
[0046] This embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, the method for estimating the age of a human face based on artificial intelligence as proposed in the above embodiment is implemented.
[0047] The storage medium proposed in this embodiment and the data storage method proposed in the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be found in the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0048] Example 3 On the basis of the previous two embodiments, this embodiment provides a method for estimating the age of a human face based on artificial intelligence. In order to verify the beneficial effects of the present invention, a scientific demonstration is carried out through simulation experiments.
[0049] Experimental method: 1000 face images were randomly selected, and experiments were conducted using Example 1 and the comparative example. The experimental results are shown in Table 1. Table 1: Schematic diagram of experimental results of this method Experimental conditions Number of people to judge (N) Accuracy (%) Average age error (years) Calculate duration Combined with gender judgment 1.5min Male (determined) 450 97 1.15 Female (determined) 450 94 1.8 Unable to judge 100 78 / Not combined with gender judgment 4.7min All images (non-gendered) 1000 60 3.7 4.7min In this table, the comparison ratio is calculated directly by age without combining gender judgment; It can be clearly seen from the table that the recognition accuracy of males and females is high, and the age error is small. The overall accuracy rate reaches 89.6%, and it can effectively exclude some pictures that are not portraits, such as animal pictures. Without combining gender judgment, the overall accuracy rate is only 60%, and the average age error is large. Secondly, the entire database needs to be compared, and the calculation amount is large, which significantly increases the time consumption.
[0050] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the present invention.
Claims
1. A method for estimating human face age based on artificial intelligence, characterized in that: The following steps are included: Collecting face images and extracting face information from the face images; A gender judgment model is introduced to judge the facial information of the human face and obtain the gender corresponding to the facial image; Based on the age recognition model, combined with the gender corresponding to the face image, the age corresponding to the face image is obtained; The age recognition model uses a male age recognition method, a female age recognition method, or a combination of the male age recognition method and the female age recognition method for output according to the gender corresponding to the face image.
2. The method for estimating face age based on artificial intelligence as claimed in claim 1, characterized in that: When extracting facial information from a face image, the specific steps include: Preprocessing of face images; Extracting line information of the preprocessed face image, and obtaining the contour of the face image according to the line information; Acquire local features of the face within the contour of the face image; Combine local features of the face to form complete facial information; The local features of the face include eyes, eyebrows, nose, mouth, and facial shape.
3. The method for estimating face age based on artificial intelligence as claimed in claim 2, characterized in that: The gender judgment model includes a facial shape judgment method, an eye and eyebrow judgment method, and a nose and mouth judgment method; The facial shape determination method comprises: Obtain the distinguishing features of forehead width between men and women, and determine whether the forehead width in the facial information belongs to a male feature or a female feature; Obtain the distinguishing features of the difference in the length of the three parts of the face between men and women, and determine whether the difference in the length of the three parts of the face in the facial information belongs to male characteristics or female characteristics; Obtain the distinguishing features of the chin of men and women, and determine whether the chin difference in the facial information belongs to male or female characteristics; Combining the three sets of judgment results, the output result of the facial shape judgment method is given; The eyes and eyebrows judgment method includes: Obtain the distinguishing features of eye size between males and females, and determine whether the eye size in the facial information belongs to male or female features; Obtain the distinguishing features of eyelid curvature between men and women, and determine whether the eyelid curvature in the facial information belongs to male or female features; Obtain the distinguishing features of eyebrow thickness between men and women, and determine whether the eyebrow thickness in the facial information belongs to male or female characteristics; Combining the three sets of judgment results, the output results of the eye and eyebrow judgment method are given; The nose and mouth judgment method includes: Obtain the distinguishing features of nose size between males and females, and determine whether the nose size in the facial information belongs to male or female features; Obtain the distinguishing features of the width of the mouth of men and women, and determine whether the width of the mouth in the facial information is a male feature or a female feature; Combining the two sets of judgment results, the output results of the nose and mouth judgment methods are given.
4. The method for estimating face age based on artificial intelligence as claimed in claim 3, characterized in that: The operation steps of the gender determination model also include: Set the initial score; Set the maximum scores for the facial shape judgment method, the eyes and eyebrows judgment method, and the nose and mouth judgment method; According to each judgment result in the facial shape judgment method, the corresponding score is given, and finally the total score is calculated; According to each judgment result in the eye and eyebrow judgment method, give the corresponding score, and finally calculate the total score; According to each judgment result of the nose and mouth judgment method, give the corresponding score, and finally calculate the total score; Then add the total scores of the three groups together to obtain the output score of the gender judgment model; Compare the output score of the gender judgment model with the initial score. When the output score of the gender judgment model is greater than the judgment threshold N, the output result is male. When the output score of the gender judgment model is less than the judgment threshold V, the output result is female. When the output score of the gender judgment model is less than the judgment threshold N and greater than the judgment threshold V, the gender judgment model does not output a result. Among them, the facial shape judgment method, the eyes and eyebrows judgment method, and the nose and mouth judgment method have positive scores when the characteristics are judged as male, and positive scores when the characteristics are judged as female.
5. The method for estimating face age based on artificial intelligence as claimed in claim 4, characterized in that: The operation steps of the age recognition model include: The output result of the gender judgment model is obtained. When the result is output as male, it is judged by the male age identification method. When the result is output as female, it is judged by the female age identification method. When no result is output, it is judged by the male age identification method and the female age identification method respectively, and the judgment results are output comprehensively.
6. The method for estimating face age based on artificial intelligence as claimed in claim 5, characterized in that: The operation steps of the male age identification method include: Get the maximum age of males; Select a male photo of any age from the database, compare the features of the selected male photo and the collected face image, and when the comparison result is that the features of the collected face image are older than the features of the selected male photo, calculate the middle number between the selected age and the maximum male age, and make a judgment once, and when the comparison result is that the features of the collected face image are younger than the features of the selected male photo, output half of the selected age, and make a second judgment, and when the comparison result is that the features of the collected face image are equal to the features of the selected male photo, output the age of the selected male photo as the age of the collected face image; The one-time judgment includes selecting a male photo of an intermediate age from a database, and then comparing the selected male photo with the collected face image. When the comparison result shows that the feature of the collected face image is older than the feature of the selected male photo, the middle number between the selected age and the maximum male age is calculated, and then the judgment is repeated until the feature of the collected face image is younger than or equal to the feature of the selected male photo; when the comparison result shows that the feature of the collected face image is younger than the feature of the selected male photo, the middle value of the two selected ages is output, and the judgment is repeated until the feature of the collected face image is equal to the feature of the selected male photo; when the comparison result shows that the feature of the collected face image is equal to the feature of the selected male photo, the age of the selected male photo is output as the age of the collected face image; The secondary judgment includes selecting a male photo of half the age from the database, and then comparing the selected male photo with the collected face image. When the comparison result shows that the feature of the collected face image is younger than the feature of the selected male photo, half of the selected age is output, and then the judgment is repeated until the feature of the collected face image is older than or equal to the feature of the selected male photo; when the comparison result shows that the feature of the collected face image is older than the feature of the selected male photo, the middle value of the two selected ages is output, and the judgment is repeated until the feature of the collected face image is equal to the feature of the selected male photo; when the comparison result shows that the feature of the collected face image is equal to the feature of the selected male photo, the age of the selected male photo is output as the age of the collected face image; The operation steps of the female age identification method include: Get the maximum age of female; Select a female photo of any age from the database, compare the features of the selected female photo and the collected face image, and when the comparison result is that the features of the collected face image are older than the features of the selected female photo, calculate the middle number between the selected age and the maximum female age, and make a judgment once, and when the comparison result is that the features of the collected face image are younger than the features of the selected female photo, output half of the selected age, and make a second judgment, and when the comparison result is that the features of the collected face image are equal to the features of the selected female photo, output the age of the selected female photo as the age of the collected face image; The one-time judgment includes selecting a female photo of an intermediate age from a database, and then comparing the features of the selected female photo and the collected face image; when the comparison result is that the features of the collected face image are older than the features of the selected female photo, the middle number between the selected age and the maximum female age is calculated, and then the judgment is repeated until the features of the collected face image are younger than or equal to the features of the selected female photo; when the comparison result is that the features of the collected face image are younger than the features of the selected female photo, the middle value of the twice selected ages is output, and the judgment is repeated until the features of the collected face image are equal to the features of the selected female photo; when the comparison result is that the features of the collected face image are equal to the features of the selected female photo, the age of the selected female photo is output as the age of the collected face image; The secondary judgment includes selecting a female photo of half the age from a database, and then comparing the features of the selected female photo and the collected facial image; when the comparison result is that the features of the collected facial image are younger than the features of the selected female photo, half of the selected age is output, and then the judgment is made again until the features of the collected facial image are older than or equal to the features of the selected female photo; when the comparison result is that the features of the collected facial image are older than the features of the selected female photo, the middle value of the two selected ages is output, and the judgment is made again until the features of the collected facial image are equal to the features of the selected female photo; when the comparison result is that the features of the collected facial image are equal to the features of the selected female photo, the age of the selected female photo is output as the age of the collected facial image.
7. The method for estimating face age based on artificial intelligence as claimed in claim 6, characterized in that: The steps of respectively judging by the male age identification method and the female age identification method and outputting the judgment results comprehensively include: The collected face images are used to output the first-level age through the male age identification method; The collected face images are used to output the secondary age through the female age identification method; The median values of the primary age and the secondary age are calculated, and multiple groups of male photos and multiple groups of female photos with the median age are extracted from the database; The collected facial images are compared with multiple groups of male photos and multiple groups of female photos respectively. When the comparison result shows that the overlap is greater than a preset value, the middle age is output as the age of the collected facial image. When the comparison result shows that the overlap is not greater than a preset value, the image is output as unrecognizable and an abnormal log is generated.
8. An artificial intelligence-based face age estimation device, based on the artificial intelligence-based face age estimation method according to any one of claims 1 to 7, characterized in that: It includes a collection module, a gender determination module, and an age recognition module; The acquisition module is used to acquire face images and extract face information from the face images; The gender determination module is used to determine the gender of a person's facial information; The age recognition module is used to judge the age of a person based on facial information.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method for estimating the age of a human face based on artificial intelligence according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for estimating the age of a human face based on artificial intelligence according to any one of claims 1 to 7 are implemented.
