Update README.md
Browse files
README.md
CHANGED
@@ -36,7 +36,7 @@ model-index:
|
|
36 |
name: Age MAE (years)
|
37 |
---
|
38 |
|
39 |
-
# π ViT-Age-Gender-Elite:
|
40 |
|
41 |
**β
MODEL WEIGHTS NOW AVAILABLE** - Trained model weights uploaded and ready for use!
|
42 |
|
@@ -71,18 +71,132 @@ print(f"Age: {age} years, Gender: {gender}, Confidence: {confidence:.1%}")
|
|
71 |
```
|
72 |
|
73 |
## π **Performance Achievements**
|
|
|
74 |
- β
**94.3% Gender Accuracy** - ELITE tier performance
|
75 |
- β
**4.5 Years Age MAE** - Research-grade precision
|
76 |
-
- β
**86.8M Parameters** - Optimally fine-tuned
|
77 |
- β
**Production Ready** - Stable, consistent results
|
78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
## π **Files Included**
|
|
|
80 |
- `pytorch_model.bin` - Trained model weights (331MB)
|
81 |
- `config.json` - Model configuration and metadata
|
82 |
- `training_logs.json` - Complete training history and metrics
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
|
84 |
-
|
85 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
|
87 |
---
|
88 |
-
|
|
|
|
|
|
|
|
36 |
name: Age MAE (years)
|
37 |
---
|
38 |
|
39 |
+
# π ViT-Age-Gender-Elite: Vision Transformer for Facial Analysis
|
40 |
|
41 |
**β
MODEL WEIGHTS NOW AVAILABLE** - Trained model weights uploaded and ready for use!
|
42 |
|
|
|
71 |
```
|
72 |
|
73 |
## π **Performance Achievements**
|
74 |
+
|
75 |
- β
**94.3% Gender Accuracy** - ELITE tier performance
|
76 |
- β
**4.5 Years Age MAE** - Research-grade precision
|
77 |
+
- β
**86.8M Parameters** - Optimally fine-tuned Vision Transformer
|
78 |
- β
**Production Ready** - Stable, consistent results
|
79 |
|
80 |
+
## π **Dataset & Training Details**
|
81 |
+
|
82 |
+
### **Training Dataset: UTKFace**
|
83 |
+
- **Total Images**: 23,687 facial images
|
84 |
+
- **Age Range**: 1-100 years
|
85 |
+
- **Demographics**: Balanced gender distribution (52.3% Male, 47.7% Female)
|
86 |
+
- **Quality**: High-resolution, diverse lighting and pose conditions
|
87 |
+
|
88 |
+
### **β οΈ Important Dataset Characteristics**
|
89 |
+
The UTKFace dataset has a **specific age distribution**:
|
90 |
+
- **Adults (21-50 years)**: ~70% of data (majority)
|
91 |
+
- **Young Adults (16-30 years)**: ~20% of data
|
92 |
+
- **Children (0-15 years)**: ~5% of data (limited)
|
93 |
+
- **Seniors (50+ years)**: ~5% of data
|
94 |
+
|
95 |
+
### **π― Model Performance by Age Group**
|
96 |
+
- **Excellent**: Adults and young adults (16-60 years) - **94.3% gender accuracy**
|
97 |
+
- **Good**: Teenagers (13-20 years) - **~90% accuracy**
|
98 |
+
- **Limited**: Children (0-12 years) - **Reduced accuracy** due to limited training data
|
99 |
+
- **Good**: Seniors (60+ years) - **~85% accuracy**
|
100 |
+
|
101 |
+
## π **Upcoming Improvements**
|
102 |
+
|
103 |
+
### **Version 2.0 - Enhanced Children Support** (In Development)
|
104 |
+
- π― **Training on FairFace Dataset** - Better age distribution
|
105 |
+
- πΆ **Children-Specific Fine-tuning** - Focused 0-15 years training
|
106 |
+
- π **APPA-REAL Integration** - Apparent age dataset inclusion
|
107 |
+
- π¨ **Data Augmentation** - Synthetic children faces generation
|
108 |
+
|
109 |
+
### **Planned Enhancements**
|
110 |
+
- **Multi-Age Ensemble**: Specialized models for different age ranges
|
111 |
+
- **Cross-Cultural Training**: Enhanced performance across ethnicities
|
112 |
+
- **Age-Specific Confidence**: Different confidence thresholds per age group
|
113 |
+
- **Real-time Optimization**: Mobile and edge device deployment
|
114 |
+
|
115 |
+
## π **Current Model Strengths**
|
116 |
+
|
117 |
+
### **Best Use Cases**
|
118 |
+
- β
**Adult demographic analysis** (primary strength)
|
119 |
+
- β
**Social media content filtering** (teen/adult classification)
|
120 |
+
- β
**Marketing analytics** (adult age segmentation)
|
121 |
+
- β
**Security applications** (adult age verification)
|
122 |
+
|
123 |
+
### **Architecture Advantages**
|
124 |
+
- **Vision Transformer**: Superior to CNN-based approaches
|
125 |
+
- **Multi-task Learning**: Joint age and gender optimization
|
126 |
+
- **Transfer Learning**: Built on google/vit-base-patch16-224
|
127 |
+
- **Robust Features**: Handles various lighting and pose conditions
|
128 |
+
|
129 |
+
## π **Technical Specifications**
|
130 |
+
|
131 |
+
### **Model Architecture**
|
132 |
+
- **Base**: google/vit-base-patch16-224
|
133 |
+
- **Parameters**: 86.8M total
|
134 |
+
- **Input**: 224Γ224 RGB images
|
135 |
+
- **Outputs**: Age (regression) + Gender (binary classification)
|
136 |
+
- **Attention Heads**: 12
|
137 |
+
- **Transformer Layers**: 12
|
138 |
+
|
139 |
+
### **Training Configuration**
|
140 |
+
- **Epochs**: 15 (fully converged)
|
141 |
+
- **Optimizer**: AdamW (lr=2e-5)
|
142 |
+
- **Batch Size**: 32
|
143 |
+
- **Training Time**: 2.95 hours on GPU
|
144 |
+
- **Validation Split**: 80/20 stratified
|
145 |
+
|
146 |
## π **Files Included**
|
147 |
+
|
148 |
- `pytorch_model.bin` - Trained model weights (331MB)
|
149 |
- `config.json` - Model configuration and metadata
|
150 |
- `training_logs.json` - Complete training history and metrics
|
151 |
+
- `model.py` - Model architecture and usage code
|
152 |
+
|
153 |
+
## β οΈ **Usage Recommendations**
|
154 |
+
|
155 |
+
### **Optimal Performance**
|
156 |
+
- **Primary Use**: Adults and young adults (16-60 years)
|
157 |
+
- **High Confidence**: Gender classification across all ages
|
158 |
+
- **Reasonable Accuracy**: Age estimation for adults
|
159 |
+
|
160 |
+
### **Limitations to Consider**
|
161 |
+
- **Children (0-12 years)**: Limited training data may affect accuracy
|
162 |
+
- **Very elderly (70+ years)**: Fewer training examples
|
163 |
+
- **Extreme poses/lighting**: May reduce performance
|
164 |
|
165 |
+
### **Best Practices**
|
166 |
+
- **Face Detection**: Ensure clear, front-facing faces
|
167 |
+
- **Image Quality**: Use good lighting and resolution
|
168 |
+
- **Age Context**: Consider model strengths for your use case
|
169 |
+
- **Confidence Thresholds**: Adjust based on your application needs
|
170 |
+
|
171 |
+
## π¬ **Research & Citation**
|
172 |
+
|
173 |
+
```bibtex
|
174 |
+
@misc{vit-age-gender-elite-2025,
|
175 |
+
title={ViT-Age-Gender-Elite: Vision Transformer for Facial Analysis},
|
176 |
+
author={Abhilash Sahoo},
|
177 |
+
year={2025},
|
178 |
+
publisher={Hugging Face},
|
179 |
+
url={https://huggingface.co/abhilash88/ViT-Age-Gender-Elite}
|
180 |
+
}
|
181 |
+
```
|
182 |
+
|
183 |
+
## π€ **Contributing & Feedback**
|
184 |
+
|
185 |
+
We welcome contributions and feedback, especially:
|
186 |
+
- **Children dataset suggestions** for Version 2.0
|
187 |
+
- **Performance evaluations** on diverse datasets
|
188 |
+
- **Use case feedback** for model improvements
|
189 |
+
- **Technical optimizations** and enhancements
|
190 |
+
|
191 |
+
## π **Roadmap**
|
192 |
+
|
193 |
+
- **Q1 2025**: Children-focused fine-tuning (Version 2.0)
|
194 |
+
- **Q2 2025**: Multi-cultural dataset integration
|
195 |
+
- **Q3 2025**: Mobile optimization and edge deployment
|
196 |
+
- **Q4 2025**: Real-time video analysis capabilities
|
197 |
|
198 |
---
|
199 |
+
|
200 |
+
**Current Version**: 1.0 (Adult-focused) | **Next Version**: 2.0 (Children-enhanced) | **Status**: Production Ready*
|
201 |
+
|
202 |
+
*Best performance on adults (16-60 years). Children support improved in upcoming Version 2.0.
|