An end-to-end MLOps pipeline that classifies brain MRI scans into diagnostic categories using Deep Learning (PyTorch), packaged as decoupled microservices in Docker containers, and deployed live on AWS cloud infrastructure.
Live deployment on AWS EC2 — MRI scan input → real-time diagnostic classification
+---------------------------------+
| Streamlit Web GUI |
| (Port 8501 - User Interface) |
+---------------------------------+
|
| HTTP POST /predict (Image Payload)
v
+---------------------------------+
| FastAPI Backend |
| (Port 8000 - Model API) |
+---------------------------------+
|
| Inference Tensor Processing
v
+---------------------------------+
| PyTorch CNN Model |
| (brain_tumor_model.pth Weights)|
+---------------------------------+
- Frontend (Streamlit): Web interface for uploading MRI scans and triggering real-time diagnostic inference.
- Backend (FastAPI): Asynchronous API that preprocesses input images, runs tensor inference via PyTorch, and returns structured JSON predictions.
- Containerization & Deployment: Multi-container setup managed via Docker Compose, deployed on AWS EC2 (Ubuntu, eu-north-1).
- Task: Multi-class brain MRI classification — Glioma / Meningioma / Pituitary Tumor / No Tumor
- Framework: PyTorch CNN
- Deployment: Live REST API inference — image upload → JSON prediction → UI render
| Layer | Technology |
|---|---|
| Machine Learning | PyTorch, Torchvision, Pillow, NumPy |
| API | FastAPI, Uvicorn |
| Frontend | Streamlit |
| Containerization | Docker, Docker Compose V2 |
| Cloud | AWS EC2 (Ubuntu Linux, eu-north-1) |
| Version Control | Git, GitHub |
medical-imaging-mlops/
│
├── models/ # Model weights (excluded via .gitignore)
│ └── brain_tumor_model.pth # Download link — see below
├── src/
│ ├── api.py # FastAPI inference endpoints
│ └── app.py # Streamlit web application
├── Dockerfile.backend # Docker image — FastAPI backend
├── Dockerfile.frontend # Docker image — Streamlit frontend
├── docker-compose.yml # Container orchestration
├── requirements.txt # Python dependencies
└── README.md
Model weights: Available on request or via
(Google Drive Link) — place in models/ before running.
git clone https://github.com/Sachinsara14/medical-imaging-mlops
cd medical-imaging-mlops
# Add brain_tumor_model.pth to models/ folder
docker compose up --buildOpen http://localhost:8501 in your browser.
Deployed on EC2 using Docker Compose V2.
Access the live instance at: [your EC2 public IP]:8501
This project is one component of an ongoing medical imaging ML portfolio:
- Brain Tumor Classification (this repo) — MLOps deployment
- Cardiac Histopathology Segmentation — Attention UNet, active learning, WSI analysis (6,627 images, Dice 0.8956)
Sachinkumar P — M.Tech., IIT Roorkee
github.com/sachinkumarp-code |
LinkedIn