Alzheimer MRI ConvNeXt Classifier
This repository contains a GPU-accelerated deep learning model for classifying Alzheimerβs disease stages from brain MRI images using a ConvNeXt-based architecture.
The model is designed for research, educational use, and technical demonstrations, and is deployed as a Hugging Face Inference Endpoint for fast GPU inference.
π§ Model Overview
- Task: MRI image classification
- Modality: Brain MRI (2D slices)
- Architecture: ConvNeXt
- Framework: PyTorch
- Deployment: Hugging Face GPU Inference Endpoint
The model predicts probabilities over predefined Alzheimer-related classes provided in class_names.json.
π¦ Repository Structure
βββ inference.py # Hugging Face inference entrypoint βββ requirements.txt # Minimal runtime dependencies βββ models/ β βββ best_model.pth # Trained ConvNeXt weights β βββ class_names.json # Class index β label mapping βββ README.md
β‘ Inference
The model is exposed via a Hugging Face Inference Endpoint and accepts an image file as input.
Example API Call
import requests
API_URL = "https://<your-endpoint>.endpoints.huggingface.cloud"
HEADERS = {
"Authorization": "Bearer YOUR_HF_TOKEN"
}
with open("sample_mri.png", "rb") as f:
response = requests.post(
API_URL,
headers=HEADERS,
files={"file": f}
)
print(response.json())