{"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/contrastive-transformer-learning-with","title":"Contrastive Transformer Learning with Proximity Data Generation for Text-Based Person Search","arxiv_id":"2311.09084","date":"2023-11-15","proceeding":null,"authors":["Hefeng Wu","Weifeng Chen","Zhibin Liu","Tianshui Chen","Zhiguang Chen","Liang Lin"],"abstract":"Given a descriptive text query, text-based person search (TBPS) aims to retrieve the best-matched target person from an image gallery. Such a cross-modal retrieval task is quite challenging due to significant modality gap, fine-grained differences and insufficiency of annotated data. To better align the two modalities, most existing works focus on introducing sophisticated network structures and auxiliary tasks, which are complex and hard to implement. In this paper, we propose a simple yet effective dual Transformer model for text-based person search. By exploiting a hardness-aware contrastive learning strategy, our model achieves state-of-the-art performance without any special design for local feature alignment or side information. Moreover, we propose a proximity data generation (PDG) module to automatically produce more diverse data for cross-modal training. The PDG module first introduces an automatic generation algorithm based on a text-to-image diffusion model, which generates new text-image pair samples in the proximity space of original ones. Then it combines approximate text generation and feature-level mixup during training to further strengthen the data diversity. The PDG module can largely guarantee the reasonability of the generated samples that are directly used for training without any human inspection for noise rejection. It improves the performance of our model significantly, providing a feasible solution to the data insufficiency problem faced by such fine-grained visual-linguistic tasks. Extensive experiments on two popular datasets of the TBPS task (i.e., CUHK-PEDES and ICFG-PEDES) show that the proposed approach outperforms state-of-the-art approaches evidently, e.g., improving by 3.88%, 4.02%, 2.92% in terms of Top1, Top5, Top10 on CUHK-PEDES. The codes will be available at https://github.com/HCPLab-SYSU/PersonSearch-CTLG","url_abs":"https://arxiv.org/abs/2311.09084v1","url_pdf":"https://arxiv.org/pdf/2311.09084v1.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":"contrastive-transformer-learning-with","repo_url":"https://github.com/hcplab-sysu/personsearch-ctlg","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"contrastive-learning","task_name":"Contrastive Learning"},{"task_slug":"cross-modal-retrieval","task_name":"Cross-Modal Retrieval"},{"task_slug":"descriptive","task_name":"Descriptive"},{"task_slug":"person-search","task_name":"Person Search"},{"task_slug":"text-generation","task_name":"Text Generation"},{"task_slug":"text-based-person-search","task_name":"Text based Person Search"}],"methods":[{"method_slug":"align","method_name":"ALIGN"},{"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":"contrastive-learning","method_name":"Contrastive Learning"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"diffusion","method_name":"Diffusion"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"focus","method_name":"Focus"},{"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":"mixup","method_name":"Mixup"},{"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":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2311.09084","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2311.09084"}},"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/hcplab-sysu/personsearch-ctlg","reach":{"status":"ok"}}],"summary":{"ran_fixture":2,"ran":5},"by_repo_kind":{"official":{"samples":7,"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":7,"samples":[{"code_sha256_prefix":"971ae8d2d8313e30","entry":"drop_path","repo":"hcplab-sysu/personsearch-ctlg","repo_kind":"official","path":"models/vit.py","file_url":"https://github.com/hcplab-sysu/personsearch-ctlg/blob/HEAD/models/vit.py","link_basis":"harvester_set","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":"971ae8d2d8313e30"}},{"code_sha256_prefix":"1b59d3b93db06ff9","entry":"load_state_dict","repo":"hcplab-sysu/personsearch-ctlg","repo_kind":"official","path":"models/vit.py","file_url":"https://github.com/hcplab-sysu/personsearch-ctlg/blob/HEAD/models/vit.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1b59d3b93db06ff9"}},{"code_sha256_prefix":"87e153290f393327","entry":"lr_scheduler","repo":"hcplab-sysu/personsearch-ctlg","repo_kind":"official","path":"function.py","file_url":"https://github.com/hcplab-sysu/personsearch-ctlg/blob/HEAD/function.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"87e153290f393327"}},{"code_sha256_prefix":"0804760f3898632b","entry":"optimizer_function","repo":"hcplab-sysu/personsearch-ctlg","repo_kind":"official","path":"function.py","file_url":"https://github.com/hcplab-sysu/personsearch-ctlg/blob/HEAD/function.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"0804760f3898632b"}},{"code_sha256_prefix":"574e71d15f0a0bc4","entry":"reshape_transform","repo":"hcplab-sysu/personsearch-ctlg","repo_kind":"official","path":"grad_cam_vis.py","file_url":"https://github.com/hcplab-sysu/personsearch-ctlg/blob/HEAD/grad_cam_vis.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"574e71d15f0a0bc4"}},{"code_sha256_prefix":"93d720e560c7f46e","entry":"test","repo":"hcplab-sysu/personsearch-ctlg","repo_kind":"official","path":"cross_visualize.py","file_url":"https://github.com/hcplab-sysu/personsearch-ctlg/blob/HEAD/cross_visualize.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"93d720e560c7f46e"}},{"code_sha256_prefix":"02566da69866c48c","entry":"trunc_normal_","repo":"hcplab-sysu/personsearch-ctlg","repo_kind":"official","path":"models/vit.py","file_url":"https://github.com/hcplab-sysu/personsearch-ctlg/blob/HEAD/models/vit.py","link_basis":"harvester_set","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":"02566da69866c48c"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}