Sharris commited on
Commit
baac404
Β·
verified Β·
1 Parent(s): 451b207

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +56 -12
README.md CHANGED
@@ -1,12 +1,56 @@
1
- ---
2
- title: Age Detection Space
3
- emoji: 🌍
4
- colorFrom: red
5
- colorTo: blue
6
- sdk: gradio
7
- sdk_version: 5.45.0
8
- app_file: app.py
9
- pinned: false
10
- ---
11
-
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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!