Anomaly Unveiled: Securing Image Classification against Adversarial Patch Attacks

Nandish Chattopadhyay, Amira Guesmi, Muhammad Shafique

TL;DR

Researchers have developed a novel, model-agnostic defense that treats adversarial patches—localized "stickers" designed to fool AI—as statistical anomalies. By using the DBSCAN clustering algorithm to isolate and neutralize these patches, the defense restores image classification accuracy from 38.8% to 67.1%, outperforming current state-of-the-art methods like LGS and Jujutsu.

What Problem Does This Paper Address?

Deep Neural Networks (DNNs) are notoriously fragile when faced with adversarial patches. Unlike traditional adversarial attacks that subtly alter every pixel in an image, patch attacks are localized, high-intensity perturbations. Think of them as physical stickers placed on a stop sign to make a self-driving car see a "speed limit" sign instead.

Existing defenses often struggle with a "utility-security" trade-off: they either require expensive model retraining or apply pre-processing filters that degrade the accuracy of perfectly clean images. Furthermore, many defenses fail to distinguish between legitimate image features and adversarial noise, leading to high false-positive rates. This paper seeks a way to "blind" the model to the patch without hurting its ability to see the rest of the image.

Methods

The authors propose a three-stage pipeline that treats adversarial noise as an outlier in the image's information distribution:

  1. Segmenting Phase: The input image is parsed using a moving window to create overlapping segments (kernels). These segments are converted into vectors to be used as data points.
  2. Isolating Phase: The core of the defense. The system applies DBSCAN (Density-Based Spatial Clustering of Applications with Noise), an unsupervised clustering algorithm. Because adversarial patches contain information that diverges significantly from the rest of the image, DBSCAN identifies these segments as "Noise" (outliers) rather than part of a legitimate cluster.
  3. Blocking Phase: Once anomalous segments are identified, they are neutralized. The authors found that replacing these pixels with the mean pixel value of the segment was more effective than using minimum or maximum values.

Crucially, this method is model-agnostic, meaning it can be dropped in front of any existing architecture (ResNet, VGG, etc.) without needing to modify the underlying model.

Datasets

The defense was evaluated using:

  • ImageNet: A standard large-scale dataset for image classification.
  • CalTech-101: Used to demonstrate the transferability and consistency of the defense across different data distributions.
  • Models: The researchers tested the pipeline on ResNet-50, ResNet-152, and VGG-19 to ensure broad applicability.

Key Insights and Ideas

  • The "Aha!" Moment - Mahalanobis Distance: The researchers used the Mahalanobis distance to measure how far patch segments "live" from the rest of the image's distribution. They discovered a clear bi-modal distribution: clean segments cluster together, while adversarial segments form a distinct, high-distance peak. This statistical disparity is what makes anomaly detection so effective.
  • Mean Value Neutralization: Simply "blacking out" a patch isn't always best. The paper notes that replacing identified anomalies with the mean pixel value provides the best recovery of the original model's intent.
  • Resilience to Adaptive Attacks: Even when the authors tried to design a "stealthy" patch that mimics the image's mean and standard deviation (an adaptive attack), the resulting distribution was still "heavy-tailed," allowing the defense to remain effective.

Key Results

The proposed defense significantly outperformed existing benchmarks:

  • Accuracy Boost: Against GoogleAp attacks on ImageNet (using ResNet-50), accuracy jumped from 38.8% (undefended) to 67.1% (defended).
  • Competitive Edge: It surpassed prominent defenses like LGS (53.86%) and Jujutsu (60%).
  • Consistency: The defense maintained high performance across different patch sizes (from 38x38 to 50x50 pixels) and across different neural architectures, proving its robustness.
  • Clean Accuracy: The baseline performance on clean samples remained high (e.g., 78.4% for ResNet-50 on ImageNet), suggesting the defense doesn't overly penalize non-adversarial images.

Limitations and Future Work

