Cross-modal Adversarial Reprogramming

Paarth Neekhara, Shehzeen Hussain, Jinglong Du, Shlomo Dubnov, Farinaz Koushanfar, Julian J. McAuley

Abstract

Researchers from UC San Diego have demonstrated that frozen image classification models can be "hijacked" to perform entirely different tasks, such as sentiment analysis or DNA sequencing, without modifying the network's weights. By learning a simple "adversarial program" that translates discrete text or genetic tokens into image patches, Vision Transformers (ViTs) and CNNs can be repurposed across data modalities. This discovery highlights a significant security vulnerability for cloud-hosted AI services, where attackers could exploit remote computational resources for unauthorized tasks.

Introduction

In the standard machine learning paradigm, adapting a model trained on one domain (e.g., natural images) to another typically involves transfer learning, which requires fine-tuning the model's parameters. Adversarial Reprogramming presents a more radical alternative: repurposing a model without any internal modifications. While previous work focused on intra-modal reprogramming (e.g., using an ImageNet classifier for MNIST digits), this paper explores the "cross-modal" challenge: can a model trained on pixels be forced to process discrete sequences like human language or genetic code?

Methodology

The proposed Cross-modal Adversarial Reprogramming framework consists of two primary components: the Adversarial Program and Label Remapping.

The cross-modal adversarial reprogramming pipeline, showing how text sequences are converted into tiled image patches for a victim classifier.

The Adversarial Program ($f_\theta$)

Because the victim model expects image data, the adversarial program "draws" sequences. Each discrete token (e.g., a word or a DNA base) is mapped to a learnable $p \times p$ pixel patch embedding. These patches are then tiled to form a complete image.

  • Unbounded attacks: The entire input image is composed of these learned patches.
  • Bounded attacks: The patches are treated as a subtle perturbation added to a legitimate "base" image, effectively hiding the repurposed task from human observers.

Label Remapping ($f_L$)

To extract a sequence-based answer from an image-based model, the researchers map the model's original output classes to the target task's classes. A "many-to-one" mapping strategy—assigning multiple ImageNet categories to a single target category—was found to be most effective. Crucially, only the token-to-patch embeddings and the label mapping are trained; the backbone image classifier remains strictly frozen.

Experimental Results

The researchers evaluated four architectures (ViT-Base, ResNet-50, Inception-V3, and EfficientNet-B4) across tasks including sentiment analysis (Yelp, IMDB), topic classification (AG News), and DNA sequence classification.

Comparison of unbounded and bounded adversarial inputs for DNA sequencing tasks across ViT and ResNet-50 architectures.

Performance and Stealth

The reprogrammed Vision Transformer (ViT) achieved remarkable results, reaching 92.8% accuracy on Yelp and 95.3% on DNA Splice detection. These figures outperform standard baselines like TF-IDF and rival specialized models like LSTMs. In the "bounded" setting, where the attack is disguised as subtle noise (L∞ norm of 0.1), the ViT still maintained high performance (88.5% on Yelp), demonstrating the stealth potential of these attacks.

Architectural Insights

A key finding is that Vision Transformers are natural polyglots. ViTs outperformed CNNs on 5 out of 6 tasks, likely because their architecture already treats images as sequences of patches. Furthermore, pre-training on ImageNet was found to be essential; the "features" learned from natural images provide a powerful inductive bias that facilitates solving unrelated sequence tasks.

Conclusion

This work demonstrates that neural networks contain "circuits" versatile enough to be repurposed across modalities. While this reveals the impressive flexibility of pre-trained representations, it also poses a major security risk. Attackers could "steal" the computational power of cloud-hosted APIs to run unauthorized or resource-heavy tasks. Future research must focus on developing defense mechanisms to detect when a model is being adversarially repurposed outside its intended domain.

Summary updated

BibTeX
@inproceedings{neekhara2022cross,
  author = {Paarth Neekhara and Shehzeen Hussain and Jinglong Du and Shlomo Dubnov and Farinaz Koushanfar and Julian J. McAuley},
  title = {{Cross-modal Adversarial Reprogramming}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2022},
  doi = {10.1109/wacv51458.2022.00295},
}
Figure