← return to matrix

// 🏆 MONAITHON — 1ST PLACE

Medical Image Segmentation

Retinal vessel segmentation using MONAI and PyTorch — deployed as a production FastAPI service.

MONAIPyTorchFastAPIStreamlitDockerPython

Overview

Developed an automated retinal vessel segmentation pipeline using the MONAI framework and U-Net architecture on the DRIVE benchmark dataset. The model was deployed as a production-grade web service using FastAPI, Streamlit, and Docker — winning 1st place at the JNNCE MONAITHON Hackathon.

Problem

Manual retinal vessel segmentation is time-consuming and subject to inter-observer variability in clinical settings. An automated, accurate, and low-latency system is needed to assist ophthalmologists with early detection of diabetic retinopathy and other vascular diseases.

Dataset Context

Name

DRIVE (Digital Retinal Images for Vessel Extraction)

Metadata Matrix Size

100 images

Telemetry Source

https://www.kaggle.com/datasets/andrewmvd/drive-digital-retinal-images-for-vessel-extraction

Pipeline Preprocessing Steps

  • »CLAHE (Contrast Limited Adaptive Histogram Equalization) for contrast enhancement
  • »Green channel extraction for vessel visibility
  • »Patch-based extraction (48×48) for training augmentation
  • »Normalization and tensor conversion using MONAI transforms

Architecture & Technical Foundation

Model Architecture

U-Net

Technology Stack

MONAI + PyTorch

Key Components

  • MONAI UNet with 4 resolution levels
  • DiceLoss + CrossEntropyLoss combined objective
  • Adam optimizer with learning rate scheduling
  • MONAI sliding window inference for full-image prediction

ML Pipeline

01

Data Ingestion

Load DRIVE retinal dataset (.tif images, .gif vessel masks) and split into train/validation (80/20).

02

Preprocessing

Extract green channel, normalize to [0,1], apply CLAHE for contrast enhancement, resize to 256×256, and binarize masks.

03

Data Augmentation

Apply MONAI transforms: flips, rotations, zoom, Gaussian noise, and contrast adjustment to improve generalization.

04

Model Training

Train MONAI U-Net (batch norm, deeper channels) using Dice + CrossEntropy loss, Adam optimizer, cosine LR scheduler, with early stopping.

05

Validation & Monitoring

Evaluate using Dice score every 2 epochs with sliding window inference; save best model checkpoint.

06

Results Visualization

Plot training loss & Dice curves and visualize predictions vs ground truth masks.

07

Evaluation Metrics

Compute Dice (~0.47), Precision (~0.32), Recall (~0.89), and F1-score (~0.47) on validation set.

08

Model Export

Save trained model weights (.pth) for deployment or inference.

09

UI

Streamlit frontend for image upload and segmentation overlay visualization.

10

Containerization

Dockerized service for portable, reproducible deployment.

Results & Outcomes

0.4729

Dice Score

0.3215

Precision

0.8929

Recall

0.4728

F1-Score

  • 1st Place at JNNCE MONAITHON Hackathon — recognized for superior model precision and deployment workflow
  • Production-ready containerized deployment with FastAPI + Docker