| ο»Ώ--- |
| language: en |
| license: mit |
| library_name: tensorflow |
| tags: |
| - computer-vision |
| - image-classification |
| - age-estimation |
| - face-analysis |
| - resnet50v2 |
| - tensorflow |
| - keras |
| - utkface |
| - bias-correction |
| - age-groups |
| - classification |
| - deep-learning |
| - facial-analysis |
| - demographic-estimation |
| - transfer-learning |
| datasets: |
| - UTKFace |
| metrics: |
| - accuracy |
| model-index: |
| - name: age-group-classifier |
| results: |
| - task: |
| type: image-classification |
| name: Age Group Classification |
| dataset: |
| type: UTKFace |
| name: UTKFace |
| metrics: |
| - type: accuracy |
| value: 0.755 |
| name: Validation Accuracy |
| pipeline_tag: image-classification |
| base_model: tensorflow/resnet50v2 |
| widget: |
| - src: https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/image-classification-input.jpg |
| example_title: Sample Face Image |
| --- |
| |
| # Age Group Classification Model π―π₯ |
|
|
| A breakthrough age group classification model that **solves the age prediction bias problem** where 70-year-olds are incorrectly predicted as 30-year-olds. Instead of exact age regression, this model classifies faces into 5 practical age groups with **75.5% validation accuracy**. |
|
|
| ## π Quick Start |
|
|
| ### Using Hugging Face Transformers |
| ```python |
| from transformers import pipeline |
| from PIL import Image |
| |
| # Load the classifier |
| classifier = pipeline("image-classification", |
| model="Sharris/age-group-classifier") |
| |
| # Classify an image |
| image = Image.open("face_image.jpg") |
| results = classifier(image) |
| |
| print(f"Predicted age group: {results[0]['label']}") |
| print(f"Confidence: {results[0]['score']:.2%}") |
| ``` |
|
|
| ## π― Model Overview |
|
|
| ### The Problem We Solved |
| Traditional age regression models suffer from **severe age bias**: |
| - 70-year-old faces β Predicted as 30-year-olds β |
| - Inconsistent predictions across age ranges |
| - Poor handling of seniors and elderly individuals |
|
|
| ### Our Solution: Age Group Classification |
| - **5 Age Groups**: More robust than exact age regression β
|
| - **Bias-Free**: 75-year-olds correctly classified as "Senior (61-80)" β
|
| - **Practical**: Returns useful age ranges for real applications β
|
| - **Reliable**: 75.5% validation accuracy with stable predictions β
|
|
|
| ## π Model Performance |
|
|
| | Metric | Value | Description | |
| |--------|-------|-------------| |
| | **Validation Accuracy** | **75.5%** | 5-class classification accuracy | |
| | **Training Accuracy** | **79.1%** | Training set performance | |
| | **Generalization Gap** | **3.6%** | Healthy gap - no overfitting | |
|
|
| ## π·οΈ Age Groups |
|
|
| | Group ID | Age Range | Label | Description | |
| |----------|-----------|-------|-------------| |
| | 0 | 0-20 years | Youth | Children, teenagers | |
| | 1 | 21-40 years | Young Adult | College age to early career | |
| | 2 | 41-60 years | Middle Age | Established adults | |
| | 3 | 61-80 years | Senior | Retirement age | |
| | 4 | 81-100 years | Elderly | Advanced age | |
|
|
| ## π€ Live Demo |
|
|
| Try the model instantly: **[Age Group Classifier Demo](https://huggingface.co/spaces/Sharris/age-group-classifier-demo)** |
|
|
| ## π License & Ethics |
|
|
| - **License**: MIT License |
| - **Bias Mitigation**: Specifically designed to reduce age prediction bias |
| - **Privacy**: Consider consent when processing facial images |
|
|
| ## π Citation |
|
|
| ```bibtex |
| @misc{age-group-classifier-2025, |
| title={Age Group Classification: Solving Age Prediction Bias in Facial Analysis}, |
| author={Sharris}, |
| year={2025}, |
| publisher={Hugging Face}, |
| url={https://huggingface.co/Sharris/age-group-classifier} |
| } |
| ``` |
|
|