Downloads · 30 days
0
KaiSKX/Alzheimer_ConvNeXtCNN
Alzheimer_ConvNeXtCNN is a image classification model from KaiSKX. Use it when you need a label for an image. The card lists the license as apache-2.0.
<p align="center" <img src="https://static.vecteezy.com/system/resources/previews/002/543/044/non2x/world-alzheimer-day-with-brain-and-icons-vector.jpg" width="250" height="220" </p
Downloads · 30 days
0
Access
Public
Updated Sep 28, 2025
Repo size
397 MB
Likes
0
Public
Click a slice to open those files.
.onnx198 MB · 49%
From the Hugging Face model README
A pre-trained ConvNeXt CNN model is fine-tuned for classifying Alzheimer's disease stages from brain MRI scans. The model distinguishes between 4 classes:
Classes:
Backbone Model: ConvNeXt (Meta AI, 2022) - A modern SOTA CNN architecture inspired by Vision Transformers but built purely on convolutions.
Transfer Learning Strategy: Progressive unfreezing approach with ImageNet-pretrained weights:
Step 1: Train classification head only (10 epochs)
↓
Step 2: Unfreeze stage 3 + head (5 epochs, reduced LR)
↓
Step 3: Unfreeze stage 2 + stage 3 + head (5 epochs, further reduced LR)
Test Accuracy: 98.78% across 4 classes.
| Format | Inference Time | Relative Speed |
|---|---|---|
| PyTorch (.pth) | 148.16 ms/image | Baseline |
| ONNX (.onnx) | 132.48 ms/image | 1.12x faster |


NOTE: The result is based on Kaggle notebook CPU environment. Different environment will have different effect but normally ONNX runtime engine has a better inference speed.
from huggingface_hub import snapshot_download
# Download entire model directory (MLflow Model)
model_dir = snapshot_download(repo_id="KaiSKX/Alzheimer_ConvNeXtCNN", repo_type="model")
# or download specific format (.onnx)
from huggingface_hub import hf_hub_download
onnx_path = hf_hub_download(repo_id="KaiSKX/Alzheimer_ConvNeXtCNN", filename="onnx/convnext_model.onnx", repo_type="model")
# or download specific format (.pth)
from huggingface_hub import hf_hub_download
onnx_path = hf_hub_download(repo_id="KaiSKX/Alzheimer_ConvNeXtCNN", filename="data/model.pth", repo_type="model")
Best for: MLflow/Databricks deployment or inference
import mlflow.pytorch
import torch
from PIL import Image
import torchvision.transforms as transforms
import time
# Load MLflow model
model = mlflow.pytorch.load_model("Alzheimer_ConvNeXtCNN")
model.eval()
# Define class names for mapping
class_names = ["Mild Demented", "Moderate Demented", "Non Demented", "Very Mild Demented"]
# Prepare input
transform = transforms.Compose([
transforms.Resize((224, 224)),
transforms.ToTensor(),
transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
])
image = Image.open("C:/Users/dream/Downloads/test_dataset/ModerateDemented/moderateDem39.jpg").convert("RGB")
input_data = transform(image).unsqueeze(0)
# Inference with timing [optional for time]
with torch.no_grad():
start_time = time.time()
output = model(input_data)
end_time = time.time()
predicted_class = torch.argmax(output, dim=1).item()
inference_time = (end_time - start_time) * 1000
print(f"Predicted class: {class_names[predicted_class]}")
print(f"Inference time: {inference_time:.2f} ms")
Best for: Cross-platform compatibility and faster CPU inference
import onnxruntime as ort
import numpy as np
from PIL import Image
import torchvision.transforms as transforms
import time
# Load ONNX model
session = ort.InferenceSession("onnx/convnext_model.onnx")
input_name = session.get_inputs()[0].name
# Define class names for mapping
class_names = ["Mild Demented", "Moderate Demented", "Non Demented", "Very Mild Demented"]
# Prepare input
transform = transforms.Compose([
transforms.Resize((224, 224)),
transforms.ToTensor(),
transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
])
image = Image.open("C:/Users/dream/Downloads/test_dataset/ModerateDemented/moderateDem39.jpg").convert("RGB")
input_data = transform(image).unsqueeze(0).numpy().astype(np.float32)
# Inference with timing [optional for time]
start_time = time.time()
output = session.run(None, {input_name: input_data})[0]
end_time = time.time()
inference_time = (end_time - start_time) * 1000
predicted_class = np.argmax(output, axis=1)[0]
print(f"Predicted class: {class_names[predicted_class]}")
print(f"Inference time: {inference_time:.2f} ms")
timmNVIDIA T4 * 2Databricks MLflow integration for experiment tracking and model registryResearch & Portfolio Use Only: This model is developed for educational and portfolio demonstration purposes. It is NOT intended for professional clinical diagnosis, medical decision-making, or any real-world medical applications**.
For detailed training methodology and MLOps implementation, please refer to the Kaggle notebook.