{"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/learning-to-count-anything-reference-less","title":"Learning to Count Anything: Reference-less Class-agnostic Counting with Weak Supervision","arxiv_id":"2205.10203","date":"2022-05-20","proceeding":null,"authors":["Michael Hobley","Victor Prisacariu"],"abstract":"Current class-agnostic counting methods can generalise to unseen classes but usually require reference images to define the type of object to be counted, as well as instance annotations during training. Reference-less class-agnostic counting is an emerging field that identifies counting as, at its core, a repetition-recognition task. Such methods facilitate counting on a changing set composition. We show that a general feature space with global context can enumerate instances in an image without a prior on the object type present. Specifically, we demonstrate that regression from vision transformer features without point-level supervision or reference images is superior to other reference-less methods and is competitive with methods that use reference images. We show this on the current standard few-shot counting dataset FSC-147. We also propose an improved dataset, FSC-133, which removes errors, ambiguities, and repeated images from FSC-147 and demonstrate similar performance on it. To the best of our knowledge, we are the first weakly-supervised reference-less class-agnostic counting method.","url_abs":"https://arxiv.org/abs/2205.10203v2","url_pdf":"https://arxiv.org/pdf/2205.10203v2.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":"learning-to-count-anything-reference-less","repo_url":"https://github.com/activevisionlab/learningtocountanything","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"learning-to-count-anything-reference-less","repo_url":"https://github.com/SinicaGroup/Class-agnostic-Few-shot-Object-Counting","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"exemplar-free-counting","task_name":"Exemplar-Free Counting"},{"task_slug":"object-counting","task_name":"Object Counting"}],"methods":[{"method_slug":"attention","method_name":"Attention"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"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":[{"leaderboard":"/sota/exemplar-free-counting-on-fsc147","task":"Exemplar-Free Counting","dataset":"FSC147","model":"RCC","rank_in_archive_order":7,"of":9,"metrics":{"MAE(test)":"17.12","MAE(val)":"17.49","RMSE(test)":"104.53","RMSE(val)":"58.81"},"uses_additional_data":false},{"leaderboard":"/sota/object-counting-on-fsc147","task":"Object Counting","dataset":"FSC147","model":"RCC","rank_in_archive_order":17,"of":19,"metrics":{"MAE(test)":"17.12","MAE(val)":"17.49","RMSE(test)":"104.53","RMSE(val)":"58.81"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2205.10203","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2205.10203"}},"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/activevisionlab/learningtocountanything","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/SinicaGroup/Class-agnostic-Few-shot-Object-Counting","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_fixture":1,"unverified":4},"by_repo_kind":{"official":{"samples":5,"ran":1,"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":"e3aa4e8e74369506","entry":"drop_path","repo":"activevisionlab/learningtocountanything","repo_kind":"official","path":"models/backbone_convnext.py","file_url":"https://github.com/activevisionlab/learningtocountanything/blob/HEAD/models/backbone_convnext.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e3aa4e8e74369506"}},{"code_sha256_prefix":"81c260a71d4df4f5","entry":"convnext_tiny","repo":"activevisionlab/learningtocountanything","repo_kind":"official","path":"models/backbone_convnext.py","file_url":"https://github.com/activevisionlab/learningtocountanything/blob/HEAD/models/backbone_convnext.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":"81c260a71d4df4f5"}},{"code_sha256_prefix":"ec3db0f866e1aa94","entry":"denormalize","repo":"activevisionlab/learningtocountanything","repo_kind":"official","path":"utils/data_utils.py","file_url":"https://github.com/activevisionlab/learningtocountanything/blob/HEAD/utils/data_utils.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":"ec3db0f866e1aa94"}},{"code_sha256_prefix":"fedf6bc671439413","entry":"get_dataloader","repo":"activevisionlab/learningtocountanything","repo_kind":"official","path":"utils/data_utils.py","file_url":"https://github.com/activevisionlab/learningtocountanything/blob/HEAD/utils/data_utils.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":"fedf6bc671439413"}},{"code_sha256_prefix":"5436174f8c0e64e0","entry":"trunc_normal_","repo":"activevisionlab/learningtocountanything","repo_kind":"official","path":"models/backbone_convnext.py","file_url":"https://github.com/activevisionlab/learningtocountanything/blob/HEAD/models/backbone_convnext.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":"5436174f8c0e64e0"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}