{"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/long-tailed-recognition-via-weight-balancing","title":"Long-Tailed Recognition via Weight Balancing","arxiv_id":"2203.14197","date":"2022-03-27","proceeding":"CVPR 2022 1","authors":["Shaden Alshammari","Yu-Xiong Wang","Deva Ramanan","Shu Kong"],"abstract":"In the real open world, data tends to follow long-tailed class distributions, motivating the well-studied long-tailed recognition (LTR) problem. Naive training produces models that are biased toward common classes in terms of higher accuracy. The key to addressing LTR is to balance various aspects including data distribution, training losses, and gradients in learning. We explore an orthogonal direction, weight balancing, motivated by the empirical observation that the naively trained classifier has \"artificially\" larger weights in norm for common classes (because there exists abundant data to train them, unlike the rare classes). We investigate three techniques to balance weights, L2-normalization, weight decay, and MaxNorm. We first point out that L2-normalization \"perfectly\" balances per-class weights to be unit norm, but such a hard constraint might prevent classes from learning better classifiers. In contrast, weight decay penalizes larger weights more heavily and so learns small balanced weights; the MaxNorm constraint encourages growing small weights within a norm ball but caps all the weights by the radius. Our extensive study shows that both help learn balanced weights and greatly improve the LTR accuracy. Surprisingly, weight decay, although underexplored in LTR, significantly improves over prior work. Therefore, we adopt a two-stage training paradigm and propose a simple approach to LTR: (1) learning features using the cross-entropy loss by tuning weight decay, and (2) learning classifiers using class-balanced loss by tuning weight decay and MaxNorm. Our approach achieves the state-of-the-art accuracy on five standard benchmarks, serving as a future baseline for long-tailed recognition.","url_abs":"https://arxiv.org/abs/2203.14197v1","url_pdf":"https://arxiv.org/pdf/2203.14197v1.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":"long-tailed-recognition-via-weight-balancing","repo_url":"https://github.com/shadealsha/ltr-weight-balancing","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"long-tailed-recognition-via-weight-balancing","repo_url":"https://github.com/hn410/exploring-weight-balancing-on-long-tailed-recognition-problem","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"NOASSERTION"}}],"tasks":[{"task_slug":"classification-1","task_name":"Classification"},{"task_slug":"long-tail-learning","task_name":"Long-tail Learning"}],"methods":[{"method_slug":"weight-decay","method_name":"Weight Decay"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/long-tail-learning-on-cifar-100-lt-r-10","task":"Long-tail Learning","dataset":"CIFAR-100-LT (ρ=10)","model":"LTR-weight-balancing","rank_in_archive_order":9,"of":31,"metrics":{"Error Rate":"31.33"},"uses_additional_data":false},{"leaderboard":"/sota/long-tail-learning-on-cifar-100-lt-r-100","task":"Long-tail Learning","dataset":"CIFAR-100-LT (ρ=100)","model":"LTR-weight-balancing","rank_in_archive_order":16,"of":66,"metrics":{"Error Rate":"46.45"},"uses_additional_data":false},{"leaderboard":"/sota/long-tail-learning-on-cifar-100-lt-r-50","task":"Long-tail Learning","dataset":"CIFAR-100-LT (ρ=50)","model":"LTR-weight-balancing","rank_in_archive_order":13,"of":25,"metrics":{"Error Rate":"42.29"},"uses_additional_data":false},{"leaderboard":"/sota/long-tail-learning-on-imagenet-lt","task":"Long-tail Learning","dataset":"ImageNet-LT","model":"LTR-weight-balancing(ResNeXt-50)","rank_in_archive_order":41,"of":69,"metrics":{"Top-1 Accuracy":"53.9"},"uses_additional_data":false},{"leaderboard":"/sota/long-tail-learning-on-inaturalist-2018","task":"Long-tail Learning","dataset":"iNaturalist 2018","model":"LTR-weight-balancing(ResNet-50)","rank_in_archive_order":33,"of":43,"metrics":{"Top-1 Accuracy":"70.2%"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2203.14197","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2203.14197"}},"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/shadealsha/ltr-weight-balancing","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/hn410/exploring-weight-balancing-on-long-tailed-recognition-problem","reach":{"status":"ok","spdx":"NOASSERTION"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/ShadeAlsha/LTR-weight-balancing","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":3,"ran_honours":2,"unverified":9},"by_repo_kind":{"official":{"samples":1,"ran":1,"repositories":1},"listed":{"samples":13,"ran":4,"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":13,"samples":[{"code_sha256_prefix":"823c62783af077c4","entry":"Args","repo":"hn410/exploring-weight-balancing-on-long-tailed-recognition-problem","repo_kind":"listed","path":"utils/regularizers.py","file_url":"https://github.com/hn410/exploring-weight-balancing-on-long-tailed-recognition-problem/blob/HEAD/utils/regularizers.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"823c62783af077c4"}},{"code_sha256_prefix":"338c1c455c22fefc","entry":"ETFClassifier","repo":"hn410/exploring-weight-balancing-on-long-tailed-recognition-problem","repo_kind":"listed","path":"utils/regularizers.py","file_url":"https://github.com/hn410/exploring-weight-balancing-on-long-tailed-recognition-problem/blob/HEAD/utils/regularizers.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"338c1c455c22fefc"}},{"code_sha256_prefix":"4780ca1d1a49db70","entry":"Normalizer","repo":"ShadeAlsha/LTR-weight-balancing","repo_kind":"official","path":"utils/regularizers.py","file_url":"https://github.com/ShadeAlsha/LTR-weight-balancing/blob/HEAD/utils/regularizers.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":"4780ca1d1a49db70"}},{"code_sha256_prefix":"7da1d353469b0be3","entry":"get_general_etf","repo":"hn410/exploring-weight-balancing-on-long-tailed-recognition-problem","repo_kind":"listed","path":"utils/regularizers.py","file_url":"https://github.com/hn410/exploring-weight-balancing-on-long-tailed-recognition-problem/blob/HEAD/utils/regularizers.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"7da1d353469b0be3"}},{"code_sha256_prefix":"dcbb19773a7cac10","entry":"get_standard_etf","repo":"hn410/exploring-weight-balancing-on-long-tailed-recognition-problem","repo_kind":"listed","path":"utils/regularizers.py","file_url":"https://github.com/hn410/exploring-weight-balancing-on-long-tailed-recognition-problem/blob/HEAD/utils/regularizers.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"dcbb19773a7cac10"}},{"code_sha256_prefix":"09c84ce863501d24","entry":"BaseArgs","repo":"hn410/exploring-weight-balancing-on-long-tailed-recognition-problem","repo_kind":"listed","path":"utils/regularizers.py","file_url":"https://github.com/hn410/exploring-weight-balancing-on-long-tailed-recognition-problem/blob/HEAD/utils/regularizers.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"09c84ce863501d24"}},{"code_sha256_prefix":"bc71a4b98ce3d15c","entry":"DataArgs","repo":"hn410/exploring-weight-balancing-on-long-tailed-recognition-problem","repo_kind":"listed","path":"utils/regularizers.py","file_url":"https://github.com/hn410/exploring-weight-balancing-on-long-tailed-recognition-problem/blob/HEAD/utils/regularizers.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"bc71a4b98ce3d15c"}},{"code_sha256_prefix":"2cff8e0fc7cbb80e","entry":"ModelArgs","repo":"hn410/exploring-weight-balancing-on-long-tailed-recognition-problem","repo_kind":"listed","path":"utils/regularizers.py","file_url":"https://github.com/hn410/exploring-weight-balancing-on-long-tailed-recognition-problem/blob/HEAD/utils/regularizers.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"2cff8e0fc7cbb80e"}},{"code_sha256_prefix":"1914c23d713ecf37","entry":"MyModel","repo":"hn410/exploring-weight-balancing-on-long-tailed-recognition-problem","repo_kind":"listed","path":"utils/regularizers.py","file_url":"https://github.com/hn410/exploring-weight-balancing-on-long-tailed-recognition-problem/blob/HEAD/utils/regularizers.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"1914c23d713ecf37"}},{"code_sha256_prefix":"8d34cc38e01f8d9a","entry":"Normalizer","repo":"hn410/exploring-weight-balancing-on-long-tailed-recognition-problem","repo_kind":"listed","path":"utils/regularizers.py","file_url":"https://github.com/hn410/exploring-weight-balancing-on-long-tailed-recognition-problem/blob/HEAD/utils/regularizers.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"8d34cc38e01f8d9a"}},{"code_sha256_prefix":"f7bd465fe4d21d9c","entry":"OptimArgs","repo":"hn410/exploring-weight-balancing-on-long-tailed-recognition-problem","repo_kind":"listed","path":"utils/regularizers.py","file_url":"https://github.com/hn410/exploring-weight-balancing-on-long-tailed-recognition-problem/blob/HEAD/utils/regularizers.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"f7bd465fe4d21d9c"}},{"code_sha256_prefix":"2315c55f41d17dd6","entry":"RootArgs","repo":"hn410/exploring-weight-balancing-on-long-tailed-recognition-problem","repo_kind":"listed","path":"utils/regularizers.py","file_url":"https://github.com/hn410/exploring-weight-balancing-on-long-tailed-recognition-problem/blob/HEAD/utils/regularizers.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"2315c55f41d17dd6"}},{"code_sha256_prefix":"9e06ce81e8a8384f","entry":"get_logger","repo":"hn410/exploring-weight-balancing-on-long-tailed-recognition-problem","repo_kind":"listed","path":"utils/regularizers.py","file_url":"https://github.com/hn410/exploring-weight-balancing-on-long-tailed-recognition-problem/blob/HEAD/utils/regularizers.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"9e06ce81e8a8384f"}},{"code_sha256_prefix":"38753fa77ce1c083","entry":"get_tmp_log_path","repo":"hn410/exploring-weight-balancing-on-long-tailed-recognition-problem","repo_kind":"listed","path":"utils/regularizers.py","file_url":"https://github.com/hn410/exploring-weight-balancing-on-long-tailed-recognition-problem/blob/HEAD/utils/regularizers.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"38753fa77ce1c083"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}