Trustworthy AI method based on Dempster-Shafer theory with application to fetal brain 3D T2w MRI segmentation.
To run the automatic segmentation algorithms a NVIDIA GPU with at least 8GB of memory is required.
The code has been tested with the configuration:
The code is supported on every operating system (OS) using docker. However, it has been tested only for
The installation is performed using docker:
First, install docker (see https://docs.docker.com/get-docker/).
Install the docker image twai:latest
using
sh build_docker.sh
This step takes a few minutes.
Create a docker container for the docker image
twai:latest
that was previously built, using the command
docker run --ipc=host --gpus all -it -v <repository-path>:/workspace/trustworthy-ai-fetal-brain-segmentation -v <data-path>:/data --name twai twai:latest
where <repository-path>
has to be replaced by the path of the git repository on your system
and <data-path>
has to be replaced by the path of a folder containing the data to be used for segmentation.
This step creates a docker container called twai
.
If you have already created the docker container twai
, you can reuse it using the command lines
docker start twai
docker attach twai
The installation has been tested for
You can compute the automatic segmentations for the backbone AI, fallback, and trustworthy AI algorithms
using the python script run_segment.py
.
To learn more about the usage of the script, please see
python run_segment.py -h
We refer to the demo below for a detailed example.
Fetal brain 3D MRI from a subset of the testing dataset can be downloaded at https://zenodo.org/record/6405632#.YkbWPCTMI5k
Put the folder \sub-feta001
of the first case in <data-path>
on your system.
Start and attach the docker container (see above).
You can now compute the automatic segmentations for the backbone AI, fallback, and trustworthy AI algorithms using, inside the docker container
python run_segment.py --input '/data/sub-feta001/srr.nii.gz' --mask '/data/sub-feta001/mask.nii.gz' --ga 27.9 --condition 'Spina Bifida' --output_folder 'output/sub-feta001' --bfc
This step takes several minutes.
You may need to adapt the paths depending where the folder \sub-feta001
is located inside <data-path>
.
For more information about the argument of run_segment.py
please run
python run_segment.py -h
The output can be found in the folder pointed by --output_folder
(output/sub-feta001'
in the example above).
The output folder contains three main folders of interest:
\backboneAI
: output segmentation of the deep learning method nnU-Net\fallback
: output segmentation of the atlas-based method\trustworthyAI
: output segmentation of our trustworthy AI algorithm combining the output of the backbone AI and the fallback algorithmsEach of those folders should contain a unique segmentation file with the extension .nii.gz
corresponding to the
segmentation computed by the algorithm of the same name as the folder name.
The figures shown in the paper can be reproduced by running
sh run_make_all_figures.sh
After running this command, the figures will be in the folder \output
.
If you find this research useful for your work, please give this repo a star :star: and cite
@article{fidon2022dempster,
title={A Dempster-Shafer approach to trustworthy AI with application to fetal brain MRI segmentation},
author={Fidon, Lucas and Aertsen, Michael and Kofler, Florian and Bink, Andrea and David, Anna L and Deprest, Thomas and Emam, Doaa and Guffens, Fr and Jakab, Andr{\'a}s and Kasprian, Gregor and others},
journal={arXiv preprint arXiv:2204.02779},
year={2022}
}