abhilash88 / age-gender-prediction

huggingface.co
Total runs: 3.1K
24-hour runs: 187
7-day runs: 426
30-day runs: -114
Model's Last Updated: October 03 2025
image-classification

Introduction of age-gender-prediction

Model Details of age-gender-prediction

๐Ÿ† ViT-Age-Gender-Prediction: Vision Transformer for Facial Analysis

โœ… MODEL WEIGHTS NOW AVAILABLE - Trained model weights uploaded and ready for use!

๐ŸŽฏ Quick Usage
import torch
from transformers import ViTImageProcessor
from model import AgeGenderViTModel  # Use the model.py from this repo

# Load model
model = AgeGenderViTModel()
model.load_state_dict(torch.load("pytorch_model.bin"))
model.eval()

# Load processor
processor = ViTImageProcessor.from_pretrained("google/vit-base-patch16-224")

# Predict on image
from PIL import Image
image = Image.open("your_image.jpg")
inputs = processor(images=image, return_tensors="pt")

with torch.no_grad():
    age_pred, gender_pred = model(inputs["pixel_values"])
    
age = int(age_pred.item())
gender = "Female" if gender_pred.item() > 0.5 else "Male"
confidence = gender_pred.item() if gender_pred.item() > 0.5 else 1 - gender_pred.item()

print(f"Age: {age} years, Gender: {gender}, Confidence: {confidence:.1%}")
๐Ÿ† Performance Achievements
  • โœ… 94.3% Gender Accuracy - ELITE tier performance
  • โœ… 4.5 Years Age MAE - Research-grade precision
  • โœ… 86.8M Parameters - Optimally fine-tuned Vision Transformer
  • โœ… Production Ready - Stable, consistent results
๐Ÿ“Š Dataset & Training Details
Training Dataset: UTKFace
  • Total Images : 23,687 facial images
  • Age Range : 1-100 years
  • Demographics : Balanced gender distribution (52.3% Male, 47.7% Female)
  • Quality : High-resolution, diverse lighting and pose conditions
โš ๏ธ Important Dataset Characteristics

The UTKFace dataset has a specific age distribution :

  • Adults (21-50 years) : ~70% of data (majority)
  • Young Adults (16-30 years) : ~20% of data
  • Children (0-15 years) : ~5% of data (limited)
  • Seniors (50+ years) : ~5% of data
๐ŸŽฏ Model Performance by Age Group
  • Excellent : Adults and young adults (16-60 years) - 94.3% gender accuracy
  • Good : Teenagers (13-20 years) - ~90% accuracy
  • Limited : Children (0-12 years) - Reduced accuracy due to limited training data
  • Good : Seniors (60+ years) - ~85% accuracy
๐Ÿ”„ Upcoming Improvements
Version 2.0 - Enhanced Children Support (In Development)
  • ๐ŸŽฏ Training on FairFace Dataset - Better age distribution
  • ๐Ÿ‘ถ Children-Specific Fine-tuning - Focused 0-15 years training
  • ๐Ÿ“Š APPA-REAL Integration - Apparent age dataset inclusion
  • ๐ŸŽจ Data Augmentation - Synthetic children faces generation
Planned Enhancements
  • Multi-Age Ensemble : Specialized models for different age ranges
  • Cross-Cultural Training : Enhanced performance across ethnicities
  • Age-Specific Confidence : Different confidence thresholds per age group
  • Real-time Optimization : Mobile and edge device deployment
๐Ÿ“ˆ Current Model Strengths
Best Use Cases
  • โœ… Adult demographic analysis (primary strength)
  • โœ… Social media content filtering (teen/adult classification)
  • โœ… Marketing analytics (adult age segmentation)
  • โœ… Security applications (adult age verification)
Architecture Advantages
  • Vision Transformer : Superior to CNN-based approaches
  • Multi-task Learning : Joint age and gender optimization
  • Transfer Learning : Built on google/vit-base-patch16-224
  • Robust Features : Handles various lighting and pose conditions
