Abstract
As real-world images come in varying sizes, the machine learning model is part of a larger system that includes an upstream image scaling algorithm. In this paper, we investigate the interplay between vulnerabilities of the image scaling procedure and machine learning models in the decision-based black-box setting. We propose a novel sampling strategy to make a black-box attack exploit vulnerabilities in scaling algorithms, scaling defenses, and the final machine learning model in an end-to-end manner. Based on this scaling-aware attack, we reveal that most existing scaling defenses are ineffective under threat from downstream models. Moreover, we empirically observe that standard black-box attacks can significantly improve their performance by exploiting the vulnerable scaling procedure. We further demonstrate this problem on a commercial Image Analysis API with decision-based black-box attacks.
Introduction
In practical deployments, machine learning (ML) models rarely process raw images directly. Instead, images of various resolutions are typically resized by an upstream image-scaling algorithm (e.g., bilinear or bicubic interpolation) to fit the model's fixed input dimensions (e.g., 224x224). While previous research has explored vulnerabilities in scaling and ML models independently, this work identifies a critical security "weak link" in their interplay.
Traditional "image-scaling attacks" aim to manipulate the resized output to resemble a different target image, but these are often mitigated by specialized scaling defenses. Conversely, standard black-box adversarial attacks on the model itself are often query-intensive and produce noticeable noise. This paper demonstrates that an attacker aware of the scaling process can "hide" adversarial perturbations within scaling artifacts, creating more potent and query-efficient attacks that bypass most existing defenses.
Methodology: Scaling-aware Noise Sampling (SNS)
The core contribution is Scaling-aware Noise Sampling (SNS), a plug-and-play technique for decision-based black-box attacks. Unlike traditional attacks that sample noise in the high-resolution (HR) space or the low-resolution (LR) space independently, SNS bridges these domains to exploit the entire pipeline.
The SNS strategy involves several key steps:
- Knowledge Inference: Inferring the scaling and defense mechanisms used in the pipeline.
- Vulnerability Encoding: Sampling noise in the LR space (the model's input size) and projecting it back to the HR space using the gradient of the scaling function. This ensures noise is concentrated on pixels that the scaling algorithm weights most heavily.
- Efficient Approximation: Using a gradient-based projection to maintain computational efficiency without solving complex optimization problems for every sample.
- Bypassing Defenses: Developing specific strategies for common defenses, such as trimmed weighted averages for median filtering and offline Expectation over Transformation (EOT) for randomized defenses.
Experimental Evaluation
The proposed approach was evaluated on ImageNet (1,000 images) and CelebA (1,000 images) datasets. High-resolution attacks were conducted at 672x672, while the baseline low-resolution attacks used 224x224. The practical threat was further validated against the Tencent Cloud Image Analysis API, a real-world commercial system.
Key Results and Insights
The experiments reveal that scaling acts as an amplifier for adversarial noise. By targeting the "vulnerable pixels" favored by scaling kernels, attackers achieve their goals with significantly less total perturbation.
- Query Efficiency: As shown in the results, the HR attack using SNS (green lines) consistently outperforms both the LR baseline (dashed black) and HR attacks without SNS (orange triangles). For example, on CelebA, with 10k queries, the HR attack achieved a ~60% success rate at low perturbation levels where the LR attack only reached ~11%.
- Stealthiness: HR attacks produce adversarial examples with significantly lower $\ell_2$ distortion, making them harder to detect visually compared to standard LR attacks.
- Defense Ineffectiveness: The authors successfully bypassed 4 out of 5 state-of-the-art scaling defenses. Most existing defenses focus on preventing "image-scaling attacks" (e.g., changing a cat to a dog) and fail to account for adversarial noise crafted to survive the scaling process.
Conclusion
This research highlights that the security of ML systems cannot be evaluated in isolation from their preprocessing pipelines. Scaling-aware attacks represent a significant advancement in black-box adversarial techniques, offering superior query efficiency and stealth. While randomized filtering defenses showed some robustness, most current spatial and frequency-domain defenses are insufficient. Future work should investigate vulnerabilities in other preprocessing steps like JPEG compression or color space conversion to build more holistic defenses.
Summary updated