Skip to content

This project develops a deep learning system for classifying brain tumors from MRI scans. It leverages two models: a fine-tuned Xception model and a custom-built CNN. The models are trained and validated using a dataset from Kaggle, encompassing glioma, meningioma, pituitary, and no tumor cases.

Notifications You must be signed in to change notification settings

sheicky/Brain_Tumor_AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 

Repository files navigation

🧠 Brain Tumor MRI Classification with Deep Learning

Open In Colab Python 3.8+ TensorFlow 2.x

An advanced deep learning system for automated brain tumor classification from MRI scans, achieving 96.89% accuracy.


image image image

🌟 Key Features

  • Dual Model Architecture
    • Transfer Learning with Xception (96.89% accuracy)
    • Custom CNN (95.65% accuracy)
  • Interactive Web Interface
    • Real-time predictions
    • Saliency map visualization
    • Confidence scores
  • AI-Powered Explanations
    • Medical context generation
    • Region-specific analysis

🎯 Overview

The system classifies brain MRI scans into four categories with exceptional accuracy:

Tumor Type Description Model Performance
Glioma Most common malignant brain tumor 97% accuracy
Meningioma Usually benign, slow-growing 90% accuracy
Pituitary Occurs in pituitary gland 99% accuracy
No Tumor Healthy brain scan 100% accuracy

🔬 Dataset

The project utilizes the Brain Tumor MRI Dataset from Kaggle:

  • Size: 7,023 MRI images
  • Resolution: High-quality .jpg format
  • Distribution: Balanced across classes
  • Augmentation: Applied for robust training

🏗️ Architecture

Transfer Learning Model (Xception)

model = Sequential([
    Xception(include_top=False, weights='imagenet'),
    GlobalMaxPooling2D(),
    Dropout(0.3),
    Dense(128, activation='relu'),
    Dropout(0.25),
    Dense(4, activation='softmax')
])

Custom CNN Architecture

  • 6 convolutional layers
  • Batch normalization
  • Skip connections
  • Dropout regularization

📊 Performance Metrics

Xception Model

Accuracy: 96.89%
Precision: 0.97
Recall: 0.96
F1-Score: 0.97

Custom CNN

Accuracy: 95.65%
Precision: 0.96
Recall: 0.95
F1-Score: 0.96

💻 Installation

# Clone repository
git clone https://github.com/sheicky/Brain_Tumor_AI.git
cd Brain_Tumor_AI

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

🚀 Usage

Access via Browser

  • Run the code on google colab
  • Open http://localhost:8501
  • Upload MRI scan
  • View predictions and analysis

📱 Web Interface Features

  • Upload: Drag & drop MRI scans
  • Model Selection: Choose between Xception and Custom CNN
  • Visualization:
    • Saliency maps
    • Confidence scores
    • Region highlighting
  • Analysis: AI-generated medical explanations

📈 Results & Metrics

Our models achieve exceptional performance:

Metric Xception Custom CNN
Accuracy 96.89% 95.65%
Precision 0.97 0.96
Recall 0.96 0.95
F1-Score 0.97 0.96

📧 Contact

Sheick - @sheicky

Project Link: https://github.com/sheicky/Brain_Tumor_AI


Made with ❤️ by Sheick | Advancing Medical Imaging with AI

About

This project develops a deep learning system for classifying brain tumors from MRI scans. It leverages two models: a fine-tuned Xception model and a custom-built CNN. The models are trained and validated using a dataset from Kaggle, encompassing glioma, meningioma, pituitary, and no tumor cases.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors