|
| 1 | + |
| 2 | + |
| 3 | +# CAM: Learning Cortical Anomaly through Masked Encoding for Unsupervised Heterogeneity Mapping |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | +[Update 2024/05/29] Training / Inference code will be available soon. |
| 13 | + |
| 14 | + |
| 15 | +Official PyTorch Implementation for the [Learning Cortical Anomaly through Masked Encoding for Unsupervised Heterogeneity Mapping](https://arxiv.org/abs/2312.02762). |
| 16 | + |
1 | 17 | # CAM
|
2 |
| -Learning Cortical Anomaly through Masked Encoding for Unsupervised Heterogeneity Mapping. |
| 18 | +A new **Self-Supervised** framework designed for **Unsupervised Anomaly Detection** of brain disorders using **3D cortical surface features**. |
| 19 | + |
| 20 | +# Getting Started |
| 21 | + |
| 22 | +## Setup |
| 23 | +1. Clone the repo: |
| 24 | +```bash |
| 25 | +git clone [email protected]:chadHGY/CAM.git |
| 26 | +cd CAM |
| 27 | +``` |
| 28 | + |
| 29 | +2. Install the required packages: |
| 30 | +```bash |
| 31 | +conda create -n cam python=3.10 |
| 32 | +conda activate cam |
| 33 | +pip install -r requirements.txt |
| 34 | +``` |
| 35 | + |
| 36 | +3. Data Preprocessing: |
| 37 | +Please make sure you have gone through [FreeSurfer's](https://surfer.nmr.mgh.harvard.edu/fswiki/recon-all) `recon-all pipeline` to extract the cortical surface features. The surface features should be found under each subject's `surf` directory. |
| 38 | + |
| 39 | + |
| 40 | +4. Data Postprocessing: |
| 41 | +Here we provide a simple script to convert the surface features to a numpy array. |
| 42 | +```bash |
| 43 | +python data_postprocessing.py --data_dir /path/to/your/freesurfer/output --output_dir /path/to/your/postprocessed/data |
| 44 | +``` |
| 45 | + |
| 46 | + |
| 47 | +# Data |
| 48 | +To easily demonstrate the usage of CAM, we provide a toy dataset in the `data` directory. The toy dataset contains 10 subjects, each with 3 cortical surface features extracted by FreeSurfer (Thickness, Sulc, Curvature). |
| 49 | + |
| 50 | + |
| 51 | +# Training |
| 52 | +```bash |
| 53 | +python src/train.py --data_dir /path/to/your/postprocessed/data --output_dir /path/to/your/output |
| 54 | +``` |
| 55 | + |
| 56 | +# Inference |
| 57 | +```bash |
| 58 | +python src/inference.py --data_dir /path/to/your/postprocessed/data --output_dir /path/to/your/output |
| 59 | +``` |
| 60 | + |
| 61 | + |
| 62 | +# Citation |
| 63 | +If you find this repository useful for your research, please use the following. |
| 64 | +``` |
| 65 | +@article{yang2023learning, |
| 66 | + title={Learning Cortical Anomaly through Masked Encoding for Unsupervised Heterogeneity Mapping}, |
| 67 | + author={Yang, Hao-Chun and Andreassen, Ole and Westlye, Lars Tjelta and Marquand, Andre F and Beckmann, Christian F and Wolfers, Thomas}, |
| 68 | + journal={arXiv preprint arXiv:2312.02762}, |
| 69 | + year={2023} |
| 70 | +} |
| 71 | +``` |
| 72 | + |
3 | 73 |
|
4 |
| -Training / Inference code will be available soon. |
| 74 | +# Acknowledgments/References |
| 75 | +1. IXI data: https://brain-development.org/ixi-dataset/ |
| 76 | +3. We would like to thank all participants in this study, making the work possible. This work was supported the German Research Foundation (DFG) Emmy Noether with reference 513851350 (TW), the Cluster of Excellence with reference 390727645 (TW) and the BMBF-funded de.NBI Cloud within the German Network for Bioinformatics Infrastructure (de.NBI) (031A532B, 031A533A, 031A533B, 031A534A, 031A535A, 031A537A, 031A537B, 031A537C, 031A537D, 031A538A). |
0 commit comments