Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tumor-Attentive Segmentation-Guided GAN for Synthetic CE-MRI Generation

Deep learning pipeline for synthesizing contrast-enhanced MRI from pre-contrast scans

Demo

Key Results

  • PSNR: 28.93 dB
  • SSIM: 0.744
  • Lesion Improvement: +15% over baseline
  • Dataset: 3,960 paired MRI slices from I-SPY1

Visual Results

alt text

Quick Start

# Clone repo
# python version 3.10.0

git clone https://github.com/MansiDakhale/TSGAN_Project.git
cd TSGAN_Project
python -m venv venv 
Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Run inference
python scripts/tsgan/infer_tsgan.py --ckpt checkpoints/gen_best.pth

# Launch demo
streamlit run scripts/tsgan/app.py

Architecture

Generator: U-Net with tumor-attentive skip connections

  • Input: Pre-contrast MRI + Segmentation mask (2-channel)
  • Output: Synthetic contrast-enhanced MRI
  • Attention modules: Channel-wise gating based on tumor regions

Discriminator: PatchGAN

  • Input: Concatenated pre-contrast and CE (real or fake)
  • Output: Patch-level real/fake predictions

Training:

  • Loss: Adversarial (MSE) + L1 reconstruction + Tumor-weighted L1
  • Optimizer: Adam (lr=2e-4)
  • Mixed precision: torch.cuda.amp
  • Epochs: 50

Quantitative Results

Metric Baseline (pix2pix) TSGAN (Ours) Improvement
L1 (global) 0.0350 0.0230 -34.3%
PSNR 26.12 dB 28.93 dB +10.8%
SSIM 0.698 0.744 +6.6%
Tumor-L1 0.0562 0.0475 -15.5%

Project Structure

├── scripts/
│   ├── build_2d_dataset.py      # DICOM→NPZ preprocessing
│   ├── pix2pix/                 # Baseline implementation
│   └── tsgan/                   # TSGAN implementation
│       ├── train_tsgan.py
│       ├── infer_tsgan.py
│       ├── evaluate_tsgan.py
│       └── app.py               # Streamlit demo
├── checkpoints/                 # Model weights
├── data/                        # Processed dataset
└── TSGAN_PROJECT_REPORT.pdf     # Complete technical report

Ablation Studies

Below is the link of TSGAN project report! https://drive.google.com/file/d/1u7ii3PQxmeSEAnuYhVT5YRgnAbCx2hma/view?usp=drive_link

See full report (Section 6) for detailed ablations on:

  • Effect of segmentation guidance
  • Attention module placement
  • Loss weighting hyperparameters

Citation

@mastersthesis{dakhale2024tsgan,
  title={Tumor-Attentive Segmentation-Guided GAN for Synthetic Contrast-Enhanced MRI Generation},
  author={Dakhale, Mansi Girdhar},
  year={2024},
  school{IIIT Lucknow}
}

Author

Mansi Dakhale

License

MIT License - see LICENSE file for details.

Acknowledgments

  • I-SPY1 Dataset creators
  • Dr. Deepshikha Agarwal (Supervisor, IIIT Lucknow)
  • PyTorch, NiBabel, scikit-image communities

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages