arXiv:2609.03139cs.CVSep 2026

Manuscript Offprint

arXiv:2609.03139

Beyond Small Patches: Black-Box Detection and Purification of Diverse Backdoor Triggers

Ahmed Abdelnaby, Mohamed Elmahallawy

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Deep neural networks (DNNs) are increasingly deployed in real-world vision systems, yet their predictions can be covertly manipulated by backdoor attacks, in which malicious triggers cause targeted misclassification while preserving high clean accuracy. Existing defenses often rely on model internals, training data, or clean validation samples, making them difficult to deploy when only black-box access to a trained model is available. We propose TRIM (Trigger Removal by Identifying Manipulated Regions), a deployment-oriented black-box defense that detects and selectively removes backdoor triggers at inference time without requiring model internals, training data, or clean samples. The key insight behind TRIM is to identify image regions that are responsible for anomalous model behavior and purify only those regions while preserving benign content. TRIM innovates via three key components: (i) region-based segmentation with deep feature representations, (ii) adaptive trigger discovery through inpainting and diffusion-based reconstruction to isolate regions responsible for misclassification—without assumptions about trigger type, shape, or location, and (iii) selective region purification that cleans poisoned regions while retaining benign content. To support practical deployment, TRIM further caches feature embeddings of previously identified triggers, enabling efficient recognition and avoiding redundant detection and purification. Extensive experiments across diverse datasets and backdoor types, including blended, sparse, varying-size, and multiple triggers, show that TRIM consistently outperforms existing black-box defenses, reducing attack success rates (ASR) to as low as 1.16% while preserving clean accuracy of up to 87.87%. These results demonstrate that effective backdoor mitigation is possible at inference time even when the defender has no access to any auxiliary data¹.

Introduction

Deep Neural Networks (DNNs) are widely deployed in computer vision systems but remain vulnerable to backdoor attacks, which activate attacker-defined behavior when specific triggers appear [8, 17, 29]. Backdoored models typically retain high accuracy on benign inputs while producing malicious predictions on triggered samples [16, 51], making them difficult to detect through conventional evaluation.

Modern triggers extend beyond fixed patches to blended, distributed, dynamic, and sample-specific patterns. Dynamic and input-aware attacks further vary trigger appearance or location, weakening defenses that assume predefined trigger characteristics. Such vulnerabilities

Appears in the Proceedings of the British Machine Vision Conference 2026 (BMVC 2026)

¹Our code is publicly available at: GitHub Repository.

2 AHMED ABDELNABY AND MOHAMED ELMAHALLAWY: BEYOND SMALL PATCHES

can originate from poisoned datasets, untrusted pre-trained models, or compromised training pipelines [☐, ☐]. Practical defenses should therefore operate without prior knowledge of trigger appearance, size, or location.

Existing white-box defenses often require training data, model parameters, internal activations, or trusted validation samples [☐, ☐, ☑, ☑], which may be unavailable for models accessed only through prediction interfaces [☐]. Existing black-box defenses [☐, ☐] may instead transform predefined regions, potentially damaging benign content while missing subtle or adaptive triggers. The key challenge is therefore to identify and neutralize trigger-related regions using only black-box model feedback.

We propose TRIM (Trigger Removal by Identifying Manipulated Regions), a model-agnostic, inference-time black-box defense requiring no training data, model internals, clean validation samples, or trigger knowledge. TRIM segments the input, extracts region-level features, and filters candidates using semantic constraints and cached benign/malicious representations. Candidate regions are selectively reconstructed and queried against the classifier; regions whose suppression influences the prediction are localized and jointly purified while preserving benign content. Feature caching reduces redundant verification, while modular segmentation and inpainting provide a tunable robustness–efficiency trade-off. In summary, our main contributions are:

  • We introduce TRIM, a model-agnostic black-box defense that detects and removes backdoor triggers without access to model internals, training data, clean validation samples, or prior trigger knowledge.

  • We develop a region-level trigger localization mechanism that combines semantic filtering, feature-based candidate selection, and selective reconstruction to identify prediction-critical manipulated regions while preserving benign image content.

  • We design a feature-caching mechanism that reuses previously verified benign and suspicious representations, reducing redundant model queries and improving the efficiency of inference-time defense.

  • We conduct extensive experiments across blended, dynamic, distributed, input-aware, and multi-trigger attacks, demonstrating that TRIM reduces attack success rate to as low as 1.16% while maintaining competitive clean accuracy up to 87.87%, outperforming state-of-the-art defenses.

References (48)