๐Ÿ“Š Technical Specifications
Model Architecture
  • Base : google/vit-base-patch16-224
  • Parameters : 86.8M total
  • Input : 224ร—224 RGB images
  • Outputs : Age (regression) + Gender (binary classification)
  • Attention Heads : 12
  • Transformer Layers : 12
Training Configuration
  • Epochs : 15 (fully converged)
  • Optimizer : AdamW (lr=2e-5)
  • Batch Size : 32
  • Training Time : 2.95 hours on GPU
  • Validation Split : 80/20 stratified
๐Ÿ“Š Files Included
  • pytorch_model.bin - Trained model weights (331MB)
  • config.json - Model configuration and metadata
  • training_logs.json - Complete training history and metrics
  • model.py - Model architecture and usage code
โš ๏ธ Usage Recommendations
Optimal Performance
  • Primary Use : Adults and young adults (16-60 years)
  • High Confidence : Gender classification across all ages
  • Reasonable Accuracy : Age estimation for adults
Limitations to Consider
  • Children (0-12 years) : Limited training data may affect accuracy
  • Very elderly (70+ years) : Fewer training examples
  • Extreme poses/lighting : May reduce performance
Best Practices
  • Face Detection : Ensure clear, front-facing faces
  • Image Quality : Use good lighting and resolution
  • Age Context : Consider model strengths for your use case
  • Confidence Thresholds : Adjust based on your application needs
๐Ÿ”ฌ Research & Citation
@misc{age-gender-prediction-2025,
  title={Age-Gender-Prediction: Vision Transformer for Facial Analysis},
  author={Abhilash Sahoo},
  year={2025},
  publisher={Hugging Face},
  url={https://huggingface.co/abhilash88/age-gender-prediction}
}
๐Ÿค Contributing & Feedback

We welcome contributions and feedback, especially:

  • Children dataset suggestions for Version 2.0
  • Performance evaluations on diverse datasets
  • Use case feedback for model improvements
  • Technical optimizations and enhancements
๐Ÿ“ˆ Roadmap
  • Q1 2025 : Children-focused fine-tuning (Version 2.0)
  • Q2 2025 : Multi-cultural dataset integration
  • Q3 2025 : Mobile optimization and edge deployment
  • Q4 2025 : Real-time video analysis capabilities

Current Version : 1.0 (Adult-focused) | Next Version : 2.0 (Children-enhanced) | Status : Production Ready*

*Best performance on adults (16-60 years). Children support improved in upcoming Version 2.0.

Runs of abhilash88 age-gender-prediction on huggingface.co

3.1K
Total runs
187
24-hour runs
397
3-day runs
426
7-day runs
-114
30-day runs

More Information About age-gender-prediction huggingface.co Model

More age-gender-prediction license Visit here:

https://choosealicense.com/licenses/apache-2.0

age-gender-prediction huggingface.co

age-gender-prediction huggingface.co is an AI model on huggingface.co that provides age-gender-prediction's model effect (), which can be used instantly with this abhilash88 age-gender-prediction model. huggingface.co supports a free trial of the age-gender-prediction model, and also provides paid use of the age-gender-prediction. Support call age-gender-prediction model through api, including Node.js, Python, http.

age-gender-prediction huggingface.co Url

https://huggingface.co/abhilash88/age-gender-prediction

abhilash88 age-gender-prediction online free

age-gender-prediction huggingface.co is an online trial and call api platform, which integrates age-gender-prediction's modeling effects, including api services, and provides a free online trial of age-gender-prediction, you can try age-gender-prediction online for free by clicking the link below.

abhilash88 age-gender-prediction online free url in huggingface.co:

https://huggingface.co/abhilash88/age-gender-prediction

age-gender-prediction install

age-gender-prediction is an open source model from GitHub that offers a free installation service, and any user can find age-gender-prediction on GitHub to install. At the same time, huggingface.co provides the effect of age-gender-prediction install, users can directly use age-gender-prediction installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

age-gender-prediction install url in huggingface.co:

https://huggingface.co/abhilash88/age-gender-prediction

Url of age-gender-prediction

age-gender-prediction huggingface.co Url

Provider of age-gender-prediction huggingface.co

abhilash88
ORGANIZATIONS

Other API from abhilash88