smooth-app
A collaborative, free and open database of ingredients, nutrition facts and information on food products from around the world
Ensemble of ResNet-50, EfficientNet-B3 and ViT-S/16 for Down Syndrome screening from facial imagery.
HealthTypeScript · JavaScriptGitHub @mirzalihassan12-hashOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
No updates detected yet. GitHub releases will appear here.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
Loading the full README. The saved excerpt is shown below.
title: Deepsyndrome Api
emoji: 🧬
colorFrom: indigo
colorTo: cyan
sdk: gradio
app_file: app_hf.py
pinned: false
Ensemble of ResNet-50 + EfficientNet-B3 + ViT-S/16 for Down Syndrome detection from facial imagery.
Pre-trained .pth files are already included. Just install and run.
Step 3 — Open the web UI
Upload any facial image and get predictions from all 3 models instantly.
Use this when you want to retrain on a new or updated dataset.
After training finishes, the .pth files in the project root are automatically replaced.Read the full README ↗Ensemble of ResNet-50 + EfficientNet-B3 + ViT-S/16 for Down Syndrome detection from facial imagery.
deep-syndrome/
├── app.py # Entry point — starts the server
├── main.py # FastAPI app + model loading + API routes
│
├── train.py # Train ALL 3 models in one go
├── train_resnet50.py # Train ResNet-50 only
├── train_efficientnet.py # Train EfficientNet-B3 only
├── train_vit.py # Train ViT-S/16 only
│
├── training/ # Shared training utilities
│ ├── dataset.py # Dataset class, transforms, dataloaders
│ ├── engine.py # Train loop, early stopping, evaluation
│ └── plots.py # Training curves, ROC, Grad-CAM
│
├── data/
│ └── Down Syndrome Dataset/
│ ├── downSyndrome/ # Down Syndrome images
│ └── healthy/ # Control images
│
├── static/
│ └── index.html # Web UI (served at http://localhost:7860)
│
├── requirements.txt # Server dependencies
├── requirements_train.txt # Training dependencies
├── ResNet50_best.pth # Trained ResNet-50 weights
├── EfficientNet_B3_best.pth # Trained EfficientNet-B3 weights
├── ViT_S16_best.pth # Trained ViT-S/16 weights
└── results/ # Auto-created after training
├── resnet50/ # ResNet-50 curves, confusion matrix, Grad-CAM
├── efficientnet/ # EfficientNet-B3 plots
└── vit/ # ViT-S/16 plots
Pre-trained
.pthfiles are already included. Just install and run.
Step 1 — Install server dependencies
pip install -r requirements.txt
Step 2 — Start the server
python app.py
Step 3 — Open the web UI
http://localhost:7860
Upload any facial image and get predictions from all 3 models instantly.
Use this when you want to retrain on a new or updated dataset.
After training finishes, the .pth files in the project root are automatically replaced.
pip install -r requirements_train.txt
Your dataset folder should have subfolders named with these keywords:
| Class | Accepted folder name keywords |
|---|---|
| Down Syndrome | down, syndrome, ds, positive, affected |
| Control (no DS) | control, normal, healthy, negative, non |
Example valid structures:
my_dataset/
├── down_syndrome/ ← images here
└── control/ ← images here
my_dataset/
├── DS_images/
├── DS_more/
└── normal_faces/
The script auto-explores all subfolders recursively and splits 70% train / 15% val / 15% test.
Dataset is already included in data/Down Syndrome Dataset/.
Train all 3 models at once (recommended)
python train.py --data-dir "data/Down Syndrome Dataset"
Or train each model separately
python train_resnet50.py --data-dir "data/Down Syndrome Dataset"
python train_efficientnet.py --data-dir "data/Down Syndrome Dataset"
python train_vit.py --data-dir "data/Down Syndrome Dataset"
Folder picker dialog (no args needed)
python train.py
A window opens — select the data/Down Syndrome Dataset folder.
| Model | Key improvement | Default LR | Default Epochs |
|---|---|---|---|
| ResNet-50 | Label smoothing (0.1) + GridDistortion aug | 1e-4 | 20 |
| EfficientNet-B3 | CLAHE + GaussianBlur augmentation | 1e-4 | 20 |
| ViT-S/16 | Linear warmup (5ep) + CosineAnnealingLR | 5e-5 | 25 |
All models share: early stopping (patience 7-8), AMP on GPU, CosineAnnealingLR.
| Flag | Default | Description |
|---|---|---|
--data-dir | (dialog) | Path to dataset root folder |
--output-dir | project root | Where to save .pth files |
--epochs | model-specific | Training epochs |
--batch-size | 32 | Batch size |
--lr | model-specific | Learning rate |
--no-gradcam | off | Skip Grad-CAM visualization |
--workers | 0 | DataLoader workers (keep 0 on Windows) |
Examples:
# Quick test
python train_resnet50.py --data-dir "data/Down Syndrome Dataset" --epochs 5
# ViT with custom LR
python train_vit.py --data-dir "data/Down Syndrome Dataset" --epochs 30 --lr 3e-5
python app.py
Training outputs saved to results/:
training_curves.png — loss / accuracy / AUC per epochroc_curves.png — ROC curve comparison*_confusion.png — confusion matrix per model*_gradcam.png — Grad-CAM heatmaps (best model)metrics.csv — accuracy, F1, AUC-ROC table| Method | Endpoint | Description |
|---|---|---|
GET | / | Web UI |
GET | /health | Model load status |
GET | /api | API info JSON |
POST | /predict | Run prediction — send multipart/form-data with file field |
GET | /docs | Swagger UI (interactive API docs) |
Example curl request:
curl -X POST http://localhost:7860/predict \
-F "[email protected]"
Example response:
{
"prediction": "Down Syndrome",
"confidence": 87.43,
"probabilities": {
"control": 12.57,
"down_syndrome": 87.43
},
"models_used": ["ResNet-50", "EfficientNet-B3", "ViT-S/16"],
"individual": {
"ResNet-50": { "prediction": "Down Syndrome", "confidence": 91.2 },
"EfficientNet-B3": { "prediction": "Down Syndrome", "confidence": 85.6 },
"ViT-S/16": { "prediction": "Control", "confidence": 78.1 }
},
"demo_mode": false
}
.pth files are found, the server runs in Demo Mode (random predictions).--workers 0 during training to avoid multiprocessing issues.