Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jemtan/FPI
Code for FPI submission to MOOD 2020
https://github.com/jemtan/FPI
Last synced: 3 months ago
JSON representation
Code for FPI submission to MOOD 2020
- Host: GitHub
- URL: https://github.com/jemtan/FPI
- Owner: jemtan
- Created: 2020-10-02T20:09:22.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-08-09T17:52:42.000Z (over 3 years ago)
- Last Synced: 2024-07-31T20:43:42.336Z (6 months ago)
- Language: Jupyter Notebook
- Size: 354 KB
- Stars: 16
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Code for Foreign Patch Interpolation (FPI) Submission for MOOD 2020
### Abstract:
In medical imaging, outliers can contain hypo/hyper-intensities, minor deformations, or completely different anatomy altogether. To detect these irregularities it is helpful to learn the features present in both normal and abnormal images. However this is difficult because of the wide range of possible abnormalities and also the number of ways that normal anatomy can vary naturally. As such, we leverage the natural variations in normal anatomy to create a range of synthetic abnormalities. Specifically, the same patch region is extracted from two independent samples and is replaced with an interpolation between both patches. The interpolation factor, patch size, and patch location are randomly sampled from uniform distributions. A wide residual encoder decoder is trained to give a pixel-wise prediction of the patch and its interpolation factor. This encourages the network to learn what features to expect normally and to identify where foreign patterns have been introduced. However, optimization must be done carefully to avoid overfitting to the self-supervised task because generalization is essential for outlier detection with this type of approach. The outlier score is derived directly from the estimate of the interpolation factor. Meanwhile the pixel-wise output allows for pixel- and subject- level predictions using the same model.### MOOD Challenge Information:
Please see link below for more information on the MOOD challenge and instructions for data access:
```
http://medicalood.dkfz.de/web/
```### Key files:
self_sup_task.py - FPI operation used to create self-supervised task
fpiSubmit.py - training/testing loops
models/wide_residual_network.py - network architecture
readData.py - data processing, reading/writing volumes
train_simple.py - run training and save models
pred_simple.py - generate predictions on test data
eval_simple.py - calculate score (average precision)#### Run training with:
```
python train_simple.py -i -o -d
```
Then place desired models into restore_dir/brain and restore_dir/abdom respectively#### Generate predictions with:
```
python pred_simple.py -i -o -m -d
```#### Calculate score with:
```
python eval_simple.py -l -o -m -d
```
Note that there are no test samples provided, but you can create your own and provide the labels in label_dir. Follow the format of the toy test samples provided by the MOOD challenge.#### Disclaimer
Now updated to tensorflow 2. If you prefer, you can use the code in self_sup_task.py to train your own architecture.This repository includes code from the respositories linked below. In particular, the network architecture is built on top of their wide resnet implementation. The linked repository is a great outlier detection method also based on a self-supervised task. If you are interested in this topic I definitely recommend you check out their paper/code!
```
https://github.com/izikgo/AnomalyDetectionTransformations
https://github.com/asmith26/wide_resnets_keras.git
```### Author Information
```
Jeremy Tan, Benjamin Hou, James Batten, Huaqi Qiu, and Bernhard Kainz.: Foreign Patch Interpolation. Medical Out-of-Distribution Analysis Challenge at MICCAI. (2020)