Dual-distribution discrepancy with self-supervised refinement for anomaly detection in medical images
Yu Cai, Hao Chen, Xin Yang, Yu Zhou, Kwang-Ting Cheng
From top to bottom: original image, , DDAD-, DDAD-, DDAD-.
Download the well-processed Med-AD benchmark from: Google Drive | OneDrive.
(The benchmark is organized using 4 public datasets, and should be only applied for academic research.)
Organize the Med-AD benchmarks manually follow the guidance.
- NVIDIA GeForce RTX 3090
- Python 3.10
- Pytorch 1.12.1
conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch -c nvidia
pip install pillow
pip install joblib
pip install pydicom
pip install opencv-python
pip install scikit-learn
pip install tensorboard
pip install matplotlib
pip install tqdm
All scripts are available in scripts/
, and configuration files are in cfgs/
.
Train and evaluate the method on RSNA dataset using AE as the backbone: ./scripts/run_rsna_ae.sh
python main.py --config cfgs/RSNA_AE.yaml --mode a;
python main.py --config cfgs/RSNA_AE.yaml --mode a;
python main.py --config cfgs/RSNA_AE.yaml --mode a; # ensemble 3 networks for module a (UDM)
python main.py --config cfgs/RSNA_AE.yaml --mode b;
python main.py --config cfgs/RSNA_AE.yaml --mode b;
python main.py --config cfgs/RSNA_AE.yaml --mode b; # ensemble 3 networks for module b (NDM)
python main.py --config cfgs/RSNA_AE.yaml --mode eval;
python main.py --config cfgs/RSNA_AE.yaml --mode r;
python main.py --config cfgs/RSNA_AE.yaml --mode eval_r;
Similarly, for training/evaluating on other datasets using other backbones, the following commands can be used:
./scripts/run_rsna_ae.sh
./scripts/run_rsna_memae.sh
./scripts/run_rsna_aeu.sh
./scripts/run_vin_ae.sh
./scripts/run_vin_memae.sh
./scripts/run_vin_aeu.sh
./scripts/run_brain_ae.sh
...
./scripts/run_lag_ae.sh
...
The trained models and results are available here.
If any questions, feel free to contact: yu.cai@connect.ust.hk
We really appreciate these wonderful open-source codes and datasets!
- RSNA Pneumonia Detection Challenge dataset
- Vin-BigData Chest X-ray Abnormalities Detection dataset (VinDr-CXR)
- Brain Tumor MRI dataset
- Large-scale Attention-based Glaucoma (LAG) dataset
If this work is helpful for you, please cite our papers:
@article{CAI2023102794,
title = {Dual-distribution discrepancy with self-supervised refinement for anomaly detection in medical images},
journal = {Medical Image Analysis},
volume = {86},
pages = {102794},
year = {2023},
issn = {1361-8415},
doi = {https://doi.org/10.1016/j.media.2023.102794},
author = {Yu Cai and Hao Chen and Xin Yang and Yu Zhou and Kwang-Ting Cheng},
}
@inproceedings{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},
booktitle={International Conference on Medical Image Computing and Computer-Assisted Intervention},
pages={584--593},
year={2022},
organization={Springer}
}