Deep learning model for classifying brain MRI scans into dementia severity categories using a modified ResNet-18 convolutional neural network.
The dataset contains labeled MRI scans categorized into four classes:
Class Description
| Non Demented | Very Mild Demented | Mild Demented | Moderate Demented
| Split | Images |
|---|---|
| Training | 23,788 |
| Validation | 5,097 |
| Test | 5,097 |
Images are organized into folders and loaded using torchvision.datasets.ImageFolder.
The project uses a modified ResNet-18 architecture for its residual blocks, solving the vanishing gradient problem.
Modifications:
- MRI scans are grayscale, so the first convolution layer was modified
- Per-Image Z-Score Normalization
- Removes brightness variation between scans.
x_norm = (x - μ) / σ
Activation: ReLU
Loss Function: Weighted Cross Entropy Loss is used to address class imbalance.
L = - Σ wi * yi * log(ŷi)
Optimizer: AdamW
Tools
- Python
- PyTorch
- Torchvision
- CUDA
- Optuna(Baysian)
- NumPy



