{"id":13546324,"url":"https://github.com/LiheYoung/UniMatch","last_synced_at":"2025-04-02T18:30:45.723Z","repository":{"id":62092573,"uuid":"527776626","full_name":"LiheYoung/UniMatch","owner":"LiheYoung","description":"[CVPR 2023] Revisiting Weak-to-Strong Consistency in Semi-Supervised Semantic Segmentation","archived":false,"fork":false,"pushed_at":"2024-10-15T02:44:36.000Z","size":6242,"stargazers_count":470,"open_issues_count":4,"forks_count":58,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-03T14:35:39.631Z","etag":null,"topics":["fixmatch","semi-supervised-learning","semi-supervised-segmentation"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/2208.09910","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/LiheYoung.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-23T00:30:34.000Z","updated_at":"2024-11-02T07:08:29.000Z","dependencies_parsed_at":"2024-01-14T02:39:15.135Z","dependency_job_id":"a5feb220-e62a-4ec6-b81f-01b0d270c1ca","html_url":"https://github.com/LiheYoung/UniMatch","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/LiheYoung%2FUniMatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiheYoung%2FUniMatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiheYoung%2FUniMatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiheYoung%2FUniMatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LiheYoung","download_url":"https://codeload.github.com/LiheYoung/UniMatch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246869634,"owners_count":20847166,"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":["fixmatch","semi-supervised-learning","semi-supervised-segmentation"],"created_at":"2024-08-01T12:00:35.533Z","updated_at":"2025-04-02T18:30:40.711Z","avatar_url":"https://github.com/LiheYoung.png","language":"Python","funding_links":[],"categories":["Papers (with code)","2023"],"sub_categories":[],"readme":"# UniMatch\n\n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/revisiting-weak-to-strong-consistency-in-semi/semi-supervised-semantic-segmentation-on-21)](https://paperswithcode.com/sota/semi-supervised-semantic-segmentation-on-21?p=revisiting-weak-to-strong-consistency-in-semi)\n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/revisiting-weak-to-strong-consistency-in-semi/semi-supervised-semantic-segmentation-on-4)](https://paperswithcode.com/sota/semi-supervised-semantic-segmentation-on-4?p=revisiting-weak-to-strong-consistency-in-semi)\n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/revisiting-weak-to-strong-consistency-in-semi/semi-supervised-semantic-segmentation-on-27)](https://paperswithcode.com/sota/semi-supervised-semantic-segmentation-on-27?p=revisiting-weak-to-strong-consistency-in-semi)\n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/revisiting-weak-to-strong-consistency-in-semi/semi-supervised-semantic-segmentation-on-29)](https://paperswithcode.com/sota/semi-supervised-semantic-segmentation-on-29?p=revisiting-weak-to-strong-consistency-in-semi)\n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/revisiting-weak-to-strong-consistency-in-semi/semi-supervised-semantic-segmentation-on-10)](https://paperswithcode.com/sota/semi-supervised-semantic-segmentation-on-10?p=revisiting-weak-to-strong-consistency-in-semi)\n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/revisiting-weak-to-strong-consistency-in-semi/semi-supervised-semantic-segmentation-on-22)](https://paperswithcode.com/sota/semi-supervised-semantic-segmentation-on-22?p=revisiting-weak-to-strong-consistency-in-semi)\n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/revisiting-weak-to-strong-consistency-in-semi/semi-supervised-semantic-segmentation-on-2)](https://paperswithcode.com/sota/semi-supervised-semantic-segmentation-on-2?p=revisiting-weak-to-strong-consistency-in-semi)\n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/revisiting-weak-to-strong-consistency-in-semi/semi-supervised-semantic-segmentation-on-1)](https://paperswithcode.com/sota/semi-supervised-semantic-segmentation-on-1?p=revisiting-weak-to-strong-consistency-in-semi)\n\n[**News: Check our latest UniMatch V2 framework!**](https://github.com/LiheYoung/UniMatch-V2)\n\nThis codebase contains a strong re-implementation of FixMatch in the field of semi-supervised semantic segmentation, as well as the official PyTorch implementation of our UniMatch in the **[natural](https://github.com/LiheYoung/UniMatch), [remote sensing](https://github.com/LiheYoung/UniMatch/tree/main/more-scenarios/remote-sensing), and [medical](https://github.com/LiheYoung/UniMatch/tree/main/more-scenarios/medical) scenarios**.\n\n\u003e **[Revisiting Weak-to-Strong Consistency in Semi-Supervised Semantic Segmentation](https://arxiv.org/abs/2208.09910)**\u003c/br\u003e\n\u003e Lihe Yang, Lei Qi, Litong Feng, Wayne Zhang, Yinghuan Shi\u003c/br\u003e\n\u003e *In Conference on Computer Vision and Pattern Recognition (CVPR), 2023*\n\n\n**We provide a list of [Awesome Semi-Supervised Semantic Segmentation](./docs/SemiSeg.md) works.**\n\n\u003cp align=\"left\"\u003e\n\u003cimg src=\"./docs/framework.png\" width=90% height=90% \nclass=\"center\"\u003e\n\u003c/p\u003e\n\n## Results\n\n**You can check our [training logs](https://github.com/LiheYoung/UniMatch/blob/main/training-logs) for convenient comparisons during reproducing.**\n\n**Note: we have added and updated some results in our camera-ready version. Please refer to our [latest version](https://arxiv.org/abs/2208.09910)**.\n\n### Pascal VOC 2012\n\nLabeled images are sampled from the **original high-quality** training set. Results are obtained by DeepLabv3+ based on ResNet-101 with training size 321.\n\n| Method                      | 1/16 (92) | 1/8 (183) | 1/4 (366) | 1/2 (732) | Full (1464) |\n| :-------------------------: | :-------: | :-------: | :-------: | :-------: | :---------: |\n| SupBaseline                 | 45.1      | 55.3      | 64.8      | 69.7      | 73.5        |\n| U\u003csup\u003e2\u003c/sup\u003ePL             | 68.0      | 69.2      | 73.7      | 76.2      | 79.5        |\n| ST++                        | 65.2      | 71.0      | 74.6      | 77.3      | 79.1        |\n| PS-MT                       | 65.8      | 69.6      | 76.6      | 78.4      | 80.0        |\n| **UniMatch (Ours)**         | **75.2**  | **77.2**  | **78.8**  | **79.9**  | **81.2**    |\n\n\n### Cityscapes\n\nResults are obtained by DeepLabv3+ based on ResNet-50/101. We reproduce U\u003csup\u003e2\u003c/sup\u003ePL results on ResNet-50.\n\n**Note: the results differ from our arXiv-V1 because we change the confidence threshold from 0.95 to 0, and change the ResNet output stride from 8 to 16. Therefore, it is currently more efficient to run.**\n\n*You can click on the numbers to be directed to corresponding checkpoints.*\n\n| ResNet-50                   | 1/16      | 1/8       | 1/4       | 1/2       | ResNet-101           | 1/16        | 1/8         | 1/4         | 1/2         |\n| :-------------------------: | :-------: | :-------: | :-------: | :-------: | :------------------: | :---------: | :---------: | :---------: | :---------: |\n| SupBaseline                 | 63.3      | 70.2      | 73.1      | 76.6      | SupBaseline          | 66.3        | 72.8        | 75.0        | 78.0        |\n| U\u003csup\u003e2\u003c/sup\u003ePL             | 70.6      | 73.0      | 76.3      | 77.2      | U\u003csup\u003e2\u003c/sup\u003ePL      | 74.9        | 76.5        | 78.5        | 79.1        |\n| **UniMatch (Ours)**         | [**75.0**](https://drive.google.com/file/d/1J-GjeZRhIhnbxtD8f_lDflXB24S1E995/view?usp=sharing)  | [**76.8**](https://drive.google.com/file/d/1pA-enIDGWSVyhJg7SFIjFQ-nlxetj6-m/view?usp=sharing)  | [**77.5**](https://drive.google.com/file/d/1EEh8XMljUf40wzMblnv9Ez9_dfXYqO7P/view?usp=sharing)  | [**78.6**](https://drive.google.com/file/d/18Bd43RsXhTw9RL3F9Vn9lz_Gs5KQWaTE/view?usp=sharing)  | **UniMatch (Ours)**  | [**76.6**](https://drive.google.com/file/d/1qmCBLC9aj57kz1_OptvK6YTo4GwxTsiK/view?usp=sharing)    | [**77.9**](https://drive.google.com/file/d/14LrPkWC8QIMO44da5pGflyOrW_Fdxo0U/view?usp=sharing)    | [**79.2**](https://drive.google.com/file/d/1cL-p2_FIwEe9Y4AapSjlLmt4hdAZzX7a/view?usp=sharing)    | [**79.5**](https://drive.google.com/file/d/1ve2BAYoh8wzQxhKD-CE7bsjcR5KqQEa3/view?usp=sharing)    |\n\n\n### COCO\n\nResults are obtained by DeepLabv3+ based on Xception-65.\n\n*You can click on the numbers to be directed to corresponding checkpoints.*\n\n| Method                      | 1/512 (232) | 1/256 (463) | 1/128 (925) | 1/64 (1849) | 1/32 (3697) |\n| :-------------------------: | :---------: | :---------: | :---------: | :---------: | :---------: |\n| SupBaseline                 | 22.9        | 28.0        | 33.6        | 37.8        | 42.2        |\n| PseudoSeg                   | 29.8        | 37.1        | 39.1        | 41.8        | 43.6        |\n| PC\u003csup\u003e2\u003c/sup\u003eSeg           | 29.9        | 37.5        | 40.1        | 43.7        | 46.1        |\n| **UniMatch (Ours)**         | [**31.9**](https://drive.google.com/file/d/1kFgg0SGLzS7SJI8sYPQKGLnw8G060kjz/view?usp=sharing)    | [**38.9**](https://drive.google.com/file/d/1scx1FanOcmaut8eVESLaSx7-DiT5JJA6/view?usp=sharing)    | [**44.4**](https://drive.google.com/file/d/1oojVn12tgPW_m94tAOU5YYVZ7xJJitCj/view?usp=sharing)    | [**48.2**](https://drive.google.com/file/d/1tI1AZ8rY6hYQrs216iz2NmlAfLl8f1uP/view?usp=sharing)    | [**49.8**](https://drive.google.com/file/d/1hwRr0IIhdeKH2JYO--iOLl5y69sJ0UYm/view?usp=sharing)    |\n\n\n### More Scenarios\n\nWe also apply our UniMatch in the scenarios of semi-supervised **remote sensing change detection** and **medical image segmentation**, achieving tremendous improvements over previous methods:\n\n- [Remote Sensing Change Detection](https://github.com/LiheYoung/UniMatch/blob/main/more-scenarios/remote-sensing) [[training logs]](https://github.com/LiheYoung/UniMatch/blob/main/more-scenarios/remote-sensing/training-logs)\n- [Medical Image Segmentation](https://github.com/LiheYoung/UniMatch/blob/main/more-scenarios/medical) [[training logs]](https://github.com/LiheYoung/UniMatch/blob/main/more-scenarios/medical/training-logs)\n\n## Getting Started\n\n### Installation\n\n```bash\ncd UniMatch\nconda create -n unimatch python=3.10.4\nconda activate unimatch\npip install -r requirements.txt\npip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 -f https://download.pytorch.org/whl/torch_stable.html\n```\n\n### Pretrained Backbone\n\n[ResNet-50](https://drive.google.com/file/d/1mqUrqFvTQ0k5QEotk4oiOFyP6B9dVZXS/view?usp=sharing) | [ResNet-101](https://drive.google.com/file/d/1Rx0legsMolCWENpfvE2jUScT3ogalMO8/view?usp=sharing) | [Xception-65](https://drive.google.com/open?id=1_j_mE07tiV24xXOJw4XDze0-a0NAhNVi)\n\n```\n├── ./pretrained\n    ├── resnet50.pth\n    ├── resnet101.pth\n    └── xception.pth\n```\n\n### Dataset\n\n- Pascal: [JPEGImages](http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCtrainval_11-May-2012.tar) | [SegmentationClass](https://drive.google.com/file/d/1ikrDlsai5QSf2GiSUR3f8PZUzyTubcuF/view?usp=sharing)\n- Cityscapes: [leftImg8bit](https://www.cityscapes-dataset.com/file-handling/?packageID=3) | [gtFine](https://drive.google.com/file/d/1E_27g9tuHm6baBqcA7jct_jqcGA89QPm/view?usp=sharing)\n- COCO: [train2017](http://images.cocodataset.org/zips/train2017.zip) | [val2017](http://images.cocodataset.org/zips/val2017.zip) | [masks](https://drive.google.com/file/d/166xLerzEEIbU7Mt1UGut-3-VN41FMUb1/view?usp=sharing)\n\nPlease modify your dataset path in configuration files.\n\n**The groundtruth masks have already been pre-processed by us. You can use them directly.**\n\n```\n├── [Your Pascal Path]\n    ├── JPEGImages\n    └── SegmentationClass\n    \n├── [Your Cityscapes Path]\n    ├── leftImg8bit\n    └── gtFine\n    \n├── [Your COCO Path]\n    ├── train2017\n    ├── val2017\n    └── masks\n```\n\n## Usage\n\n### UniMatch\n\n```bash\n# use torch.distributed.launch\nsh scripts/train.sh \u003cnum_gpu\u003e \u003cport\u003e\n# to fully reproduce our results, the \u003cnum_gpu\u003e should be set as 4 on all three datasets\n# otherwise, you need to adjust the learning rate accordingly\n\n# or use slurm\n# sh scripts/slurm_train.sh \u003cnum_gpu\u003e \u003cport\u003e \u003cpartition\u003e\n```\n\nTo train on other datasets or splits, please modify\n``dataset`` and ``split`` in [train.sh](https://github.com/LiheYoung/UniMatch/blob/main/scripts/train.sh).\n\n### FixMatch\n\nModify the ``method`` from ``'unimatch'`` to ``'fixmatch'`` in [train.sh](https://github.com/LiheYoung/UniMatch/blob/main/scripts/train.sh).\n\n### Supervised Baseline\n\nModify the ``method`` from ``'unimatch'`` to ``'supervised'`` in [train.sh](https://github.com/LiheYoung/UniMatch/blob/main/scripts/train.sh), and double the ``batch_size`` in configuration file if you use the same number of GPUs as semi-supervised setting (no need to change ``lr``). \n\n\n## Citation\n\nIf you find this project useful, please consider citing:\n\n```bibtex\n@inproceedings{unimatch,\n  title={Revisiting Weak-to-Strong Consistency in Semi-Supervised Semantic Segmentation},\n  author={Yang, Lihe and Qi, Lei and Feng, Litong and Zhang, Wayne and Shi, Yinghuan},\n  booktitle={CVPR},\n  year={2023}\n}\n```\n\nWe have some other works on semi-supervised semantic segmentation:\n\n- [[CVPR 2022] ST++](https://github.com/LiheYoung/ST-PlusPlus) \n- [[CVPR 2023] AugSeg](https://github.com/ZhenZHAO/AugSeg)\n- [[CVPR 2023] iMAS](https://github.com/ZhenZHAO/iMAS)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLiheYoung%2FUniMatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLiheYoung%2FUniMatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLiheYoung%2FUniMatch/lists"}