This repository contains PyTorch implementation of the following paper: CVAD: A generic medical anomaly detector based on Cascade VAE (https://arxiv.org/abs/2110.15811)
- First clone the repository
git clone https://github.com/XiaoyuanGuo/CVAD.git
- Create the virtual environment via conda
conda create -n cvad python=3.7
- Activate the virtual environment.
conda activate cvad
- Install the dependencies.
pip install --user --requirement requirements.txt
To train the model on CIFAR10/SIIM-ISIC datasets, run the following commands:
python -u main.py cifar10 CVAD ./ --channel 3 --cvae_n_epochs 100 --cls_n_epochs 20 --normal_class 0
To use the model for SIIM-ISIC dataset, please download the data from https://www.kaggle.com/c/siim-isic-melanoma-classification/data into ./data/ folder.
python -u main.py siim CVAD ./ --channel 3 --cvae_n_epochs 100 --cls_n_epochs 20
python -u main.py breast CVAD --channel 1 --capacity 4 --cvae_n_epochs 100 --cls_n_epochs 20
python -u main.py breast CVAD --channel 1 --capacity 4 --cvae_n_epochs 100 --cls_n_epochs 20 --cvae_lr 0.000001 --cls_lr 0.000001
python -u main.py try CVAD --channel 1 --capacity 4 --cvae_n_epochs 20 --cls_n_epochs 8 --cvae_lr 0.000001 --cls_lr 0.000001
python -u main.py try CVAD --load_cvae_model True --cvae_model_path /mnt/storage/breast_cancer_kaggle/CVAD/weights/try/
If you use this repository or would like to refer the paper, please use the following BibTeX entry
@article{guo2021cvad,
title={CVAD: A generic medical anomaly detector based on Cascade VAE},
author={Guo, Xiaoyuan and Gichoya, Judy Wawira and Purkayastha, Saptarshi and Banerjee, Imon},
journal={arXiv preprint arXiv:2110.15811},
year={2021}
}