Git Product home page Git Product logo

pytorch-age-estimation's Introduction

Gender Classification and Age Estimation

This repository represents a deep learning project aimed at estimating age and predicting gender using the UTKFace dataset available on Kaggle along with MTCNN (Multi-task Cascaded Convolutional Networks) for face detection. The primary objective of this project is to accurately predict the age and gender of individuals depicted in images in the best case scenario.

Project Components

This project comprises two main sections: "Facenet" and "AgeNet" (custom names).

Facenet:

The "Facenet" section employs the Multi-task Cascaded Convolutional Networks (MTCNN) to detect and extract facial regions present within images.

AgeNet:

The "AgeNet" section consists of three distinct components:

  1. Gender Classification Network (VGG-Face): Utilizing the powerful VGG-Face architecture, this network is designed to classify the gender of individuals within the detected facial regions. Its deep learning capabilities enable precise gender identification based on facial features.

  2. Age Range Classification Network: Instead of directly predicting the exact age of each individual in the image, we will predict age ranges. This approach reduces the output complexity, making the classification more efficient.

  3. Age Estimation Network: Unlike conventional age estimation approaches that predict only age ranges, this network refines age estimation further by predicting a specific age from within the age range determined in the previous step. This advanced approach provides more precise age predictions.

These three components are combined to form the "AgeNet" model, a comprehensive architecture for accurate age and gender prediction. The integration of multiple networks enables a more holistic understanding of facial attributes, resulting in enhanced prediction performance.

Training Insights

Visualizing the journey of model training is crucial to understanding its performance. Below, you'll find insightful line charts that represent accuracy and error metrics throughout the training process:

Analyzing the line charts yields the following insights:

  • Gender Classification Accuracy:

    • Training Set: Achieved an impressive gender classification accuracy of 97%.
    • Validation Set: Maintained a strong accuracy of 90% on unseen data.
  • Age Range Classification Accuracy:

    • Training Set: Attained a satisfactory accuracy of 72% in classifying age ranges.
    • Validation Set: Demonstrated robust performance with an accuracy of 65% on validation data.
  • Age Estimation Error:

    • Training Set: Managed age estimation with a mean absolute error of 2.9 , showcasing reasonable precision.
    • Validation Set: Maintained consistency with an estimated age error of 3.05.

The visual representation and detailed insights highlight the model's strengths and areas for potential enhancement. The exceptional gender classification accuracy reflects the model's competence in this task. Although age range classification and age estimation exhibit slightly lower accuracy and marginally higher errors, they offer opportunities for optimization and refinement.

Installation

  1. Clone the repository:
git clone https://github.com/manhcuong02/Pytorch-Age-Estimation.git

cd Pytorch-Age-Estimation
  1. Install the required dependencies:
pip install -r requirements.txt

Usage

  1. Download weights of the pretrained model from ggdrive, and then add them to the 'weights' directory.

  2. Run the age estimation script:

python3 predict.py --image-path your_path --weights weights_path --face-size 64 --device cpu --save-result --imshow   
  1. Using the PyQt5 Interface (coming soon):
python3 main.py

Results

Below are some promising outcomes of this project; however, there still exist inaccuracies in age and gender recognition in certain cases.

pytorch-age-estimation's People

Contributors

manhcuong02 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

chanvitchiib

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.