{"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/polyloss-a-polynomial-expansion-perspective-1","title":"PolyLoss: A Polynomial Expansion Perspective of Classification Loss Functions","arxiv_id":"2204.12511","date":"2022-04-26","proceeding":"ICLR 2022 4","authors":["Zhaoqi Leng","Mingxing Tan","Chenxi Liu","Ekin Dogus Cubuk","Xiaojie Shi","Shuyang Cheng","Dragomir Anguelov"],"abstract":"Cross-entropy loss and focal loss are the most common choices when training deep neural networks for classification problems. Generally speaking, however, a good loss function can take on much more flexible forms, and should be tailored for different tasks and datasets. Motivated by how functions can be approximated via Taylor expansion, we propose a simple framework, named PolyLoss, to view and design loss functions as a linear combination of polynomial functions. Our PolyLoss allows the importance of different polynomial bases to be easily adjusted depending on the targeting tasks and datasets, while naturally subsuming the aforementioned cross-entropy loss and focal loss as special cases. Extensive experimental results show that the optimal choice within the PolyLoss is indeed dependent on the task and dataset. Simply by introducing one extra hyperparameter and adding one line of code, our Poly-1 formulation outperforms the cross-entropy loss and focal loss on 2D image classification, instance segmentation, object detection, and 3D object detection tasks, sometimes by a large margin.","url_abs":"https://arxiv.org/abs/2204.12511v2","url_pdf":"https://arxiv.org/pdf/2204.12511v2.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":"polyloss-a-polynomial-expansion-perspective-1","repo_url":"https://github.com/abhuse/polyloss-pytorch","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"polyloss-a-polynomial-expansion-perspective-1","repo_url":"https://github.com/frgfm/Holocron","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"polyloss-a-polynomial-expansion-perspective-1","repo_url":"https://github.com/jahongir7174/MaskRCNN","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"polyloss-a-polynomial-expansion-perspective-1","repo_url":"https://github.com/jahongir7174/PolyLoss","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"polyloss-a-polynomial-expansion-perspective-1","repo_url":"https://github.com/lumia-group/apl","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"polyloss-a-polynomial-expansion-perspective-1","repo_url":"https://github.com/nachiket273/loss-tryout","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"polyloss-a-polynomial-expansion-perspective-1","repo_url":"https://github.com/yiyixuxu/polyloss-pytorch","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"polyloss-a-polynomial-expansion-perspective-1","repo_url":"https://github.com/MindCode-4/code-8/tree/main/polyloss","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"polyloss-a-polynomial-expansion-perspective-1","repo_url":"https://github.com/MindSpore-scientific-2/code-4/tree/main/PolyLoss","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"polyloss-a-polynomial-expansion-perspective-1","repo_url":"https://github.com/MindSpore-scientific-2/code-5/tree/main/PolyLoss","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"polyloss-a-polynomial-expansion-perspective-1","repo_url":"https://github.com/MindSpore-scientific-2/code-8/tree/main/PolyLoss","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"polyloss-a-polynomial-expansion-perspective-1","repo_url":"https://github.com/MindSpore-scientific/code-1/tree/main/PolyLoss","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"polyloss-a-polynomial-expansion-perspective-1","repo_url":"https://github.com/MindSpore-scientific/code-10/tree/main/PolyLoss","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"polyloss-a-polynomial-expansion-perspective-1","repo_url":"https://github.com/MindSpore-scientific/code-11/tree/main/PolyLoss","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"polyloss-a-polynomial-expansion-perspective-1","repo_url":"https://github.com/MindSpore-scientific/code-13/tree/main/PolyLoss","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"polyloss-a-polynomial-expansion-perspective-1","repo_url":"https://github.com/MindSpore-scientific/code-5/tree/main/polyloss","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"polyloss-a-polynomial-expansion-perspective-1","repo_url":"https://github.com/MindSpore-scientific/code-8/tree/main/PolyLoss","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"polyloss-a-polynomial-expansion-perspective-1","repo_url":"https://github.com/jahongir7174/EfficientNetV2","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":null},{"paper_slug":"polyloss-a-polynomial-expansion-perspective-1","repo_url":"https://github.com/pwc-1/Paper-9/tree/main/7/PolyLoss","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null}],"tasks":[{"task_slug":"3d-object-detection","task_name":"3D Object Detection"},{"task_slug":"image-classification","task_name":"Image Classification"},{"task_slug":"instance-segmentation","task_name":"Instance Segmentation"},{"task_slug":"object-detection","task_name":"Object Detection"},{"task_slug":"semantic-segmentation","task_name":"Semantic Segmentation"},{"task_slug":"image-classification","task_name":"image-classification"}],"methods":[{"method_slug":"focal-loss","method_name":"Focal Loss"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/image-classification-on-imagenet","task":"Image Classification","dataset":"ImageNet","model":"EfficientNetV2 (PolyLoss)","rank_in_archive_order":99,"of":1060,"metrics":{"Top 1 Accuracy":"87.2%"},"uses_additional_data":true}],"syntology":{"syntology_url":"https://syntology.ai/paper/2204.12511","atlas_url":"https://app.syntology.ai/?focus=2204.12511","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2204.12511"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/jahongir7174/MaskRCNN","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/pwc-1/Paper-9/tree/main/7/PolyLoss","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MindSpore-scientific/code-10/tree/main/PolyLoss","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MindSpore-scientific-2/code-8/tree/main/PolyLoss","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MindSpore-scientific/code-11/tree/main/PolyLoss","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/frgfm/Holocron","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MindSpore-scientific/code-1/tree/main/PolyLoss","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/abhuse/polyloss-pytorch","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/jahongir7174/PolyLoss","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MindSpore-scientific/code-5/tree/main/polyloss","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/lumia-group/apl","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MindCode-4/code-8/tree/main/polyloss","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/yiyixuxu/polyloss-pytorch","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MindSpore-scientific-2/code-5/tree/main/PolyLoss","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MindSpore-scientific/code-8/tree/main/PolyLoss","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MindSpore-scientific/code-13/tree/main/PolyLoss","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MindSpore-scientific-2/code-4/tree/main/PolyLoss","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/nachiket273/loss-tryout","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/jahongir7174/EfficientNetV2","reach":null}],"summary":{"ran":5,"ran_fixture":1,"unverified":1},"by_repo_kind":{"listed":{"samples":7,"ran":6,"repositories":3}},"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":1,"samples":[{"code_sha256_prefix":"f6b1da081133f2de","entry":"crossentropyfirstn","repo":"nachiket273/loss-tryout","repo_kind":"listed","path":"polynloss.py","file_url":"https://github.com/nachiket273/loss-tryout/blob/HEAD/polynloss.py","link_basis":"harvester_set","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":"f6b1da081133f2de"}},{"code_sha256_prefix":"75f93a5098113ec2","entry":"focallossfirstn","repo":"nachiket273/loss-tryout","repo_kind":"listed","path":"polynloss.py","file_url":"https://github.com/nachiket273/loss-tryout/blob/HEAD/polynloss.py","link_basis":"harvester_set","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":"75f93a5098113ec2"}},{"code_sha256_prefix":"e6a94a5bc4d9e8f4","entry":"resize","repo":"jahongir7174/MaskRCNN","repo_kind":"listed","path":"utils/util.py","file_url":"https://github.com/jahongir7174/MaskRCNN/blob/HEAD/utils/util.py","link_basis":"harvester_set","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":"e6a94a5bc4d9e8f4"}},{"code_sha256_prefix":"6806c813ec675aab","entry":"to_one_hot","repo":"yiyixuxu/polyloss-pytorch","repo_kind":"listed","path":"PolyLoss.py","file_url":"https://github.com/yiyixuxu/polyloss-pytorch/blob/HEAD/PolyLoss.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6806c813ec675aab"}},{"code_sha256_prefix":"9ead510a24af1caa","entry":"xy2wh","repo":"jahongir7174/MaskRCNN","repo_kind":"listed","path":"utils/util.py","file_url":"https://github.com/jahongir7174/MaskRCNN/blob/HEAD/utils/util.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9ead510a24af1caa"}},{"code_sha256_prefix":"e79b32bd70ec5c58","entry":"xyn2xy","repo":"jahongir7174/MaskRCNN","repo_kind":"listed","path":"utils/util.py","file_url":"https://github.com/jahongir7174/MaskRCNN/blob/HEAD/utils/util.py","link_basis":"harvester_set","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":"e79b32bd70ec5c58"}},{"code_sha256_prefix":"f31e8ddcecd510f0","entry":"polynloss","repo":"nachiket273/loss-tryout","repo_kind":"listed","path":"polynloss.py","file_url":"https://github.com/nachiket273/loss-tryout/blob/HEAD/polynloss.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":"f31e8ddcecd510f0"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}