Distilling Cognitive Backdoor Patterns within an Image

Hanxun Huang, Xingjun Ma, S. Erfani, James Bailey
2/12/2026

No official code found. Best implementation: HanxunH/CognitiveDistillation (36 stars, MIT, PyTorch, last commit 2025-10-29).

Abstract

This paper proposes a simple method to distill and detect backdoor patterns within an image: \emph{Cognitive Distillation} (CD). The idea is to extract the"minimal essence"from an input image responsible for the model's prediction. CD optimizes an input mask to extract a small pattern from the input image that can lead to the same model output (i.e., logits or deep features). The extracted pattern can help understand the cognitive mechanism of a model on clean vs. backdoor images and is thus called a \emph{Cognitive Pattern} (CP). Using CD and the distilled CPs, we uncover an interesting phenomenon of backdoor attacks: despite the various forms and sizes of trigger patterns used by different attacks, the CPs of backdoor samples are all surprisingly and suspiciously small. One thus can leverage the learned mask to detect and remove backdoor examples from poisoned training datasets. We conduct extensive experiments to show that CD can robustly detect a wide range of advanced backdoor attacks. We also show that CD can potentially be applied to help detect potential biases from face datasets. Code is available at \url{https://github.com/HanxunH/CognitiveDistillation}.

View on arXivView PDF

Code Implementations(1)

PyTorchMIT

[ICLR2023] Distilling Cognitive Backdoor Patterns within an Image

363PythonJan 23, 202311 months agoMIT
backdoor-attacksbackdoor-defensedeep-learningdeep-neural-networksiclr+2 more

Cite this paper

@article{huang2026distilling,
  title  = {Distilling Cognitive Backdoor Patterns within an Image},
  author = {Hanxun Huang and Xingjun Ma and S. Erfani and James Bailey},
  year   = {2026},
  eprint = {2301.10908},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/pdf/2301.10908},
  journal = {ICLR 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2301.10908.svg)](https://codeofpaper.com/paper/2301.10908)

Discussion