glisicstefan/age-estimation-resnet50
0
Age Estimation using ResNet50
A deep learning project focused on predicting human age from facial images using the UTKFace dataset. This project follows a modular software engineering approach, separating data processing, model architecture, and training logic.
๐ Key Features
- Transfer Learning: Leverages a pre-trained ResNet50 model for robust feature extraction.
- Modular Architecture: Clean code structure with specialized scripts for data setup, model building, and training logic.
- Data Augmentation: Implements
RandomHorizontalFlip,RandomRotation, andColorJitterto improve model generalization and reduce overfitting. - Optimized Training: Two-stage training process, including an initial run followed by fine-tuning with a reduced learning rate.
๐ Performance
The model achieves a Mean Absolute Error (MAE) of 4.67 years on the test set. This means that, on average, the model's prediction is within ~4.7 years of the actual age.
๐ง Inference Pipeline
To ensure high accuracy, the application follows a robust inference workflow:
- Face Detection: Uses OpenCV (Haar Cascades) to locate and crop the face from the input image. This removes background noise and mimics the UTKFace dataset format.
- Preprocessing: The cropped face is resized to 224x224 and normalized using ImageNet statistics.
- Age Estimation: The ResNet50 model processes the face and outputs a continuous value.
- Post-processing: The result is rounded to the nearest integer for a user-friendly experience.
๐ป Web Interface
The project includes an interactive web dashboard built with Gradio.
- Input: Upload an image or use your webcam.
- Output: Real-time age estimation displayed as a clean label.
๐ ๏ธ Installation & Usage
- Clone the repository:
git clone [https://github.com/glisicstefan/age-estimation-resnet50.git](https://github.com/glisicstefan/age-estimation-resnet50.git)
cd age-estimation-resnet50