{"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/discrete-constrained-regression-for-local","title":"Discrete-Constrained Regression for Local Counting Models","arxiv_id":"2207.09865","date":"2022-07-20","proceeding":null,"authors":["Haipeng Xiong","Angela Yao"],"abstract":"Local counts, or the number of objects in a local area, is a continuous value by nature. Yet recent state-of-the-art methods show that formulating counting as a classification task performs better than regression. Through a series of experiments on carefully controlled synthetic data, we show that this counter-intuitive result is caused by imprecise ground truth local counts. Factors such as biased dot annotations and incorrectly matched Gaussian kernels used to generate ground truth counts introduce deviations from the true local counts. Standard continuous regression is highly sensitive to these errors, explaining the performance gap between classification and regression. To mitigate the sensitivity, we loosen the regression formulation from a continuous scale to a discrete ordering and propose a novel discrete-constrained (DC) regression. Applied to crowd counting, DC-regression is more accurate than both classification and standard regression on three public benchmarks. A similar advantage also holds for the age estimation task, verifying the overall effectiveness of DC-regression.","url_abs":"https://arxiv.org/abs/2207.09865v1","url_pdf":"https://arxiv.org/pdf/2207.09865v1.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":"discrete-constrained-regression-for-local","repo_url":"https://github.com/xhp-hust-2018-2011/dcreg","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"age-estimation","task_name":"Age Estimation"},{"task_slug":"classification-1","task_name":"Classification"},{"task_slug":"crowd-counting","task_name":"Crowd Counting"},{"task_slug":"regression-1","task_name":"regression"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2207.09865","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2207.09865"}},"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/xhp-hust-2018-2011/dcreg","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":3,"unverified":7},"by_repo_kind":{"official":{"samples":10,"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":"ab976e78a902391a","entry":"change_padding","repo":"xhp-hust-2018-2011/dcreg","repo_kind":"official","path":"Network/base_Network_module.py","file_url":"https://github.com/xhp-hust-2018-2011/dcreg/blob/HEAD/Network/base_Network_module.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ab976e78a902391a"}},{"code_sha256_prefix":"7b2528df8884eefd","entry":"compute_rf","repo":"xhp-hust-2018-2011/dcreg","repo_kind":"official","path":"Network/base_Network_module.py","file_url":"https://github.com/xhp-hust-2018-2011/dcreg/blob/HEAD/Network/base_Network_module.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7b2528df8884eefd"}},{"code_sha256_prefix":"bd14ee2717325fe2","entry":"make_layers","repo":"xhp-hust-2018-2011/dcreg","repo_kind":"official","path":"Network/CountNet.py","file_url":"https://github.com/xhp-hust-2018-2011/dcreg/blob/HEAD/Network/CountNet.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"bd14ee2717325fe2"}},{"code_sha256_prefix":"e44e8c0665a56aa6","entry":"Class2Count","repo":"xhp-hust-2018-2011/dcreg","repo_kind":"official","path":"Network/class_func.py","file_url":"https://github.com/xhp-hust-2018-2011/dcreg/blob/HEAD/Network/class_func.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":"e44e8c0665a56aa6"}},{"code_sha256_prefix":"14624d4f59c79aaa","entry":"Count2Class","repo":"xhp-hust-2018-2011/dcreg","repo_kind":"official","path":"Network/class_func.py","file_url":"https://github.com/xhp-hust-2018-2011/dcreg/blob/HEAD/Network/class_func.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":"14624d4f59c79aaa"}},{"code_sha256_prefix":"ce83548cdfb3acae","entry":"get_config_str","repo":"xhp-hust-2018-2011/dcreg","repo_kind":"official","path":"utils/IOtools.py","file_url":"https://github.com/xhp-hust-2018-2011/dcreg/blob/HEAD/utils/IOtools.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":"ce83548cdfb3acae"}},{"code_sha256_prefix":"d90e035029407c5e","entry":"get_local_count","repo":"xhp-hust-2018-2011/dcreg","repo_kind":"official","path":"Network/class_func.py","file_url":"https://github.com/xhp-hust-2018-2011/dcreg/blob/HEAD/Network/class_func.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":"d90e035029407c5e"}},{"code_sha256_prefix":"75b9b529e82ec492","entry":"get_pad","repo":"xhp-hust-2018-2011/dcreg","repo_kind":"official","path":"utils/load_data_V2.py","file_url":"https://github.com/xhp-hust-2018-2011/dcreg/blob/HEAD/utils/load_data_V2.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":"75b9b529e82ec492"}},{"code_sha256_prefix":"cba361f3f6dee53a","entry":"interval_divide","repo":"xhp-hust-2018-2011/dcreg","repo_kind":"official","path":"cls_funcs/Interval_paritition.py","file_url":"https://github.com/xhp-hust-2018-2011/dcreg/blob/HEAD/cls_funcs/Interval_paritition.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":"cba361f3f6dee53a"}},{"code_sha256_prefix":"bf8495bc6c35bf0e","entry":"load_model","repo":"xhp-hust-2018-2011/dcreg","repo_kind":"official","path":"utils/IOtools.py","file_url":"https://github.com/xhp-hust-2018-2011/dcreg/blob/HEAD/utils/IOtools.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":"bf8495bc6c35bf0e"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}