arXiv:2610.10436cs.CVOct 2026

Manuscript Offprint

arXiv:2610.10436

Detecting Adversarial Images through Response Profiles of Vision-Language Models

Arash Vashagh, Roozbeh Razavi-Far

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Arash Vashagh and Roozbeh Razavi-Far

Trustworthy and Secure AI (TSAI) Lab, Faculty of Computer Science, University of New Brunswick, Canada

Email: arash.vashagh@unb.ca, roozbeh.razavi-far@unb.ca

Abstract—Adversarial perturbations can alter the predictions of frozen vision-language models (VLMs) while leaving their confidence and image-text similarity patterns seemingly plausible. We investigate whether we can identify adversarial inputs based on the broader way an image interacts with a collection of general semantic prompts. Our detector summarizes these responses using category-level statistics, relationships among prompts, deviations from clean reference distributions, and stability under weak image transformations, producing a compact response profile that is classified by a lightweight model while the VLM remains fixed. We evaluate the approach on multiple public image datasets, several CLIP-style visual backbones, and a range of gradient-based, optimization-based, automated, and spatial attacks. The detector achieves strong discrimination in attack-specific settings and retains substantial performance when evaluated on attacks not seen during training. Under a controlled detector-specific protocol, the response-profile representation outperforms the evaluated embedding-geometry baselines. Additional analyses show that the feature groups provide complementary information and that the method remains effective under variations in the prompt configuration. We also examine inference cost and performance against detector-aware adaptive attacks. Overall, the results indicate that response patterns across semantic prompts provide a useful complementary signal for adversarial image detection in frozen VLMs.

Index Terms—adversarial examples, adversarial detection, vision-language models, CLIP, trustworthy machine learning

I. INTRODUCTION

Vision-language models (VLMs) have become a central component of modern AI systems [1]-[3]. Models such as CLIP [1] align images and natural-language descriptions in a shared representation space, enabling zero-shot recognition, multimodal retrieval, and open-vocabulary reasoning without task-specific retraining. These capabilities make VLM representations attractive for downstream systems that must interpret visual inputs through flexible semantic concepts. Their growing use in applications such as content moderation and autonomous systems [4] also makes the reliability of these representations increasingly important.

Despite their strong generalization capabilities, VLMs remain vulnerable to adversarial perturbations. As with conventional vision models, small input perturbations can change the model prediction while leaving the image visually similar to the original [5]–[8]. Detecting such inputs is challenging because an adversarial example does not necessarily produce an obviously abnormal final confidence score. A successful perturbation may still yield a confident zero-shot prediction or apparently plausible image-text similarities. Consequently, examining only the final classifier output can discard information contained in the broader representation produced by the VLM.

Existing adversarial detectors exploit several forms of representation abnormality. Confidence-based approaches use quantities such as maximum softmax probability or energy scores [9], [10]. Other methods measure sensitivity to input transformations, density in feature space, local intrinsic dimensionality, Mahalanobis distance, or related representation statistics [11]–[13]. More recent VLM-specific methods analyze geometric properties of pretrained multimodal embeddings, attention responses, or learned semantic priors [14]–[17]. These approaches demonstrate that adversarial perturbations can leave detectable signatures beyond the final prediction.

Our motivation is that a frozen VLM provides another source of information that is naturally available but not fully represented by a single confidence score or embedding-space distance: its pattern of responses across many text prompts. Given an image and a collection of text prompts, a CLIP-style model produces a vector of image-text similarities rather than a single scalar output. This vector describes how the image is positioned relative to multiple directions in the joint vision-language space. Adversarial perturbations that alter the image representation can therefore change not only the predicted dataset class, but also the distribution, local relationships, reference deviations, and transformation behavior of these prompt-conditioned responses.

This observation motivates treating adversarial detection as a response-profiling problem. Instead of asking only whether the input has low confidence or lies far from clean samples in the image embedding space, we characterize how the input interacts with a fixed semantic reference space. We use general prompts that are separate from the dataset class prompts used by the zero-shot classifier. Their image-text similarities provide a reusable representation from which we can extract several complementary measurements.

The novelty of our approach lies in constructing a compact detector representation from multiple properties of this prompt-conditioned response. First, category-level statistics summarize how similarity mass is distributed across broad semantic groups. Second, we use a graph built from text-embedding relationships to measure global and local variation among prompt responses. Third, clean-reference residuals quantify how the observed response differs from response distributions estimated from clean training images. Fourth, graph diffusion measures how the response changes under smoothing over related prompts. Finally, weak transformations of the input provide stability measurements that characterize how the VLM response changes under small image modifications. These components are concatenated into a compact response profile and classified by a lightweight multilayer perceptron.

This design differs from existing VLM-based adversarial detectors in both the representation analyzed and how the pretrained model is used. Geometry-based methods such as GeoDetect operate primarily on distances or density-related properties of pretrained embeddings [15], while prompt-based irrelevant probing (PIP) uses attention responses generated by irrelevant probing questions [16]. Our method instead operates directly on the pattern of image-text similarities generated by a fixed prompt bank and combines several summaries of that response into a single detector representation. The underlying image encoder, text encoder, prompt embeddings, and prompt graph remain frozen; only the small detector operating on the extracted features is trained.

An additional motivation for this design is interpretability at the feature-group level. Because the final detector operates on an explicitly constructed low-dimensional representation rather than a newly learned VLM representation, we can evaluate the contributions of different signal families separately. We can therefore remove or combine category, graph, residual, and transformation-stability components without modifying the frozen backbone. This lets us study the detector as a composition of measurable response properties rather than an opaque classifier operating directly on high-dimensional pretrained embeddings.

We evaluate the proposed detector across CIFAR-10, STL-10, and Tiny-ImageNet using ViT-B/16, ViT-B/32, and ConvNeXt CLIP-style backbones. The evaluation covers PGD, MI-FGSM, CW, AutoAttack, and flow-based attacks under both standard attack-specific and cross-attack settings. We additionally evaluate a confidence-based MSP detector, compare against embedding-geometry detectors under a controlled protocol, measure the contribution of individual feature groups through controlled ablations, quantify inference cost, and study detector-aware attacks. Together, these experiments evaluate both the effectiveness and generalization of the proposed response representation and the contribution of its individual components.

Our contributions are summarized as follows:

• We introduce adversarial image detection through prompt-conditioned response profiling, using the pattern of image-text similarities produced by a frozen VLM as the basis for detection.

• We develop a compact representation that combines category-level statistics, prompt-graph measurements, clean-reference residuals, graph-diffusion features, and transformation-stability features while keeping the underlying VLM fixed.

• We use a lightweight MLP detector that operates only on the extracted response profile, enabling analysis of individual feature groups without fine-tuning the VLM backbone.

• We provide a multi-dataset, multi-backbone, and multi-attack evaluation including standard and cross-attack detection, a confidence baseline, controlled comparisons with embedding-geometry detectors, feature ablations, runtime measurements, and detector-aware evaluation.

References (34)