muddasser's picture
Update README.md
b01762e verified

A newer version of the Streamlit SDK is available: 1.56.0

Upgrade
metadata
title: Brain Tumor Detection
emoji: 🐢
colorFrom: yellow
colorTo: green
sdk: streamlit
app_file: app.py
pinned: false

🧠 Brain Tumor Detection (CNN Only)

This is a Streamlit-based web app for detecting brain tumors using a CNN model trained on MRI images. The app only uses image input for prediction — tabular data is not required.

Features

  • Upload a brain MRI image (.jpg, .jpeg, .png).
  • Predicts Benign or Malignant tumors.
  • Uses a CNN trained on grayscale MRI images resized to 128x128 pixels.
  • Lightweight and fast — suitable for deployment on Hugging Face Spaces.

How to Use

  1. Upload MRI Image: Select a brain MRI image (JPG, JPEG, or PNG format).
  2. View Prediction: The app will display the uploaded image and predict:
    • Benign
    • Malignant

The prediction is displayed directly in the app.

Model Details

  • CNN Architecture:

    • 3 convolutional layers (32, 64, 128 filters) with ReLU activation
    • Max-pooling and dropout layers for regularization
    • Final dense layer with sigmoid activation
  • Input: Grayscale MRI image, resized to 128x128, normalized to [0,1]

  • Training Dataset: Brain Tumor images only

  • Metrics: Binary classification (Tumor vs. No Tumor)

Installation (For Local Development)

  1. Clone the repository.
  2. Install dependencies:
pip install -r requirements.txt