HUANG: A Robust Diffusion Model-based Targeted Adversarial Attack Against Deep Hashing Retrieval

Chihan Huang, Xiaobo ShenAAAI 2025 · DOI

TL;DR

This paper introduces HUANG, the first targeted adversarial attack method for deep hashing retrieval that leverages diffusion models. HUANG effectively generates adversarial images that fool hashing retrieval systems by combining semantic learning with a novel adversarial denoising process, achieving state-of-the-art performance in black-box scenarios.

What Problem Does This Paper Address?

Deep hashing models are crucial for efficient image retrieval, compressing high-dimensional data into compact binary codes for fast similarity searches. However, like other deep learning models, they are vulnerable to adversarial attacks. While most adversarial attacks focus on image classification, attacking retrieval models is more challenging because the goal isn't to misclassify an image into a wrong category, but to make the retrieval system return irrelevant or specific other images. Furthermore, targeted attacks, which aim to make retrieval results match a specific target category, are even more complex and destructive. Existing black-box attack methods for deep hashing often suffer from poor robustness, low visual quality, and long inference times. This paper addresses the need for a robust, effective, and visually appealing targeted adversarial attack against deep hashing retrieval systems, particularly in black-box settings where model details are unknown.

Methods

HUANG employs a two-stage approach: Semantic Learning and Adversarial Generation.

  • Semantic Learning: This stage aims to extract rich semantic information from the target label and image. It uses a "Target Fusion" module to combine features from the target label and image, creating "target semantics." These semantics are then fed into a "Target Adaptation" module to generate a reconstructed label and a "prototype code." This process is guided by a reconstruction loss (ensuring the reconstructed label captures target category information) and a similarity loss (minimizing the Hamming distance between the prototype code and the ground truth code). This stage fixes its parameters after learning.
  • Adversarial Generation: This stage utilizes a pre-trained diffusion model. The core innovation here is "Adversarial Denoising." Instead of a standard reverse diffusion process that restores noise to a benign image, HUANG modifies it to generate adversarial images.
  • It incorporates adversarial perturbations and a "residual image" (the difference between the current noisy image and the original benign image) to guide the diffusion process.
  • This dynamic interplay between denoising and adding adversarial perturbations shifts the image distribution from benign to adversarial.
  • The residual image helps to maintain visual similarity to the original benign image, enhancing robustness and transferability.
  • The process is formulated to sample from a conditional distribution that balances the original diffusion process with guidance from adversarial perturbations and target semantics.

Datasets

The paper evaluates HUANG on three standard datasets:

  • FLICKR-25K: 25,000 images across 38 categories.
  • NUS-WIDE: 193,734 images across 21 categories.
  • MS-COCO: 123,287 images across 80 categories.

The authors selected specific subsets for query, training, and database for each dataset. No new benchmarks were introduced.

Key Insights and Ideas

  • Diffusion Models for Attacks: This is the first work to leverage diffusion models for adversarial attacks on deep hashing retrieval. This opens up a new avenue for generating high-quality, sophisticated adversarial examples.
  • Adversarial Denoising: The novel "adversarial denoising" process is key. By dynamically balancing the standard denoising process of diffusion models with adversarial perturbations and the residual image, HUANG achieves both high attack effectiveness and excellent visual quality.
  • Semantic Guidance is Crucial: The semantic learning stage, which extracts and utilizes target label and image semantics, is vital for guiding the adversarial generation process towards specific target categories.
  • Robustness through Dynamic Interplay: The interplay between denoising and adversarial perturbation addition is not just for generating the attack but also imbues the resulting adversarial images with significant robustness against common defense mechanisms.

Key Results

  • State-of-the-Art Performance: HUANG consistently outperforms existing targeted black-box attack methods (DHTA, ProS-GAN, THA, PTA, SAAT) across all tested datasets and hash bit lengths, achieving significant improvements in targeted mean average precision (t-MAP). For example, on FLICKR-25K against DPSH, HUANG achieved an average t-MAP improvement of 10.93% over the previous SOTA model, SAAT.
  • High Visual Quality: Adversarial images generated by HUANG are nearly identical to benign images, with low perceptibility scores (e.g., 1.29 for FLICKR-25K, 1.10 for NUS-WIDE, and 0.98 for MS-COCO with 32-bit DPSH).
  • Robustness: HUANG demonstrates superior robustness against common adversarial defense methods like JPEG compression, feature squeezing, and randomized smoothing, with only a slight decrease in t-MAP.
  • Transferability: The generated adversarial images exhibit strong cross-hash bit transferability, meaning they remain effective across different hash bit configurations.

Limitations and Future Work

  • Computational Cost: While diffusion models offer high quality, they can be computationally intensive. The paper mentions the experimental setup uses a GeForce RTX 4080 GPU, suggesting significant computational resources are needed. The inference time for generating adversarial images is not explicitly detailed but is implied to be better than some prior methods.
  • Ablation Study Highlights Module Importance: The ablation study shows that removing any of the core modules (Target Fusion, Target Adaptation, Adversarial Perturbation, Residual Image, Target Semantic) leads to a decline in attack performance, underscoring the importance of each component. This suggests that further optimization might involve fine-tuning the interaction between these modules.
  • Future Work: The paper doesn't explicitly detail future work directions, but the success in black-box targeted attacks using diffusion models suggests potential for exploring more complex attack scenarios, different diffusion model architectures, or even white-box attacks with diffusion models. The robustness against defenses also opens doors for research into more sophisticated adversarial defense strategies.

Summary updated

BibTeX
@inproceedings{huang2025huang,
  author = {Chihan Huang and Xiaobo Shen},
  title = {{HUANG: A Robust Diffusion Model-based Targeted Adversarial Attack Against Deep Hashing Retrieval}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i4.32377},
}
Figure