arXiv:2609.03406cs.CVSep 2026

Manuscript Offprint

arXiv:2609.03406

Neural-Collapse-guided Task-Free Continual Anomaly Detection

Xiaotong Kong, Chaoyang Song, Ziai Zhou, Jinxia Zhang, Kanjian Zhang, Haikun Wei

Xiaotong Kong, Chaoyang Song, Ziai Zhou, Jinxia Zhang*, Kanjian Zhang, Haikun Wei

Abstract—Recent years have witnessed growing interest in continual anomaly detection for industrial visual inspection. However, real-world manufacturing environments exhibit unpredictable shifts in data distributions, rendering task-dependent continual learning assumptions impractical. To address this limitation, we formulate industrial anomaly detection as a task-free continual learning problem and propose NC-TFAD, a neural-collapse-inspired, geometry-driven framework for learning from non-stationary data streams without task boundaries. NC-TFAD freezes a pretrained backbone and aligns streaming features to a simplex Equiangular Tight Frame (ETF) prototype space to stabilize representation geometry under non-stationary streams. To satisfy the NC-inspired geometric construction in the absence of real anomalies, we generate synthetic anomaly samples as auxiliary anchors during training. Building on this geometry, we further introduce inter- and intra-class regularization together with a Focal Neural Collapse Contrastive (FNCC) loss to suppress representation drift and improve normal-anomaly separability. Finally, a normal-patch-prototype-guided localization branch constructs calibrated patch-wise deviation maps from normal training samples and fuses them with a weak self-attention prior, producing anomaly heatmaps without pixel-level annotations. Extensive experiments on MVTec AD and VisA show that NC-TFAD consistently outperforms representative task-free continual learning methods adapted from general vision, as well as unified anomaly detection baselines, in both image-level detection and pixel-level localization under the task-free continual learning protocol. These results highlight that geometry-driven modeling offers an effective and robust solution for task-free continual anomaly detection in real-world industrial applications.

Index Terms—Anomaly detection, Task-free, Continual learning, Neural collapse

I. INTRODUCTION

ANOMALY detection (AD) is a fundamental problem in industrial visual inspection and intelligent manufacturing systems. It is critical for ensuring product quality, reducing production risks, and enabling automated workflows [1], [2]. In practice, anomalies exhibit diverse appearances, wide scale variation, and severe class imbalance. These factors make manual, expertise-driven inspection inefficient and inconsistent in accuracy and repeatability. As industrial data volumes grow, manual inspection can no longer meet the requirements of high precision, low latency, and long-term reliability, accelerating the adoption of deep-learning-based AD in industrial settings.

In recent years, deep learning has significantly advanced the development of anomaly detection methods [3], [4]. Compared with rule-based or shallow-feature approaches, deep learning methods can learn representations directly from data. They can exploit large collections of normal samples to acquire discriminative features. As a result, they typically generalize better under complex backgrounds, diverse defect types, and cross-category scenarios. Existing deep anomaly detection methods have evolved from the paradigm of one-model-one-category toward one-model-for-all [5], [6]. Earlier category-specific models perform well in controlled settings but require frequent retraining as products or production lines change, leading to high maintenance cost and poor scalability. Unified frameworks such as UniAD [7] alleviate these issues by consolidating multiple categories into a single model and reducing deployment and storage overhead.

Since most existing methods assume that all training data are jointly available during model training [1], [8], [9], [10], a substantial gap remains between unified AD models and real industrial deployment. In practical manufacturing environments, new product categories and inspection objects are introduced incrementally. In this context, continual learning (CL) [11], [12] has been adopted in anomaly detection to address distributional shifts over time. Nevertheless, conventional CL methods generally rely on explicit task boundaries or task identifiers. Such information is rarely available in industrial AD scenarios, where task transitions are inherently ambiguous and task labels are unavailable during inference [13]. Consequently, task-free continual learning (TFCL) is regarded as a more realistic and deployment-oriented learning paradigm for industrial anomaly detection.

While TFCL has achieved promising progress in general vision tasks [14], [15], its application to industrial anomaly detection remains limited. Existing task-free frameworks are not specifically designed for anomaly detection and struggle to reconcile long-term knowledge retention with the detection of subtle anomalies. The problem is further exacerbated by the lack of anomaly supervision.

