Continual learning approaches for anomaly detection

Davide Dalle Pezze, Eugenia Anello, Chiara Masiero, Gian Antonio Susto

Introduction: The Challenge of Dynamic Industrial Environments

In modern manufacturing, anomaly detection (AD) models are rarely static. As production lines evolve and new products are introduced, models must adapt to inspect new items without losing the ability to monitor older ones. However, standard deep learning architectures suffer from Catastrophic Forgetting (CF): the tendency for a model to overwrite the knowledge of previous tasks when learning new data, leading to a sharp decline in performance on earlier tasks.

Overview of the continual learning setup for anomaly detection across sequential tasks.

While "Experience Replay"—storing a subset of old images to retrain alongside new ones—is a common solution in Continual Learning (CL), it presents a significant memory bottleneck. High-resolution images (e.g., 256x256) are essential for pixel-level defect localization, but storing thousands of such images is often impractical in edge-computing industrial settings.

The CLAD Framework and SCALE

To address these challenges, this research introduces the CLAD (Continual Learning for Anomaly Detection) framework. CLAD decouples the system into two distinct components: a Memory Module for knowledge retention and an AD Module for defect localization.

The core innovation is SCALE (SCALing is Enough), a compressed replay technique. Rather than storing raw high-resolution images or abstract latent vectors, SCALE stores images downsampled to a 32x32 resolution—a 64x compression factor. To restore these images for training, the framework employs a Super-Resolution (SR) model based on the Pix2Pix architecture.

The CLAD framework updates the memory module and AD model by combining generated images from previous tasks with new task data.

As the system transitions from Task $i-1$ to Task $i$, the memory module retrieves the low-resolution samples of old tasks, upscales them back to 256x256, and combines them with the new task's dataset. This hybrid data pool is then used to update both the memory module and the AD model, ensuring the system retains fine-grained textural knowledge of past products.

Key Insights: Stability and Reconstruction Quality

Several critical findings emerged from the development of SCALE:

  1. Pixel-Level Stability: Storing low-resolution pixels proved more stable than storing latent representations. Latent codes are often tied to specific, evolving model weights, whereas pixels represent a "ground truth" that remains valid throughout the training lifecycle.
  2. Inpainting Resilience: Among various AD architectures, the Inpaint approach—where a model reconstructs masked portions of an image—demonstrated the highest resilience to catastrophic forgetting.
  3. Fidelity for Anomaly Detection: Anomaly detection is uniquely sensitive to image quality. While standard Variational Autoencoders (VAEs) can achieve higher compression, they often produce blurry reconstructions. SCALE’s use of Super-Resolution maintains the sharp details necessary to prevent the model from misidentifying reconstruction artifacts as actual defects.

Experimental Results on MVTec AD

The framework was evaluated using the MVTec AD Dataset, treating 10 object categories as a sequential stream of tasks. SCALE achieved a Fréchet Inception Distance (FID) of 105.57 at 64x compression, significantly outperforming VAEs, which produced unusable images with an FID of 245.87.

In terms of detection performance, the combination of SCALE and Inpaint yielded an average F1 score of 0.35. Notably, this approach outperformed "Replay Low Mem" baselines. Because SCALE compresses images so effectively, it allows the model to store a much larger variety of samples within the same memory footprint, providing a more robust representation of the "normal" data distribution for previous tasks.

Limitations and Future Outlook

While SCALE offers a powerful solution for memory-efficient continual learning, it introduces computational overhead. Training the Super-Resolution and Inpaint modules is time-intensive, with the Inpaint model requiring roughly 1200 minutes of training compared to 180 minutes for simpler autoencoders. Furthermore, the study focused on reconstruction-based AD; adapting embedding-based methods like PatchCore, which lack traditional learnable weights, remains a challenge for future research. Expanding SCALE to other high-detail tasks, such as semantic segmentation, represents a promising avenue for further exploration.

Summary updated

BibTeX
@article{pezze2025continual,
  author = {Davide Dalle Pezze and Eugenia Anello and Chiara Masiero and Gian Antonio Susto},
  title = {{Continual learning approaches for anomaly detection}},
  journal = {Evol. Syst.},
  year = {2025},
  doi = {10.1007/s12530-025-09732-7},
}
Figure