Skip to content

This repository serves as a high-level overview of our graduation project. All source code and data will be made available after the official publication of our research paper.

Notifications You must be signed in to change notification settings

OmarEmad101/GP_InfDE-Public-Version

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Web-Based Cardiac Delayed Enhanced MRI Segmentation Using Deep Learning and Synthetic Data Augmentation

License: MIT Python 3.8+ TensorFlow React

🚧 Note: This repository serves as a high-level overview of our graduation project. All source code and data will be made available after the official publication of our research paper.

Project Overview

This project tackles two fundamental challenges in medical AI: data scarcity and clinical integration. We developed a comprehensive system that uses Generative Adversarial Networks (GANs) to synthesize realistic cardiac MRI data, significantly improving segmentation accuracy for myocardial infarction detection. Our solution includes a fully functional web-based platform that seamlessly integrates AI-powered analysis into the daily workflow of medical professionals.

The core innovation lies in addressing the critical shortage of annotated cardiac MRI data through advanced synthetic data generation, while providing clinicians with an intuitive interface for reviewing, refining, and utilizing AI-generated segmentations in their diagnostic process.

Clinical Impact

Cardiovascular disease remains the leading cause of global mortality. Accurate segmentation of myocardial infarction is crucial for:

  • Diagnosis and Treatment Planning: Precise identification of infarcted tissue
  • Therapeutic Guidance: Essential for procedures like ventricular tachycardia ablation
  • Clinical Decision Support: Standardized, reproducible analysis for optimal patient care

Technical Innovation

Our approach addresses critical challenges in medical AI:

  • Data Scarcity: Novel synthetic data generation using GANs and mathematical simulation
  • Class Imbalance: Advanced loss functions and attention mechanisms
  • Clinical Integration: Web-based DICOM viewer with interactive segmentation refinement

System Architecture

System Architecture Diagram

Complete system workflow from data preprocessing through synthetic data generation to clinical deployment

Inter-Component Communication

The system operates as a cohesive pipeline where each component feeds into the next:

  1. Preprocessed real data trains the initial GAN models
  2. The mathematical simulator generates diverse synthetic masks
  3. Trained GANs convert synthetic masks into realistic images
  4. Combined real and synthetic data trains robust segmentation models
  5. The web platform deploys trained models for clinical use

This integrated approach ensures that improvements in any component benefit the entire system, creating a robust solution for clinical cardiac MRI analysis.

System Components and Workflow

Our integrated pipeline consists of five interconnected modules that work together to deliver robust cardiac MRI segmentation:

The system begins with the EMIDEC dataset containing 100 cardiac MRI cases. Raw DICOM images undergo spatial normalization to ensure consistent 1Γ—1Γ—1 mmΒ³ voxel spacing. A specialized localization network identifies and extracts 128Γ—128 regions of interest centered on the left ventricle, reducing computational complexity while maintaining clinical relevance.

This innovative component generates diverse synthetic segmentation masks using three complementary strategies:

  • Fully Synthetic Generation: Creates physiologically realistic myocardium shapes with embedded infarction patterns
  • Hybrid Injection: Combines real myocardial anatomy with synthetically generated pathology
  • Cross-Subject Fusion: Transfers infarction patterns between different patients using k-nearest neighbor matching

The simulator produces thousands of realistic mask variations, dramatically expanding the training dataset beyond the original 100 cases.

Two specialized GAN architectures transform synthetic masks into realistic cardiac MRI images:

Pix2Pix Network: Performs conditional image-to-image translation from segmentation masks to realistic DE-MRI images. Our custom implementation uses weighted loss functions to address severe class imbalance, ensuring proper representation of rare pathological regions.

CycleGAN Network: Enables domain adaptation between cine MRI (abundant but lacking pathology) and LGE sequences (rare but showing infarctions). This allows us to leverage larger datasets of normal cardiac images.

The enhanced dataset trains two complementary segmentation architectures:

  • Attention Residual U-Net: Custom architecture with attention gates that focus on clinically relevant regions
  • nnU-Net: State-of-the-art medical segmentation framework adapted for cardiac pathology detection

Both models benefit from the expanded synthetic dataset, showing particular improvement in detecting rare pathological classes like no-reflow regions.

The final component integrates all AI models into a production-ready web application. Built with React and Django, it provides:

  • Native DICOM file handling and visualization
  • Real-time AI inference with interactive overlay display
  • Brush-based editing tools for manual refinement
  • Automated clinical reporting with quantitative metrics

Results and Performance

Segmentation Performance (Dice Score)

Class Real Data Only Real + GAN Data Improvement
LV Cavity 0.9350 0.9365 +0.16%
Normal Myocardium 0.8222 0.8319 +0.97%
Infarcted Myocardium 0.6126 0.6651 +5.25%
No-Reflow Area 0.5376 0.6676 +13.00%
Mean Dice Score 0.7268 0.7752 +4.84%

GAN Model Development and Optimization

Our GAN development involved extensive experimentation to achieve optimal performance. The following table shows our iterative improvement process:

Pix2Pix Model Trials and Configurations

