{"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/weakly-supervised-object-localization-via","title":"Weakly Supervised Object Localization via Transformer with Implicit Spatial Calibration","arxiv_id":"2207.10447","date":"2022-07-21","proceeding":null,"authors":["Haotian Bai","Ruimao Zhang","Jiong Wang","Xiang Wan"],"abstract":"Weakly Supervised Object Localization (WSOL), which aims to localize objects by only using image-level labels, has attracted much attention because of its low annotation cost in real applications. Recent studies leverage the advantage of self-attention in visual Transformer for long-range dependency to re-active semantic regions, aiming to avoid partial activation in traditional class activation mapping (CAM). However, the long-range modeling in Transformer neglects the inherent spatial coherence of the object, and it usually diffuses the semantic-aware regions far from the object boundary, making localization results significantly larger or far smaller. To address such an issue, we introduce a simple yet effective Spatial Calibration Module (SCM) for accurate WSOL, incorporating semantic similarities of patch tokens and their spatial relationships into a unified diffusion model. Specifically, we introduce a learnable parameter to dynamically adjust the semantic correlations and spatial context intensities for effective information propagation. In practice, SCM is designed as an external module of Transformer, and can be removed during inference to reduce the computation cost. The object-sensitive localization ability is implicitly embedded into the Transformer encoder through optimization in the training phase. It enables the generated attention maps to capture the sharper object boundaries and filter the object-irrelevant background area. Extensive experimental results demonstrate the effectiveness of the proposed method, which significantly outperforms its counterpart TS-CAM on both CUB-200 and ImageNet-1K benchmarks. The code is available at https://github.com/164140757/SCM.","url_abs":"https://arxiv.org/abs/2207.10447v2","url_pdf":"https://arxiv.org/pdf/2207.10447v2.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":"weakly-supervised-object-localization-via","repo_url":"https://github.com/164140757/scm","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"weakly-supervised-object-localization-via","repo_url":"https://github.com/author31/scm_nbdev","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"long-range-modeling","task_name":"Long-range modeling"},{"task_slug":"object","task_name":"Object"},{"task_slug":"object-localization","task_name":"Object Localization"},{"task_slug":"weakly-supervised-object-localization","task_name":"Weakly-Supervised Object Localization"}],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"diffusion","method_name":"Diffusion"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"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":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"transformer","method_name":"Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/weakly-supervised-object-localization-on-cub-2","task":"Weakly-Supervised Object Localization","dataset":"CUB-200-2011","model":"Deit-S","rank_in_archive_order":2,"of":3,"metrics":{"GT-known localization accuracy":"96.6","Top-1 Localization Accuracy":"76.4","average top-1 classification accuracy":"78.5"},"uses_additional_data":false},{"leaderboard":"/sota/weakly-supervised-object-localization-on-2","task":"Weakly-Supervised Object Localization","dataset":"ImageNet","model":"Deit-S","rank_in_archive_order":2,"of":6,"metrics":{"GT-known localization accuracy":"68.8","Top-1 Localization Accuracy":"56.1","average top-1 classification accuracy":"76.7"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2207.10447","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2207.10447"}},"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/164140757/SCM","reach":null}],"summary":{"ran":4,"ran_draft_wrong":3,"unverified":3},"by_repo_kind":{"official":{"samples":10,"ran":7,"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":"ce23b9a90f7e4277","entry":"Attention","repo":"164140757/SCM","repo_kind":"official","path":"lib/models/deit.py","file_url":"https://github.com/164140757/SCM/blob/HEAD/lib/models/deit.py","link_basis":"first_harvest_node","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":"ce23b9a90f7e4277"}},{"code_sha256_prefix":"cf9b5254c1c546d6","entry":"Block","repo":"164140757/SCM","repo_kind":"official","path":"lib/models/deit.py","file_url":"https://github.com/164140757/SCM/blob/HEAD/lib/models/deit.py","link_basis":"first_harvest_node","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":"cf9b5254c1c546d6"}},{"code_sha256_prefix":"ffeae770a3f8ffce","entry":"Fuse","repo":"164140757/SCM","repo_kind":"official","path":"lib/models/deit.py","file_url":"https://github.com/164140757/SCM/blob/HEAD/lib/models/deit.py","link_basis":"first_harvest_node","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":"ffeae770a3f8ffce"}},{"code_sha256_prefix":"b780b9943fd000fc","entry":"HybridEmbed","repo":"164140757/SCM","repo_kind":"official","path":"lib/models/deit.py","file_url":"https://github.com/164140757/SCM/blob/HEAD/lib/models/deit.py","link_basis":"first_harvest_node","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":"b780b9943fd000fc"}},{"code_sha256_prefix":"bb789660ac0c59bb","entry":"embeddings_to_cosine_similarity_matrix","repo":"164140757/SCM","repo_kind":"official","path":"lib/models/deit.py","file_url":"https://github.com/164140757/SCM/blob/HEAD/lib/models/deit.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"bb789660ac0c59bb"}},{"code_sha256_prefix":"ac13c6b3c1647de2","entry":"inverse_schulz","repo":"164140757/SCM","repo_kind":"official","path":"lib/models/deit.py","file_url":"https://github.com/164140757/SCM/blob/HEAD/lib/models/deit.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ac13c6b3c1647de2"}},{"code_sha256_prefix":"e0c1b88633b751da","entry":"norm_cam","repo":"164140757/SCM","repo_kind":"official","path":"lib/models/deit.py","file_url":"https://github.com/164140757/SCM/blob/HEAD/lib/models/deit.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e0c1b88633b751da"}},{"code_sha256_prefix":"234c278bead3ee45","entry":"Encoder","repo":"164140757/SCM","repo_kind":"official","path":"lib/models/deit.py","file_url":"https://github.com/164140757/SCM/blob/HEAD/lib/models/deit.py","link_basis":"first_harvest_node","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":"234c278bead3ee45"}},{"code_sha256_prefix":"c2d706c181c15ef2","entry":"SCM","repo":"164140757/SCM","repo_kind":"official","path":"lib/models/deit.py","file_url":"https://github.com/164140757/SCM/blob/HEAD/lib/models/deit.py","link_basis":"first_harvest_node","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":"c2d706c181c15ef2"}},{"code_sha256_prefix":"c56f1df1064bfab1","entry":"VisionTransformer","repo":"164140757/SCM","repo_kind":"official","path":"lib/models/deit.py","file_url":"https://github.com/164140757/SCM/blob/HEAD/lib/models/deit.py","link_basis":"first_harvest_node","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":"c56f1df1064bfab1"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}