{"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/relation-aware-global-attention","title":"Relation-Aware Global Attention for Person Re-identification","arxiv_id":"1904.02998","date":"2019-04-05","proceeding":"CVPR 2020 6","authors":["Zhizheng Zhang","Cuiling Lan","Wen-Jun Zeng","Xin Jin","Zhibo Chen"],"abstract":"For person re-identification (re-id), attention mechanisms have become attractive as they aim at strengthening discriminative features and suppressing irrelevant ones, which matches well the key of re-id, i.e., discriminative feature learning. Previous approaches typically learn attention using local convolutions, ignoring the mining of knowledge from global structure patterns. Intuitively, the affinities among spatial positions/nodes in the feature map provide clustering-like information and are helpful for inferring semantics and thus attention, especially for person images where the feasible human poses are constrained. In this work, we propose an effective Relation-Aware Global Attention (RGA) module which captures the global structural information for better attention learning. Specifically, for each feature position, in order to compactly grasp the structural information of global scope and local appearance information, we propose to stack the relations, i.e., its pairwise correlations/affinities with all the feature positions (e.g., in raster scan order), and the feature itself together to learn the attention with a shallow convolutional model. Extensive ablation studies demonstrate that our RGA can significantly enhance the feature representation power and help achieve the state-of-the-art performance on several popular benchmarks. The source code is available at https://github.com/microsoft/Relation-Aware-Global-Attention-Networks.","url_abs":"https://arxiv.org/abs/1904.02998v2","url_pdf":"https://arxiv.org/pdf/1904.02998v2.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":"relation-aware-global-attention","repo_url":"https://github.com/microsoft/Relation-Aware-Global-Attention-Networks","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"clustering","task_name":"Clustering"},{"task_slug":"image-classification","task_name":"Image Classification"},{"task_slug":"person-re-identification","task_name":"Person Re-Identification"},{"task_slug":null,"task_name":"Relation"},{"task_slug":"scene-segmentation","task_name":"Scene Segmentation"}],"methods":[{"method_slug":"rga","method_name":"RGA"}],"datasets_introduced":[],"methods_introduced":[{"slug":"rga","name":"RGA","full_name":"Relation-aware Global Attention"}],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1904.02998","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1904.02998"}},"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/microsoft/Relation-Aware-Global-Attention-Networks","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":6},"by_repo_kind":{"official":{"samples":6,"ran":0,"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":"302abe91718126bb","entry":"accuracy","repo":"microsoft/Relation-Aware-Global-Attention-Networks","repo_kind":"official","path":"reid/evaluation_metrics/classification.py","file_url":"https://github.com/microsoft/Relation-Aware-Global-Attention-Networks/blob/HEAD/reid/evaluation_metrics/classification.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":"302abe91718126bb"}},{"code_sha256_prefix":"b39a10404aa7ed0b","entry":"cmc","repo":"microsoft/Relation-Aware-Global-Attention-Networks","repo_kind":"official","path":"reid/evaluation_metrics/ranking.py","file_url":"https://github.com/microsoft/Relation-Aware-Global-Attention-Networks/blob/HEAD/reid/evaluation_metrics/ranking.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":"b39a10404aa7ed0b"}},{"code_sha256_prefix":"4be3d910a039412b","entry":"cosine_dist","repo":"microsoft/Relation-Aware-Global-Attention-Networks","repo_kind":"official","path":"reid/loss/loss_set.py","file_url":"https://github.com/microsoft/Relation-Aware-Global-Attention-Networks/blob/HEAD/reid/loss/loss_set.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":"4be3d910a039412b"}},{"code_sha256_prefix":"be97fdf67a958e5d","entry":"euclidean_dist","repo":"microsoft/Relation-Aware-Global-Attention-Networks","repo_kind":"official","path":"reid/loss/loss_set.py","file_url":"https://github.com/microsoft/Relation-Aware-Global-Attention-Networks/blob/HEAD/reid/loss/loss_set.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":"be97fdf67a958e5d"}},{"code_sha256_prefix":"7138b7088bf941e8","entry":"mean_ap","repo":"microsoft/Relation-Aware-Global-Attention-Networks","repo_kind":"official","path":"reid/evaluation_metrics/ranking.py","file_url":"https://github.com/microsoft/Relation-Aware-Global-Attention-Networks/blob/HEAD/reid/evaluation_metrics/ranking.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":"7138b7088bf941e8"}},{"code_sha256_prefix":"4fc0211f67ebf023","entry":"normalize","repo":"microsoft/Relation-Aware-Global-Attention-Networks","repo_kind":"official","path":"reid/loss/loss_set.py","file_url":"https://github.com/microsoft/Relation-Aware-Global-Attention-Networks/blob/HEAD/reid/loss/loss_set.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":"4fc0211f67ebf023"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}