How brianshih95/deep-learning-for-medical-imaging works
This repository contains two MRI brain-tumor segmentation implementations: a U-Net baseline and a Segment Anything Model (SAM) variant. Their principal workflow is to find image/mask pairs, split them by patient, prepare datasets, train and evaluate segmentation models, and save visualizations and checkpoints. The source excerpts support those flows but not the contents of the hw2 notebook, so it is shown without inferred connections.
Main entry points: unet.py U-Net training · sam.py SAM training
Components 16
Data preparation
- Pair images and masks
hw1/src/unet.py - Patient-level split
hw1/src/unet.py - U-Net dataset
hw1/src/unet.py - Pair images and masks
hw1/src/sam.py - Patient-level split
hw1/src/sam.py - SAM dataset
hw1/src/sam.py
Segmentation models
- U-Net model
hw1/src/unet.py - SAM model
hw1/src/sam.py
Training and evaluation
- U-Net training
hw1/src/unet.py - SAM training
hw1/src/sam.py - Loss and metrics
hw1/src/unet.py - Loss and metrics
hw1/src/sam.py - Checkpoints and plots
hw1/src/unet.py - Checkpoints and plots
hw1/src/sam.py
Notebook work
- Notebook workflow
hw2/src/main.ipynb
Other components
- MRI image-mask files
Connections 14
- MRI image-mask files → Pair images and masks: scans files
hw1/src/unet.py - Pair images and masks → Patient-level split: passes pairs
hw1/src/unet.py - Patient-level split → U-Net dataset: creates splits
hw1/src/unet.py - U-Net dataset → U-Net training: feeds batches
hw1/src/unet.py - U-Net training → U-Net model: trains model
hw1/src/unet.py - U-Net training → Loss and metrics: computes scores
hw1/src/unet.py - U-Net training → Checkpoints and plots: saves results
hw1/src/unet.py - MRI image-mask files → Pair images and masks: scans files
hw1/src/sam.py - Pair images and masks → Patient-level split: passes pairs
hw1/src/sam.py - Patient-level split → SAM dataset: creates splits
hw1/src/sam.py - SAM dataset → SAM training: feeds batches
hw1/src/sam.py - SAM training → SAM model: trains model
hw1/src/sam.py - SAM training → Loss and metrics: computes scores
hw1/src/sam.py - SAM training → Checkpoints and plots: saves results
hw1/src/sam.py