Spaces:
Runtime error
Runtime error
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,12 +1,56 @@
|
|
| 1 |
-
---
|
| 2 |
-
title: Age Detection
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
-
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 8 |
-
app_file: app.py
|
| 9 |
-
pinned: false
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Age Detection ResNet50
|
| 3 |
+
emoji: π¨βπ©βπ§βπ¦
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: green
|
| 6 |
+
sdk: gradio
|
| 7 |
+
sdk_version: 4.44.0
|
| 8 |
+
app_file: app.py
|
| 9 |
+
pinned: false
|
| 10 |
+
license: mit
|
| 11 |
+
models:
|
| 12 |
+
- Sharris/age-detection-resnet50-model
|
| 13 |
+
datasets:
|
| 14 |
+
- UTKFace
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
# Age Detection with ResNet50
|
| 18 |
+
|
| 19 |
+
This Hugging Face Space demonstrates age prediction from facial images using a ResNet50-based regression model trained on the UTKFace dataset.
|
| 20 |
+
|
| 21 |
+
## π― **Key Features**
|
| 22 |
+
|
| 23 |
+
- **Advanced Architecture**: ResNet50 backbone with 256Γ256 input resolution
|
| 24 |
+
- **Bias Correction**: Inverse frequency sample weighting to address dataset imbalances
|
| 25 |
+
- **Robust Training**: Huber loss for outlier resilience and label noise tolerance
|
| 26 |
+
- **High Accuracy**: 19.96 years validation MAE with comprehensive bias correction
|
| 27 |
+
|
| 28 |
+
## π§ **Model Details**
|
| 29 |
+
|
| 30 |
+
- **Architecture**: ResNet50 pre-trained on ImageNet
|
| 31 |
+
- **Input Size**: 256Γ256Γ3 RGB images
|
| 32 |
+
- **Loss Function**: Huber loss (Ξ΄=1.0) for robust regression
|
| 33 |
+
- **Sample Weighting**: Inverse frequency weighting (0.225x to 34.259x by age)
|
| 34 |
+
- **Training Data**: UTKFace dataset with age range 0-116 years
|
| 35 |
+
|
| 36 |
+
## π‘ **Usage Tips**
|
| 37 |
+
|
| 38 |
+
1. **Crop to face**: For best results, crop the image to show mainly the face
|
| 39 |
+
2. **Good lighting**: Ensure the face is well-lit and clearly visible
|
| 40 |
+
3. **Front-facing**: Works best with front-facing portraits
|
| 41 |
+
4. **Age range**: Trained on ages 0-116, most accurate for common age ranges
|
| 42 |
+
|
| 43 |
+
## π **Performance**
|
| 44 |
+
|
| 45 |
+
- **Validation MAE**: 19.96 years
|
| 46 |
+
- **Bias Correction**: Addresses systematic young-age bias through sample weighting
|
| 47 |
+
- **Age Distribution**: Balanced training across all age groups using inverse frequency weighting
|
| 48 |
+
|
| 49 |
+
## π¬ **Technical Implementation**
|
| 50 |
+
|
| 51 |
+
- Built with TensorFlow/Keras 3
|
| 52 |
+
- ResNet50 preprocessing pipeline
|
| 53 |
+
- Gradio interface for easy web deployment
|
| 54 |
+
- Automatic model download from Hugging Face Hub
|
| 55 |
+
|
| 56 |
+
Upload a face image and get an instant age prediction!
|