Skip to content

A Generative Adversarial Network (GAN) trained to generate artificial CT scan images of lungs infected with the COVID-19 virus.

Notifications You must be signed in to change notification settings

brendon-ng/COVID-19-Affected-Lung-CT-Image-Generative-Network

 
 

Repository files navigation

COVID-19-Affected Lung CT Image Generative Network

Screenshot 2023-01-19 at 4 53 00 PM
Left: Real Image, Right: Generated Image
MORE IMAGES AND RESULTS FOUND IN OUR PAPER LINKED HERE

A Generational Adversarial Network (GAN) to generate CT scans of lungs with COVID-19

Premise and Motivation

  • Generate images of lungs with COVID-19 to model progression of COVID-19
  • Use this to expand current datasets, which are limited in quantity
  • Eventually create an image-to-image model to see the progression of the disease in one set of lungs

Major Components

Usage

To Create/Train the COVID-19-Affected Lung CT Generative Network

Option 1: Running Locally

  • Model definition and training is located in COVID_GAN.ipynb or COVID_GAN.py.
  • To run, clone this repo, and download the data set available here.
  • Make sure the above-mentioned script and the zip file of data are in the same directory.
  • Before running, make sure all dependencies are installed by running pip3 install -r requirements.txt in terminal.
  • Ensure the hyperparameter load_data_from_Google_Drive is set to False.
  • The program will define a new model and train it with the data provided and hyperparameters specified and changeable in COVID_GAN.ipynb or COVID_GAN.py.
  • Run the program in terminal with python3 COVID_GAN.py or jupyter notebook COVID_GAN.ipynb or with any other framework of your choosing.
  • The final models will be saved in a new subdirectory called "Saved_Models".

Option 2: Running on Google Colabs

  • If you would like to run the model creation/training in Google Colabs, you can make a copy of the Colab here.
  • To obtain the data, go to our project resources and click Add shortcut to Drive for the whole folder.
  • Ensure the hyperparameter load_data_from_Google_Drive is set to True.
  • The program will define a new model and train it with the data provided and hyperparameters specified and changeable in the Colab after you've made a copy.
  • Run the program on Google Colabs.
  • The final models will be saved in a new directory in "My Drive" called "COVID_GAN_Saved_Models".

Demo of our final model.

Option 1: Running Locally.

  • Demo is located at Demo_COVID_GAN_Progression.ipynb.
  • Download both the dataset and .h5 files of the final models are downloaded from project resources.
  • Ensure the zipped dataset and final models are in the same directory as Demo_COVID_GAN.ipynb.
  • Before running, make sure all dependencies are installed by running pip3 install -r requirements.txt.
  • Ensure the hyperparameter load_data_from_Google_Drive is set to False.
  • The demo will load in the pre-trained models using the .h5 files as well as the data to run the demo.
  • Run the demo with jupyter notebook Demo_COVID_GAN.ipynb or with any other framework of your choosing.

Option 2: Running on Google Colabs.

  • If you would like to run the demo in Google Colabs, you can make a copy of the Demo Colab here.
  • To obtain the data and models, go to our project resources and click Add shortcut to Drive for the whole folder.
  • Ensure the hyperparameter load_data_from_Google_Drive is set to True.
  • The program will load in the pre-trained models from project resources as well as the data to run the demo.
  • Run the program on Google Colabs.

Project Links

Linked throughout the README

Paper
Model Definition and Training Script Colab
Demo Colab
Project Resources (Final Models and Data)

References and Helpful Links:

[1] Age Progression/Regression by Conditional Adversarial Encoders
[2] Exploring GAN Latent Space
[3] Deep Convolutional Neural Network Tutorial
[4] GAN Tutorial
[5] Visualize Autoencoders (Latent Space)

About

A Generative Adversarial Network (GAN) trained to generate artificial CT scan images of lungs infected with the COVID-19 virus.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 98.2%
  • Python 1.5%
  • HTML 0.3%