Downloads · 30 days
0
okandeniz/alzheimer-classification-swin-transformer
alzheimer-classification-swin-transformer is a machine learning model from okandeniz. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This project focuses on multiclass Alzheimer MRI image classification using a custom Swin Transformer-based deep learning architecture implemented with PyTorch.
Downloads · 30 days
0
Access
Public
Updated May 23, 2026
Repo size
110 MB
Likes
0
Public
Click a slice to open those files.
.pth110 MB · 100%
From the Hugging Face model README
This project focuses on multiclass Alzheimer MRI image classification using a custom Swin Transformer-based deep learning architecture implemented with PyTorch.
The model was trained to classify brain MRI scans into four different Alzheimer stages:
The project includes:
The model is based on the Swin Transformer architecture, which applies self-attention within shifted local windows to efficiently learn both local and global image representations.
| Class | Precision | Recall | F1-Score |
|---|---|---|---|
| MildDemented | 0.9678 | 0.9869 | 0.9772 |
| ModerateDemented | 0.9962 | 1.0000 | 0.9981 |
| NonDemented | 0.9426 | 0.9465 | 0.9446 |
| VeryMildDemented | 0.9469 | 0.9205 | 0.9335 |
The results demonstrate that the Swin Transformer architecture can effectively classify Alzheimer stages from MRI images with high performance.
The model was trained on an Alzheimer MRI image classification dataset containing four diagnostic categories.
You can download the pretrained model weights directly from this repository.
import torch
from PIL import Image
from torchvision import transforms
# Load model
model.load_state_dict(torch.load("alzheimer_classification_swin_transformer_model.pth"))
model.eval()
# Image transforms
transform = transforms.Compose([
transforms.Resize((224, 224)),
transforms.ToTensor()
])
# Load image
image = Image.open("sample.jpg").convert("RGB")
image = transform(image).unsqueeze(0)
# Prediction
with torch.inference_mode():
output = model(image)
pred = torch.argmax(output, dim=1)
print(pred)
├── notebooks/
├── models/
│ └── alzheimer_classification_swin_transformer_model.pth
├── images/
├── app/
├── README.md
└── requirements.txt
Potential future enhancements:
This project is released under the MIT License.