Spaces:
Sleeping
Sleeping
A newer version of the Streamlit SDK is available: 1.56.0
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
- Upload MRI Image: Select a brain MRI image (JPG, JPEG, or PNG format).
- 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)
- Clone the repository.
- Install dependencies:
pip install -r requirements.txt