💡 Inspiration

Access to medical imaging data is often restricted due to patient privacy, regulatory barriers, or limited availability in under-resourced regions.
As an aspiring AI developer with a deep interest in healthcare, I was inspired to create a solution that can help overcome data scarcity in medicine — especially for researchers or hospitals that lack large datasets.

My goal became clear: build an AI that can generate synthetic medical images — realistic, privacy-safe, and useful for training other machine learning models.


🤖 What it does

GenAI-MedSynth is an AI-powered web application that:

  • Reconstructs and analyzes input chest X-ray images using a trained Variational Autoencoder (VAE)
  • Generates new, high-fidelity synthetic lung X-ray samples
  • Allows users to upload their own images and instantly synthesize realistic outputs
  • Provides a download button for saving the results
  • Includes a toggle to enable/disable saving synthetic images — aligning with responsible AI practices

The app is user-friendly, fast, and designed to support both education and research.


🛠 How I built it

  • Model: A Variational Autoencoder built and trained in PyTorch using a public pneumonia chest X-ray dataset from kaggle
  • Interface: A modern Streamlit front-end for image upload, generation, and visualization
  • Data processing: Preprocessing pipeline built with NumPy, PIL, and custom scripts to convert .jpeg to .npy tensors
  • App logic: Users can upload an image → AI reconstructs → generates new synthetic samples → displays and downloads

All outputs are stored in standard formats (.png, .npy) to integrate with machine learning workflows.


⚙️ Challenges I ran into

  • Initial dataset (CBIS-DDSM) had conversion issues, so I pivoted to a pneumonia chest X-ray dataset
  • Training on CPU only at the beginning was extremely slow — optimizing batch size and resolution helped
  • Designing an app that is both AI-powered and beginner-friendly required careful UI planning
  • Preprocessing needed precise normalization, resizing, and shape handling to avoid broken inputs

🏆 Accomplishments that I am proud of

  • Generated over 600+ high-quality synthetic lung X-rays that look 80–90% medically realistic
  • Trained a deep VAE model from scratch with decreasing loss over 200+ epochs
  • Built a clean, fully functional AI app with image upload, preview, regeneration, and download
  • Followed responsible AI guidelines by anonymizing outputs and giving users control over saving data

📚 What I learned

  • How to architect and train a Variational Autoencoder for real-world medical data
  • How to handle preprocessing pipelines for grayscale medical images
  • How to deploy AI models into a usable front-end using Streamlit
  • The importance of user control and ethical considerations in healthcare AI

🚀 What's next for GenAI-MedSynth

  • Add multi-domain support: brain CT scans, retinal fundus images, skin lesions
  • Integrate Conditional VAE (CVAE) to guide generation based on disease class
  • Add SSIM / FID evaluation metrics to measure synthetic image quality
  • Release an API version for research labs and hospitals to use programmatically
  • Expand dataset support to allow large-scale synthetic dataset generation in bulk

Built With

Share this project:

Updates