/mood22

Primary LanguageJupyter NotebookMIT LicenseMIT

Improving synthetic anomaly based out-of-distribution with harder anomalies

Official implementation from CitAI team, winner of MICCAI 2022 Medical Out-of Distribution Challenge (MOOD22).

Citing

If you use this implementation, please cite our paper:

@article{marimont2023harder,
  title={Harder synthetic anomalies to improve OoD detection in Medical Images},
  author={Marimont, Sergio Naval and Tarroni, Giacomo},
  journal={arXiv preprint arXiv:2308.01412},
  year={2023}
}

Instructions

Copy dataset JSON specification files

We use monai pre-processing pipelines which require json files with the dataset information and training / validation splits. Examples of JSON files are provided in the json_datalist directory. Copy abdominal / brain JSON files to the respective MOOD dataset directories, i.e. the same directory where the MOOD .nii.gz files are.

[OPTIONAL] Generate a validation set

We used FPI [1] script provided here to generate synthetic validation dataset. If you have a validation set create a JSON file for it such as:

{"numValidation": 251,
 "validation": [
     {
         "image": "./ano_00007/ano_00007_image.nii.gz",
         "label": "./ano_00007/ano_00007_label.nii.gz",
         "type": "synthetic_additive_noise"
     },
     {
         "image": "./ano_00014/ano_00014_image.nii.gz",
         "label": "./ano_00014/ano_00014_label.nii.gz",
         "type": "synthetic_additive_noise"
     },
     {
         "image": "./ano_00036/ano_00036_image.nii.gz",
         "label": "./ano_00036/ano_00036_label.nii.gz",
         "type": "synthetic_additive_noise"
     },
 ]
 }

If not using validation set, do not specify the validation_dataset_config key in the experiment configuration.

Define experiment configuration

Example of configuration is provided in mood_abdom_test

Train a Model

Run train_model.py providing the experiment configuration file as argument:

python train_model.py -e experiments.mood_abdom_test

Visualize anomaly generation process

Visualize the abdominal generation process using visualize_anomalies.ipynb notebook.

Team

Sergio Naval Marimont, Giacomo Tarroni

License

Improving synthetic anomaly based out-of-distribution with harder anomalies is relased under the MIT License.

[1]: Jeremy Tan, Benjamin Hou, James Batten, Huaqi Qiu, and Bernhard Kainz.: Foreign Patch Interpolation. Medical Out-of-Distribution Analysis Challenge at MICCAI. (2020)