~/localhost

Project

Brain Tumor MRI Classifier

CompleteDeep learning · Explainable AI

Overview

The Streamlit app running locally with the repository's trained weights. The scans come from the project's dataset and may have been used in training, so this shows the app working, not its accuracy.

A ResNet18 transfer-learning classifier that labels brain MRI scans as tumor or no tumor, and explains each prediction with Grad-CAM.

This project fine-tunes an ImageNet-pretrained ResNet18 on a public Kaggle brain-MRI dataset of 253 images (tumor / no tumor). A Streamlit app runs the model on an uploaded scan and adds a Grad-CAM heatmap, so every prediction shows which regions of the scan influenced it.

Research and educational prototype. Not clinically validated.

Problem

Image classifiers are hard to trust when they are black boxes. Grad-CAM makes the model's evidence visible, which matters for any medical-imaging research.

Role

Sole engineer

Stack

Modeling
PythonPyTorchtorchvision ResNet18Transfer learning
Explainability
Grad-CAM
App
Streamlit
Data
Kaggle brain MRI dataset (tumor / no tumor)

Research and educational project only. It is not a medical device, is not clinically validated, and must not be used for diagnosis.

Architecture

From a scan to a prediction with an explanation.

  1. Preprocessing

    Resize each scan to 224×224 and normalize it.

  2. Model

    An ImageNet-pretrained ResNet18 with a new two-class output layer (tumor / no tumor).

  3. Explanation

    Grad-CAM saliency maps overlaid on the input scan.

  4. Inference

    A Streamlit app: upload a scan, see the prediction and its Grad-CAM overlay.

Engineering

Engineering decisions

  • Transfer learning

    A pretrained backbone learns well from a modest public dataset.

  • Explainability built in

    Grad-CAM shows whether the model looks at plausible regions, not artifacts.

Challenges & solutions

  • Limited data

    Starting from ImageNet-pretrained weights, the network only has to adapt to MRI scans rather than learn vision from 253 images.

Results & roadmap

Results & outcomes

Evaluation metrics are not yet available: the repository doesn't record them, so none are shown.

Verified results to be added

Links