While the results are impressive, the paper notes a few areas for growth:

  • Hyperparameter Sensitivity: The effectiveness of DBSCAN depends on tuning parameters like eps (neighborhood distance) and minPts. Finding a "one-size-fits-all" setting for every possible image remains a challenge.
  • Computational Overhead: Running a clustering algorithm on image segments adds a pre-processing step that might impact real-time performance in latency-sensitive applications.
  • Expansion to Other Tasks: The current work focuses on image classification. The authors aim to extend this anomaly-based approach to more complex tasks like object detection and other computer vision challenges in the future.

Summary updated

Abstract

Adversarial patch attacks pose a significant threat to the practical deployment of deep learning systems. However, existing research primarily focuses on image pre-processing defenses, which often result in reduced classification accuracy for clean images and fail to effectively counter physically feasible attacks. In this paper, we investigate the behavior of adversarial patches as anomalies within the distribution of image information and leverage this insight to develop a robust defense strategy. Our proposed defense mechanism utilizes a clustering-based technique called DBSCAN to isolate anomalous image segments, which is carried out by a three-stage pipeline consisting of Segmenting, Isolating, and Blocking phases to identify and mitigate adversarial noise. Upon identifying adversarial components, we neutralize them by replacing them with the mean pixel value, surpassing alternative replacement options. Our model-agnostic defense mechanism is evaluated across multiple models and datasets, demonstrating its effectiveness in countering various adversarial patch attacks in image classification tasks. Our proposed approach significantly improves accuracy, increasing from 38.8\% without the defense to 67.1\% with the defense against LaVAN and GoogleAp attacks, surpassing prominent state-of-the-art methods such as LGS (53.86\%) and Jujutsu (60\%)

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
ImageNet-1K · GoogleAp attack on ImageNetAnomaly Unveiled defense (Ours; DBSCAN-based pipeline)Robust accuracy67.1%attack=GoogleAp · backbone=ResNet-50
Source quote
L332: Ours │ 67.1%
Caltech-101 · GoogleAp attack on CalTech-101Anomaly Unveiled defense (Ours; DBSCAN-based pipeline)Robustness (w/ patch)76.5%attack=GoogleAp · backbone=ResNet-50 · patch-size=38 × 38 · resolution=38x38
Source quote
L268: ResNet 50 │ 90.9% │ 49.2% │ 76.5%
Caltech-101 · LAVAN attack on CalTech-101Anomaly Unveiled defense (Ours; DBSCAN-based pipeline)Robustness (w/ patch)73.6%attack=LaVAN · backbone=ResNet-50 · patch-size=38 × 38 · resolution=38x38
Source quote
L295: ResNet 50 │ 90.9% │ 17.1% │ 73.6%
Reported baseline / comparator measurements (3)
BenchmarkMethodMetricScoreProtocol / Evidence
LaVAN and GoogleAp adversarial patch attacksNo defense (undefended classifier) baselineAccuracy38.8%Abstract reports this as the accuracy before applying the defense; model, dataset, and …
Source quote
L5: Our proposed approach significantly improves accuracy, increasing from 38.8% without the defense to 67.1% with the defense against LaVAN and GoogleAp attacks, surpassing prominent state-of-the-art methods such as LGS \cite{naseer2019local} (53.86%) and Jujutsu \cite{Jujutsu} (60%).
GoogleAp attackLGS baselineRobust accuracy53.86%attack=GoogleAp
Source quote
L324: LGS \cite{naseer2019local} │ 53.86%
GoogleAp attackJujutsu baselineRobust accuracy60%attack=GoogleAp
Source quote
L330: Jujutsu \cite{Jujutsu} │ 60%
BibTeX
@inproceedings{chattopadhyay2024anomaly,
  author = {Nandish Chattopadhyay and Amira Guesmi and Muhammad Shafique},
  title = {{Anomaly Unveiled: Securing Image Classification against Adversarial Patch Attacks}},
  booktitle = {ICIP},
  year = {2024},
  doi = {10.1109/icip51287.2024.10648223},
}

Loading related content...

Figure