Diff of /README.md [000000] .. [978658]

Switch to unified view

a b/README.md
1
2
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/StefanDenn3r/Unsupervised_Anomaly_Detection_Brain_MRI/blob/master/Unsupervised%20Anomaly%20Detection%20Brain-MRI.ipynb)
3
[![DOI:10.1016/j.media.2020.101952](https://zenodo.org/badge/DOI/10.1016/j.media.2020.101952.svg)](https://doi.org/10.1016/j.media.2020.101952)
4
[![DOI:10.48550/arXiv.2004.03271](https://zenodo.org/badge/DOI/10.48550/arXiv.2004.03271.svg)](http://arxiv.org/abs/2004.03271)
5
6
7
# Autoencoders for Unsupervised Anomaly Segmentation in Brain MR Images: A Comparative Study
8
9
This repository contains the code for our paper on [Autoencoders for Unsupervised Anomaly Segmentation in Brain MR Images: A Comparative Study](https://www.sciencedirect.com/science/article/abs/pii/S1361841520303169). 
10
If you use any of our code, please cite:
11
```
12
@article{Baur2020,
13
  title = {Autoencoders for Unsupervised Anomaly Segmentation in Brain MR Images: A Comparative Study},
14
  author = {Baur, Christoph and Denner, Stefan and Wiestler, Benedikt and Albarqouni, Shadi and Navab, Nassir},
15
  url = {http://arxiv.org/abs/2004.03271},
16
  year = {2020}
17
}
18
19
```
20
```
21
@article{baur2021autoencoders,
22
  title={Autoencoders for unsupervised anomaly segmentation in brain mr images: A comparative study},
23
  author={Baur, Christoph and Denner, Stefan and Wiestler, Benedikt and Navab, Nassir and Albarqouni, Shadi},
24
  journal={Medical Image Analysis},
25
  pages={101952},
26
  year={2021},
27
  publisher={Elsevier}
28
}
29
```
30
* [Autoencoders for Unsupervised Anomaly Segmentation in Brain MR Images: A Comparative Study](#autoencoders-for-unsupervised-anomaly-segmentation-in-brain-mr-images-a-comparative-study)
31
  * [Requirements](#requirements)
32
  * [Folder Structure](#folder-structure)
33
  * [Usage](#usage)
34
      * [Config file format](#config-file-format)
35
      * [CLI-Usage](#cli-usage)
36
  * [Disclaimer](#disclaimer)
37
  * [License](#license)
38
    
39
40
<!-- /code_chunk_output -->
41
42
## Requirements
43
* Python >= 3.6
44
45
All packages used in this repository are listed in [requirements.txt](https://github.com/StefanDenn3r/Unsupervised_Anomaly_Detection_Brain_MRI/blob/master/requirements.txt).
46
To install those, run `pip3 install -r requirements.txt`
47
48
49
## Folder Structure
50
  ```
51
  Unsupervised_Anomaly_Detection_Brain_MRI/
52
53
  ├── Unsupervised Anomaly Detection Brain-MRI.ipynb - Jupyter notebook to work on Google Colab
54
  ├── run.py - execute to run in commandline
55
  ├── config.json - holds configuration
56
57
  ├── data_loaders/ - Definition of dataloaders
58
  │   ├── BRAINWEB.py
59
  │   ├── MSISBI2015.py
60
  │   └── ...
61
62
  ├── logs/ - default directory for storing tensorboard logs
63
64
  ├── mains/ - Main files to train each architecture
65
  │   ├── main_AE.py
66
  │   └── ...
67
68
  ├── model/ - Architecture definitions
69
  │   ├── autoencoder.py
70
  │   └── ...
71
72
  ├── trainers/ - trainers including definition of loss functions, metrics and restoration methods
73
  │   ├── AE.py
74
  │   └── ...
75
76
  └── utils/ - small utility functions
77
      ├── util.py
78
      └── ...
79
  ```
80
81
## Usage
82
83
Since we utilized a private dataset for training on healthy data we exchanged this dataset in the code with the publicly available Brainweb dataset. 
84
The Brainweb dataset can be downloaded [here](https://brainweb.bic.mni.mcgill.ca/). For easy use, we also provide a script, which allows you to download the dataset. The script can be found in [here](https://github.com/StefanDenn3r/Unsupervised_Anomaly_Detection_Brain_MRI/blob/master/utils/brainweb_download.py). 
85
86
### Config file format
87
First define the path to the data directories in `config.default.json`.
88
Of course only those you want to use have to be defined. 
89
If you want to use your own dataset, check how the dataloaders in `dataloaders` 
90
are defined and implement your own to work with our code.
91
```json
92
{
93
  "BRAINWEBDIR": "path/to/Brainweb",
94
  "MSSEG2008DIR": "path/to/MSSEG2008",
95
  "MSISBI2015DIR": "path/to/ISBIMSlesionChallenge",
96
  "MSLUBDIR": "path/to/MSlub",
97
  "CHECKPOINTDIR": "path/to/saved/checkpoints",
98
  "SAMPLEDIR": "path/to/saved/sample_dir"
99
}
100
```
101
102
### CLI Usage
103
For the results of our paper we used the `run.py`. 
104
Every model can also be trained individually using the script which are provided in the `mains` folder.
105
106
107
### Google Colab Usage
108
Offering you an easy start to work with the code base is essential. Therefore, we prepared a Jupyter Notebook for Google Colab, which can be found here: [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/StefanDenn3r/Unsupervised_Anomaly_Detection_Brain_MRI/blob/master/Unsupervised%20Anomaly%20Detection%20Brain-MRI.ipynb)
109
Running all cells will download the brainweb dataset, train all models and evaluate them. Enjoy! 
110
111
## Disclaimer
112
The code has been cleaned and polished for the sake of clarity and reproducibility, and even though it has been checked thoroughly, it might contain bugs or mistakes. Please do not hesitate to open an issue or contact the authors to inform of any problem you may find within this repository.
113
114
## License
115
This project is licensed under the GNU General Public License v3.0. See LICENSE for more details