{"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-distance-weighted-cross-entropy-loss","title":"Class Distance Weighted Cross-Entropy Loss for Ulcerative Colitis Severity Estimation","arxiv_id":"2202.05167","date":"2022-02-09","proceeding":null,"authors":["Gorkem Polat","Ilkay Ergenc","Haluk Tarik Kani","Yesim Ozen Alahdab","Ozlen Atug","Alptekin Temizel"],"abstract":"In scoring systems used to measure the endoscopic activity of ulcerative colitis, such as Mayo endoscopic score or Ulcerative Colitis Endoscopic Index Severity, levels increase with severity of the disease activity. Such relative ranking among the scores makes it an ordinal regression problem. On the other hand, most studies use categorical cross-entropy loss function to train deep learning models, which is not optimal for the ordinal regression problem. In this study, we propose a novel loss function, class distance weighted cross-entropy (CDW-CE), that respects the order of the classes and takes the distance of the classes into account in calculation of the cost. Experimental evaluations show that models trained with CDW-CE outperform the models trained with conventional categorical cross-entropy and other commonly used loss functions which are designed for the ordinal regression problems. In addition, the class activation maps of models trained with CDW-CE loss are more class-discriminative and they are found to be more reasonable by the domain experts.","url_abs":"https://arxiv.org/abs/2202.05167v2","url_pdf":"https://arxiv.org/pdf/2202.05167v2.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-distance-weighted-cross-entropy-loss","repo_url":"https://github.com/GorkemP/labeled-images-for-ulcerative-colitis","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"image-classification","task_name":"Image Classification"},{"task_slug":"regression-1","task_name":"regression"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/image-classification-on-limuc","task":"Image Classification","dataset":"LIMUC","model":"Inception-v3","rank_in_archive_order":1,"of":2,"metrics":{"Quadratic Weighted Kappa":"0.8678"},"uses_additional_data":false}],"syntology":{"syntology_url":"https://syntology.ai/paper/2202.05167","atlas_url":"https://app.syntology.ai/?focus=2202.05167","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2202.05167"}},"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/GorkemP/labeled-images-for-ulcerative-colitis","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":3,"unverified":4},"by_repo_kind":{"official":{"samples":7,"ran":3,"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":"4617b0ca3e52ff3c","entry":"get_batch_size_for_model","repo":"GorkemP/labeled-images-for-ulcerative-colitis","repo_kind":"official","path":"utils/provider.py","file_url":"https://github.com/GorkemP/labeled-images-for-ulcerative-colitis/blob/HEAD/utils/provider.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":"4617b0ca3e52ff3c"}},{"code_sha256_prefix":"4421a6e9a34491e6","entry":"get_mean_sensitivity_specificity","repo":"GorkemP/labeled-images-for-ulcerative-colitis","repo_kind":"official","path":"utils/metrics.py","file_url":"https://github.com/GorkemP/labeled-images-for-ulcerative-colitis/blob/HEAD/utils/metrics.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":"4421a6e9a34491e6"}},{"code_sha256_prefix":"266764878f01e2f9","entry":"weighted_random_sampler","repo":"GorkemP/labeled-images-for-ulcerative-colitis","repo_kind":"official","path":"utils/provider.py","file_url":"https://github.com/GorkemP/labeled-images-for-ulcerative-colitis/blob/HEAD/utils/provider.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":"266764878f01e2f9"}},{"code_sha256_prefix":"4bc29aa65d1053ba","entry":"initialize_model","repo":"GorkemP/labeled-images-for-ulcerative-colitis","repo_kind":"official","path":"utils/provider.py","file_url":"https://github.com/GorkemP/labeled-images-for-ulcerative-colitis/blob/HEAD/utils/provider.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":"4bc29aa65d1053ba"}},{"code_sha256_prefix":"b28c83cab897ab43","entry":"train","repo":"GorkemP/labeled-images-for-ulcerative-colitis","repo_kind":"official","path":"train_classification_model_CV.py","file_url":"https://github.com/GorkemP/labeled-images-for-ulcerative-colitis/blob/HEAD/train_classification_model_CV.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":"b28c83cab897ab43"}},{"code_sha256_prefix":"f0f8090fe416b806","entry":"train_inception","repo":"GorkemP/labeled-images-for-ulcerative-colitis","repo_kind":"official","path":"train_classification_model_CV.py","file_url":"https://github.com/GorkemP/labeled-images-for-ulcerative-colitis/blob/HEAD/train_classification_model_CV.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":"f0f8090fe416b806"}},{"code_sha256_prefix":"6aed499775adb9c6","entry":"validation","repo":"GorkemP/labeled-images-for-ulcerative-colitis","repo_kind":"official","path":"train_classification_model_CV.py","file_url":"https://github.com/GorkemP/labeled-images-for-ulcerative-colitis/blob/HEAD/train_classification_model_CV.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":"6aed499775adb9c6"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}