{"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/car-class-aware-regularizations-for-semantic-1","title":"CAR: Class-aware Regularizations for Semantic Segmentation","arxiv_id":"2203.07160","date":"2022-03-14","proceeding":"arXiv:2203.07160 2022 3","authors":["Ye Huang","Di Kang","Liang Chen","Xuefei Zhe","Wenjing Jia","Xiangjian He","Linchao Bao"],"abstract":"Recent segmentation methods, such as OCR and CPNet, utilizing \"class level\" information in addition to pixel features, have achieved notable success for boosting the accuracy of existing network modules. However, the extracted class-level information was simply concatenated to pixel features, without explicitly being exploited for better pixel representation learning. Moreover, these approaches learn soft class centers based on coarse mask prediction, which is prone to error accumulation. In this paper, aiming to use class level information more effectively, we propose a universal Class-Aware Regularization (CAR) approach to optimize the intra-class variance and inter-class distance during feature learning, motivated by the fact that humans can recognize an object by itself no matter which other objects it appears with. Three novel loss functions are proposed. The first loss function encourages more compact class representations within each class, the second directly maximizes the distance between different class centers, and the third further pushes the distance between inter-class centers and pixels. Furthermore, the class center in our approach is directly generated from ground truth instead of from the error-prone coarse prediction. Our method can be easily applied to most existing segmentation models during training, including OCR and CPNet, and can largely improve their accuracy at no additional inference overhead. Extensive experiments and ablation studies conducted on multiple benchmark datasets demonstrate that the proposed CAR can boost the accuracy of all baseline models by up to 2.23% mIOU with superior generalization ability. The complete code is available at https://github.com/edwardyehuang/CAR.","url_abs":"https://arxiv.org/abs/2203.07160v2","url_pdf":"https://arxiv.org/pdf/2203.07160v2.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":"car-class-aware-regularizations-for-semantic-1","repo_url":"https://github.com/edwardyehuang/CAR","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"representation-learning","task_name":"Representation Learning"},{"task_slug":"semantic-segmentation","task_name":"Semantic Segmentation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/semantic-segmentation-on-pascal-context","task":"Semantic Segmentation","dataset":"PASCAL Context","model":"CAA + CAR (ConvNeXt-Large + JPU)","rank_in_archive_order":9,"of":66,"metrics":{"mIoU":"64.1"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2203.07160","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2203.07160"}},"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":"deterministic:regex_extraction","url":"https://github.com/edwardyehuang/CAR","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":4},"by_repo_kind":{"official":{"samples":4,"ran":0,"repositories":1}},"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":"308fef7c1b155486","entry":"affinity_loss","repo":"edwardyehuang/CAR","repo_kind":"official","path":"heads/cpnet.py","file_url":"https://github.com/edwardyehuang/CAR/blob/HEAD/heads/cpnet.py","link_basis":"harvester_set","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":"308fef7c1b155486"}},{"code_sha256_prefix":"de1c90a4bf104fc5","entry":"construct_ideal_affinity_martix","repo":"edwardyehuang/CAR","repo_kind":"official","path":"heads/cpnet.py","file_url":"https://github.com/edwardyehuang/CAR/blob/HEAD/heads/cpnet.py","link_basis":"harvester_set","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":"de1c90a4bf104fc5"}},{"code_sha256_prefix":"4af5ad313f070405","entry":"get_class_sum_features_and_counts","repo":"edwardyehuang/CAR","repo_kind":"official","path":"car_core/utils.py","file_url":"https://github.com/edwardyehuang/CAR/blob/HEAD/car_core/utils.py","link_basis":"harvester_set","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":"4af5ad313f070405"}},{"code_sha256_prefix":"72ea1625c6585131","entry":"square_mean_loss","repo":"edwardyehuang/CAR","repo_kind":"official","path":"car_core/utils.py","file_url":"https://github.com/edwardyehuang/CAR/blob/HEAD/car_core/utils.py","link_basis":"harvester_set","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":"72ea1625c6585131"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}