Papers › BadHash: Invisible Backdoor Attacks against Deep Hashing with Clean Label

BadHash: Invisible Backdoor Attacks against Deep Hashing with Clean Label

1 Jul 2022arXiv:2207.00278archive 2025-07-28

Shengshan Hu, Ziqi Zhou, Yechao Zhang, Leo Yu Zhang, Yifeng Zheng, Yuanyuan HE, Hai Jin

Due to its powerful feature learning capability and high efficiency, deep hashing has achieved great success in large-scale image retrieval. Meanwhile, extensive works have demonstrated that deep neural networks (DNNs) are susceptible to adversarial examples, and exploring adversarial attack against deep hashing has attracted many research efforts. Nevertheless, backdoor attack, another famous threat to DNNs, has not been studied for deep hashing yet. Although various backdoor attacks have been proposed in the field of image classification, existing approaches failed to realize a truly imperceptive backdoor attack that enjoys invisible triggers and clean label setting simultaneously, and they also cannot meet the intrinsic demand of image retrieval backdoor. In this paper, we propose BadHash, the first generative-based imperceptible backdoor attack against deep hashing, which can effectively generate invisible and input-specific poisoned images with clean label. Specifically, we first propose a new conditional generative adversarial network (cGAN) pipeline to effectively generate poisoned samples. For any given benign image, it seeks to generate a natural-looking poisoned counterpart with a unique invisible trigger. In order to improve the attack effectiveness, we introduce a label-based contrastive learning network LabCLN to exploit the semantic characteristics of different labels, which are subsequently used for confusing and misleading the target model to learn the embedded trigger. We finally explore the mechanism of backdoor attacks on image retrieval in the hash space. Extensive experiments on multiple benchmark datasets verify that BadHash can generate imperceptible poisoned samples with strong attack ability and transferability over state-of-the-art deep hashing schemes.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2207.00278")

Code

Syntology Ran 1 of 12 code samples harvested from 1 repository linked to this paper; 11 have no recorded run. Of those that ran: 1 ran · our draft was wrong.

By repository: official repository: 12 samples from 1 repository, 1 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

cgcl-codes/badhash officialmentioned in paperpytorchMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

12 samples harvested; 1 ran; 0 honoured the contract we drafted; 11 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · our draft was wrong
11unverified

Licence: 0 of the 12 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from cgcl-codes/badhash. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: 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. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

l2normalize cgcl-codes/badhash/model/spectral_norm.py official repository ran · our draft was wrong fingerprinted MIT (permissive) · bedff51745d2cf84 · report
CalcHammingDist cgcl-codes/badhash/utils/hamming_matching.py official repository unverified MIT (permissive) · fec8bc71986e9775 · report
CalcMap cgcl-codes/badhash/utils/hamming_matching.py official repository unverified MIT (permissive) · 0d0f5f9ab369ac01 · report
CalcSim cgcl-codes/badhash/model/utils.py official repository unverified MIT (permissive) · a1703482ab911f6a · report
compute_result cgcl-codes/badhash/utils/hamming_matching.py official repository unverified MIT (permissive) · e41e957d5b40db30 · report
get_data cgcl-codes/badhash/utils/data_provider.py official repository unverified MIT (permissive) · a3c3e950fd3ba00c · report
get_scheduler cgcl-codes/badhash/model/module.py official repository unverified MIT (permissive) · 0427d9736d5128bb · report
load_label cgcl-codes/badhash/utils/data_provider.py official repository unverified MIT (permissive) · 8edd0019ee4ece92 · report
log_trick cgcl-codes/badhash/model/utils.py official repository unverified MIT (permissive) · 62659c288a716208 · report
remove_spectral_norm cgcl-codes/badhash/model/spectral_norm.py official repository unverified MIT (permissive) · b68aa157100e24b9 · report
smooth_one_hot cgcl-codes/badhash/model/utils.py official repository unverified MIT (permissive) · 52dca59d4bef58a4 · report
spectral_norm cgcl-codes/badhash/model/spectral_norm.py official repository unverified MIT (permissive) · 80dbe040cd85c98b · report

Tasks

Adversarial AttackBackdoor AttackContrastive LearningDeep HashingImage ClassificationImage RetrievalRetrievalimage-classification

1 archive task tag without a task page not shown.

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Contrastive Learning

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections