Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Pipeline for Retinopathy of Prematurity (ROP)

Multi-task deep learning pipeline for ROP severity classification on fundus and fluorescein angiography images.

Tasks

Task Type Classes
Plus disease Binary plus / no-plus
Stage Binary low (0–2) / severe (3+)
Zone Multi-class I / II / III

Architecture

  • Backbone: EfficientNet-B0/B1 (transfer learning via timm)
  • Multi-task heads: shared features → 3 independent classification heads
  • Cross-validation: GroupedKFold (patient-level split)
  • Explainability: Grad-CAM

Project Structure

ROP/
├── data/
│   ├── raw/              # Original images (organized by patient/eye)
│   ├── labels.xlsx       # Annotations (gold standard + readers)
│   └── processed/        # Preprocessed images
├── src/
│   ├── preprocessing.py  # Retina crop, resize, normalization
│   ├── dataset.py        # PyTorch Dataset
│   ├── model.py          # EfficientNet multi-task model
│   ├── train.py          # Training loop + cross-validation
│   ├── evaluate.py       # Metrics (AUROC, kappa, F1, etc.)
│   ├── interreader.py    # Inter-reader agreement analysis
│   ├── gradcam.py        # Grad-CAM explainability
│   └── run_experiments.py # Experiment orchestrator
├── configs/
│   └── config.yaml       # All hyperparameters
├── notebooks/            # Exploratory & analysis notebooks
├── outputs/              # Models, predictions, figures, reports
└── requirements.txt

Setup

# Create virtual environment
python -m venv .venv
source .venv/bin/activate

# Install dependencies
pip install -r requirements.txt

Labels File Format (data/labels.xlsx)

Column Description
patient_id Unique patient identifier
eye L (left) or R (right)
modality fundus or FA
image_path Relative path to image in data/raw/
plus 0 = no plus, 1 = plus
stage_bin 0 = low (stage 0–2), 1 = severe (stage 3+)
stage_raw Raw stage value (0–5)
zone 0 = zone I, 1 = zone II, 2 = zone III
gs_plus Gold standard plus
gs_stage_bin Gold standard stage (binary)
gs_zone Gold standard zone
reader_* Individual reader annotations

Running Experiments

# Preprocess all images
python src/preprocessing.py --config configs/config.yaml

# Run all experiments (fundus-only, FA-only, combined)
python src/run_experiments.py --config configs/config.yaml

# Inter-reader analysis
python src/interreader.py --config configs/config.yaml

# Generate Grad-CAM visualizations
python src/gradcam.py --config configs/config.yaml --experiment fundus_only

Metrics

  • Plus & Stage: AUROC, Sensitivity, Specificity, F1-score
  • Zone: Weighted kappa, Macro F1-score
  • Comparison: AI vs Junior readers vs Senior readers (vs Gold Standard)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages