Giter Site home page Giter Site logo

firstmover / cr-seg Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 74 KB

Source code for "Consistency Regularization Improves Placenta Segmentation in Fetal EPI MRI Time Series" paper.

License: MIT License

Python 100.00%
consistency-regularization mri registration segmentation semi-supervised-learning

cr-seg's Introduction

Consistency Regularization Improves Placenta Segmentation in Fetal EPI MRI Time Series

This repo includes the code for the paper Liu et al. 2023.

Python 3.9 GitHub Repo Stars



Environment and dependency

Create a conda environment with:

conda create --name cr_seg --file requirements.txt

Specify your paths to data, cache, and results directories in:

  1. ./envs/default
  2. ./configs/segm_release/spatial_temporal_cr.py

Results

Pre-process of data

srun --partition=gpu \
--job-name=segm \
--gres=gpu:1 \
--ntasks=1 \
--ntasks-per-node=1 \
--cpus-per-task=16 \
--time=24:00:00 \
python scripts/pre_compute_data.py

Training

pretrain registration models for all cross-validation folds

python ./scripts/submit_job_registraion.py \
--exp-name regi_release \
--config-name voxelmorph \
--job-name=regi \
--num-gpus-per-node=1 \
--cpus-per-task=20 \
--num-nodes=1 \
--array-parallelism=5

Train UNet with spatial and temporal consistency regularization for all cross-validation folds

python ./scripts/submit_job_segmentation.py \
--task-mode train \
--exp-name segm_release \
--config-name spatial_temporal_cr \
--lambda-list '0.001' \
--lambda-t-list '0.001' \
--job-name segm_regi \
--num-gpus-per-node 4 \
--cpus-per-task 8 \
--array-parallelism 5

Inference and evaluation

Run inference for labeled data for all cross-validation folds

python ./scripts/submit_job_segmentation.py \
--task-mode inference_labeled \
--exp-name segm_release \
--config-name spatial_temporal_cr \
--lambda-list '0.001' \
--lambda-t-list '0.001' \
--tta \
--tta-cfg-path ./configs/segm_release/_base_/tta_all_crop.py \
--save-data-name-list 'img,pred_seg_map,gt_seg_map' \
--job-name inference \
--partition gpu \
--num-gpus-per-node 1 \
--cpus-per-task 16 \
--array-parallelism 5

Run inference for time series data (unlabeled and labeled data) for all cross-validation folds

python ./scripts/submit_job_segmentation.py \
--task-mode inference_time_series \
--exp-name segm_release \
--config-name spatial_temporal_cr \
--lambda-list '0.001' \
--lambda-t-list '0.001' \
--tta \
--tta-cfg-path ./configs/segm_release/_base_/tta_all_crop.py \
--save-data-name-list 'pred_seg_map' \
--job-name inference \
--partition gpu \
--num-gpus-per-node 1 \
--cpus-per-task 16 \
--array-parallelism 5

Visualization

Pre-compute and evulate time series data

python scripts/visualization/pre_compute_time_series.py \
--result_root ./results/segm_release \
--job-name eval \
--partition gpu \
--num-gpus-per-node 1 \
--cpus-per-task 24 \
--array-parallelism 8

Visualize labeled results

streamlit run scripts/visualization/labeled.py -- --result_root ./results/segm_release --model_name epoch_100_all

Visualize time series results

streamlit run scripts/visualization/time_series.py -- --result_root ./results/segm_release --model_name epoch_100_all

todos

  • Add commands for non-slurm users
  • Add more details for data set structures
  • Update citation

Acknowledgement

License

This repo is licensed under the MIT License and the copyright belongs to all authors - see the LICENSE file for details.

Citation

@inproceedings{liu2023consistency,
  title={Consistency Regularization Improves Placenta Segmentation in Fetal EPI MRI Time Series},
  author={Liu, Yingcheng and Karani, Neerav and Abulnaga, S Mazdak and Xu, Junshen and Grant, P Ellen and Abaci Turk, Esra and Golland, Polina},
  booktitle={International Workshop on Preterm, Perinatal and Paediatric Image Analysis},
  pages={77--87},
  year={2023},
  organization={Springer}
}

Contact

Email: [email protected]

cr-seg's People

Contributors

firstmover avatar

Watchers

 avatar

Forkers

peterzs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.