Prediction of Age, Gender, and Ethnicity Using CNN and Facial Images in Real-Time

Anirudh Kanwar, Kiran Deep Singh · 2023

Age, gender and ethnicity prediction is very important nowadays as it has many real-life applications in various types of fields but it is also a very challenging task because of reasons such as the complexity of facial appearance and lighting. Convolutional Neural Networks (CNN) is a deep learning artificial neural network which has shown great success in solving this problem. CNNs use convolutional layers to extract characteristics from the input data and apply a set of filters to the data, which helps to identify different types of patterns in the data. The outputs of CNN are then passed through fully connected layers which perform classification based on the identified patterns. OpenCV is a machine learning library which is available as an open source that helps in performing real-time operations. This library detects objects through captured or real-time images or videos. We propose a real-time age, gender and ethnicity prediction system with the help of OpenCV and then pass it through CNN. In this paper, we trained three CNN models each for age, gender and ethnicity on the preprocessed dataset. We used a large-scale dataset containing facial images of different individuals with labels of all three attributes. We evaluated the performance of trained models on a test set of images and calculated benchmarks such as accuracy. We used OpenCV to capture real-time images from a webcam, preprocessed that image, and then used the trained CNN models to predict the age, gender and ethnicity of the captured image in real-time. The accuracy rates obtained from age, gender and ethnicity models are 82.5, 89.45 and 86.69 percent respectively.

Read the paper · More papers on PaperTik