Skip to content

Latest commit

Β 

History

42 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation



Python TensorFlow Keras OpenCV

Scikit-Learn Jupyter Google Colab License

Models Evaluated Task Domain Status


Automated detection of 🧠 brain tumors from MRI scans using Convolutional Neural Networks.
A fast, reliable AI-powered second opinion for radiologists.



πŸ“‹ Table of Contents


πŸ”¬ Overview

This project, developed by Jayan Gupta, focuses on the automated classification of Brain MRI scans using advanced Deep Learning techniques. The goal is to distinguish between brain scans that contain a Tumor and those that do not.

By leveraging Convolutional Neural Networks (CNNs), the system aims to provide a fast and reliable second opinion for radiologists β€” potentially accelerating the diagnostic process for critical medical conditions.

Input MRI Scan  ──▢  Preprocessing  ──▢  CNN Model  ──▢  Tumor / No Tumor

✨ Key Features

Feature Description
🧠 Deep Learning Pipeline End-to-end implementation from data preprocessing to model evaluation
πŸ—οΈ Multiple Architectures Evaluation of 3 different CNN models for performance comparison
πŸ”„ Image Augmentation Techniques applied to improve generalization on smaller datasets
πŸ“Š Clear Visualization Tools for viewing MRI scans and understanding model predictions
⚑ Fast Inference Optimized pipeline for rapid scan classification
πŸ“ˆ Comprehensive Metrics Accuracy, precision, recall, F1-score, and confusion matrices

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    BRAIN MRI CLASSIFICATION PIPELINE            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   RAW MRI DATA  │─────▢│  PREPROCESSING  │─────▢│  AUGMENTED   β”‚
β”‚                 β”‚      β”‚  β€’ Resize        β”‚      β”‚  DATASET     β”‚
β”‚  yes/ (tumor)  β”‚      β”‚  β€’ Normalize     β”‚      β”‚              β”‚
β”‚  no/  (healthy)β”‚      β”‚  β€’ Split 80/20   β”‚      β”‚  Flip, Zoom  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β”‚  Rotate, ...  β”‚
                                                   β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                                                          β”‚
                         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β–Ό
            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
            β”‚     CNN ARCHITECTURES  β”‚
            β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
            β”‚  β”‚    Model A: CNN  β”‚  β”‚
            β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
            β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
            β”‚  β”‚    Model B: CNN  β”‚  β”‚
            β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
            β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
            β”‚  β”‚    Model C: CNN  β”‚  β”‚
            β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β”‚
                       β–Ό
            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
            β”‚   CLASSIFICATION     β”‚
            β”‚   βœ… Tumor Detected  β”‚
            β”‚   βœ… No Tumor Found  β”‚
            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“‚ Dataset

The dataset is organized into two primary categories:

MRI/
β”œβ”€β”€ πŸ“ yes/          # MRI scans WITH diagnosed tumors
β”‚   β”œβ”€β”€ Y1.jpg
β”‚   β”œβ”€β”€ Y2.jpg
β”‚   └── ...
β”‚
└── πŸ“ no/           # Healthy brains β€” NO tumor detected
    β”œβ”€β”€ no1.jpg
    β”œβ”€β”€ no2.jpg
    └── ...

πŸ“Œ Google Colab Users: Mount your Drive and point to
/content/drive/MyDrive/MRI/MRI/

Sample Distribution

Tumor (yes/)  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘  ~60%
Healthy (no/) β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘  ~40%

πŸ› οΈ Technologies

Category Tools
Language Python
Deep Learning TensorFlow Keras
Image Processing OpenCV PIL
Visualization Matplotlib Seaborn
ML Utilities Scikit-learn
Notebook Jupyter Colab

πŸš€ Getting Started

1. Clone the Repository

git clone https://github.com/your-username/brain-mri-tumor-classifier.git
cd brain-mri-tumor-classifier

2. Install Dependencies

pip install tensorflow numpy pandas matplotlib seaborn \
            opencv-python pillow scikit-learn

Or install from requirements (recommended):

pip install -r requirements.txt

3. Prepare the Dataset

Place your MRI dataset in the following structure:
MRI/
  β”œβ”€β”€ yes/   ← tumor scans
  └── no/    ← healthy scans

4. Run the Notebook

jupyter notebook Jayan_Gupta_project.ipynb

🌐 Or open directly in Google Colab β€” just mount your Drive and run all cells.


πŸ“Š Results

Three CNN architectures were trained and evaluated. Key metrics include:

Metric Description
Accuracy Overall correct predictions
Precision Positive predictive value
Recall Sensitivity β€” catches true tumors
F1-Score Harmonic mean of precision & recall
AUC-ROC Area under the receiver operating curve

πŸ“„ Detailed results and confusion matrices are available inside the notebook.


πŸ§‘β€πŸ’» Author


Jayan Gupta

GitHub LinkedIn

Created with care πŸ’™


βš•οΈ Medical Disclaimer

⚠️ Important Notice

This tool is intended for research and educational purposes only.
It should not be used as a primary diagnostic tool.
Always consult with a qualified medical professional for any health concerns.


⭐ If this project helped you, consider giving it a star!

About

Deep learning-based Brain MRI classification system using CNNs to detect tumors, featuring multiple architectures, image augmentation, and visualization for accurate and efficient diagnostic support.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages