4. INTRODUCTION
▸ Facial analysis from images has gained a lot of interest because it helps in several
different problems like better ad targeting for customers, better content
recommendation system, security surveillance, and other fields as well.
▸ Age and gender are a very important part of facial attributes and identifying them are
the very basic of facial analysis and a required step for such tasks.
▸ Many companies are using these kinds of tools for different purposes making it easier
for them to work with customers, cater to their needs better and create a great
experience for them.
4
7. STEPS INVOLVED
Detect faces: When given a frame/video, the CNN algorithm first detects for
faces in each frame. Classify into Male/Female : Once it finds faces in the
frame, the features of the faces are extracted, and the gender is determined
using second layer of CNN.
•Classify into one of the 8 age ranges: In the third layer of CNN, the age of
the faces is determined and falls under either of the 8 age ranges [ (0-2), (4-
6), (8-12), (15-20), (25 – 32), (38-43), (48-53), (60-100)]
•Put the results on the frame and display it: the result is displayed on the
frame containing the age range and gender using OpenCV. The resulting
frame consists of a square box around the faces with the estimated gender
and age.
7
8. PROCEDURE
→The Dataset
• For this python project, we'll use the Adience dataset; the dataset is available in the public
domain and you can find it. For this python project, we'll use the Adience dataset; the
dataset is available in the public domain and you can find it here. This dataset serves as a
benchmark for face photos and is inclusive of various real-world imaging conditions like
noise, lighting, pose, and appearance.
The images have been collected from Flickr albums and distributed under the Creative
Commons (CC) license. It has a total of 26,580 photos of 2,284 subjects in eight age ranges
(as mentioned above) and is about IGB in size.The models we will use have been trained on
this dataset This dataset serves as a benchmark for face photos and is inclusive of various
real-world imaging conditions like noise, lighting, pose, and appearance.
The images have been collected from Flickr albums and distributed under the Creative
Commons (CC) license. It has a total of 26,580 photos of 2,284 subjects in eight age ranges
(as mentioned above) and is about 1GB in size.
8
9. PROCEDURE
The models we will use have been trained on this dataset.→ We use the argparse library to
create an argument parser so we can get the frame argument from the command prompt.
We make it parse the argument holding the path to the frame to classify gender and age for.
→ For face, age, and gender, initialize protocol buffer and model.→ Initialize the mean
values for the model and the lists of age ranges and genders to classify from. Now, use the
readNet0 method to load the networks. The first parameter holds trained weights and the
second carries network configuration.→ We make a call to the highlightFace0 function with
the faceNet and frame parameters, and what this returns, we will store in the names
resultImg and faceBoxes. And if we got 0 face Boxes, it means there was no face to detect.
9
16. FUTUTRE SCOPE
16
In cameras, this project is effective for detecting faces and age gaps and
program can also be used to recognize faces using a CCTV camera.
In Real Time Incident Monitoring System can only detect the face, gender
and age according to the defined rules but it still requires more training.
Some future improvements can be made to this project. To improve the
accuracy, a dataset with more number of images can be given.
The algorithm can be improved to an extent where it can be able to
process and give the desired result on images with disturbances like lack
of clarity, a different angle, or any kind of accessories on the face. For
example, if the person is wearing sunglasses, or has makeup on the face,
the algorithm will be able to give the desired result.
17. CONCLUSION
17
We have implemented a CNN to detect gender and age from a single
picture of a face.
The performance of this system can be improved marginally by using
more training data images. There is less availability of labeled images
for age and gender, but CNN can still improve its performance.
As it is difficult to accurately guess an exact age from a single image
because of factors like makeup, lighting, obstructions, and facial
expressions.