If you use this code, please use the following citation - Shehroz S. Khan, Faraz Khosbakhtian, Ahmad Bilal Ashraf, Anomaly Detection Approach to Identify Early Cases in aPandemic using Chest X-rays, 34th Canadian Conference on Artificial Intelligence, BC, 2021
COVID-19 continues to have a devestating effect on the health and the wellness of global population. Here, we are proposing a Convolutional Variational Autoencoder for Anomaly Detection of COVID-19 cases from CXR images.
For a detailed description of COVIDx dataset and the methodology behind COVIDomaly please visit here
The data used for this network is a modified version of COVIDx. I have downsampled the images into 224 * 224.
You can download the modified dataset here
Please make sure resized_COVIDx.zip
is placed at the same directory as the repository's root directory (at the same place as the main.py
).
Before trying to run the experiments, please make sure you:
- Have downloaded and extracted the data from here
- You meet the library requirements listed in the Requirements section of this document
You can choose the behaviour of the code and the hyper-parameters of network by command line arguments. To get some help run:
python main.py -h
To experiment only with normal cases in training:
python main.py -n normal
To experiment with normal cases and non-COVID Pneumonia in training:
python main.py -n normal pneumonia
You can also turn off the training, and just do the testing:
python main.py -n normal pneumonia --train=False
To use this project you will need:
OpenCV, sklearn, Pandas, pyTorch, Tensorflow, TensorBoard, and matplotlib
For ease of use, you can clone the environment used in development of the project. Make sure you are in the root directory of the project and run this command in terminal: `You can clone my environment with command:
conda env create -f ./Z-conda-env/COVIDomaly.yml
conda activate COVIDomaly