To bridge this gap, we formulate industrial AD as a task-free continual learning problem and propose Neural-Collapse-guided Task-Free Anomaly Detection (NC-TFAD), a geometry-driven framework specifically tailored for this demanding setting. Unlike existing continual or unified anomaly detection approaches that rely on explicit task boundaries, replay buffers, or joint training assumptions, NC-TFAD enables continual adaptation under unknown task transitions using only the currently observed data stream. Specifically, NC-TFAD freezes a pretrained backbone to extract stable visual features and employs a lightweight linear projection layer to align streaming features to a Simplex Equiangular Tight Frame (ETF) prototype space induced by neural

∗^{*} Corresponding author. This work was supported by National Natural Science Fund of China (Grant number 62573123), Research Fund for Advanced Ocean Institute of Southeast University, Nantong (GP202411), the Postgraduate Research & Practice Innovation Program of Jiangsu Province (26CXJH0649) and the Fundamental Research Funds for the Central Universities. We also thank the Big Data Computing Center of Southeast University for providing the facility support on the numerical calculations in this paper.

Xiaotong Kong, Chaoyang Song, Ziai Zhou, Jinxia Zhang, Kanjian Zhang and Haikun Wei are with the Key Laboratory of Measurement and Control of CSE, Ministry of Education, School of Automation, Southeast University, Nanjing 210096, China (e-mail: {230259964, 230248980, 230238499, jinxiazhang, kjzhang, hkwei}@seu.edu.cn).

collapse [16]. To instantiate the NC-inspired normal-anomaly geometry in the absence of real anomaly supervision, we introduce a synthetic anomaly generation strategy that provides auxiliary geometric anchors for the otherwise unobserved anomalous direction. The resulting synthetic anomalies provide weak image-level supervision for establishing a stable normal-anomaly geometric reference, rather than explicitly modeling the full appearance distribution of real industrial defects. Building on this geometric structure, we introduce NC-guided inter- and intra-class regularization to preserve the ETF-induced geometry by promoting intra-class compactness and inter-class separation, thereby stabilizing the embedding space under distribution shifts. We further propose a Focal Neural Collapse Contrastive (FNCC) loss that emphasizes hard sample-sample and sample-prototype pairs, improving sample-level discriminability and anomaly separability under non-stationary streams. In addition, NC-TFAD includes a normal-patch-prototype-guided localization branch. It builds a compact prototype set from normal training patches only, scores each test patch by its calibrated deviation from the normal patch manifold, and uses backbone self-attention only as a weak spatial prior.

Extensive experiments on the MVTec AD and VisA datasets demonstrate that NC-TFAD significantly outperforms existing state-of-the-art approaches under the task-free continual anomaly detection setting.

The main contributions of this work are summarized as follows:

  1. We formulate industrial anomaly detection under a task-free continual learning protocol in which normal samples arrive in a single-pass non-stationary stream without task boundaries, category identifiers, or access to historical data, better reflecting real-world industrial inspection with continuously evolving data distributions.

  2. We propose NC-TFAD, which reformulates neural-collapse geometry for task-free continual anomaly detection in a category-agnostic manner. Unlike standard multiclass ETF formulations tied to semantic classes, NC-TFAD employs two fixed ETF directions to represent normal and anomalous states shared across all categories. Since real anomalies are unavailable during training, synthetic anomalies are introduced as auxiliary geometric anchors to instantiate the missing anomalous direction without anomaly supervision.

  3. We develop an NC-guided continual optimization mechanism that integrates inter-class alignment and intra-class compactness with a Focal Neural Collapse Contrastive (FNCC) loss. FNCC jointly models sample-sample and sample-prototype relations within a unified contrastive objective and applies focal weighting to hard positive pairs and ambiguous prototype assignments, improving robustness under non-stationary distributions.

  4. We further introduce a normal-patch-prototype-guided localization branch that uses only normal training patches to construct a compact localization memory. During inference, patch-wise prototype deviations are calibrated by the normal distance distribution and fused with a weak self-attention prior, improving pixel-level localization without requiring pixel-level supervision.

References (45)