Update README.md
Browse files
README.md
CHANGED
|
@@ -1,40 +1,51 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
##
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
- **
|
| 32 |
-
- **
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
cd facial-beauty-rating-cnns# facial-rating-using-cnn
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Aesthetix AI
|
| 3 |
+
emoji: 🗿
|
| 4 |
+
colorFrom: gray
|
| 5 |
+
colorTo: purple
|
| 6 |
+
sdk: streamlit
|
| 7 |
+
sdk_version: 1.29.0
|
| 8 |
+
app_file: app.py
|
| 9 |
+
pinned: false
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# Aesthetix AI: Facial Symmetry & Aesthetic Rater 🗿
|
| 13 |
+
|
| 14 |
+
An AI-powered computer vision system that analyzes facial aesthetics and predicts a rating on a 1.0-5.0 scale. Built with PyTorch, utilizing a fine-tuned ResNet18 architecture and Grad-CAM for visual explainability.
|
| 15 |
+
|
| 16 |
+
**Try the App:** [Link to your Hugging Face Space]
|
| 17 |
+
|
| 18 |
+
## Overview
|
| 19 |
+
|
| 20 |
+
Unlike standard face classifiers that just detect identity, Aesthetix AI is a **regression model** trained to quantify subjective facial attractiveness based on the SCUT-FBP5500 Dataset.
|
| 21 |
+
|
| 22 |
+
It features a complete inference pipeline:
|
| 23 |
+
|
| 24 |
+
1. **Face Isolation**: Uses Haar Cascades to detect and tightly crop the face.
|
| 25 |
+
2. **Semantic Segmentation**: Uses DeepLabV3 to remove background noise (hair/neck masking) to force the model to evaluate facial geometry only.
|
| 26 |
+
3. **Scoring Engine**: A ResNet18 CNN fine-tuned to predict a continuous float score.
|
| 27 |
+
4. **Explainability**: Generates Grad-CAM heatmaps to visualize exactly which features (eyes, jawline, symmetry) the model focused on.
|
| 28 |
+
|
| 29 |
+
## Performance
|
| 30 |
+
|
| 31 |
+
- **Architecture**: ResNet18 (Pre-trained on ImageNet → Fine-tuned)
|
| 32 |
+
- **Loss Function**: MSELoss (Mean Squared Error)
|
| 33 |
+
- **Optimizer**: Adam (lr=1e-4)
|
| 34 |
+
- **Validation Loss**: 0.0858 (MSE)
|
| 35 |
+
- **Interpretation**: The model's predictions are on average within +/- 0.29 points of the human ground truth.
|
| 36 |
+
|
| 37 |
+
## The Stack
|
| 38 |
+
|
| 39 |
+
- **PyTorch**: Core deep learning framework.
|
| 40 |
+
- **Torchvision**: Pre-trained models (ResNet18, DeepLabV3).
|
| 41 |
+
- **OpenCV**: Face detection and image processing.
|
| 42 |
+
- **Streamlit**: Interactive web interface.
|
| 43 |
+
- **Grad-CAM**: Visual attention mapping.
|
| 44 |
+
|
| 45 |
+
## Installation & Usage
|
| 46 |
+
|
| 47 |
+
1. Clone the repo:
|
| 48 |
+
|
| 49 |
+
```bash
|
| 50 |
+
git clone https://github.com/AKMessi/facial-rating-using-cnn.git
|
| 51 |
cd facial-beauty-rating-cnns# facial-rating-using-cnn
|