Introduction
In the realm of adversarial machine learning, most research focuses on integrity attacks—manipulating inputs to cause misclassification. However, as deep learning models are increasingly deployed in time-critical systems like autonomous vehicles and real-time surveillance, the availability of these models becomes a primary security concern. This paper explores "sponge attacks," which aim to deplete computational resources and increase latency, effectively causing a denial-of-service (DoS) condition. Specifically, we investigate and enhance the "PhantomSponges" attack against the YOLOv5 object detection architecture.
The Vulnerability: Non-Maximum Suppression (NMS)
The bottleneck in many object detection pipelines is the Non-Maximum Suppression (NMS) algorithm. NMS is responsible for pruning redundant, overlapping bounding boxes to ensure that each detected object is represented by a single, optimal box. The computational complexity of NMS scales with the number of candidate boxes. By flooding the model with "phantom" boxes—predictions that do not overlap enough to be pruned but are numerous enough to overwhelm the processor—an attacker can trigger a massive slowdown.
The Enhanced PhantomSponges Attack
We introduce an Enhanced PhantomSponges attack that optimizes the generation of these phantom boxes. While previous iterations focused on minimizing box size, our approach utilizes a novel IoU-Targeted Loss. This loss function specifically minimizes the Intersection over Union (IoU) between all predicted bounding boxes, ensuring they remain distinct and forcing the NMS algorithm to iterate through every single candidate.
To make the attack practical, we employ Universal Adversarial Perturbations (UAPs). This allows a single, pre-calculated noise pattern to be applied to any input image to trigger the latency spike, removing the need for per-image optimization during deployment.
Proposed Defense: Dynamic Resizing
To counter these attacks, we propose a simple yet effective defense: dynamic image resizing. By randomly scaling the y-axis of input images before they reach the model, we can disrupt the precise pixel-level alignment required by the UAP. Because the adversarial noise is finely tuned to the original image dimensions, this geometric shift "breaks" the attack, allowing the NMS algorithm to function at near-normal speeds.
Experimental Results
Our evaluation used the Berkeley Deep Drive (BDD100K) dataset across various YOLOv5 model sizes (Nano, Small, Medium, and Large). The results demonstrate the extreme potency of the enhanced attack and the robustness of the dynamic resizing defense.
As shown in the experimental data, the enhanced attack can achieve up to a 550% increase in NMS execution time on the YOLOv5 small model. Interestingly, we observed a "Dual Impact" phenomenon where the attack occasionally increased recall. This suggests the attack forces the model into an "over-eager" state, generating so many boxes that it accidentally captures objects it might otherwise miss, though at a prohibitive computational cost.
The defense mechanism proved highly effective. For instance, applying dynamic resizing to an attacked YOLOv5 large model resulted in a 90.18% decrease in NMS execution time, successfully restoring the system's real-time performance capabilities.
Conclusion
This research highlights that post-processing stages like NMS are significant security vulnerabilities in modern computer vision pipelines. While the Enhanced PhantomSponges attack poses a serious threat to system availability, our findings suggest that simple geometric defenses like dynamic resizing can provide a high degree of robustness. Future work will investigate the transferability of these attacks to other architectures, such as Faster R-CNN and Vision Transformers.
Summary updated