Skip to content

Developed an Image-based Classifier model using CNN,Keras and OpenCV to detect Age of a person from an input image

Notifications You must be signed in to change notification settings

rohanrohan2012/Age-Classifier

Repository files navigation

Age Classification using CNN

Overview

A Convolutional Neural Network designed from scratch trained using Keras framework that categorizes images of people based on their ages. The model categorizes the input image based on three categories- Young , Middle and Old.

Dataset

IMFDB - Indian Movie Face Database was the dataset used for this project. IMFDB is a large unconstrained face database consisting of 34512 images of 100 Indian actors collected from more than 100 videos. All the images are manually selected and cropped from the video frames resulting in a high degree of variability interms of scale, pose, expression, illumination, age, resolution, occlusion, and makeup. url- http://cvit.iiit.ac.in/projects/IMFDB/

Preprocessing

The following preprocessing was applied to each image:

  • Have trained the network on frontal faces images
  • Random crops of 64 × 64 pixels from the input image of random sizes
  • Randomly mirror images in each forward-backward training pass
  • Data Augmentation is used

Model Description

For Age Classification, following are the details of the model:

  1. 3x3 filter shape, 32 feature maps. Stride of 1 and 0 padding. Followed by: ReLU,Batch-Normalization,Max-Pool,Dropout of 0.25
  2. 3x3 filter shape, 64 feature maps. Followed by: Batch-Normalization
  3. 3x3 filter shape, 64 feature maps,stride 1 and padding 1. ReLU, Batch-Normalization,Max-Pool of size 2,Dropout of 0.25.
  4. 3x3 filter shape, 128 feature maps. Followed by: Batch-Normalization
  5. 3x3 filter shape, 128 feature maps. Followed by: Batch-Normalization
  6. 3x3 filter shape, 128 feature maps,stride 1 and padding 1. ReLU, Batch-Normalization,Max-Pool of size 2,Dropout of 0.25.
  7. Fully connected layer of 512 neurons. Followed by : ReLU,Batch Normalization, Dropout = 0.5.
  8. Last layer maps to the 3 classes for age

Trained with a learning rate of 0.01,Batch Size of 32 and with 75 to 100 epochs. Used Stochastic Gradient Descent (SGD) optimizer and 70% split of train and validation data. Used OpenCV library for image processing along with data visualization and augmentation.

With 75 epochs With 100 epochs

Libraries Used

1.OpenCV
2.Keras
3.Numpy
4.Pandas
5.Seaborn
6.Matplotlib
7.Pickle
8.sklearn

Results

Training Accuracy : 84.34% Validation Accuracy : 84.91%

Contributors

-Rohan Limaye: https://github.com/rylp
-Rohan Naik: https://github.com/rohan-naik07

About

Developed an Image-based Classifier model using CNN,Keras and OpenCV to detect Age of a person from an input image

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published