💡 Inspiration

Alzheimer’s Disease is one of the most devastating neurodegenerative diseases, and early detection can significantly improve patient care. We wanted to create a computational tool that makes MRI-based prediction accessible and easy to use for research, education, and awareness.

👉 What it does

Cognify is a deep learning web application that classifies 128×128 grayscale MRI images into four Alzheimer’s stages:

  • 😊 Normal

  • 🙂 Mild

  • 😐 Moderate

  • 😱 Severe

It predicts the most likely stage and shows class probabilities, helping visualize risk and understanding of the disease.

⚒️ How we built it

🏗️ Project Structure

📦 Alzheimer-s-MRI-Prediction-System /
│
├── app.py                    # Streamlit web app
├── alzheimers_cnn_model.h5   # Trained CNN model
├── train.parquet             # Training dataset
├── test.parquet              # Test dataset
├── cognify.ipynb             # Training / EDA notebook
├── requirements.txt          # Python dependencies
└── README.md                 # Project documentation
└── images/
      streamlit_demo.jpg

1️⃣ Clone the Repository

git Clone https://github.com/MohamedAli1937/Alzheimer-s-MRI-Prediction-System.git

2️⃣ Create a Virtual Environment

python -m venv venv
source venv/bin/activate  # Linux / Mac
venv\Scripts\activate     # Windows

3️⃣ Install Requirements

pip install -r requirements.txt  

4️⃣ Run the Streamlit App

streamlit run app.py  

📈 Model Performance

Training Accuracy: 81.59%

Validation Accuracy: 73.8%

⚔️ Challenges we ran into

  • 🔋 Large image dataset causing RAM overload, requiring model downsizing.

  • 👾 Understanding Parquet files and converting images from raw bytes.

  • 🤖 Balancing CNN complexity vs. performance to prevent overfitting while keeping the model lightweight.

🏆 Accomplishments that we're proud of

  • 🎯 Successfully trained a CNN achieving ~78–80% test accuracy on unseen MRI images.

  • 🌐 Built a fully functional Streamlit web app for real-time Alzheimer’s stage prediction.

  • 🔥 Made a lightweight model that runs on standard laptops without GPU.

    🎓 What we learned

  • 📦 How to preprocess MRI data stored in Parquet format.

  • 🛠️ How to build, train, and evaluate CNNs for multi-class medical image classification.

  • 🚀 Deploying TensorFlow models with Streamlit to create interactive web applications.

  • 🗝️ Handling practical challenges like memory limits and model optimization.

    🔜 What's next for Cognify

  • ✅ Add Grad-CAM visualization to explain predictions.

  • ✅ Support 3D MRI volumes instead of 2D slices.

  • ✅ Deploy on HuggingFace Spaces or a cloud server for wider accessibility.

  • ✅ Extend to predict progression or risk forecasting over time.

Built With

Share this project:

Updates