Age and Gender Detection Using Python: Mohd Rafey, Gurubasava
Age and Gender Detection Using Python: Mohd Rafey, Gurubasava
ISSN: 2456-236X
Vol. 05 Issue 01 | 2020
ABSTRACT
In this paper, the author has worked on a technique for age and gender classification using python
algorithm. Human identification and classification are being utilized in various field for a very long time.
Fields like Government ID Cards, Verification procedures etc. We have already developed techniques like
retina scan, iris scans, fingerprint and other sophisticated systems such as DNA fingerprinting to identify the
individuals. Although these already built methods works efficiently, the hardware, software and human
proficiency requirement are way too demanding for several simpler task which may or may not require a
professional efficiency. Technique reported in this paper is simple and easy for human classification which
can be performed using only a webcam and a decent computer system.
Keywords: Age Estimation, Gender Detection, Python Deep Learning, Convolutional Neural Network,
Webcam
1. INTRODUCTION
Human Classification is an age-old procedure and being done in various fields and technology such as
biometrics, forensics sciences, Image processing, Identification system, etc. With the development of Artificial
Intelligence and techniques such as Neural Network and Deep Learning, it has become increasingly easier to
classify human. These new technologies help identification, classification of Individuals without the need of
another professional or Individual records. Also Being immensely fast, these technologies can classify millions
of individuals way faster than a professional.
Human Facial Image Processing provides many clues and cues applicable to industries such as security,
entertainment, etc [1]. Human Face can provide immense amount of information like their emotional state,
slightest agreement or disagreement, irony or anger, etc. This is the reason why faces have been long research
topic in psychology [2]. This data (or in our case digital data) is very valuable as they help recognition, selection
or identification of individual according to the requirement.
Age and Gender Detection can alone provide a lot of information to places such as recruitment team of
organizations, Verification of ID cards, example: Voter ID cards which millions of individual uses to cast their
vote at the time of election, etc. Human Facial Image processing eases the task of finding ineligible or counterfeit
individuals.
2. RESEARCH METHODOLOGY
Basic requirement for this project includes: Python 2.7-3.6, Open CV2, PyCharm Community Edition,
Webcam (at least 2.0MP). An adequately equipped windows machine to run the project is required.
The Project uses Python Deep Learning to identify the gender and age of given face data accurately.
Deep Learning belongs to the family of machine Learning. Deep Learning mimics the functionality of human
cognitive thinking and acts as an Artificial Intelligence system. It can recognise objects, faces, speeches, characters
from unstructured data sets.
The Algorithm designed is divided into four main parts: Input, Face Detection, Face Processing (Age
and Gender classification) and output.
2.1 Input
Main Focus of this design is to make the whole process easier and faster. In order to get the input fast there
are two options to feed the data into the algorithm. First, User can use the system webcam or any other webcam
camera device to directly take the live data. This is not only fast but user can get real-time output while using the
webcam device. Second User can use “—image <name>.jpg” tag while initiating the algorithm. This method reads
the jpeg file, process it and gives back the output. One key advantage of this method is user can process multiple
files at once.
2.2 Face Detection
Face detection has a long research history. Yang et al [3] compared some prominent face detection algorithms
in year 2002, But they did not use any prominent algorithms such as Haar Classifiers in their studies. Haar
Classifier is one of the most prominent and accurate object detection approach described by P. Viola and M. Jones
[4]. For any Face recognition system or facial image processing system to work properly face detection needs to
be implemented properly. A thorough survey can be found in [5] There are several natural (lighting, pose angle,
face marks) as well as digital (noise, glitches) variation imposed while detecting a face in a frame. Difficulties of
human face recognition lie in the following two properties of human face as a pattern: (1) number of patterns, that
is, faces to be classified is tremendous, maybe infinite; and (2) almost all patterns are very similar[5]. We have
used audience dataset of all the different type of variations to fix this issue and increase the efficiency of the
algorithm. The audience set will also act as benchmark for Gender Detection and Age Classification in out neural
network. All the photos have been collected from Creative Common (CC) distribution license.
3. PROCEDURE
Since the technique is implemented, we can start testing it for its accuracy. The general procedure to be
followed is
• Input the data.
• Create a frame.
• Detect the face.
• Classify the Gender.
• Classify the Age Group.
• Attach the result in the image.
• Output the image in specified location.
4. TEST RUN
To verify the efficiency of the technique we collected some of human face along with their mentioned
ages when the photo was captured and fed them to the program. The performance can be judged using the chart
below:
Gender: Female Gender: Female Age Group: (22-34) Both Age and
Age: 32 years Gender are
correct.
Gender: Male Gender: Male Age Group: (22-34) Both Age and
Age: 28 years Gender are
correct.
Gender: Male Gender: Male Age Group: (60-100) Both Age and
Age: 88 years Gender are
correct.
[1] M. H. U. Yap, “Facial image processing for facial analysis,” Proceedings - International Carnahan
Conference on Security Technology., vol. 1, 2010.
[2] C. Y. Jiang X., Applied Pattern Recognition. Studies in Computational Intelligence, Berlin, Heidelberg:
Springer, 2008.
[3] D. J. K. a. N. A. M. H. Yang, “Detecting Faces in Images: A Survey,” IEEE, vol. 24, no. 1, pp. 34-58, 2002.
[4] P. V. a. M. Jones, “Rapid object detection using a boosted cascade of simple features,” Proceedings of the
2001 IEEE Computer Society Conference on Computer Vision and Pattern Recognition, vol. 1, 2001.
[5] W.-Y. &. C. R. &. P. Zhao, “Face Recognition: A Literature Survey,” ACM Comput. Surv.., pp. 399-458.
[6] K. K. Y. Kaya, “A BASIC STUDY ON HUMAN FACE RECOGNITION,” Frontiers of Pattern
Recognition, Academic Press, pp. 265-289, 1972.
[7] D. D. Zhang, “Automated Biometrics - Technologies and Systems,” Kluwer Academic Publishers, vol. 1,
2000.
[8] R. E. a. T. H. E. Eidinger, “Age and Gender Estimation of Unfiltered Faces,” IEEE Transactions on
Information Forensics and Security, vol. 9, no. 12, pp. 2170-2179, 2014.