Skip to content
Back to Projects
ML / AI 2025-10 Featured

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.

91.3% Accuracy
PyTorchComputer VisionMedical ImagingFastAPIBraTS
Shared encoder architecture diagram Architecture
Shared encoder architecture — single backbone for classification and segmentation

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.

Results

MetricScore
Classification Accuracy91.3%
Sensitivity97.1%
Dice Score (Segmentation)76.5%
Model Parameters31.7M
Inference Speedup~40% faster vs separate models
Performance benchmarks across classification, sensitivity, dice score, and inference speed

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
  • 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

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.

Tech Stack

  • ML: PyTorch, torchvision, BraTS dataset
  • API: FastAPI, Uvicorn, Pydantic
  • Testing: pytest with 25/25 test coverage
  • Optimization: Conditional inference, shared encoder, mixed precision