{"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/towards-hard-positive-query-mining-for-detr","title":"Towards Hard-Positive Query Mining for DETR-based Human-Object Interaction Detection","arxiv_id":"2207.05293","date":"2022-07-12","proceeding":null,"authors":["Xubin Zhong","Changxing Ding","Zijian Li","Shaoli Huang"],"abstract":"Human-Object Interaction (HOI) detection is a core task for high-level image understanding. Recently, Detection Transformer (DETR)-based HOI detectors have become popular due to their superior performance and efficient structure. However, these approaches typically adopt fixed HOI queries for all testing images, which is vulnerable to the location change of objects in one specific image. Accordingly, in this paper, we propose to enhance DETR's robustness by mining hard-positive queries, which are forced to make correct predictions using partial visual cues. First, we explicitly compose hard-positive queries according to the ground-truth (GT) position of labeled human-object pairs for each training image. Specifically, we shift the GT bounding boxes of each labeled human-object pair so that the shifted boxes cover only a certain portion of the GT ones. We encode the coordinates of the shifted boxes for each labeled human-object pair into an HOI query. Second, we implicitly construct another set of hard-positive queries by masking the top scores in cross-attention maps of the decoder layers. The masked attention maps then only cover partial important cues for HOI predictions. Finally, an alternate strategy is proposed that efficiently combines both types of hard queries. In each iteration, both DETR's learnable queries and one selected type of hard-positive queries are adopted for loss computation. Experimental results show that our proposed approach can be widely applied to existing DETR-based HOI detectors. Moreover, we consistently achieve state-of-the-art performance on three benchmarks: HICO-DET, V-COCO, and HOI-A. Code is available at https://github.com/MuchHair/HQM.","url_abs":"https://arxiv.org/abs/2207.05293v1","url_pdf":"https://arxiv.org/pdf/2207.05293v1.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":"towards-hard-positive-query-mining-for-detr","repo_url":"https://github.com/muchhair/hqm","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"human-object-interaction-detection","task_name":"Human-Object Interaction Detection"},{"task_slug":"object","task_name":"Object"}],"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":"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":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2207.05293","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2207.05293"}},"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/muchhair/hqm","reach":{"status":"ok"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/MuchHair/HQM","reach":{"status":"ok"}}],"summary":{"ran":2,"ran_honours":2,"ran_draft_wrong":1},"by_repo_kind":{"official":{"samples":5,"ran":5,"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":5,"samples":[{"code_sha256_prefix":"4cf8a0fe1446f307","entry":"DETRHOI","repo":"MuchHair/HQM","repo_kind":"official","path":"models/Hard_Sample/HQM/hoi_HQM.py","file_url":"https://github.com/MuchHair/HQM/blob/HEAD/models/Hard_Sample/HQM/hoi_HQM.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4cf8a0fe1446f307"}},{"code_sha256_prefix":"d89f278361015fd1","entry":"MLP","repo":"MuchHair/HQM","repo_kind":"official","path":"models/Hard_Sample/HQM/hoi_HQM.py","file_url":"https://github.com/MuchHair/HQM/blob/HEAD/models/Hard_Sample/HQM/hoi_HQM.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d89f278361015fd1"}},{"code_sha256_prefix":"ae8f0c20ba273e10","entry":"box_cxcywh_to_xyxy","repo":"MuchHair/HQM","repo_kind":"official","path":"models/Hard_Sample/HQM/hoi_HQM.py","file_url":"https://github.com/MuchHair/HQM/blob/HEAD/models/Hard_Sample/HQM/hoi_HQM.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ae8f0c20ba273e10"}},{"code_sha256_prefix":"16eb6a3482eb2819","entry":"box_xyxy_to_cxcywh","repo":"MuchHair/HQM","repo_kind":"official","path":"models/Hard_Sample/HQM/hoi_HQM.py","file_url":"https://github.com/MuchHair/HQM/blob/HEAD/models/Hard_Sample/HQM/hoi_HQM.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"16eb6a3482eb2819"}},{"code_sha256_prefix":"f5602847693d22a5","entry":"nested_tensor_from_tensor_list","repo":"MuchHair/HQM","repo_kind":"official","path":"models/Hard_Sample/HQM/hoi_HQM.py","file_url":"https://github.com/MuchHair/HQM/blob/HEAD/models/Hard_Sample/HQM/hoi_HQM.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f5602847693d22a5"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}