SliceWise — MRI Brain Tumor Detection & Segmentation
Multimodal MRI classification and segmentation model trained on BraTS dataset with shared encoder, achieving 91.3% accuracy and 97.1% sensitivity.
What this project proves
End-to-end model design, evaluation, and automation
Shared-encoder multimodal MRI system with 91.3% accuracy, 97.1% sensitivity, and a productized training-to-demo pipeline.
Core challenge
Unify classification and segmentation without paying the cost of separate models.
Evaluation lens
Model architecture, training pipeline, and applied evaluation discipline.
A faster multimodal system with strong clinical metrics and automated reproducibility.
Overview
Built a production-ready multimodal MRI classification and segmentation pipeline trained on the BraTS dataset. The model uses a shared encoder architecture for both tumor classification and pixel-level segmentation, achieving strong performance across both tasks simultaneously.
This project is strongest as an example of end-to-end applied ML system design: model architecture, preprocessing, inference optimization, explainability, quality control, and productized delivery all had to work together.
Results
| Metric | Score |
|---|---|
| Classification Accuracy | 91.3% |
| Sensitivity | 97.1% |
| Dice Score (Segmentation) | 76.5% |
| Model Parameters | 31.7M |
| Inference Speedup | ~40% faster vs separate models |
What I Owned
- Designed the shared-encoder multitask architecture
- Built the training and evaluation pipeline around the BraTS dataset
- Added conditional inference so segmentation only runs when classification indicates tumor presence
- Productized the work into a demo/application workflow with testing and explainability tooling
Live App — Detection & Segmentation
Inference Pipeline
flowchart LR
A[MRI Input] --> B[Preprocessing]
B --> C[Shared Encoder]
C --> D{Tumor?}
D -->|Yes| E[Segmentation Head]
D -->|No| F[No Tumor]
E --> G[Pixel Mask]
C --> H[Classification Head]
H --> D Conditional segmentation activates only when tumor is detected, avoiding unnecessary compute on negative cases.
Hard Problems Solved
- Unify two tasks without doubling system cost: the architecture needed to support both classification and segmentation without separate full models
- Keep explanations clinically interpretable: Grad-CAM attention and masking quality controls were necessary to make model behavior more inspectable
- Turn research output into a usable tool: the work had to move beyond offline metrics into a reproducible, demoable inference workflow
Grad-CAM Explainability
Brain Masking Quality Control
Key Features
- Shared Encoder Architecture: Single backbone for both classification and segmentation reduces parameter count and inference time
- Conditional Segmentation: Segmentation head activates only when tumor is detected, optimizing inference
- Grad-CAM Explainability: Per-prediction attention heatmaps with brain-mask-aware focus, rendered live in the Streamlit app
- Robust Brain Masking: Automated QC pipeline filters slices on area coverage and border-touch thresholds before model input
- One-Command Pipeline: Productized training-to-demo pipeline with automation across 6 stages, 4 smart prompts, and 25/25 passing tests
- API Endpoints: 11 FastAPI endpoints for model inference, health checks, and data management
Why It Matters
This project shows I can bridge research-grade model development and product-minded delivery: architecture design, evaluation rigor, inference behavior, and user-facing tooling all reinforce each other.
Tech Stack
- ML: PyTorch, EfficientNet, U-Net, BraTS dataset
- Explainability: Grad-CAM with brain-mask-aware preprocessing
- App: Streamlit frontend, FastAPI backend, Uvicorn, Pydantic
- Testing: pytest with 25/25 test coverage
- Optimization: Conditional inference, shared encoder, mixed precision