Table of Contents
Fetching ...

Hierarchical Gaussian Mixture Normalizing Flow Modeling for Unified Anomaly Detection

Xincheng Yao, Ruoqi Li, Zefeng Qian, Lu Wang, Chongyang Zhang

TL;DR

Unified anomaly detection across multiple classes suffers from a homogeneous latent mapping when using standard normalizing flows. The paper introduces HGAD, which enhances NF-based AD with inter-class Gaussian mixture priors, intra-class mixed centers, and a mutual information objective to create a multimodal, well-separated latent space. A two-stage optimization and an entropy-regularized anomaly scoring strategy yield strong improvements on four industrial benchmarks and surpass state-of-the-art unified AD methods. The approach enables a single model to detect anomalies across diverse classes, reducing training and deployment costs while maintaining high detection and localization performance. This has practical impact for real-world industrial inspection and related multi-class anomaly detection tasks.

Abstract

Unified anomaly detection (AD) is one of the most challenges for anomaly detection, where one unified model is trained with normal samples from multiple classes with the objective to detect anomalies in these classes. For such a challenging task, popular normalizing flow (NF) based AD methods may fall into a "homogeneous mapping" issue,where the NF-based AD models are biased to generate similar latent representations for both normal and abnormal features, and thereby lead to a high missing rate of anomalies. In this paper, we propose a novel Hierarchical Gaussian mixture normalizing flow modeling method for accomplishing unified Anomaly Detection, which we call HGAD. Our HGAD consists of two key components: inter-class Gaussian mixture modeling and intra-class mixed class centers learning. Compared to the previous NF-based AD methods, the hierarchical Gaussian mixture modeling approach can bring stronger representation capability to the latent space of normalizing flows, so that even complex multi-class distribution can be well represented and learned in the latent space. In this way, we can avoid mapping different class distributions into the same single Gaussian prior, thus effectively avoiding or mitigating the "homogeneous mapping" issue. We further indicate that the more distinguishable different class centers, the more conducive to avoiding the bias issue. Thus, we further propose a mutual information maximization loss for better structuring the latent feature space. We evaluate our method on four real-world AD benchmarks, where we can significantly improve the previous NF-based AD methods and also outperform the SOTA unified AD methods.

Hierarchical Gaussian Mixture Normalizing Flow Modeling for Unified Anomaly Detection

TL;DR

Unified anomaly detection across multiple classes suffers from a homogeneous latent mapping when using standard normalizing flows. The paper introduces HGAD, which enhances NF-based AD with inter-class Gaussian mixture priors, intra-class mixed centers, and a mutual information objective to create a multimodal, well-separated latent space. A two-stage optimization and an entropy-regularized anomaly scoring strategy yield strong improvements on four industrial benchmarks and surpass state-of-the-art unified AD methods. The approach enables a single model to detect anomalies across diverse classes, reducing training and deployment costs while maintaining high detection and localization performance. This has practical impact for real-world industrial inspection and related multi-class anomaly detection tasks.

Abstract

Unified anomaly detection (AD) is one of the most challenges for anomaly detection, where one unified model is trained with normal samples from multiple classes with the objective to detect anomalies in these classes. For such a challenging task, popular normalizing flow (NF) based AD methods may fall into a "homogeneous mapping" issue,where the NF-based AD models are biased to generate similar latent representations for both normal and abnormal features, and thereby lead to a high missing rate of anomalies. In this paper, we propose a novel Hierarchical Gaussian mixture normalizing flow modeling method for accomplishing unified Anomaly Detection, which we call HGAD. Our HGAD consists of two key components: inter-class Gaussian mixture modeling and intra-class mixed class centers learning. Compared to the previous NF-based AD methods, the hierarchical Gaussian mixture modeling approach can bring stronger representation capability to the latent space of normalizing flows, so that even complex multi-class distribution can be well represented and learned in the latent space. In this way, we can avoid mapping different class distributions into the same single Gaussian prior, thus effectively avoiding or mitigating the "homogeneous mapping" issue. We further indicate that the more distinguishable different class centers, the more conducive to avoiding the bias issue. Thus, we further propose a mutual information maximization loss for better structuring the latent feature space. We evaluate our method on four real-world AD benchmarks, where we can significantly improve the previous NF-based AD methods and also outperform the SOTA unified AD methods.
Paper Structure (27 sections, 29 equations, 6 figures, 6 tables, 1 algorithm)

This paper contains 27 sections, 29 equations, 6 figures, 6 tables, 1 algorithm.

Figures (6)

  • Figure 1: Anomaly detection task settings. We aim to implement one unified AD model (b). (c) Mapping all input features to the same latent class center may induce the "homogeneous mapping" issue. (d) We propose a hierarchical Gaussian mixture modeling method for more effectively capturing the complex multi-class distribution.
  • Figure 2: Comparison between many-to-one and our unified NF-based AD methods on MVTecAD. (a) and (c) show the training losses and the testing anomaly detection and localization AUROCs. (b) shows that the many-to-one NF-based AD model (i.e., training the one-for-one AD method, FastFlow, on multiple classes simultaneously) may have an obvious normal-abnormal overlap under the unified case, while ours (d) can bring better normal-abnormal distinguishability.
  • Figure 3: Model overview. The extracted feature vectors are sent into the normalizing flow model for transforming into latent embeddings. Following CFLOW, we add positional embeddings (i.e., sinusoidal position encoding) to each invertible layer as they are effective for NF-based AD methods. Then, we employ our hierarchical Gaussian mixture modeling approach to fit the latent embeddings, which can assist the model against learning the "homogeneous mapping".
  • Figure 4: Qualitative results on MVTecAD. (a) and (b) both represent global anomalies, (c) contains large cracks, (d) shows small dints, (e) contains texture scratches, and (f) shows color anomalies.
  • Figure 5: Log-likelihood histograms on MVTecAD. All categories are from the MVTecAD dataset.
  • ...and 1 more figures