Skip to content

sohan2311/SIC-Project---Brain-Tumor-Detection-using-VGG-16-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SIC-Project---Brain-Tumor-Detection-using-VGG-16

🧠 Brain Tumor Detection Using VGG-16 Model

Python TensorFlow Keras License GitHub stars

🎯 Project Overview

This project implements a Convolutional Neural Network (CNN) using the VGG-16 architecture for detecting brain tumors from MRI scans. The model achieves ~88% training accuracy and ~82% test accuracy using transfer learning techniques.

πŸ‘¨β€πŸŽ“ Project Information

  • Author: Sohan Maity
  • Roll No: 523EC0001
  • Email: 523ec0001@iiitk.ac.in
  • Institution: Indian Institute of Information Technology Design and Manufacturing Kurnool (IIITDM Kurnool)
  • Program: Samsung Innovation Campus - Final Project

πŸŽ₯ Project Presentation

Project Video

πŸ“Š Dataset Information

Download Dataset

The dataset contains MRI brain scan images classified into two categories:

  • NO: No tumor detected (encoded as 0)
  • YES: Tumor detected (encoded as 1)

Dataset Statistics

Set Images Accuracy
Training Set 169 images ~88%
Test Set 84 images ~82%

πŸ—οΈ Model Architecture

VGG-16 Transfer Learning

  • Base Model: VGG-16 pre-trained on ImageNet
  • Input Shape: (224, 224, 3)
  • Frozen Layers: All VGG-16 convolutional layers
  • Custom Head: Global Average Pooling + Dense layers

Model Structure

VGG-16 Base (Frozen)
    ↓
Global Average Pooling 2D
    ↓
Dense(1024, activation='relu')
    ↓
Dense(1024, activation='relu')
    ↓
Dense(512, activation='relu')
    ↓
Dense(2, activation='softmax')

πŸš€ Quick Start

Prerequisites

pip install tensorflow keras opencv-python matplotlib scikit-learn plotly tqdm imutils numpy

Installation

  1. Clone the repository

    git clone https://github.com/sohan2311/brain-tumor-detection.git
    cd brain-tumor-detection
  2. Install dependencies

    pip install -r requirements.txt
  3. Download the dataset

    kaggle datasets download -d navoneel/brain-mri-images-for-brain-tumor-detection

Usage

  1. Train the model

    python train_model.py
  2. Make predictions

    python predict.py --image path/to/mri_scan.jpg

πŸ“ Project Structure

brain-tumor-detection/
β”‚
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ brain_tumor_dataset/
β”‚   β”‚   β”œβ”€β”€ yes/          # Tumor images
β”‚   β”‚   └── no/           # No tumor images
β”‚   β”œβ”€β”€ TRAIN/
β”‚   β”œβ”€β”€ TEST/
β”‚   └── VAL/
β”‚
β”œβ”€β”€ models/
β”‚   └── brain_tumor_model.h5
β”‚
β”œβ”€β”€ notebooks/
β”‚   └── Brain_Tumor_Detection.ipynb
β”‚
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ train_model.py
β”‚   β”œβ”€β”€ predict.py
β”‚   β”œβ”€β”€ data_preprocessing.py
β”‚   └── model_architecture.py
β”‚
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ README.md
└── LICENSE

πŸ”¬ Technical Details

Data Preprocessing

  • Image Resizing: 224Γ—224 pixels
  • Normalization: Pixel values scaled to [0, 1]
  • Label Encoding: Binary classification (0: No Tumor, 1: Tumor)
  • Data Split: 67% Training, 33% Testing

Model Configuration

  • Optimizer: Adam (learning_rate=0.01)
  • Loss Function: Categorical Crossentropy
  • Metrics: Accuracy
  • Epochs: 15
  • Batch Size: Default

Performance Metrics

Metric Training Validation
Accuracy 88% 82%
Loss 0.0007 0.6297

πŸ“ˆ Results & Visualizations

Training History

The model shows excellent learning progression:

  • Epoch 1: 62.47% β†’ Epoch 15: 100% (Training Accuracy)
  • Validation Accuracy: Stabilized around 89-90%

Key Findings

  • βœ… Successful implementation of transfer learning
  • βœ… Good generalization despite small dataset
  • βœ… Effective feature extraction using VGG-16
  • ⚠️ Signs of overfitting in later epochs

🧠 About Brain Tumors

A brain tumor is an abnormal mass of cells in the brain, which can be:

  • Benign: Non-cancerous
  • Malignant: Cancerous

Common Symptoms:

  • Persistent headaches
  • Seizures
  • Vision/speech difficulties
  • Memory loss
  • Personality changes

Early detection through MRI analysis can significantly improve treatment outcomes.

πŸ› οΈ Technologies Used

Python TensorFlow Keras OpenCV Jupyter NumPy Matplotlib scikit-learn

πŸ“‹ Requirements

tensorflow>=2.0.0
keras>=2.0.0
opencv-python>=4.0.0
matplotlib>=3.0.0
scikit-learn>=1.0.0
plotly>=5.0.0
tqdm>=4.0.0
imutils>=0.5.0
numpy>=1.19.0

πŸš€ Future Enhancements

  • Improve Accuracy: Implement ResNet, EfficientNet architectures
  • Data Augmentation: Add rotation, zoom, flipping techniques
  • Multi-class Classification: Detect different tumor types (Glioma, Meningioma, Pituitary)
  • Web Deployment: Create Flask/FastAPI web application
  • Mobile App: Develop mobile application for real-time detection
  • Model Optimization: Implement model quantization for faster inference

πŸ“Š Model Performance Visualization

The training process shows:

  • Rapid Learning: Quick improvement in first 5 epochs
  • Convergence: Model stabilizes around epoch 7-8
  • Overfitting Signs: Training accuracy reaches 100% while validation plateaus

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ™ Acknowledgments

  • Samsung Innovation Campus for providing the learning platform
  • IIITDM Kurnool for academic support
  • Kaggle Community for the dataset
  • TensorFlow/Keras Teams for the excellent deep learning frameworks
  • VGG Team for the groundbreaking architecture

πŸ“ž Contact

Sohan Maity

GitHub LinkedIn


⭐ If you found this project helpful, please give it a star! ⭐

Made with ❀️ for advancing medical AI and brain tumor detection

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published