Test-Time Backdoor Detection for Object Detection Models

Hangtao Zhang, Yichen Wang, Shihui Yan, Chenyu Zhu, Ziqi Zhou, Linshan Hou, Shengshan Hu, Minghui Li, Yanjun Zhang, Leo Yu Zhang

Abstract

Object detection (OD) models are uniquely vulnerable to backdoor attacks that can cause objects to "vanish" or "ghost" objects to appear. This paper introduces TRACE (TRAnsformation Consistency Evaluation), a black-box, test-time defense designed to identify poisoned samples. TRACE operates as a "firewall," inspecting images by measuring detection stability across contextual and focal transformations. By exploiting the "shortcut learning" nature of backdoor triggers, TRACE achieves a 30% improvement in AUROC over previous state-of-the-art defenses without requiring access to internal model weights.

Introduction

Backdoor attacks involve poisoning a small fraction of training data so that a model learns to behave maliciously when a specific "trigger" (e.g., a small patch or a specific object) is present. While image classification backdoors typically result in simple mislabeling, the effects on Object Detection (OD) are more diverse and damaging:

  • Ghosting: The model detects non-existent objects.
  • Vanishing: The model fails to detect legitimate objects in the scene.
  • Global Misclassification: Every object in a scene is incorrectly labeled.
Comparison of clean vs. backdoored object detection outputs showing ghosting and vanishing effects.

Existing defenses often require "white-box" access to model weights or are limited to classification tasks. TRACE addresses these gaps by providing a black-box, test-time defense that evaluates images as they are processed.

Methodology: TRACE

TRACE relies on two core observations regarding how backdoored models perceive triggers versus natural objects: Contextual Transformation Consistency (CTC) and Focal Transformation Consistency (FTC).

Contextual Transformation Consistency (CTC)

Natural objects are context-dependent; for example, a car's detection confidence usually drops if it is blended into an incongruous background like fire. However, backdoor triggers act as "shortcuts" that the model recognizes regardless of the surrounding scene. TRACE blends test images with various random backgrounds; if detection confidence remains unnaturally stable (low variance), the image is flagged as a likely "ghosting" attack.

Focal Transformation Consistency (FTC)

This metric targets "vanishing" attacks where a trigger renders the model "blind" to a specific region. TRACE slides a "Natural Backdoor Object" (NBO)—a highly recognizable object like a stop sign—across the image. On a clean image, the NBO is detected consistently. On a poisoned image, the NBO's confidence plummets when it overlaps with a hidden trigger. This "Island Effect" (a sharp drop in confidence) reveals the hidden "black hole" created by the trigger.

Example of a vanishing/misclassification attack where a trigger (umbrella) alters the model's prediction.

Experimental Evaluation

TRACE was evaluated using major benchmarks including MS-COCO, PASCAL VOC, and Synthesized Traffic Signs. The researchers tested the defense against seven state-of-the-art backdoor attacks (e.g., OGA, RMA, UTA) across three diverse model architectures: YOLOv5, Faster-RCNN, and DETR.

Key Results

  • Superior Performance: TRACE achieved a 30% improvement in AUROC compared to previous defenses like Detector Cleanse.
  • Universality: The method proved effective against all seven tested attack types, regardless of whether the goal was to add or remove objects.
  • Adaptive Robustness: Even against "omniscient" attackers who knew the TRACE mechanism, bypassing the defense required the attacker to significantly reduce the effectiveness of their own backdoor.

Discussion and Future Work

TRACE demonstrates that semantic-aware changes (swapping backgrounds or adding objects) are more effective at exposing OD backdoor logic than simple pixel-level noise. However, the method introduces computational overhead because it requires multiple model passes per image.

Future research aims to develop "zero-shot" detection methods that maintain high accuracy without the need for multiple transformation passes, potentially enabling real-time protection for video applications and autonomous systems.

Summary updated

BibTeX
@inproceedings{zhang2025test,
  author = {Hangtao Zhang and Yichen Wang and Shihui Yan and Chenyu Zhu and Ziqi Zhou and Linshan Hou and Shengshan Hu and Minghui Li and Yanjun Zhang and Leo Yu Zhang},
  title = {{Test-Time Backdoor Detection for Object Detection Models}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2025},
  doi = {10.1109/cvpr52734.2025.02270},
}
Figure