Abstract
Deep Neural Networks (DNNs) used in object detection are highly susceptible to adversarial attacks that can cause misclassification, object disappearance, or the creation of "ghost" objects. This paper presents a novel, model-agnostic defense framework that leverages the contextual "common sense" inherent in large-scale language models. By translating visual detection results into a pseudo-language called SCENE-Lang and utilizing a BERT-based architecture (SCENE-BERT) to verify contextual consistency, the proposed method effectively identifies adversarial anomalies. Experimental results on PASCAL VOC and MS COCO datasets demonstrate that this approach significantly outperforms existing state-of-the-art context-based defenses while remaining compatible with any off-the-shelf object detector.
Introduction
Adversarial examples—inputs meticulously engineered to deceive machine learning models—pose a critical security risk to autonomous systems. In the realm of object detection, an attacker might perturb an image so that a "STOP" sign is interpreted as a speed limit sign, or a pedestrian becomes invisible to a vehicle's vision system.
Humans naturally mitigate such errors by relying on environmental context; for instance, one does not expect to find a toothbrush on a city bus or a refrigerator in a forest. However, most modern object detectors process objects in relative isolation. While previous research has attempted to integrate context into defense, these solutions were often "model-dependent," requiring deep integration into specific architectures like Faster R-CNN. This paper introduces a model-agnostic defense that acts as a post-processing filter, applicable to any detector (e.g., YOLO, SSD) without requiring retraining of the vision model.
Methodology
The proposed defense operates through a two-stage pipeline: scene translation and contextual verification.
SCENE-Lang: Representing Scenes as Sentences
To bridge the gap between computer vision and natural language processing, the authors developed SCENE-Lang. This pseudo-language represents a detected scene as a sequence of tokens. Each token is a tuple containing a coarse-grained spatial location and an object category label. The image is divided into a grid (e.g., 3x3), and detections are mapped to these cells based on their center coordinates. For example, an elephant detected in the center-right of an image might be represented as the token <5, elephant>.
SCENE-BERT: Learning Scene Grammar
The core of the system is SCENE-BERT, a transformer-based model adapted from the BERT architecture. Unlike standard BERT, which learns word relationships in text, SCENE-BERT is trained on clean image datasets to learn the "grammar" of real-world scenes—specifically, which objects typically appear together and in what spatial configurations.
The Detection Mechanism
During inference, the system performs a consistency check on the detector's output. It sequentially masks each detected object and asks SCENE-BERT to predict the most likely object for that location based on the surrounding context. If the detector's original output (e.g., "toothbrush") deviates significantly from SCENE-BERT's high-probability prediction (e.g., "signal"), the system flags the image as an adversarial attack. This "Masked Scene Modeling" effectively uses global context to validate local detections.
Experimental Evaluation
The researchers evaluated the framework using two primary benchmarks:
- PASCAL VOC: A dataset with 20 categories, representing relatively simple scenes.
- MS COCO: A complex dataset with 80 categories and an average of 7.7 objects per image, offering a dense contextual environment.
The defense was tested against various attack types, including misclassification (changing a label), hiding (removing a label), and appearing (adding a fake label), across different victim models like YOLO and Faster R-CNN.
Key Results and Insights
- High Detection Performance: The method achieved an ROC-AUC of over 0.72 in most test cases. It consistently outperformed context-agnostic baselines like "Feature Squeezing" and surpassed the previous state-of-the-art context-based detector (SCEME) by 12-69% in AUC.
- Importance of Spatial Context: A key finding was that "SCENE-BERT Strict" (considering both location and label) significantly outperformed a "Relaxed" version that ignored spatial data. This confirms that where an object is located relative to others is vital for contextual reasoning.
- Robustness Across Models: Because the defense only analyzes the final labels and locations, it proved equally effective regardless of the underlying object detection architecture.
Limitations and Future Work
While highly effective, the system has a specific "blind spot": context-consistent attacks. If an attacker can successfully change an object into another category that is contextually plausible (e.g., changing a van to a car), SCENE-BERT may not flag it. Additionally, rare but benign scenes—such as surreal art or highly unusual real-world events—might trigger false positives. Future work aims to incorporate larger, more diverse training sets to improve the model's understanding of rare contextual relationships and reduce false alarm rates.
Summary updated