Skip to content

Adversarially Training of Autoencoders for Unsupervised Anomaly Segmentation

License

Notifications You must be signed in to change notification settings

ahmedgh970/Adversarial_Training

Repository files navigation

Adversarially Training of Autoencoders for Unsupervised Anomaly Segmentation

This repo contains a method to adversarially train Autoencoders (AEs) (Dense AE and Variational AE) for unsupervised anomaly segmentation task on brain MR Images.

Tags

Adversarial Training, Autoencoders, Anomaly Segmentation, Unsupervised, Brain MR Images, TensorFlow, Keras

Requirements

  • Python >= 3.6

All packages used in this repository are listed in requirements.txt. To install those, run:

pip3 install -r requirements.txt

Folder Structure

Autoencoders_Adversarial_Training_UAD/
│
├── Autoencoders_Adversarial_Training_UAD.ipynb - Jupyter notebook to work on Google Colab
│
├── data/  - Data folder
│   ├── data_descriptions.txt
│   └── ...
│
├── models/  - Models defining and training
│   └── Autoencoders/
│       └── DCAE.py
│   └── Latent Variable models/
│       └── VAE.py
│
├── saved/  - Saving folder
│   └── ...
│
└── scripts/  - Utility scripts for evaluation and adversarial crafting
    ├── adversarial_crafting.py
    ├── eval_brats.py
    ├── eval_mslub.py
    ├── ...
    └── utils.py

Usage

CLI Usage

Every model can be trained and evaluated individually using the scripts which are provided in the models/* and scripts/* folders.

Google Colab Usage

Training can be started by importing Autoencoders_Adversarial_Training_UAD.ipynb in Google Colab. This github repository is linked and can directly loaded into the notebook. However, the datasets have to be stored so that Google Colab can access them. Either uploading by a zip-file or uploading it to Google Drive and mounting the drive.

Adversarial Robustness Toolbox Installation

The most recent version of ART can be downloaded or cloned from this repository:

git clone https://github.com/Trusted-AI/adversarial-robustness-toolbox

Install ART with the following command from the project folder adversarial-robustness-toolbox: Using pip:

pip install .

Disclaimer

Please do not hesitate to open an issue to inform of any problem you may find within this repository.

Reference

For more details about the unsupervised anomaly segmentation method, you can find our published paper on MIDL 2022 Conference Transformers for Unsupervised Anomaly Segmentation in Brain MR Images.

@article{ahghorbe2022,
  title = {Transformer based Models for Unsupervised Anomaly Segmentation in Brain MR Images},
  author = {Ghorbel, Ahmed and Aldahdooh, Ahmed and Hamidouche, Wassim and Albarqouni, Shadi},
  booktitle={Medical Imaging with Deep Learning},
  year = {2022}
}

For more details about the adversarial training procedure, you can read the paper on ARAE: Adversarially robust training of autoencoders improves novelty detection.

@article{salehi2021arae,
  title={Arae: Adversarially robust training of autoencoders improves novelty detection},
  author={Salehi, Mohammadreza and Arya, Atrin and Pajoum, Barbod and Otoofi, Mohammad and Shaeiri, Amirreza and Rohban, Mohammad Hossein and Rabiee, Hamid R},
  journal={Neural Networks},
  volume={144},
  pages={726--736},
  year={2021},
  publisher={Elsevier}
}

License

This project is licensed under the GNU General Public License v3.0. See LICENSE for more details