Case study / 2025
Alzheimer’s MRI classification
A four-class MRI image experiment on labeled OASIS slices, with a separate FastAPI prototype for serving TensorFlow predictions.
- My contribution
- I trained the four-class TensorFlow image model and built a related FastAPI inference prototype.
- Verification
- The notebook reports 17,288 slices on an image-level split also used for validation. Patient-level separation remains unverified.
- Evidence
- Training and evaluation notebook

Build the classifier from the slices up
I started with labeled OASIS image slices and built a TensorFlow classifier for the four dementia labels provided with the dataset. The notebook standardizes the images at 224 × 224 pixels and uses three convolutional blocks to learn image features before the final classifier. It records the training run, exports the Keras model and keeps the evaluation next to the preprocessing code.
See what the test actually measured
I set aside 20% of the image paths with a stratified split. The notebook reports results on 17,288 slices and shows a class-by-class report and confusion matrix. The same split also supplied the validation data during training. The split was by image path, so separation at the patient level remains unverified. An independent evaluation would need to hold out whole patients before training.
Turn the upload into a prediction
In a related Hugging Face Space, I packaged a saved TensorFlow classifier behind FastAPI. The service decodes the uploaded image, converts it to RGB, resizes and scales it, then returns the model’s scores for all four labels as JSON. A separate generated text step uses those scores to write a summary. The source lets a reader trace the serving path independently of the training notebook. This was an educational prototype.