{"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/cctrans-simplifying-and-improving-crowd","title":"CCTrans: Simplifying and Improving Crowd Counting with Transformer","arxiv_id":"2109.14483","date":"2021-09-29","proceeding":null,"authors":["Ye Tian","Xiangxiang Chu","Hongpeng Wang"],"abstract":"Most recent methods used for crowd counting are based on the convolutional neural network (CNN), which has a strong ability to extract local features. But CNN inherently fails in modeling the global context due to the limited receptive fields. However, the transformer can model the global context easily. In this paper, we propose a simple approach called CCTrans to simplify the design pipeline. Specifically, we utilize a pyramid vision transformer backbone to capture the global crowd information, a pyramid feature aggregation (PFA) model to combine low-level and high-level features, an efficient regression head with multi-scale dilated convolution (MDC) to predict density maps. Besides, we tailor the loss functions for our pipeline. Without bells and whistles, extensive experiments demonstrate that our method achieves new state-of-the-art results on several benchmarks both in weakly and fully-supervised crowd counting. Moreover, we currently rank No.1 on the leaderboard of NWPU-Crowd. Our code will be made available.","url_abs":"https://arxiv.org/abs/2109.14483v1","url_pdf":"https://arxiv.org/pdf/2109.14483v1.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":"cctrans-simplifying-and-improving-crowd","repo_url":"https://github.com/Nonad/Twins-with-RFB","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"cctrans-simplifying-and-improving-crowd","repo_url":"https://github.com/wfs123456/CCTrans","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"crowd-counting","task_name":"Crowd Counting"}],"methods":[{"method_slug":"attention","method_name":"Attention"},{"method_slug":"convolution","method_name":"Convolution"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dilated-convolution","method_name":"Dilated Convolution"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"vision-transformer","method_name":"Vision Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2109.14483","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2109.14483"}},"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/Nonad/Twins-with-RFB","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/wfs123456/CCTrans","reach":null}],"summary":{"ran_fixture":2,"unverified":4},"by_repo_kind":{"listed":{"samples":6,"ran":2,"repositories":2}},"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":"d08f4d64816a826e","entry":"cal_new_tensor","repo":"wfs123456/CCTrans","repo_kind":"listed","path":"test_image_patch.py","file_url":"https://github.com/wfs123456/CCTrans/blob/HEAD/test_image_patch.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":"d08f4d64816a826e"}},{"code_sha256_prefix":"43b3c77113470048","entry":"tensor_divideByfactor","repo":"wfs123456/CCTrans","repo_kind":"listed","path":"test_image_patch.py","file_url":"https://github.com/wfs123456/CCTrans/blob/HEAD/test_image_patch.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":"43b3c77113470048"}},{"code_sha256_prefix":"ebd7b446507c5c74","entry":"GN","repo":"Nonad/Twins-with-RFB","repo_kind":"listed","path":"dataaug.py","file_url":"https://github.com/Nonad/Twins-with-RFB/blob/HEAD/dataaug.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ebd7b446507c5c74"}},{"code_sha256_prefix":"fc6a1a15b53af7e9","entry":"SAP","repo":"Nonad/Twins-with-RFB","repo_kind":"listed","path":"dataaug.py","file_url":"https://github.com/Nonad/Twins-with-RFB/blob/HEAD/dataaug.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"fc6a1a15b53af7e9"}},{"code_sha256_prefix":"66d06a102be0ec25","entry":"darker","repo":"Nonad/Twins-with-RFB","repo_kind":"listed","path":"dataaug.py","file_url":"https://github.com/Nonad/Twins-with-RFB/blob/HEAD/dataaug.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"66d06a102be0ec25"}},{"code_sha256_prefix":"f6fe519345f70747","entry":"load_data","repo":"Nonad/Twins-with-RFB","repo_kind":"listed","path":"image.py","file_url":"https://github.com/Nonad/Twins-with-RFB/blob/HEAD/image.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f6fe519345f70747"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}