{"id":13644939,"url":"https://github.com/MIRACLE-Center/YOLO_Universal_Anatomical_Landmark_Detection","last_synced_at":"2025-04-21T10:35:04.949Z","repository":{"id":40466950,"uuid":"383057794","full_name":"MIRACLE-Center/YOLO_Universal_Anatomical_Landmark_Detection","owner":"MIRACLE-Center","description":"[MICCAI 2021] You Only Learn Once: Universal Anatomical Landmark Detection  https://arxiv.org/abs/2103.04657","archived":false,"fork":false,"pushed_at":"2025-03-03T06:26:07.000Z","size":823,"stargazers_count":82,"open_issues_count":3,"forks_count":22,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-03T07:25:44.053Z","etag":null,"topics":["deep-learning","global-local","landmark-detection","multi-domain-learning","universal-model"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MIRACLE-Center.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-07-05T07:48:46.000Z","updated_at":"2025-03-03T06:26:12.000Z","dependencies_parsed_at":"2024-01-05T07:37:16.818Z","dependency_job_id":"78193d89-d3a8-46d8-8104-7c2dbf271a81","html_url":"https://github.com/MIRACLE-Center/YOLO_Universal_Anatomical_Landmark_Detection","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MIRACLE-Center%2FYOLO_Universal_Anatomical_Landmark_Detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MIRACLE-Center%2FYOLO_Universal_Anatomical_Landmark_Detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MIRACLE-Center%2FYOLO_Universal_Anatomical_Landmark_Detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MIRACLE-Center%2FYOLO_Universal_Anatomical_Landmark_Detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MIRACLE-Center","download_url":"https://codeload.github.com/MIRACLE-Center/YOLO_Universal_Anatomical_Landmark_Detection/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250041044,"owners_count":21365205,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","global-local","landmark-detection","multi-domain-learning","universal-model"],"created_at":"2024-08-02T01:02:20.161Z","updated_at":"2025-04-21T10:34:59.941Z","avatar_url":"https://github.com/MIRACLE-Center.png","language":"Python","funding_links":[],"categories":["Object Detection Applications"],"sub_categories":[],"readme":"# YOLO_Universal_Anatomical_Landmark_Detection [arXiv](https://arxiv.org/pdf/2103.04657)\n\nPyTorch implementation for learning a universal model for anatomical landmark detection on mixed datasets.\n![results](images/results.jpg)\n\n[You Only Learn Once: Universal Anatomical Landmark Detection](https://github.com/ICT-MIRACLE-lab/YOLO_Universal_Anatomical_Landmark_Detection)  \n [Heqin Zhu](https://github.com/mbinary),  [Qingsong Yao](https://github.com/qsyao), [Li Xiao](http://miracle.ict.ac.cn/?page_id=151\u0026lang=zh), [S. Kevin Zhou](http://miracle.ict.ac.cn/?page_id=151\u0026lang=zh)  \nKey Lab of Intelligent Information Processing of Chinese Academy of Sciences (CAS), Institute of Computing Technology, CAS\nIn MICCAI 2021.\n\n## Abstract\nDetecting anatomical landmarks in medical images plays an essential role in understanding the anatomy and planning automated processing. In recent years, a variety of deep neural network methods have been developed to detect landmarks automatically. However, all of those methods are unary in the sense that a highly specialized network is trained for a single task say associated with a particular anatomical region. In this work, for the ﬁrst time, we investigate the idea of “You Only Learn Once (YOLO)” and develop a universal anatomical landmark detection model to realize multiple landmark detection tasks with end-to-end training based on mixed datasets. The model consists of a local network and a global network: The local network is built upon the idea of universal U-Net to learn multi-domain local features and the global network is a parallelly-duplicated sequential of dilated convolutions that extract global features to further disambiguate the landmark locations. It is worth mentioning that the new model design requires much fewer parameters than models with standard convolutions to train. We evaluate our YOLO model on three X-ray datasets of 1,588 images on the head, hand, and chest, collectively contributing 62 landmarks. The experimental results show that our proposed universal model behaves largely better than any previous models trained on multiple datasets. It even beats the performance of the model that is trained separately for every single dataset.\n\n## Prerequisites\n- Linux\n- NVIDIA GPU \n- python3.5+\n\n## Getting Started\n### Installation\n- Install python packages`\n```bash\npip3 install -r requirements.txt\n```\n\n- Clone this repo:\n```bash\ngit clone https://github.com/ICT-MIRACLE-lab/YOLO_Universal_Anatomical_Landmark_Detection\n```\n\n### Preparing Datasets\nDownload the head([link1](https://figshare.com/s/37ec464af8e81ae6ebbf), [link2](https://www.kaggle.com/datasets/c34a0ef0cd3cfd5c5afbdb30f8541e887171f19f196b1ad63790ca5b28c0ec93)), [hand](https://ipilab.usc.edu/research/baaweb), [chest](https://www.kaggle.com/nikhilpandey360/chest-xray-masks-and-labels) datasets.\n\nPrepare datasets in the following directory structure.\n\n* data \n    * ISBI2015\\_ceph       # head\n    \t* 400\\_junior\n    \t* 400\\_senior\n    \t* raw\n    \t\t* \\*.bmp\n    * hand\n    \t* all.csv # [download here](https://github.com/christianpayer/MedicalDataAugmentationTool-HeatmapRegression/blob/master/hand_xray/hand_xray_dataset/setup/all.csv)\n    \t* jpg\n    \t    * \\*.jpg\n    * chest\n    \t* pngs        \n    \t    * CHNCXR_\\*.png\n    \t* labels\n    \t    * CHNCXR\\_\\*.txt   # unzip [chest_labels.zip](data/chest_labels.zip)\n* universal\\_landmark\\_detection  # working directory\n\nNow , `cd uinversal_landmark_detection`.\n\n### Usage\n```bash\nusage: main.py [-h] [-C CONFIG] [-c CHECKPOINT] [-g CUDA_DEVICES] [-m MODEL]\n               [-l LOCALNET] [-n NAME_LIST [NAME_LIST ...]] [-e EPOCHS]\n               [-L LR] [-w WEIGHT_DECAY] [-s SIGMA] [-x MIX_STEP] [-u] -r\n               RUN_NAME -d RUN_DIR -p {train,validate,test}\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -C CONFIG, --config CONFIG\n  -c CHECKPOINT, --checkpoint CHECKPOINT\n                        checkpoint path\n  -g CUDA_DEVICES, --cuda_devices CUDA_DEVICES\n  -m MODEL, --model MODEL\n  -l LOCALNET, --localNet LOCALNET\n  -n NAME_LIST [NAME_LIST ...], --name_list NAME_LIST [NAME_LIST ...]\n  -e EPOCHS, --epochs EPOCHS\n  -L LR, --lr LR\n  -w WEIGHT_DECAY, --weight_decay WEIGHT_DECAY\n  -s SIGMA, --sigma SIGMA\n  -x MIX_STEP, --mix_step MIX_STEP\n  -u, --use_background_channel\n  -r RUN_NAME, --run_name RUN_NAME\n  -d RUN_DIR, --run_dir RUN_DIR\n  -p {train,validate,test}, --phase {train,validate,test}\n```\n\n### Train\n- Train a U-Net model\n```bash\npython3 main.py -d ../runs -r unet2d_runs -p train -m unet2d -e 100\n```\n\n- Train our GU2Net model\n```bash\npython3 main.py -d ../runs -r GU2Net_runs -p train -m gln -l u2net -e 100\n```\n\n- Loading checkpoint\n```bash\npython3 main.py -d ../runs -r GU2Net_runs -p train -m gln -l u2net -e 100 -c CHECKPOINT_PATH\n```\nThis running results are in the following directory structure.\n\n* ../runs \n    * GU2Net\\_runs\n    \t* network_graph.txt\n    \t* config_train.yaml\n    \t* config_origin.yaml\n    \t* learning_rate.png\n    \t* loss.png\n    \t* checkpoints\n    \t\t* best\\_GU2Net\\_runs\\_\\*.pt\n        * results\n        \t* train_epoch\n        \t* test_epoch\n\n### Test\nAfter training, it will automatically run the tests.\n\nYet you could manually run the tests:\n```bash\npython3 main.py -d ../runs -r GU2Net_runs -p test -m gln -l u2net -c CHECKPOINT_PATH\n```\n\n### Evaluation\n```bash\npython3 evaluation.py -i ../runs/GU2Net_runs/results/test_epochxxx\n```\n\n### Example\n1. Download checkpoint: [Google Drive](https://drive.google.com/file/d/1yQLjZTCqn_fWzyPPJSRxFycrnIoe4U3U/view?usp=sharing)|[蓝奏云](https://wwa.lanzoui.com/i90Dct8u0jg)\n2. Unzip it in `YOLO_Universal_Anatomical_Landmark_Detection/universal_landmark_detection`\n3. Run commands:\n```shell\npython3 main.py -d ../runs -r GU2Net -p test -C config.yaml -m gln -l u2net -n chest cephalometric hand -c best.pt\npython3 evaluation.py -i ../runs/GU2Net/results/test_epoch067\n```\n\n## Citation\n```\n@inproceedings{zhu2021you,\n  title={You only Learn Once: Universal Anatomical Landmark Detection},\n  author={Zhu, Heqin and Yao, Qingsong and Xiao, Li and Zhou, S. Kevin},\n  booktitle={International Conference on Medical Image Computing and Computer-Assisted Intervention},\n  pages={85--95},\n  year={2021},\n  organization={Springer}\n}\n@article{zhu2022learning,\n  title={Learning to localize cross-anatomy landmarks in x-ray images with a universal model},\n  author={Zhu, Heqin and Yao, Qingsong and Xiao, Li and Zhou, S Kevin},\n  journal={BME frontiers},\n  year={2022},\n  publisher={AAAS}\n}\n```\n\n## Acknowledgments\nThe yamlConfig.py is modified from [adn](https://github.com/liaohaofu/adn) and unet2d.py is modified from  [PyTorch-UNet](https://github.com/milesial/Pytorch-UNet). \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMIRACLE-Center%2FYOLO_Universal_Anatomical_Landmark_Detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMIRACLE-Center%2FYOLO_Universal_Anatomical_Landmark_Detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMIRACLE-Center%2FYOLO_Universal_Anatomical_Landmark_Detection/lists"}