Abstract
Although continual learning and anomaly detection have separately been well-studied in previous works, their intersection remains rather unexplored. The present work addresses a learning scenario where a model has to incrementally learn a sequence of anomaly detection tasks, i.e. tasks from which only examples from the normal (majority) class are available for training. We define this novel learning problem of continual anomaly detection (CAD) and formulate it as a meta-learning problem. Moreover, we propose A Rapid Continual Anomaly Detector (ARCADe), an approach to train neural networks to be robust against the major challenges of this new learning problem, namely catastrophic forgetting and overfitting to the majority class. The results of our experiments on three datasets show that, in the CAD problem setting, ARCADe substantially outperforms baselines from the continual learning and anomaly detection literature. Finally, we provide deeper insights into the learning strategy yielded by the proposed meta-learning algorithm.
Introduction
Most machine learning models are trained in an "offline" fashion on static datasets. However, real-world applications—such as industrial manufacturing or cybersecurity—demand models that can adapt to new data and "normal" behaviors emerging over time. This requirement falls under Continual Learning (CL). While CL typically focuses on balanced classification tasks, a significant gap exists at its intersection with Anomaly Detection (AD).
In the AD setting, training data often consists solely of the "normal" class (One-Class Classification). Applying sequential learning to these tasks introduces two primary failures:
- Catastrophic Forgetting: The model overwrites knowledge of previous normal classes to accommodate the current one.
- Overfitting to the Majority: Without exposure to anomalies during training, models tend to over-generalize, eventually classifying all inputs as "normal."
Methodology
To address these challenges, we propose ARCADe, a meta-learning approach based on the bi-level optimization logic of Model-Agnostic Meta-Learning (MAML). Unlike standard MAML, ARCADe meta-learns both a model initialization and parameter-specific learning rates.
Bi-level Optimization and Learning Rate Clipping
During meta-training, the model simulates learning sequences of tasks. It optimizes its initial state so that after a few gradient steps on a new task, it performs well on both the new task and previously encountered ones. Crucially, the meta-learned learning rates are clipped between 0 and 1. If the meta-optimizer assigns a learning rate of 0 to a parameter, that parameter becomes "task-agnostic," remaining fixed during new tasks to preserve existing knowledge.
We evaluate two variants:
- ARCADe-M: Meta-learns initialization and learning rates for all parameters.
- ARCADe-H: Meta-learns only for the output layer ("head"), treating the backbone as a fixed feature extractor.
Experimental Results
We evaluated ARCADe on three standard benchmarks adapted for CAD: Omniglot, MiniImageNet, and CIFAR-FS. In this setup, one class is designated as "normal" for training, while all other classes serve as "anomalies" during testing.
On the Omniglot dataset, ARCADe demonstrated remarkable stability, learning 100 tasks sequentially with only a 6% loss in accuracy. In contrast, baselines like OC-MAML and SeqFOMAML collapsed much earlier in the sequence. On more complex natural image datasets like MiniImageNet, ARCADe-M achieved a retained accuracy of approximately 64.5%, significantly outperforming non-ARCADe baselines. Furthermore, the model is highly efficient, requiring only 3 gradient updates and as few as 10 examples to learn a new task.
Analysis of Learning Strategy
A key insight from our work is the behavior of the meta-learned learning rates across network layers. The meta-optimizer automatically identifies which features are universal and which are task-specific.
As shown in the analysis of learning rates, early layers (responsible for detecting basic edges and shapes) tend to receive lower learning rates, keeping them stable. Later layers receive higher rates to adapt to specific class features. This mechanism allows the model to resist the "everything is normal" trap by balancing immediate adaptation with long-term knowledge retention.
Conclusion
ARCADe successfully addresses the Continual Anomaly Detection problem by meta-learning parameter-specific adaptation rates. While computationally intensive due to the bi-level optimization, it offers a robust solution for sequential one-class classification. Future work will explore applying ARCADe to non-image domains, such as time-series sensor data, and investigating the impact of curriculum learning on task sequences.
Summary updated