You See What I Want You To See: Exploring Targeted Black-Box Transferability Attack for Hash-Based Image Retrieval Systems

Yanru Xiao, Cong Wang

Abstract

With the large multimedia content online, deep hashing has become a popular method for efficient image retrieval and storage. However, by inheriting the algorithmic backend from softmax classification, these techniques are vulnerable to the well-known adversarial examples as well. The massive collection of online images into the database also opens up new attack vectors. Attackers can embed adversarial images into the database and target specific categories to be retrieved by user queries. In this paper, we start from an adversarial standpoint to explore and enhance the capacity of targeted black-box transferability attack for deep hashing. We motivate this work by a series of empirical studies to see the unique challenges in image retrieval. We study the relations between adversarial subspace and black-box transferability via utilizing random noise as a proxy. Then we develop a new attack that is simultaneously adversarial and robust to noise to enhance transferability. Our experimental results demonstrate about 1.2-3x improvements of black-box transferability compared with the state-of-the-art mechanisms.

The Challenge of Black-Box Hashing

Deep hashing has become the industry standard for large-scale image retrieval, used in systems like Google Image Search and Pinterest. It works by mapping images into a "Hamming space"—a sequence of binary codes (0s and 1s)—where semantically similar images are assigned similar codes. While these systems are known to be vulnerable to adversarial attacks in "white-box" settings (where the attacker has full access to the model), real-world systems are typically "black-boxes."

Attacking a black-box system requires transferability: an adversarial image crafted for one model must also deceive a different, unknown model. Researchers found that targeted attacks in hashing are exceptionally difficult. Unlike standard classification (softmax), where an attacker just needs to shift an image into the "top" class, retrieval requires the adversarial code to fall within a very specific, tiny radius (the retrieval threshold) in a massive binary space. As shown in Figure 1, standard methods that work well for softmax classification often have a transfer success rate of less than 1% in hashing systems.

Comparison of attack success rates between Softmax classification (a) and Deep Hashing (b), highlighting the significantly lower black-box transferability in hashing systems.

Methodology: Mining Vulnerability and NAG

To bridge this gap, the authors introduced two primary concepts to improve transferability:

1. Vulnerable Pairs Mining

The researchers discovered that certain pairs of (source image, target category) are naturally more "vulnerable" and transfer more easily between models. These can be identified by analyzing the Hamming distance in a local white-box model. As illustrated in Figure 2, vulnerable pairs exhibit a distinct distribution in Hamming space compared to normal pairs, making them strategic targets for successful black-box transfers.

Analysis of successful vs. unsuccessful transfers in HashNet. (a) shows the relationship between white-box and black-box Hamming distances, while (b) illustrates the distinct distributions for vulnerable vs. normal image pairs.

2. Noise-induced Adversarial Generation (NAG)

NAG is the core algorithm developed to enhance transferability. Instead of finding a single point that tricks the model, NAG seeks an "Adversarial Sphere." The intuition is that if an adversarial image is "robust"—meaning it still tricks the model even when random Gaussian noise is added—it is much more likely to reside in a large adversarial subspace that overlaps with the decision boundaries of an unknown black-box model. The algorithm uses Lagrangian relaxation to solve a constrained optimization problem: minimizing the distance to the target category while ensuring the image remains adversarial even under noise perturbations.

Key Insights and Results

One of the most elegant ideas in the study is using random noise as a proxy to estimate the "volume" of the adversarial region. A "thin" adversarial region is easy for a white-box model to find but unlikely to exist in a different black-box model. A "fat" region (one that survives noise) is much more likely to transfer successfully.

The study utilized the ImageNet dataset, evaluating the attack across six different deep architectures, including ResNet and DenseNet variants. Key results include:

  • Significant Boost in Success: For "vulnerable pairs," NAG achieved an average success rate of 16.85%, compared to roughly 11% for state-of-the-art baselines like PGD or Diversity Inputs (DI).
  • Model Combinations: In specific scenarios, such as transferring from ResNet152 to ResNet101, NAG provided a 2–3× performance boost over existing methods.
  • Qualitative Impact: Case studies demonstrated the ability to force queries for political figures to return unrelated images (e.g., specific clothing items) from a database, highlighting the potential for unauthorized advertising or misinformation.

Conclusion and Future Work

While NAG provides a massive relative improvement, absolute success rates for "normal" pairs remain low (around 1.82%), suggesting that black-box hashing systems possess a degree of natural resistance. Future research may explore ensemble attacks to further expand the adversarial sphere or focus on developing hashing-specific defense mechanisms that can shrink these vulnerable regions without compromising retrieval accuracy.

Summary updated

BibTeX
@inproceedings{xiao2021you,
  author = {Yanru Xiao and Cong Wang},
  title = {{You See What I Want You To See: Exploring Targeted Black-Box Transferability Attack for Hash-Based Image Retrieval Systems}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2021},
  url = {https://openreview.net/forum?id=0_WF9DFNSuV},
}
Figure