Spaces:
Runtime error
Runtime error
| title: Age Detection ResNet50 | |
| emoji: π¨βπ©βπ§βπ¦ | |
| colorFrom: blue | |
| colorTo: green | |
| sdk: gradio | |
| sdk_version: 4.44.0 | |
| app_file: app.py | |
| pinned: false | |
| license: mit | |
| models: | |
| - Sharris/age-detection-resnet50-model | |
| datasets: | |
| - UTKFace | |
| # Age Detection with ResNet50 | |
| This Hugging Face Space demonstrates age prediction from facial images using a ResNet50-based regression model trained on the UTKFace dataset. | |
| ## π― **Key Features** | |
| - **Advanced Architecture**: ResNet50 backbone with 256Γ256 input resolution | |
| - **Bias Correction**: Inverse frequency sample weighting to address dataset imbalances | |
| - **Robust Training**: Huber loss for outlier resilience and label noise tolerance | |
| - **High Accuracy**: 19.96 years validation MAE with comprehensive bias correction | |
| ## π§ **Model Details** | |
| - **Architecture**: ResNet50 pre-trained on ImageNet | |
| - **Input Size**: 256Γ256Γ3 RGB images | |
| - **Loss Function**: Huber loss (Ξ΄=1.0) for robust regression | |
| - **Sample Weighting**: Inverse frequency weighting (0.225x to 34.259x by age) | |
| - **Training Data**: UTKFace dataset with age range 0-116 years | |
| ## π‘ **Usage Tips** | |
| 1. **Crop to face**: For best results, crop the image to show mainly the face | |
| 2. **Good lighting**: Ensure the face is well-lit and clearly visible | |
| 3. **Front-facing**: Works best with front-facing portraits | |
| 4. **Age range**: Trained on ages 0-116, most accurate for common age ranges | |
| ## π **Performance** | |
| - **Validation MAE**: 19.96 years | |
| - **Bias Correction**: Addresses systematic young-age bias through sample weighting | |
| - **Age Distribution**: Balanced training across all age groups using inverse frequency weighting | |
| ## π¬ **Technical Implementation** | |
| - Built with TensorFlow/Keras 3 | |
| - ResNet50 preprocessing pipeline | |
| - Gradio interface for easy web deployment | |
| - Automatic model download from Hugging Face Hub | |
| Upload a face image and get an instant age prediction! |