A hackathon MVP for AI-powered brain MRI analysis. Combines two EfficientNet-B3 models (Alzheimer's staging + Brain Tumor classification) with Grad-CAM explainability, MC Dropout uncertainty estimation, and DeepSeek-powered clinical reports & AI chat.
# From the repo root
bash start.shThen open http://localhost:5173.
cd backend
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
# Copy and edit env (add your DeepSeek API key)
cp .env.example .env
# Start server (models load from ../alz_best.pt and ../tumor_best.pt)
uvicorn app:app --reload --port 8000cd frontend
npm install
npm run dev- Patient Management — Add/remove patient profiles, filter by status (Living / Deceased / Recurrence), persist in localStorage
- Dual Model Analysis — Brain Tumor (Glioma / Meningioma / No Tumor / Pituitary) and Alzheimer's (4 stages) on the same upload
- Uncertainty Estimation — MC Dropout (20 passes) + Test-Time Augmentation (5 views)
- Grad-CAM Heatmaps — Visual explanation of model attention on the final EfficientNet block
- DeepSeek Reports — Auto-generated structured clinical narrative per analysis
- AI Chat Assistant — Streaming chat with full patient + analysis context via DeepSeek
- Settings Modal — Configure DeepSeek API key and check backend connection health
| Model | Architecture | Classes | Dropout |
|---|---|---|---|
alz_best.pt |
EfficientNet-B3 | Mild / Moderate / Non / Very Mild Demented | 0.3 |
tumor_best.pt |
EfficientNet-B3 | Glioma / Meningioma / No Tumor / Pituitary | 0.5 |
Input: 224×224 RGB, ImageNet normalization.
| Method | Path | Description |
|---|---|---|
| GET | /api/health |
Backend + model status |
| GET/POST | /api/patients |
List / create patients |
| PUT/DELETE | /api/patients/{id} |
Update / delete patient |
| POST | /api/analyze |
Run inference (returns prediction + Grad-CAM) |
| POST | /api/report |
Generate DeepSeek clinical report |
| POST | /api/chat/stream |
Streaming AI chat (SSE) |
| GET/PUT | /api/settings |
View / update DeepSeek API key |
DEEPSEEK_API_KEY=sk-... # Required for reports & chat
ALZ_CHECKPOINT=../alz_best.pt # Path to Alzheimer model checkpoint
TUMOR_CHECKPOINT=../tumor_best.pt # Path to Tumor model checkpoint
For research purposes only — not a clinical diagnostic tool. All AI outputs require physician review.