https://github.com/haturusinghe/cnn-age-gender
This repository contains implementations of convolutional neural networks (CNNs) for age and gender classification using facial images from the UTKFace dataset.
https://github.com/haturusinghe/cnn-age-gender
age-detection convolutional-neural-networks gender-detection tensorflow
Last synced: 2 months ago
JSON representation
This repository contains implementations of convolutional neural networks (CNNs) for age and gender classification using facial images from the UTKFace dataset.
- Host: GitHub
- URL: https://github.com/haturusinghe/cnn-age-gender
- Owner: haturusinghe
- Created: 2021-09-23T01:05:39.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2025-01-09T03:47:38.000Z (over 1 year ago)
- Last Synced: 2025-03-31T06:16:31.705Z (over 1 year ago)
- Topics: age-detection, convolutional-neural-networks, gender-detection, tensorflow
- Language: Jupyter Notebook
- Homepage:
- Size: 6.36 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Age and Gender Classification using CNNs
This repository contains implementations of convolutional neural networks (CNNs) for age and gender classification using facial images from the UTKFace dataset.
## Models
### Age Classification Model
- Uses a CNN architecture with separable convolutions
- Predicts age as a continuous value using regression
- Features:
- Input image size: 200x200x3
- 6 convolutional blocks with batch normalization and LeakyReLU
- Dense layers with dropout for regularization
- Outputs lower and upper age bounds
- Mean Absolute Error loss function
### Gender Classification Model
- CNN for binary classification of gender (male/female)
- Architecture:
- Input image size: 200x200x3
- 5 convolutional blocks with batch normalization
- Dense layers with dropout
- Softmax output layer
- Categorical crossentropy loss
## Dataset
- Uses the [UTKFace dataset](https://susanqq.github.io/UTKFace/)
- Images are preprocessed to 200x200 pixels
- Training/validation split: 70%/30%
- Data augmentation with random flips and rotations
## Training
- Models trained using Adam optimizer
- Early stopping and model checkpointing
- TensorBoard logging for monitoring training
- Learning rate scheduling
## Results
The models achieve:
- Age prediction: MAE of ~5.5 years
- Gender classification: ~90% accuracy
## Requirements
- TensorFlow 2.x
- NumPy
- Matplotlib
- scikit-learn
## Usage
The Jupyter notebooks contain the complete implementation:
- `age_class_model.ipynb`: Age regression model
- `gender_class_model(UTK_Crop).ipynb`: Gender classification model
Models can be exported to TFLite format for mobile/edge deployment.