This repository contains the code to reproduce the experiments from the paper “Unsupervised Anomaly Localization with Structural Feature Autoencoders”
In this work, we propose to combine working in a multi-channel feature space with Structural Similarity loss to significantly improve the localization performance of anomalies that are not necessarily hyperintense.
Download this repository by running
git clone https://github.com/FeliMe/feature-autoencoder
in your terminal.
Create and activate the Anaconda environment:
conda env create -f environment.yml
conda activate anomaly_detection
Additionally, you need to install the repository as a package:
python3 -m pip install --editable .
To be able to use Weights & Biases for logging, set the environment variables $WANDBNAME and $WANDBPROJECT.
We use the Cambridge Centre for Ageing and Neuroscience (Cam-CAN) dataset for training (https://camcan-archive.mrc-cbu.cam.ac.uk/dataaccess/index.php) and the Multimodal Brain Tumor Image Segmentation Benchmark (BraTS) for evaluation (ipp.cbica.upenn.edu 2020 version).
You can preprocess the data by running
python3 fae/data/prepare_data.py --dataset CamCAN --weighting t1
python3 fae/data/prepare_data.py --dataset BraTS --weighting t1
To generate the results from Section 4 (Table 1, MOOD Dataset), run:
bash fae/run_mood.sh
To generate the results from Section 4 (Figure 3, Comparison with the Baselines), run:
bash fae/run_comparison.sh