Trial Key Changes FID ↓ IS ↑ LPIPS ↓ PSNR ↑
1 Baseline Pix2Pix, tanh, no weighting, default U-Net + PatchGAN 512.4 1.32 0.682 10.3
2 Baseline Pix2Pix, sigmoid, no weighting 505.8 1.45 0.68 11.7
3 Weighted L1 loss, Ξ» = 60, sigmoid, 7/6 layers 423.9 1.75 0.598 11.4
4 Weighted L1 loss, Ξ» = 70, tanh, 7/6 layers, deeper discriminator 420.2 1.77 0.599 11.2
5 Weighted L1 loss, Ξ» = 80, sigmoid, deeper discriminator, noise to BG 487.8 1.53 0.643 10.8
6 Ξ» = 90, sigmoid, instance norm, input mask removed from discriminator 348.4 1.68 0.581 15.3
7 Ξ» = 110, tanh, added dropout, deeper U-Net 317.3 1.66 0.588 15.9
8 Ξ» = 70, tanh, 6/5 layers, shallow discriminator 310.4 1.71 0.572 14.4
9 Ξ» = 100, tanh, 6/5 layers, mask-only discriminator 224.2 1.83 0.566 15.5
10 Final: Ξ» = 100, tanh, 6/5 layers, weighted L1, dropout, standard PatchGAN discriminator (input + target, not very deep, outputs (30,30,1)) 198.15 2.192 0.5382 16.42

Comparison with Existing GAN-Based Methods

Our final model demonstrates superior performance compared to existing approaches in the literature:

Model FID ↓ IS ↑ PSNR ↑
CycleGAN 262.6 1.112 32.4
Pix2Pix 244.4 1.714 30.5
U-Net++ Pix2Pix 201.1 1.747 -
Differential P2P 244.3 1.885 -
Joint Model 206.3 1.737 -
Our Model 198.15 2.192 16.42

Note: While our PSNR is lower due to the complexity of DE-MRI images, our model excels in perceptual quality metrics (FID, IS) which are more relevant for medical image synthesis.

Key Achievements

  • βœ… 13% improvement in no-reflow region segmentation
  • βœ… 61% reduction in FID score for synthetic image quality
  • βœ… 66% increase in Inception Score for image diversity
  • βœ… Web-based platform for clinical integration
  • βœ… Best-in-class performance compared to existing GAN methods

System Demonstration

System Demo Video

Watch our comprehensive demonstration showing the complete workflow from DICOM upload to AI-powered segmentation and clinical reporting

Published Research

This project has resulted in a comprehensive research paper:

Paper (Under Review)

  • "Web-Based Cardiac Delayed Enhanced MRI Segmentation Using Deep Learning and Synthetic Data Augmentation"
    πŸ“„ Currently private while we finalize the publication process.
    πŸ“¬ For early access or collaboration inquiries, feel free to contact me.

Research Contributions

Novel Methodologies

  1. Mathematical Simulation Framework: Novel approach for generating realistic cardiac pathology patterns
  2. Hybrid GAN Architecture: Innovative combination of Pix2Pix and CycleGAN for medical image synthesis
  3. Clinical Integration Platform: Comprehensive web-based system for AI-powered cardiac MRI analysis
  4. Performance Validation: Thorough evaluation on EMIDEC dataset with clinical relevance metrics

Impact and Significance

  • Clinical Workflow Integration: Bridges the gap between AI research and clinical practice
  • Data Scarcity Solution: Addresses fundamental challenge in medical AI through synthetic data generation
  • Performance Enhancement: Demonstrates significant improvement in rare class segmentation (13% for no-reflow regions)

Docker Deployment (Private for Now)

We have developed a complete Docker image that automates our data generation pipeline β€” from synthetic mask generation to DE-MRI image synthesis using GANs.

🚧 This Docker image is currently private as it contains unpublished components. It will be made public after the research is officially published.

πŸ“¬ If you are interested in accessing the Docker image for review, research, or collaboration, please feel free to contact me.

Citation

If you use this work in your research, please cite:

@article{cardiac_segmentation_2025,
  title={Web-Based Cardiac Delayed Enhanced MRI Segmentation Using Deep Learning and Synthetic Data Augmentation},
  author={Omar N. and Omar E. and Khaled M. and Hana H. and Khaled A. and Ahmed A. and Tamer B.},
  journal={Graduation Project},
  year={2025},
  institution={Cairo University, Faculty of Engineering}
}

Acknowledgments

  • EMIDEC Challenge: For providing the cardiac MRI dataset
  • Cairo University: Systems and Biomedical Engineering Department
  • NIH NIDDK: Biomedical and Metabolic Imaging Branch collaboration
  • Open Source Community: TensorFlow, React, and medical imaging libraries

Contact

  • Project Team

Meet our dedicated development team working on this graduation project:

  • Institution: Cairo University, Faculty of Engineering

⭐ Star this repository if you find it helpful!

For questions, issues, or collaboration opportunities, please open an issue or contact the development team.


About

This repository serves as a high-level overview of our graduation project. All source code and data will be made available after the official publication of our research paper.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published