8000 GitHub - liusongshang/DDAD: PyTorch implementation of the paper: Dual-Distribution Discrepancy for Anomaly Detection in Chest X-Rays (MICCAI 2022)
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
forked from caiyu6666/DDAD

PyTorch implementation of the paper: Dual-Distribution Discrepancy for Anomaly Detection in Chest X-Rays (MICCAI 2022)

License

Notifications You must be signed in to change notification settings

liusongshang/DDAD

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DDAD (MICCAI 2022)

Our significant extension version of DDAD, named DDAD-ASR, will be soon available at https://github.com/caiyu6666/DDAD-ASR


This is the PyTorch implementation of our paper:

Dual-Distribution Discrepancy for Anomaly Detection in Chest X-Rays
Yu Cai, Hao Chen, Xin Yang, Yu Zhou, Kwang-Ting Cheng.
International Conference on Medical Image Computing and Computer Assisted Intervention (MICCAI), 2022, Early Accept.

Requirements

  • Python 3.6
  • Pytorch 1.7.0
  • tensorboard 2.5.0
  • pillow 6.1.0
  • pydicom 2.3.0 (for data preprocessing)

Data Preparation

  1. Download the training dataset of RSNA Pneumonia Detection Challenge and VinBigData Chest X-ray Abnormalities Detection challenge. Note that we only use their training set as labels of testing set are not available.
  2. Use data/preprocess.py to preprocess the two datasets respectively. The output files should be *.png.
  3. Move the repartition files rsna_data.json and vin_data.json to corresponding data roots and rename to data.json.

The final structure of datasets should be as following:

├─DATA_PATH
│ ├─rsna-pneumonia-detection-challenge   # data root of RSNA dataset
│ │ ├─train_png_512   # preprocessed images of rsna dataset 
│ │ │ ├─xxx.png
│ │ │ ├─ ......
│ │ ├─data.json   # repartition file of rsna dataset (renamed from "rsna_data.json")
│ ├─VinCXR   # data root of VinBigData dataset
│ │ ├─train_png_512   # preprocessed images of VinBigData dataset
│ │ │ ├─xxx.png
│ │ │ ├─ ......
│ │ ├─data.json   # repartition file of VinBigData dataset (renamed from "vin_data.json")

The data.json is a dictionary that storing the data repartition information:

{
  "train": {
    "0": ["*.png", ], // The known normal images for one-class training
    "unlabeled": {
          "0": ["*.png", ], // normal images used to build the unlabeled dataset
    	  "1": ["*.png", ]  // abnormal images used to build the unlabeled dataset
    }
  },
  
  "test": {
  	"0": ["*.png", ],  // normal testing images
  	"1": ["*.png", ]  // abnormal testing images
  }
}

Train and Evaluate

Train the reconstruction network for module A. (Repeat K=3 times to obtain an ensemble of K networks.)

python main.py --config cfgs/RSNA_AE.yaml --mode a

Train the reconstruction network for module B. (Repeat K=3 times to obtain an ensemble of K networks.)

python main.py --config cfgs/RSNA_AE.yaml --mode b

Evaluation

python main.py --config cfgs/RSNA_AE.yaml --mode eval

Each single reconstruction network can also be tested for comparison.

python main.py --config cfgs/RSNA_AE.yaml --mode test

In total, you can directly excute ./train_eval.sh to train and evaluate the DDAD (AE) on RSNA dataset.

Different configuration files can be used for experiments on different datasets and different basic networks.

AUC under different AR of unlabeled dataset

Experiments on RSNA dataset. AE is the basic network.

Histograms of anomaly scores

Citation

If this work is helpful for you, please cite our paper:

@article{cai2022dual,
  title={Dual-Distribution Discrepancy for Anomaly Detection in Chest X-Rays},
  author={Cai, Yu and Chen, Hao and Yang, Xin and Zhou, Yu and Cheng, Kwang-Ting},
  journal={arXiv preprint arXiv:2206.03935},
  year={2022}
}

Contact

If you have any question, feel free to email Yu Cai.

About

PyTorch implementation of the paper: Dual-Distribution Discrepancy for Anomaly Detection in Chest X-Rays (MICCAI 2022)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.9%
  • Shell 1.1%
0