CN108021863B - Electronic device, age classification method based on image and storage medium - Google Patents

Electronic device, age classification method based on image and storage medium Download PDF

Info

Publication number
CN108021863B
CN108021863B CN201711059224.XA CN201711059224A CN108021863B CN 108021863 B CN108021863 B CN 108021863B CN 201711059224 A CN201711059224 A CN 201711059224A CN 108021863 B CN108021863 B CN 108021863B
Authority
CN
China
Prior art keywords
age
pixel
face
face image
image
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
CN201711059224.XA
Other languages
Chinese (zh)
Other versions
CN108021863A (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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201711059224.XA priority Critical patent/CN108021863B/en
Priority to PCT/CN2018/076182 priority patent/WO2019085338A1/en
Publication of CN108021863A publication Critical patent/CN108021863A/en
Application granted granted Critical
Publication of CN108021863B publication Critical patent/CN108021863B/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
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • G06V10/267Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion by performing operations on regions, e.g. growing, shrinking or watersheds
    • 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
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/172Classification, e.g. identification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/178Human faces, e.g. facial parts, sketches or expressions estimating age from face image; using age information for improving recognition

Abstract

The invention discloses an electronic device, an age classification method based on images and a storage medium, comprising the following steps: after receiving a first face image of an age to be identified, cutting the first face image by using a preset cutting rule to obtain a preset number of second face images; respectively carrying out age identification on the second face images by using a predetermined face image identification model to generate age characteristic vectors corresponding to the second face images; carrying out averaging processing on the age characteristic vectors to obtain an average age characteristic vector; and carrying out age classification analysis on the average age characteristic vector by using a predetermined age classification function to obtain an average age type corresponding to the second face image, wherein the average age type is the age type corresponding to the first face image. Therefore, the problems of large calculated amount and low efficiency in the training process of the face recognition model can be effectively avoided, and the accuracy of classifying the ages according to the face images can be improved.

Description

Electronic device, age classification method based on image and storage medium
Technical Field
The present invention relates to the field of face recognition, and in particular, to an electronic device, an age classification method based on an image, and a storage medium.
Background
In recent years, with the development of face recognition technology, there is an increasing demand for users to recognize face images, for example, in network popularization, age groups of people corresponding to the images are recognized by recognizing face images, and user preferences of different age groups and product popularity of users of different age groups are collected according to the recognized age groups.
At present, in a commonly used face recognition technology, before age classification is performed according to a face image, a sample set formed by a plurality of face images needs to be acquired to perform multi-age classification, samples conforming to the current age group are used as a positive sample set, samples of other age groups are used as a negative sample set to perform training, and a face image recognition model for performing age classification according to the face image is generated. However, generally, the number of negative samples corresponding to a certain age group is tens of times that of positive samples, and the number of positive samples and the number of negative samples are unbalanced, which causes a certain error in the face image recognition model generated by training.
Disclosure of Invention
In view of the above, the invention provides an age classification method based on an image, which can improve the accuracy of age classification according to a face image and effectively avoid the problems of large calculation amount and low efficiency in a face recognition model training process.
To achieve the above object, the present invention provides an electronic device, which includes a memory and a processor connected to the memory, wherein the processor is configured to execute an image-based age classification system stored in the memory, and when executed by the processor, the image-based age classification system implements the following steps:
a cutting step, cutting a first face image of an age to be identified by using a preset cutting rule after the first face image is received, so as to obtain a preset number of second face images;
an age feature vector generation step of respectively performing age recognition on the second face images by using predetermined face image recognition models to generate age feature vectors corresponding to the second face images, wherein the predetermined face image recognition models include generation networks of the age feature vectors;
generating average age characteristic vectors, namely performing averaging processing on the age characteristic vectors to obtain average age characteristic vectors;
and an age classification step, namely performing age classification analysis on the average age characteristic vector by using a predetermined age classification function to obtain an average age type corresponding to the second face image, wherein the average age type is the age type corresponding to the first face image.
Preferably, the face image recognition model comprises an output layer matched with the generation network of the age feature vectors, the output layer comprising the age classification function.
Preferably, the preset clipping rule includes:
detecting a face range and an age characteristic contained in the first face image;
determining a pixel area corresponding to the face according to the range of the detected face, and finding out a starting pixel and an ending pixel corresponding to the pixel area;
and taking the initial pixel as a fixed-point pixel of a first preset-size cutting frame, determining a transverse fixed-point pixel of the preset-size cutting frame every other first number of pixels along the abscissa direction of the initial pixel from the initial pixel, and cutting the pixel region once at each transverse fixed-point pixel by using the preset-size cutting frame to obtain at least one second face image, wherein the second face image comprises at least one age feature.
Preferably, the preset clipping rule further includes: determining a longitudinal fixed point pixel of a cutting frame with a preset size every second number of pixels along the longitudinal coordinate direction of the initial pixel from the initial pixel;
selecting longitudinal fixed-point pixels one by one, taking the longitudinal fixed-point pixels as fixed-point pixels of a cutting frame with a preset size after selecting one longitudinal fixed-point pixel, determining transverse fixed-point pixels of the cutting frame with the preset size at intervals of a first number of pixels along the abscissa direction of the longitudinal fixed-point pixels from the longitudinal fixed-point pixels, and cutting the pixel region once at each transverse fixed-point pixel by using the cutting frame with the preset size to obtain at least one second face image, wherein each second face image comprises at least one age feature.
Preferably, the predetermined face image recognition model includes a convolutional neural network model, the generation network of the age feature vector is a convolutional neural network, and the age feature vector generation step includes analyzing the age features included in the second face image by using the convolutional neural network, respectively, and generating the age feature vector corresponding to each of the second face images.
In addition, to achieve the above object, the present invention also provides an image-based age classification method, including the steps of:
A. after receiving a first face image of an age to be identified, cutting the first face image by using a preset cutting rule to obtain a preset number of second face images;
B. respectively carrying out age identification on the second face images by using a predetermined face image identification model to generate age characteristic vectors corresponding to the second face images, wherein the predetermined face image identification model comprises a generation network of the age characteristic vectors;
C. carrying out averaging processing on the age characteristic vectors to obtain an average age characteristic vector;
D. and carrying out age classification analysis on the average age characteristic vector by using a predetermined age classification function to obtain an average age type corresponding to the second face image, wherein the average age type is the age type corresponding to the first face image.
Preferably, the face image recognition model comprises an output layer matched to the generation network of the age feature vectors, the output layer comprising the age classification function.
Preferably, the preset clipping rule includes: detecting a face range and an age characteristic contained in the first face image;
determining a pixel area corresponding to the face according to the range of the detected face, and finding out a starting pixel and an ending pixel corresponding to the pixel area;
and taking the initial pixel as a fixed-point pixel of a first preset-size cutting frame, determining a transverse fixed-point pixel of the preset-size cutting frame every other first number of pixels along the abscissa direction of the initial pixel from the initial pixel, and cutting the pixel region once at each transverse fixed-point pixel by using the preset-size cutting frame to obtain at least one second face image, wherein the second face image comprises at least one age feature.
Preferably, the preset clipping rule further includes:
determining a longitudinal fixed point pixel of a cutting frame with a preset size every other second data pixel along the longitudinal coordinate direction of the starting pixel from the starting pixel;
selecting longitudinal fixed-point pixels one by one, taking the longitudinal fixed-point pixels as fixed-point pixels of a cutting frame with a preset size after selecting one longitudinal fixed-point pixel, determining transverse fixed-point pixels of the cutting frame with the preset size at intervals of a first number of pixels along the abscissa direction of the longitudinal fixed-point pixels from the longitudinal fixed-point pixels, and cutting the pixel region once at each transverse fixed-point pixel by using the cutting frame with the preset size to obtain at least one second face image, wherein each second face image comprises at least one age feature.
Further, to achieve the above object, the present invention also provides a computer readable storage medium storing an image-based age classification system executable by at least one processor to cause the at least one processor to perform the steps of the image-based age classification method as described above.
Compared with the prior art, the electronic device, the age classification method based on the image and the storage medium provided by the invention have the advantages that firstly, after a first face image of an age to be identified is received, the first face image is cut by using a preset cutting rule to obtain a preset number of second face images; then, respectively carrying out age identification on the second face images by using a predetermined face image identification model to generate age characteristic vectors corresponding to the second face images; then, carrying out averaging processing on the characteristic vectors of all ages to obtain an average vector; and finally, carrying out age classification analysis on the average vector by using a predetermined age classification function to obtain an average age type corresponding to the second face image, wherein the average age type is the age type corresponding to the first face image. Therefore, the problems of large calculation amount and low efficiency in the training process of the face recognition model can be effectively avoided, and the accuracy of age classification according to the face image can be improved.
Drawings
FIG. 1 is a diagram of an alternative hardware architecture of the electronic device of the present invention;
FIG. 2 is a block diagram of a preferred embodiment of the image-based age classification process of the present invention;
FIG. 3 is a flowchart illustrating an embodiment of the method for classifying ages based on images according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the description relating to "first", "second", etc. in the present invention is for descriptive purposes only and is not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, technical solutions between the embodiments may be combined with each other, but must be based on the realization of the technical solutions by a person skilled in the art, and when the technical solutions are contradictory to each other or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present invention.
Fig. 1 is a schematic diagram of an alternative hardware architecture of the electronic device 10 according to the present invention. In this embodiment, the electronic device 10 may include, but is not limited to, a memory 11, a processor 12, and a display 13, which may be communicatively connected to each other by a communication bus 14. It is noted that fig. 1 only shows the electronic device 10 with components 11-13, but it is to be understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead.
The memory 11 includes at least one type of computer-readable storage medium, which includes a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the storage 11 may be an internal storage unit of the electronic device 10, such as a hard disk or a memory of the electronic device 10. In other embodiments, the memory 11 may also be an external storage device of the electronic apparatus 10, such as a plug-in hard disk provided on the electronic apparatus 10, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like. Of course, the memory 11 may also comprise both an internal storage unit of the electronic apparatus 10 and an external storage device thereof. In the present embodiment, the memory 11 is generally used for storing an operating system and various types of application software installed in the electronic device 10, for example, for storing an image-based age classification program and the like. Further, the memory 11 may also be used to temporarily store various types of data that have been output or are to be output.
Processor 12 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 12 is generally used to control the overall operation of the electronic device 10. In the present embodiment, the processor 12 is configured to execute program codes or process data stored in the memory 11, for example, to execute an image-based age classification program or the like stored in the memory 11.
The display 13 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch panel, or the like in some embodiments. The display 13 is used for displaying a progress of processing information in the electronic apparatus 10 and for displaying a user interface for visualization, for example, for displaying an image-based age classification interface or the like.
The communication bus 14 is used for realizing communication connection among various modules
The hardware structure and functions of the electronic device 10 proposed by the present invention have been described in detail. It should be noted that the image-based age classification program stored in the memory 11 is executed by the processor 12 to implement the steps of the image-based age classification method according to the various embodiments of the present invention.
In one embodiment, the image-based age classification program, when executed by the processor 12, performs the steps of:
a cutting step, if a first face image with the age to be identified exists, cutting the first face image by using a preset cutting rule to obtain a preset number of second face images;
an age characteristic vector generation step, wherein the age identification is carried out on the second face images by utilizing a predetermined face image identification model respectively, so as to generate age characteristic vectors corresponding to the second face images, and the predetermined face image identification model comprises a generation network of the age characteristic vectors;
an average age characteristic vector generation step, namely performing averaging processing on the age characteristic vectors to obtain an average age characteristic vector;
and an age classification step, performing age classification analysis on the average age characteristic vector by using a predetermined age classification function to obtain an average age type corresponding to the second face image, wherein the average age type is the age type corresponding to the first face image.
Specifically, in this embodiment, the preset clipping rule includes:
detecting a face range and an age characteristic contained in the first face image; determining a pixel region corresponding to the face according to the detected face range, for example, a pixel region determined by a quadrangle with the smallest area including the face is a pixel region corresponding to the face, finding a starting pixel corresponding to the pixel region, for example, a pixel at the leftmost upper corner of the pixel region is the starting pixel, and an ending pixel, for example, a pixel at the rightmost lower corner of the pixel region is the ending pixel; and regarding the starting pixel as a vertex of the leftmost corner of the first pre-sized cropping frame, for example, a 60 × 60-pixel cropping frame, wherein the fixed-point pixel refers to a vertex of the leftmost corner of the pre-sized cropping frame, and starting from the starting pixel, every first number, for example, 50 pixels along the abscissa direction of the starting pixel determine a horizontal fixed-point pixel of the pre-sized cropping frame, for example, the horizontal fixed-point pixel refers to a vertex of the leftmost corner of the pre-sized cropping frame, and cropping the pixel region with the pre-sized cropping frame once at each horizontal fixed-point pixel to obtain at least one second face image, wherein the second face images each include at least one age feature. It is further noted that the age characteristics include skin color, distance between facial contours, and size, aspect, mottle, wrinkles, etc. of facial contours.
Or, in another embodiment, the preset clipping rule further includes:
determining, starting from the start pixel, every second number, for example, 60, of pixels along the ordinate direction of the start pixel, the longitudinal fixed-point pixel of a preset-size crop box; selecting longitudinal fixed point pixels one by one, taking the longitudinal fixed point pixels as fixed point pixels of a preset-size cropping frame, such as a 60 × 60-pixel cropping frame, determining transverse fixed point pixels of the preset-size cropping frame by every first number, such as 50 pixels, from the longitudinal fixed point pixels along the abscissa direction of the longitudinal fixed point pixels, and cropping the pixel region once by using the preset-size cropping frame at each transverse fixed point pixel to obtain at least one second face image, wherein the second face image comprises at least one age feature.
It should be noted that the size corresponding to the preset size clipping frame needs to be larger than the size of the picture recognizable by the predetermined face recognition model, in an embodiment, the size corresponding to the preset size clipping frame needs to be larger than the size of the picture recognizable by the predetermined face recognition model by 15% to 25%, and in each clipping, the difference of the age characteristics included in the clipped second face image is more obvious and better, the number of times of clipping is not too large and is not too small, if the number of times of clipping is too large, the calculation amount is increased, so that the efficiency of age prediction is low, and if the number of times of clipping is too small, the improvement of the accuracy of age prediction is not obvious. Experimental data show that the cutting times are preferably 6 to 12 times.
Further, in this embodiment, the predetermined face image recognition model includes a convolutional neural network model, the generation network of the age feature vector is a convolutional neural network, and the age feature vector generation step includes analyzing the age features included in the second face image by using the convolutional neural network, respectively, and generating an age feature vector corresponding to each of the second face images.
Next, the average value of the age feature vectors is obtained.
Then, using a predetermined age classification function, for example, in this embodiment, the predetermined classification function is a Softmax classification function, and performing age classification analysis on the average age feature vector to obtain an average age type corresponding to the second face image, where the average age type is an age type corresponding to the first face image, and it should be noted that in this embodiment, the age types include a baby period, a toddler period, a young period, a middle period, and an old period.
According to the embodiment, after receiving a first face image of an age to be identified, the electronic device provided by the invention cuts the first face image by using a preset cutting rule to obtain a preset number of second face images; respectively carrying out age identification on the second face images by using a predetermined face image identification model to generate age characteristic vectors corresponding to the second face images, wherein the predetermined face image identification model comprises a generation network of the age characteristic vectors; carrying out averaging processing on the age characteristic vectors to obtain an average age characteristic vector; and carrying out age classification analysis on the average age characteristic vector by using a predetermined age classification function to obtain an average age type corresponding to the second face image, wherein the average age type is the age type corresponding to the first face image. The problems of large calculated amount and low efficiency in the training process of the face recognition model can be effectively avoided, and the accuracy of age classification according to the face image can be improved.
Further, in one embodiment, the image-based age classification program may be divided into one or more virtual program modules according to functions implemented by each part of the image-based age classification program.
Fig. 2 is a block diagram of a preferred embodiment of the image-based age classification procedure of the present invention. As can be seen from fig. 2, in the present embodiment, according to the different functions implemented by each part of the image-based age classification program, the image-based age classification program is divided into a clipping module 201, an age feature vector generation module 202, an average age feature vector generation module 203, and an age classification module 204, wherein the functions or operations implemented by the modules 202 and 204 are similar to those described above and are not described in detail here, for example:
the cropping module 201 is configured to crop a first face image with a preset cropping rule if the first face image with the age to be identified is to be obtained, so as to obtain a preset number of second face images;
an age feature vector generation module 202, configured to perform age recognition on the second face images by using predetermined face image recognition models respectively, and generate age feature vectors corresponding to the second face images, where the predetermined face image recognition models include a generation network of the age feature vectors;
the average age feature vector generation module 203 is configured to perform averaging processing on the age feature vectors to obtain an average age feature vector;
and the age classification module 204 is configured to perform age classification analysis on the average age feature vector by using a predetermined age classification function to obtain an average age type corresponding to the second face image, where the obtained average age type is the age type corresponding to the first face image.
In addition, the invention also provides an age classification method based on the image. Referring to fig. 3, a flowchart of a preferred embodiment of the image-based age classification method of the present invention is shown. The method may be performed by an apparatus, which may be implemented by software and/or hardware.
As can be seen from fig. 3, in the present embodiment, the method for classifying ages based on images includes steps S301 to S304.
Step S301, if a first face image of the age to be identified exists, cutting the first face image by using a preset cutting rule to obtain a preset number of second face images;
step S302, age recognition is carried out on second face images by utilizing predetermined face image recognition models respectively, and age characteristic vectors corresponding to the second face images are generated, wherein the predetermined face image recognition models comprise generation networks of the age characteristic vectors;
step S303, carrying out averaging processing on the age characteristic vectors to obtain an average age characteristic vector;
step S304, performing age classification analysis on the average age feature vector by using a predetermined age classification function to obtain an average age type corresponding to the second facial image, where the obtained average age type is the age type corresponding to the first facial image.
Specifically, in this embodiment, the preset clipping rule includes:
detecting a face range and an age characteristic contained in the first face image; determining a pixel region corresponding to the face according to the detected face range, for example, a pixel region determined by a quadrangle with the smallest area including the face is a pixel region corresponding to the face, finding a starting pixel corresponding to the pixel region, for example, a pixel at the leftmost upper corner of the pixel region is the starting pixel, and an ending pixel, for example, a pixel at the rightmost lower corner of the pixel region is the ending pixel; and regarding the starting pixel as a vertex of the leftmost corner of the first pre-sized cropping frame, for example, a 60 × 60-pixel cropping frame, wherein the fixed-point pixel refers to a vertex of the leftmost corner of the pre-sized cropping frame, and starting from the starting pixel, every first number, for example, 50 pixels along the abscissa direction of the starting pixel determine a horizontal fixed-point pixel of the pre-sized cropping frame, for example, the horizontal fixed-point pixel refers to a vertex of the leftmost corner of the pre-sized cropping frame, and cropping the pixel region with the pre-sized cropping frame once at each horizontal fixed-point pixel to obtain at least one second face image, wherein the second face images each include at least one age feature. It is further noted that the age characteristics include skin color, distance between facial contours, and size, aspect, mottle, wrinkles, etc. of facial contours.
Or, in another embodiment, the preset clipping rule further includes:
determining, starting from the start pixel, every second number, for example, 60, of pixels along the ordinate direction of the start pixel, the longitudinal fixed-point pixel of a preset-size crop box; selecting longitudinal fixed point pixels one by one, taking the longitudinal fixed point pixels as fixed point pixels of a preset size cutting frame, such as a 60 x 60 pixel cutting frame, from the longitudinal fixed point pixels, determining transverse fixed point pixels of the preset size cutting frame every first number, such as 50 pixels, along the abscissa direction of the longitudinal fixed point pixels, and cutting the pixel region once by using the preset size cutting frame at each transverse fixed point pixel to obtain at least one second face image, wherein each second face image comprises at least one age feature.
It should be noted that the size corresponding to the preset size clipping frame needs to be larger than the size of the picture recognizable by the predetermined face recognition model, in an embodiment, the size corresponding to the preset size clipping frame needs to be larger than the size of the picture recognizable by the predetermined face recognition model by 15% to 25%, and in each clipping, the difference of the age characteristics included in the clipped second face image is more obvious and better, the number of times of clipping is not too large and is not too small, if the number of times of clipping is too large, the calculation amount is increased, so that the efficiency of age prediction is low, and if the number of times of clipping is too small, the improvement of the accuracy of age prediction is not obvious. Experimental data show that the cutting times are preferably 6 to 12 times.
Further, in this embodiment, the predetermined face image recognition model includes a convolutional neural network model, the generation network of the age feature vector is a convolutional neural network, and the age feature vector generation step includes analyzing the age features included in the second face image by using the convolutional neural network, respectively, and generating an age feature vector corresponding to each of the second face images.
Next, the average value of the age feature vectors is obtained.
Then, using a predetermined age classification function, for example, in this embodiment, the predetermined classification function is a Softmax classification function, and performing age classification analysis on the average age feature vector to obtain an average age type corresponding to the second face image, where the average age type is an age type corresponding to the first face image, and it should be noted that in this embodiment, the age types include a baby period, a toddler period, a young period, a middle period, and an old period.
According to the embodiment, after receiving a first face image of an age to be identified, the age classification method based on the image cuts the first face image by using a preset cutting rule to obtain a preset number of second face images; respectively carrying out age identification on the second face images by using a predetermined face image identification model to generate age characteristic vectors corresponding to the second face images, wherein the predetermined face image identification model comprises a generation network of the age characteristic vectors; carrying out averaging processing on the age characteristic vectors to obtain an average age characteristic vector; and carrying out age classification analysis on the average age characteristic vector by using a predetermined age classification function to obtain an average age type corresponding to the second face image, wherein the average age type is the age type corresponding to the first face image. The problems of large calculated amount and low efficiency in the training process of the face recognition model can be effectively avoided, and the accuracy of age classification according to the face image can be improved.
Furthermore, an embodiment of the present invention further provides a computer-readable storage medium, on which an image-based age classification program is stored, which when executed by a processor implements the following steps:
a cutting step, cutting the first face image by using a preset cutting rule after receiving the first face image with the age to be identified to obtain a preset number of second face images;
an age characteristic vector generation step, wherein the age identification is carried out on the second face images by utilizing a predetermined face image identification model respectively, and age characteristic vectors corresponding to the second face images are generated, wherein the predetermined face image identification model comprises an age characteristic vector generation network;
an average age characteristic vector generation step, namely performing averaging processing on the age characteristic vectors to obtain an average age characteristic vector;
and an age classification step, performing age classification analysis on the average age characteristic vector by using a predetermined age classification function to obtain an average age type corresponding to the second face image, wherein the average age type is the age type corresponding to the first face image.
The embodiment of the computer-readable storage medium of the present invention is substantially the same as the embodiments of the electronic device and the image-based age classification method, and will not be described in detail herein.
According to the embodiment, the age classification method based on the images can effectively solve the problems of large calculation amount and low efficiency in the training process of the face recognition model, and can improve the accuracy of age classification according to the face images.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (8)

1. An electronic device, comprising a memory, and a processor coupled to the memory, the processor configured to execute an image-based age classification program stored in the memory, the image-based age classification program when executed by the processor implementing the steps of:
the step of cutting out, after receiving the first face image of treating discernment age, detect face scope and the age characteristic that first face image contains, utilize the preset rule of cutting out will first face image cuts out, obtains the second face image of predetermineeing quantity, the age characteristic includes face complexion, color spot, wrinkle, the face contains the distance between each profile, each profile to and the size of each profile, and the rule of cutting out that predetermineeing includes:
detecting a face range and an age characteristic contained in the first face image;
determining a pixel area corresponding to the face according to the detected face range, and finding out a starting pixel and an ending pixel corresponding to the pixel area;
taking the initial pixel as a fixed-point pixel of a first preset-size cutting frame, determining a transverse fixed-point pixel of the preset-size cutting frame every other first number of pixels along the abscissa direction of the initial pixel from the initial pixel, and cutting the pixel region once at each transverse fixed-point pixel by using the preset-size cutting frame to obtain at least one second face image, wherein the second face image comprises at least one age feature;
an age characteristic vector generation step of respectively carrying out age identification on the second face images by using a predetermined face image identification model to generate age characteristic vectors corresponding to the second face images;
generating average age characteristic vectors, namely performing averaging processing on the age characteristic vectors to obtain average age characteristic vectors;
and an age classification step, wherein the average age characteristic vector is subjected to age classification analysis by using a predetermined age classification function to obtain an average age type corresponding to the second facial image, the average age type is the age type corresponding to the first facial image, and the age classification function is a softmax function.
2. The electronic device of claim 1, wherein the facial image recognition model includes an output layer matched to a generation network of the age feature vectors, the output layer including the age classification function.
3. The electronic device of claim 1, wherein the preset clipping rule further comprises:
determining a longitudinal fixed point pixel of a cutting frame with a preset size every second number of pixels along the longitudinal coordinate direction of the initial pixel from the initial pixel;
selecting longitudinal fixed-point pixels one by one, taking the longitudinal fixed-point pixels as fixed-point pixels of a cutting frame with a preset size after selecting one longitudinal fixed-point pixel, determining transverse fixed-point pixels of the cutting frame with the preset size at intervals of a first number of pixels along the abscissa direction of the longitudinal fixed-point pixels from the longitudinal fixed-point pixels, and cutting the pixel region once at each transverse fixed-point pixel by using the cutting frame with the preset size to obtain at least one second face image, wherein each second face image comprises at least one age feature.
4. The electronic device according to claim 1, wherein the predetermined facial image recognition model includes a convolutional neural network model, the generation network of the age feature vector is a convolutional neural network, and the age feature vector generation step includes analyzing age features included in the second facial images by using the convolutional neural networks, respectively, to generate the age feature vector corresponding to each of the second facial images.
5. An image-based age classification method, characterized in that the method comprises the steps of:
A. after receiving the first face image of treating discernment age, detect face scope and the age characteristic that first face image contains, utilize preset cutting rule will first face image cuts out, obtains the second face image of predetermineeing quantity, the age characteristic includes face complexion, color spot, wrinkle, the face contains the distance between each profile, each profile to and the size of each profile, preset cutting rule includes:
detecting a face range and an age characteristic contained in the first face image;
determining a pixel area corresponding to the face according to the detected face range, and finding out a starting pixel and an ending pixel corresponding to the pixel area;
taking the initial pixel as a fixed-point pixel of a first preset-size cutting frame, determining a transverse fixed-point pixel of the preset-size cutting frame every other first number of pixels along the abscissa direction of the initial pixel from the initial pixel, and cutting the pixel region once at each transverse fixed-point pixel by using the preset-size cutting frame to obtain at least one second face image, wherein the second face image comprises at least one age feature;
B. respectively carrying out age identification on the second face images by using a predetermined face image identification model to generate age characteristic vectors corresponding to the second face images;
C. carrying out averaging processing on the age characteristic vectors to obtain an average age characteristic vector;
D. and carrying out age classification analysis on the average age characteristic vector by utilizing a predetermined age classification function to obtain the average age type corresponding to the second facial image, wherein the average age type is the age type corresponding to the first facial image, and the age classification function is a softmax function.
6. The image-based age classification method of claim 5, wherein the facial image recognition model includes an output layer matched to the generation network of age feature vectors, the output layer including the age classification function.
7. The image-based age classification method according to claim 5, wherein the preset clipping rule further includes:
determining a longitudinal fixed point pixel of a cutting frame with a preset size every other second data pixel along the longitudinal coordinate direction of the starting pixel from the starting pixel;
selecting longitudinal fixed-point pixels one by one, taking the longitudinal fixed-point pixels as fixed-point pixels of a cutting frame with a preset size after selecting one longitudinal fixed-point pixel, determining transverse fixed-point pixels of the cutting frame with the preset size at intervals of a first number of pixels along the abscissa direction of the longitudinal fixed-point pixels from the longitudinal fixed-point pixels, and cutting the pixel region once at each transverse fixed-point pixel by using the cutting frame with the preset size to obtain at least one second face image, wherein each second face image comprises at least one age feature.
8. A computer readable storage medium storing an image-based age classification program executable by at least one processor to cause the at least one processor to perform the steps of the image-based age classification method according to any one of claims 5 to 7.
CN201711059224.XA 2017-11-01 2017-11-01 Electronic device, age classification method based on image and storage medium Active CN108021863B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201711059224.XA CN108021863B (en) 2017-11-01 2017-11-01 Electronic device, age classification method based on image and storage medium
PCT/CN2018/076182 WO2019085338A1 (en) 2017-11-01 2018-02-10 Electronic apparatus, image-based age classification method and system, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711059224.XA CN108021863B (en) 2017-11-01 2017-11-01 Electronic device, age classification method based on image and storage medium

Publications (2)

Publication Number Publication Date
CN108021863A CN108021863A (en) 2018-05-11
CN108021863B true CN108021863B (en) 2022-05-06

Family

ID=62079656

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711059224.XA Active CN108021863B (en) 2017-11-01 2017-11-01 Electronic device, age classification method based on image and storage medium

Country Status (2)

Country Link
CN (1) CN108021863B (en)
WO (1) WO2019085338A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110334643B (en) * 2019-06-28 2023-05-23 知鱼智联科技股份有限公司 Feature evaluation method and device based on face recognition
CN113095119B (en) * 2020-01-09 2023-11-21 北京君正集成电路股份有限公司 Face recognition system for correcting face cutting frame
CN111626303B (en) * 2020-05-29 2021-04-13 南京甄视智能科技有限公司 Sex and age identification method, sex and age identification device, storage medium and server
CN111914772B (en) * 2020-08-06 2024-05-03 北京金山云网络技术有限公司 Age identification method, age identification model training method and device
CN113837043B (en) * 2021-09-14 2023-11-21 汇纳科技股份有限公司 Age estimation method, device and system applied to face image and storage medium

Family Cites Families (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7912246B1 (en) * 2002-10-28 2011-03-22 Videomining Corporation Method and system for determining the age category of people based on facial images
CN101584575B (en) * 2009-06-19 2011-05-04 无锡骏聿科技有限公司 Age assessment method based on face recognition technology
CN104143097B (en) * 2013-05-09 2017-02-08 腾讯科技(深圳)有限公司 Classification function obtaining method and device, face age recognition method and device and equipment
CN103473769B (en) * 2013-09-05 2016-01-06 东华大学 A kind of fabric defects detection method based on svd
EP3074928A4 (en) * 2013-11-25 2017-11-15 Ehsan Fazl Ersi System and method for face recognition
CN105303149B (en) * 2014-05-29 2019-11-05 腾讯科技(深圳)有限公司 The methods of exhibiting and device of character image
CN105718869B (en) * 2016-01-15 2019-07-02 网易(杭州)网络有限公司 The method and apparatus of face face value in a kind of assessment picture
CN106203306A (en) * 2016-06-30 2016-12-07 北京小米移动软件有限公司 The Forecasting Methodology at age, device and terminal
CN106295506A (en) * 2016-07-25 2017-01-04 华南理工大学 A kind of age recognition methods based on integrated convolutional neural networks
CN106503623B (en) * 2016-09-27 2019-10-08 中国科学院自动化研究所 Facial image age estimation method based on convolutional neural networks
CN106529402B (en) * 2016-09-27 2019-05-28 中国科学院自动化研究所 The face character analysis method of convolutional neural networks based on multi-task learning
CN106485235B (en) * 2016-10-24 2019-05-03 厦门美图之家科技有限公司 A kind of convolutional neural networks generation method, age recognition methods and relevant apparatus
CN106779050A (en) * 2016-11-24 2017-05-31 厦门中控生物识别信息技术有限公司 The optimization method and device of a kind of convolutional neural networks
CN106778584B (en) * 2016-12-08 2019-07-16 南京邮电大学 A kind of face age estimation method based on further feature Yu shallow-layer Fusion Features
CN106778682B (en) * 2017-01-11 2019-07-09 厦门中控智慧信息技术有限公司 A kind of training method and its equipment of convolutional neural networks model
CN107122826B (en) * 2017-05-08 2019-04-23 京东方科技集团股份有限公司 Processing method and system and storage medium for convolutional neural networks
CN107169454B (en) * 2017-05-16 2021-01-01 中国科学院深圳先进技术研究院 Face image age estimation method and device and terminal equipment thereof

Also Published As

Publication number Publication date
CN108021863A (en) 2018-05-11
WO2019085338A1 (en) 2019-05-09

Similar Documents

Publication Publication Date Title
CN108021863B (en) Electronic device, age classification method based on image and storage medium
CN109146892B (en) Image clipping method and device based on aesthetics
CN110197146B (en) Face image analysis method based on deep learning, electronic device and storage medium
WO2019205391A1 (en) Apparatus and method for generating vehicle damage classification model, and computer readable storage medium
CN111428581A (en) Face shielding detection method and system
CN111914775B (en) Living body detection method, living body detection device, electronic equipment and storage medium
CN109033955B (en) Face tracking method and system
CN110008997B (en) Image texture similarity recognition method, device and computer readable storage medium
CN110619656B (en) Face detection tracking method and device based on binocular camera and electronic equipment
CN111325104A (en) Text recognition method, device and storage medium
CN112101317A (en) Page direction identification method, device, equipment and computer readable storage medium
CN112036400B (en) Method for constructing network for target detection and target detection method and system
CN111680546A (en) Attention detection method, attention detection device, electronic equipment and storage medium
CN110795714A (en) Identity authentication method and device, computer equipment and storage medium
CN110135889A (en) Method, server and the storage medium of intelligent recommendation book list
CN111080665B (en) Image frame recognition method, device, equipment and computer storage medium
CN113159026A (en) Image processing method, image processing apparatus, electronic device, and medium
CN112966599A (en) Training method of key point identification model, and key point identification method and device
CN112149570A (en) Multi-person living body detection method and device, electronic equipment and storage medium
CN110232381B (en) License plate segmentation method, license plate segmentation device, computer equipment and computer readable storage medium
CN113592720B (en) Image scaling processing method, device, equipment and storage medium
WO2021179751A1 (en) Image processing method and system
CN112380978B (en) Multi-face detection method, system and storage medium based on key point positioning
CN114332809A (en) Image identification method and device, electronic equipment and storage medium
WO2019071663A1 (en) Electronic apparatus, virtual sample generation method and storage medium

Legal Events

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