Inspiration

I wanted to improve early-detection in Alzheimer’s Disease MRIs, since it affects patients with this diagnosis as well as their families and friends. Early detection can help individuals take preventative measures, or prepare and slow down the progression of Alzheimer's Disease. I was also curious about how Alzheimer's diagnostics could be identified with ML models and with an untrained human "eye" -- could machines detect and classify Alzheimer's Disease progression in MRIs better than humans?

What it does

Project Fairy analyzes brain MRI scans to classify patients into one of four clinical stages: Healthy Control (Cognitively Normal), Mild Cognitive Impairment (MCI), Mild Alzheimer's Disease (Early-Stage), or Moderate Alzheimer's Disease (Mid-Stage). These names were inspired by the clinical terminology used by the National Institute on Aging (NIA) and the Alzheimer's Association, but made understandable for the average person.

This project also uses Grad-CAM heatmapping to show which parts of the brain are triggering the diagnosis in the CNN model, which helps us understand its decision-making process for further interpretability and review.

How we built it

I started with a simple baseline CNN called Alzheimer_Fairy_CNN, which overfit the data, then upgraded to the ResNet18 model, which is a lightweight pre-trained multi-class classification model known for its high performance and deep network. Because the dataset classes were heavily imbalanced, I also used data augmentation and stratified splitting in the dataset so the model could train and recognize rare MRI cases. I also implemented Grad-CAM to help visually show how the model classified MRIs by showing what features and details in the MRIs it focused on.

Technologies:

Data:

Environment:

  • Python
  • Google Colab

Frameworks:

  • PyTorch
  • Torchvision

Analysis:

  • Scikit-learn
  • Pandas
  • NumPy

Visualizations:

  • Matplotlib
  • Seaborn
  • OpenCV (for Grad-CAM)

Challenges we ran into

Given the MRI dataset, I noticed that label 1 MRIs made up less than 1% of the MRI images, which would lead to complications in training the model to correctly identify this Alzheimer's stage, since the data was so limited and uncommon. Additionally, since I ran the model training on a CPU, it took several hours for a single run-through of the notebook code, especially since I trained two CNN models to later compare their performances.

While I tried Google Colab's free GPU, the session would frequently timeout and delete my local files, which caused a limitation where I could not run through model training more than once or twice in a sitting. It forced me to optimize my data preparation pipeline to prevent the code from crashing.

Accomplishments that we're proud of

I'm proud of successfully training the ResNet18 model for classifying Alzheimer's stages given my limited hardware and resources, and I learned a lot on how rigorous testing should be before implementing systems in a clinical or medical system, especially due to the severity and delicate nature of these issues.

What we learned

I learned that a rigorous approach to data preparation and pipelining is just as important as building the ML models and algorithms. Not just that, but F1-scores are crucial in understanding the results and validity of the model when dealing with complex medical data. I also learned through this hackathon how "black box" ML models could be made more transparent and understandable. In this case, I used Grad-CAM to produce a heatmap to understand how the ResNet18 "viewed" the MRIs and made its diagnosis. A lot of intuition and understanding of what the model does could help you determine how you can approach building the model and making it transparent and interpretable.

What's next for Project Fairy: Multi-Stage Alzheimer’s Detection in MRIs

The next step is to improve Progression Forecasting. While the model can diagnose which stage of Alzheimer's the MRI image is facing, showing how a specific MRI/patient’s brain can progress over time with Alzheimer's could be another crucial element in medical care and treatment.

Built With

Share this project:

Updates