{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/bidirectional-copy-paste-for-semi-supervised","title":"Bidirectional Copy-Paste for Semi-Supervised Medical Image Segmentation","arxiv_id":"2305.00673","date":"2023-05-01","proceeding":"CVPR 2023 1","authors":["Yunhao Bai","Duowen Chen","Qingli Li","Wei Shen","Yan Wang"],"abstract":"In semi-supervised medical image segmentation, there exist empirical mismatch problems between labeled and unlabeled data distribution. The knowledge learned from the labeled data may be largely discarded if treating labeled and unlabeled data separately or in an inconsistent manner. We propose a straightforward method for alleviating the problem - copy-pasting labeled and unlabeled data bidirectionally, in a simple Mean Teacher architecture. The method encourages unlabeled data to learn comprehensive common semantics from the labeled data in both inward and outward directions. More importantly, the consistent learning procedure for labeled and unlabeled data can largely reduce the empirical distribution gap. In detail, we copy-paste a random crop from a labeled image (foreground) onto an unlabeled image (background) and an unlabeled image (foreground) onto a labeled image (background), respectively. The two mixed images are fed into a Student network and supervised by the mixed supervisory signals of pseudo-labels and ground-truth. We reveal that the simple mechanism of copy-pasting bidirectionally between labeled and unlabeled data is good enough and the experiments show solid gains (e.g., over 21% Dice improvement on ACDC dataset with 5% labeled data) compared with other state-of-the-arts on various semi-supervised medical image segmentation datasets. Code is available at https://github.com/DeepMed-Lab-ECNU/BCP}.","url_abs":"https://arxiv.org/abs/2305.00673v1","url_pdf":"https://arxiv.org/pdf/2305.00673v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"bidirectional-copy-paste-for-semi-supervised","repo_url":"https://github.com/HiLab-git/SSL4MIS","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"bidirectional-copy-paste-for-semi-supervised","repo_url":"https://github.com/deepmed-lab-ecnu/bcp","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"image-segmentation","task_name":"Image Segmentation"},{"task_slug":"medical-image-segmentation","task_name":"Medical Image Segmentation"},{"task_slug":"semantic-segmentation","task_name":"Semantic Segmentation"},{"task_slug":"semi-supervised-semantic-segmentation","task_name":"Semi-Supervised Semantic Segmentation"},{"task_slug":"semi-supervised-medical-image-segmentation","task_name":"Semi-supervised Medical Image Segmentation"}],"methods":[{"method_slug":"copy-paste","method_name":"Copy-Paste"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/semi-supervised-medical-image-segmentation-on-3","task":"Semi-supervised Medical Image Segmentation","dataset":"ACDC 10% labeled data","model":"BCP","rank_in_archive_order":5,"of":5,"metrics":{"Dice (Average)":"88.84"},"uses_additional_data":false},{"leaderboard":"/sota/semi-supervised-medical-image-segmentation-on-2","task":"Semi-supervised Medical Image Segmentation","dataset":"ACDC 20% labeled data","model":"BCP","rank_in_archive_order":4,"of":4,"metrics":{"Dice (Average)":"89.52"},"uses_additional_data":false},{"leaderboard":"/sota/semi-supervised-medical-image-segmentation-on-4","task":"Semi-supervised Medical Image Segmentation","dataset":"ACDC 5% labeled data","model":"BCP","rank_in_archive_order":4,"of":4,"metrics":{"Dice (Average)":"87.59"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2305.00673","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2305.00673"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/deepmed-lab-ecnu/bcp","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/HiLab-git/SSL4MIS","reach":null},{"provenance":"deterministic:regex_extraction","url":"https://github.com/DeepMed-Lab-ECNU/BCP","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":2,"ran_honours":2,"ran_draft_wrong":1,"ran_fixture":1,"unverified":13},"by_repo_kind":{"official":{"samples":19,"ran":6,"repositories":2}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"6684d7714ad58e8b","entry":"WeakStrongAugment","repo":"HiLab-git/SSL4MIS","repo_kind":"official","path":"code/dataloaders/dataset.py","file_url":"https://github.com/HiLab-git/SSL4MIS/blob/HEAD/code/dataloaders/dataset.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6684d7714ad58e8b"}},{"code_sha256_prefix":"d54bd9f61fb16ee3","entry":"color_jitter","repo":"HiLab-git/SSL4MIS","repo_kind":"official","path":"code/dataloaders/dataset.py","file_url":"https://github.com/HiLab-git/SSL4MIS/blob/HEAD/code/dataloaders/dataset.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d54bd9f61fb16ee3"}},{"code_sha256_prefix":"49da02d1d655ed9e","entry":"get_probability","repo":"DeepMed-Lab-ECNU/BCP","repo_kind":"official","path":"code/utils/BCP_utils.py","file_url":"https://github.com/DeepMed-Lab-ECNU/BCP/blob/HEAD/code/utils/BCP_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"49da02d1d655ed9e"}},{"code_sha256_prefix":"11437f8ee9b097b7","entry":"mask_DiceLoss","repo":"DeepMed-Lab-ECNU/BCP","repo_kind":"official","path":"code/utils/BCP_utils.py","file_url":"https://github.com/DeepMed-Lab-ECNU/BCP/blob/HEAD/code/utils/BCP_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"11437f8ee9b097b7"}},{"code_sha256_prefix":"b747cc536cbf2109","entry":"random_rot_flip","repo":"HiLab-git/SSL4MIS","repo_kind":"official","path":"code/dataloaders/dataset.py","file_url":"https://github.com/HiLab-git/SSL4MIS/blob/HEAD/code/dataloaders/dataset.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b747cc536cbf2109"}},{"code_sha256_prefix":"ae8cca7f206aff6e","entry":"to_one_hot","repo":"DeepMed-Lab-ECNU/BCP","repo_kind":"official","path":"code/utils/BCP_utils.py","file_url":"https://github.com/DeepMed-Lab-ECNU/BCP/blob/HEAD/code/utils/BCP_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ae8cca7f206aff6e"}},{"code_sha256_prefix":"50a034d1b41e897e","entry":"LargestCC_pancreas","repo":"deepmed-lab-ecnu/bcp","repo_kind":"official","path":"code/LA_BCP_train.py","file_url":"https://github.com/deepmed-lab-ecnu/bcp/blob/HEAD/code/LA_BCP_train.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"50a034d1b41e897e"}},{"code_sha256_prefix":"f1f6cbaf5ba771ec","entry":"concate_mask","repo":"deepmed-lab-ecnu/bcp","repo_kind":"official","path":"code/utils/BCP_utils.py","file_url":"https://github.com/deepmed-lab-ecnu/bcp/blob/HEAD/code/utils/BCP_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f1f6cbaf5ba771ec"}},{"code_sha256_prefix":"c5f63f170e272caa","entry":"context_mask","repo":"deepmed-lab-ecnu/bcp","repo_kind":"official","path":"code/utils/BCP_utils.py","file_url":"https://github.com/deepmed-lab-ecnu/bcp/blob/HEAD/code/utils/BCP_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c5f63f170e272caa"}},{"code_sha256_prefix":"451e37bdd602a2e2","entry":"get_ACDC_2DLargestCC","repo":"deepmed-lab-ecnu/bcp","repo_kind":"official","path":"code/ACDC_BCP_train.py","file_url":"https://github.com/deepmed-lab-ecnu/bcp/blob/HEAD/code/ACDC_BCP_train.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"451e37bdd602a2e2"}},{"code_sha256_prefix":"3acc895b1dba4189","entry":"get_ACDC_LargestCC","repo":"deepmed-lab-ecnu/bcp","repo_kind":"official","path":"code/ACDC_BCP_train.py","file_url":"https://github.com/deepmed-lab-ecnu/bcp/blob/HEAD/code/ACDC_BCP_train.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3acc895b1dba4189"}},{"code_sha256_prefix":"6bd5afe45408a227","entry":"get_ACDC_masks","repo":"deepmed-lab-ecnu/bcp","repo_kind":"official","path":"code/ACDC_BCP_train.py","file_url":"https://github.com/deepmed-lab-ecnu/bcp/blob/HEAD/code/ACDC_BCP_train.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6bd5afe45408a227"}},{"code_sha256_prefix":"1279c0b7c31f46f0","entry":"get_ACDC_masks","repo":"deepmed-lab-ecnu/bcp","repo_kind":"official","path":"code/KDE_demo.py","file_url":"https://github.com/deepmed-lab-ecnu/bcp/blob/HEAD/code/KDE_demo.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1279c0b7c31f46f0"}},{"code_sha256_prefix":"b36289c49f14d7c5","entry":"get_cut_mask","repo":"deepmed-lab-ecnu/bcp","repo_kind":"official","path":"code/LA_BCP_train.py","file_url":"https://github.com/deepmed-lab-ecnu/bcp/blob/HEAD/code/LA_BCP_train.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b36289c49f14d7c5"}},{"code_sha256_prefix":"d07df0bf1e2ed610","entry":"get_probability","repo":"deepmed-lab-ecnu/bcp","repo_kind":"official","path":"code/pancreas/losses.py","file_url":"https://github.com/deepmed-lab-ecnu/bcp/blob/HEAD/code/pancreas/losses.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d07df0bf1e2ed610"}},{"code_sha256_prefix":"ed4f9ecd63e9fe9f","entry":"mix_loss","repo":"DeepMed-Lab-ECNU/BCP","repo_kind":"official","path":"code/utils/BCP_utils.py","file_url":"https://github.com/DeepMed-Lab-ECNU/BCP/blob/HEAD/code/utils/BCP_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ed4f9ecd63e9fe9f"}},{"code_sha256_prefix":"b4b3d82f0caa5a95","entry":"patients_to_slices","repo":"deepmed-lab-ecnu/bcp","repo_kind":"official","path":"code/KDE_demo.py","file_url":"https://github.com/deepmed-lab-ecnu/bcp/blob/HEAD/code/KDE_demo.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b4b3d82f0caa5a95"}},{"code_sha256_prefix":"ce1c2f509485040b","entry":"random_mask","repo":"deepmed-lab-ecnu/bcp","repo_kind":"official","path":"code/utils/BCP_utils.py","file_url":"https://github.com/deepmed-lab-ecnu/bcp/blob/HEAD/code/utils/BCP_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ce1c2f509485040b"}},{"code_sha256_prefix":"6768062cc3a09e6f","entry":"softmax_mse_loss","repo":"deepmed-lab-ecnu/bcp","repo_kind":"official","path":"code/pancreas/losses.py","file_url":"https://github.com/deepmed-lab-ecnu/bcp/blob/HEAD/code/pancreas/losses.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6768062cc3a09e6f"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}