{"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/class-wise-difficulty-balanced-loss-for","title":"Class-Wise Difficulty-Balanced Loss for Solving Class-Imbalance","arxiv_id":"2010.01824","date":"2020-10-05","proceeding":null,"authors":["Saptarshi Sinha","Hiroki Ohashi","Katsuyuki Nakamura"],"abstract":"Class-imbalance is one of the major challenges in real world datasets, where a few classes (called majority classes) constitute much more data samples than the rest (called minority classes). Learning deep neural networks using such datasets leads to performances that are typically biased towards the majority classes. Most of the prior works try to solve class-imbalance by assigning more weights to the minority classes in various manners (e.g., data re-sampling, cost-sensitive learning). However, we argue that the number of available training data may not be always a good clue to determine the weighting strategy because some of the minority classes might be sufficiently represented even by a small number of training data. Overweighting samples of such classes can lead to drop in the model's overall performance. We claim that the 'difficulty' of a class as perceived by the model is more important to determine the weighting. In this light, we propose a novel loss function named Class-wise Difficulty-Balanced loss, or CDB loss, which dynamically distributes weights to each sample according to the difficulty of the class that the sample belongs to. Note that the assigned weights dynamically change as the 'difficulty' for the model may change with the learning progress. Extensive experiments are conducted on both image (artificially induced class-imbalanced MNIST, long-tailed CIFAR and ImageNet-LT) and video (EGTEA) datasets. The results show that CDB loss consistently outperforms the recently proposed loss functions on class-imbalanced datasets irrespective of the data type (i.e., video or image).","url_abs":"https://arxiv.org/abs/2010.01824v1","url_pdf":"https://arxiv.org/pdf/2010.01824v1.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":"class-wise-difficulty-balanced-loss-for","repo_url":"https://github.com/hitachi-rd-cv/CDB-loss","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"long-tail-learning","task_name":"Long-tail Learning"}],"methods":[],"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":"CDB-loss","rank_in_archive_order":29,"of":31,"metrics":{"Error Rate":"41.26"},"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":"CDB-loss","rank_in_archive_order":59,"of":66,"metrics":{"Error Rate":"57.43"},"uses_additional_data":false},{"leaderboard":"/sota/long-tail-learning-on-egtea","task":"Long-tail Learning","dataset":"EGTEA","model":"CDB-loss (3D- ResNeXt101)","rank_in_archive_order":1,"of":3,"metrics":{"Average Precision":"63.86","Average Recall":"66.24"},"uses_additional_data":false},{"leaderboard":"/sota/long-tail-learning-on-imagenet-lt","task":"Long-tail Learning","dataset":"ImageNet-LT","model":"CDB-loss (ResNet 10)","rank_in_archive_order":65,"of":69,"metrics":{"Top-1 Accuracy":"38.5"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2010.01824","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2010.01824"}},"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/hitachi-rd-cv/CDB-loss","reach":null}],"summary":{"unverified":2},"by_repo_kind":{"official":{"samples":2,"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":2,"samples":[{"code_sha256_prefix":"9dffd656122a8b8a","entry":"validate","repo":"hitachi-rd-cv/CDB-loss","repo_kind":"official","path":"CIFAR-LT/cifar_train.py","file_url":"https://github.com/hitachi-rd-cv/CDB-loss/blob/HEAD/CIFAR-LT/cifar_train.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"9dffd656122a8b8a"}},{"code_sha256_prefix":"48f9455a228a54a0","entry":"validate","repo":"hitachi-rd-cv/CDB-loss","repo_kind":"official","path":"EGTEA/EGTEA_train.py","file_url":"https://github.com/hitachi-rd-cv/CDB-loss/blob/HEAD/EGTEA/EGTEA_train.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"48f9455a228a54a0"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}