DementiaNet is a multimodal deep-learning system that predicts Alzheimer's Disease / Dementia risk across three independent data modalities, each backed by its own trained neural network:
| Modality | Model Type | Classes / Output |
|---|---|---|
| MRI | CNN (_MRI_CNN) |
Non-Demented · Very Mild · Mild · Moderate |
| Biomarkers | Feedforward NN (_Biomarker_NN) |
No Dementia · Dementia (probability) |
| Speech | (in progress) | Low Risk · High Risk |
Results from individual models are fused via a weighted ensemble to produce a combined dementia risk score.
- Full in-app training — no terminal required. Train the MRI and Biomarker models directly from the Streamlit UI with configurable epochs and learning rate.
- Named checkpoint management — save multiple trained weights with custom names and notes. Switch between checkpoints at any time without restarting the app.
- Checkpoint registry — a
checkpoints/registry.jsonfile tracks every saved model's accuracy, hyperparameters, date, and notes, persisting across sessions. - Demo-ready loading — on demo day, open the app, go to the Model Manager, and load your best checkpoint in one click.
- Weighted ensemble — the Ensemble tab combines MRI (45%), Biomarker (25%), and Speech (30%) predictions into a single risk gauge.
- Live training feedback — per-epoch loss and validation accuracy stream into the UI in real time during training.
480-NN-Project-MRI/
├── app.py # Streamlit application (main entry point)
├── run.sh # One-command launcher (venv + deps + app)
├── requirements.txt # Python dependencies
│
├── functions/
│ ├── mri.py # MRI CNN model definition and training script
│ ├── biomarker.py # Biomarker NN model definition and training script
│ ├── speech.py # Speech model (in progress)
│ ├── multimodal.py # Ensemble / multimodal utilities
│ └── main.py # CLI entry point
│
├── checkpoints/
│ ├── registry.json # Named checkpoint registry (auto-generated)
│ ├── mri_best.pt # Active MRI weights (auto-generated)
│ └── biomarker_best.pt # Active Biomarker weights (auto-generated)
│
└── Data/
├── MRIData/
│ └── Data/
│ ├── Mild Dementia/
│ ├── Very mild Dementia/
│ ├── Moderate Dementia/
│ └── Non Demented/
└── BMData/
└── main.csv
git clone https://github.com/abrizu/480-NN-Project-MRI.git
cd 480-NN-Project-MRIDatasets are not included due to size. Download and extract them manually:
| Dataset | Source | Extract to |
|---|---|---|
| MRI Images (4-class) | Kaggle – Alzheimer MRI Dataset | Data/MRIData/Data/ |
| Biomarker CSV | Kaggle – Comprehensive Health & Brain Imaging | Data/BMData/main.csv |
| Speech Dataset | (insert link) | Data/SPData/ |
After extraction, your Data/MRIData/Data/ folder should contain exactly four class subfolders:
Mild Dementia/, Very mild Dementia/, Moderate Dementia/, Non Demented/
bash run.shrun.sh automatically:
- Detects your Python version (3.9+ required)
- Creates a
.venvvirtual environment if one doesn't exist - Installs all dependencies
- Starts the Streamlit app at
http://localhost:8501
- Open
http://localhost:8501in your browser. - Navigate to the MRI or Biomarkers tab.
- Expand the ⚙️ Model Manager panel.
- Click the 🏋️ Train New Model sub-tab.
- Adjust epochs and learning rate using the sliders.
- Click 🚀 Start Training — live loss/accuracy updates stream into the UI.
- When training completes, enter a name and optional notes for the checkpoint (e.g.
demo_run,high_lr_v2). - Click 💾 Save & Activate — the checkpoint is saved, registered, and immediately loaded.
- Open the ⚙️ Model Manager panel in the relevant tab.
- Click 📁 Saved Checkpoints.
- Select the checkpoint from the dropdown and click ⬆️ Load & Activate.
- MRI: Upload a
.jpg/.pngbrain MRI scan → click Analyze MRI → view class probabilities. - Biomarkers: Fill in the patient form (age, comorbidities, imaging scores) → click Analyze Biomarkers → view the risk gauge.
- Ensemble: After running at least one modality, visit the 📊 Ensemble tab for a combined weighted risk score.
# MRI model
python functions/mri.py
# Biomarker model
python functions/biomarker.pyManually save weights to checkpoints/mri_best.pt or checkpoints/biomarker_best.pt after CLI training to use them in the app.
All installed automatically by run.sh:
torch · torchvision · torchaudio
numpy · pandas · scikit-learn · scipy · matplotlib
streamlit · plotly
librosa · soundfile
Pillow · nibabel · kaggle · tqdm · requests
⚠️ Research use only.
DementiaNet is an academic research project and is not a validated clinical diagnostic instrument. Do not use it for actual medical decision-making.