CoolFace
Modelpublic

MONAI/pediatric_abdominal_ct_segmentation

sourceHugging Faceupdated 1y agoView on Hugging Face
2likes
README.md165 linesDownload Raw Back to docs
1# Model Overview2A Pediatric 3D Abdominal Organ Segmentation model, pretrained on adult and pediatric public datasets, and fine tuned for institutional pediatric data.3 4Please cite this manuscript:5Somasundaram E, Taylor Z, Alves VV, et al. Deep-Learning Models for Abdominal CT Organ Segmentation in Children: Development and Validation in Internal and Heterogeneous Public Datasets. AJR 2024 May 1 [published online]. Accepted manuscript. doi:10.2214/AJR.24.309316 7## Data8Modality:9- CT10 11Organs Segmented:12- Liver13- Spleen14- Pancreas15 16Pre-training data:17- Total Segmentator (815)18- BTCV (30)19- TCIA Pediatric (282)20 21Fine-tuning data:22- Cincinnati Children's Liver Spleen CT dataset (275)23- Cincinnati Children's Pancreas CT dataset (146)24 25Testing data:26- Cincinnati Children's Liver-Spleen (57)27- Cincinnati Children's Pancreas (35)28- TCIA-Pediatric (74)29- Total Segmentator (50)30 31External dataset licenses can be found in accompanying text file. Internal datasets currently not publicly available.32 33To load data for training / inference / evaluate:34 35Ensure that the "image" and "label" parameters within the "training" and "validation" sections in configs/TS_test.json (or a new dataset json), as well as the "datalist" and "dataset_dir" in configs/train.yaml, configs/inference.yaml, and configs/evaluate-standalone.yaml files (or the according yaml if using multigpu / parallel or different model inferencing) are each changed to match the intended dataset's values.36 37One may make separate .json files detailing which exam images / masks are to be used in the same format as configs/TS_test.json with "training" and "validation" under root, as long as the "datalist_file_path" and "dataset_dir" values is changed accordingly in configs/train.yaml and configs/inference.yaml, and configs/evaluate-standalone.yaml (or the according yaml in different circumstances).38 39Ensure data folder structure is as follows, with scan files in the primary dataset folder, and mask files in the /labels/final subfolder:40    dataset/41    ├─ exam_001.nii.gz42    ├─ exam_002.nii.gz43    ├─ ...44    ├─ labels/45    │  ├─ final/46    │  │  ├─ exam_001.nii.gz47    │  │  ├─ exam_002.nii.gz48    │  │  ├─ ...49 50Configuration defaults are currently set to the external TotalSegmentator CT dataset.51 52### Model Architectures53- DynUNet54- SegResNet55- SwinUNETR56 57### Hyper-Parameter Tuning58Weights and Biases was used to extensively tune each model for learning rate, scheduler and optimizer. For fine-tuning the fraction of trainable layers was also optimized. DynUNet performed overall better on all test datasets. The Total Segmentator model was also compared and the DynUNet model significantly outperformed Total Segmentator on institutional test data while maintaining relatively stable performance on adult and TCIA datasets.59 60### Input61One channel CT image62 63### Output64Four channel CT label65- Label 3: pancreas66- Label 2: spleen67- Label 1: liver68- Label 0: background69- 96x96x9670 71## Performance72 - MedArxiv to be linked73 74 75## MONAI Bundle Commands76In addition to the Pythonic APIs, a few command line interfaces (CLI) are provided to interact with the bundle. The CLI supports flexible use cases, such as overriding configs at runtime and predefining arguments in a file.77 78For more details usage instructions, visit the [MONAI Bundle Configuration Page](https://docs.monai.io/en/latest/config_syntax.html).79 80 81#### Execute training:82Dataset used defaults to TotalSegmentator (https://zenodo.org/records/6802614#.ZFPll4TMKUk)83```84python -m monai.bundle run --config_file configs/train.yaml85```86 87Please note that if the default dataset path is not modified with the actual path in the bundle config files, you can also override it by using `--dataset_dir`:88 89```90python -m monai.bundle run --config_file configs/train.yaml --dataset_dir <actual dataset path>91```92 93#### `train` config to execute multi-GPU training:94 95```96torchrun --nnodes=1 --nproc_per_node=8 -m monai.bundle run --config_file configs/train-multigpu.yaml97```98 99#### Override the `train` config to execute evaluation with the trained model:100 101```102python -m monai.bundle run --config_file "['configs/train.yaml','configs/evaluate.yaml']"103```104 105#### Execute inference:106 107```108python -m monai.bundle run --config_file configs/inference.yaml109```110 111#### Execute standalone `evaluate`:112```113python -m monai.bundle run --config_file configs/evaluate.yaml114```115 116 117#### Execute standalone `evaluate` in parallel:118```119torchrun --nnodes=1 --nproc_per_node=8 -m monai.bundle run --config_file configs/evaluate-standalone.yaml120```121 122 123#### Export checkpoint for TorchScript:124 125```126python -m monai.bundle ckpt_export network_def --filepath models/dynunet_FT.ts --ckpt_file models/dynunet_FT.pt --meta_file configs/metadata.json --config_file configs/inference.yaml127```128 129#### Export checkpoint to TensorRT based models with fp32 or fp16 precision:130 131```132python -m monai.bundle trt_export --net_id network_def --filepath models/A100/dynunet_FT_trt_16.ts --ckpt_file models/dynunet_FT.pt --meta_file configs/metadata.json --config_file configs/inference.yaml  --precision <fp32/fp16> --use_trace "True" --dynamic_batchsize "[1, 4, 8]" --converter_kwargs "{'truncate_long_and_double':True, 'torch_executed_ops': ['aten::upsample_trilinear3d']}"133```134 135#### Execute inference with the TensorRT model:136 137```138python -m monai.bundle run --config_file "['configs/inference.yaml', 'configs/inference_trt.yaml']"139```140 141# References142 143[1] Somasundaram E, Taylor Z, Alves VV, et al. Deep-Learning Models for Abdominal CT Organ Segmentation in Children: Development and Validation in Internal and Heterogeneous Public Datasets. AJR 2024 May 1 [published online]. Accepted manuscript. doi:10.2214/AJR.24.30931144 145[2] Wasserthal, J., Breit, H.-C., Meyer, M. T., Pradella, M., Hinck, D., Sauter, A. W., Heye, T., Boll, D., Cyriac, J., Yang, S., Bach, M., & Segeroth, M. (2023, June 16). TotalSegmentator: Robust segmentation of 104 anatomical structures in CT images. arXiv.org. https://arxiv.org/abs/2208.05868 . https://doi.org/10.1148/ryai.230024146 147[3] Jordan, P., Adamson, P. M., Bhattbhatt, V., Beriwal, S., Shen, S., Radermecker, O., Bose, S., Strain, L. S., Offe, M., Fraley, D., Principi, S., Ye, D. H., Wang, A. S., Van Heteren, J., Vo, N.-J., & Schmidt, T. G. (2021). Pediatric Chest/Abdomen/Pelvic CT Exams with Expert Organ Contours (Pediatric-CT-SEG) (Version 2) [Data set]. The Cancer Imaging Archive. https://doi.org/10.7937/TCIA.X0H0-1706148 149[4] https://www.synapse.org/#!Synapse:syn3193805/wiki/89480150 151# License152Copyright (c) MONAI Consortium153 154Licensed under the Apache License, Version 2.0 (the "License");155you may not use this file except in compliance with the License.156You may obtain a copy of the License at157 158    http://www.apache.org/licenses/LICENSE-2.0159 160Unless required by applicable law or agreed to in writing, software161distributed under the License is distributed on an "AS IS" BASIS,162WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.163See the License for the specific language governing permissions and164limitations under the License.165