Brain Tumor Detection using CNN

Advanced Deep Learning for Medical Image Classification

Revolutionizing Medical Diagnosis with AI

Our convolutional neural network model accurately classifies brain MRI images to detect tumors with high precision, assisting medical professionals in early diagnosis.

Try It Now

About the Project

This project implements a deep learning-based approach to classify brain MRI images as either having a tumor (cancer) or not. The model uses a Convolutional Neural Network (CNN) trained on a dataset of medical images to provide accurate predictions, serving as an assistive tool for radiologists and medical professionals.

Advanced CNN Architecture

Our model utilizes multiple convolutional layers with ReLU activation and max pooling to effectively extract features from medical images.

Curated Dataset

Trained on a carefully collected dataset with 155 tumor-positive images and 98 tumor-negative images for balanced learning.

High Accuracy

The model achieves strong performance metrics through optimized architecture and hyperparameter tuning.

Model Architecture

The model is a Convolutional Neural Network (CNN) built using TensorFlow and Keras, consisting of:

  • 3 Convolutional layers with ReLU activation and MaxPooling
  • A Flatten layer to transform image data for classification
  • 2 Dense layers with a dropout layer to reduce overfitting
  • Binary output (cancer or no cancer) with a sigmoid activation
model = Sequential([
    Conv2D(32, (3, 3), activation='relu', input_shape=(150, 150, 3)),
    MaxPooling2D(2, 2),
    Conv2D(64, (3, 3), activation='relu'),
    MaxPooling2D(2, 2),
    Conv2D(128, (3, 3), activation='relu'),
    MaxPooling2D(2, 2),
    Flatten(),
    Dense(512, activation='relu'),
    Dropout(0.5),
    Dense(1, activation='sigmoid')
])

Try the Classifier

Upload a brain MRI image to analyze it for potential tumors. Our model will process the image and provide a classification result.

Upload Brain MRI Image

Drag & drop your image here or click to browse

Result

Dataset Information

Dataset Structure

The model was trained on images stored in separate folders for positive (tumor) and negative (no tumor) cases:

brain_tumor_data/
├── yes/       -> Contains 155 images labeled as "cancer" in JPG format
├── no/        -> Contains 98 images labeled as "no cancer" in JPG format

The dataset was split with 80% for training and 20% for validation during the model development process.