Official code of the paper "StRegA: Unsupervised Anomaly Detection in Brain MRIs using a Compact Context-encoding Variational Autoencoder" (https://doi.org/10.1016/j.compbiomed.2022.106093 and https://arxiv.org/abs/2201.13271).
This was first presented at ISMRM-ESMRMB 2022, London. Abstract available on RG: https://www.researchgate.net/publication/358357400_StRegA_Unsupervised_Anomaly_Detection_in_Brain_MRIs_using_Compact_Context-encoding_Variational_Autoencoder
The name "StRegA" is inspired by the name of the Italian herb liquore with saffron - Strega (following the tradition of namming MR-related products with name of alchoholic drinks or liquores.
engine.py
andtrain.py
are used to train new models with a custom data loader expected to iterate over slices of FSL segmented data on the 2D modelccevae.py
contains the model code and uses parts fromae_bases.py
,ce_noise.py
andhelpers.py
Pipeline.ipynb
shows the entire StRegA pipeline including post-processing.- The
dataloaders
folder has some examples of the dataloader that was used during training and validation
A "master" checkpoint was created (not part of the manuscript) by training on MOOD (T1) + IXI T1 + IXI T2 + IXI PD MRIs segmented with FSL. This can be found on Huggingface: https://huggingface.co/soumickmj/StRegA_cceVAE2D_Brain_MOOD_IXIT1_IXIT2_IXIPD. This checkpoint can directly be used (example provided in Pipeline.ipynb notebook) or can be saved as a checkpoint file to make it like a locally-trained model. Here is an example:
from transformers import AutoModel
modelHF = AutoModel.from_pretrained("soumickmj/StRegA_cceVAE2D_Brain_MOOD_IXIT1_IXIT2_IXIPD", trust_remote_code=True)
torch.save(modelHF.model, "/path/to/checkpoint/brain.ptrh")
Please feel free to contact me for any questions or feedback:
If you like this repository, please click on Star!
If you use this approach in your research or use codes from this repository, please cite either or both of the following in your publications:
BibTeX entry:
@article{chatterjee2022strega,
title={StRegA: Unsupervised Anomaly Detection in Brain MRIs using a Compact Context-encoding Variational Autoencoder},
author={Chatterjee, Soumick and Sciarra, Alessandro and D{\"u}nnwald, Max and Tummala, Pavan and Agrawal, Shubham Kumar and Jauhari, Aishwarya and Kalra, Aman and Oeltze-Jafra, Steffen and Speck, Oliver and N{\"u}rnberger, Andreas},
journal={Computers in Biology and Medicine},
pages={106093},
year={2022},
publisher={Elsevier},
doi={10.1016/j.compbiomed.2022.106093}
}
}
The complete manuscript is also on ArXiv:-
The ISMRM-ESMRMB 2022 abstract:-
BibTeX entry:
@inproceedings{mickISMRM22strega,
author = {Chatterjee, Soumick and Sciarra, Alessandro and D{\"u}nnwald, Max and Tummala, Pavan and Agrawal, Shubham Kumar and Jauhari, Aishwarya and Kalra, Aman and Oeltze-Jafra, Steffen and Speck, Oliver and N{\"u}rnberger, Andreas},
year = {2022},
month = {05},
pages = {0172},
title = {StRegA: Unsupervised Anomaly Detection in Brain MRIs using Compact Context-encoding Variational Autoencoder},
booktitle={ISMRM-ESMRMB 2022}
}
Thank you so much for your support.