Table of Contents
Fetching ...

BayPrAnoMeta: Bayesian Proto-MAML for Few-Shot Industrial Image Anomaly Detection

Soham Sarkar, Tanmay Sen, Sayantan Banerjee

TL;DR

BayPrAnoMeta reframes few-shot industrial anomaly detection by replacing deterministic prototypes with task-specific probabilistic normality models, using a Normal-Inverse-Wishart prior to obtain a multivariate Student-$t$ predictive for robust, uncertainty-aware scoring. The method extends Proto-MAML to a Bayesian inner-loop and a likelihood-based outer-loop objective, enabling well-defined performance even when the support size is smaller than the embedding dimension. The authors further extend the framework to a federated setting with supervised contrastive regularization to handle heterogeneous, privacy-constrained clients, and prove convergence to stationary points under standard assumptions. Empirical results on MVTec AD show consistent AUROC improvements over MAML, Proto-MAML, and PatchCore, with additional gains when combining federated learning and contrastive regularization, highlighting practical benefits for safe, scalable industrial anomaly detection.

Abstract

Industrial image anomaly detection is a challenging problem owing to extreme class imbalance and the scarcity of labeled defective samples, particularly in few-shot settings. We propose BayPrAnoMeta, a Bayesian generalization of Proto-MAML for few-shot industrial image anomaly detection. Unlike existing Proto-MAML approaches that rely on deterministic class prototypes and distance-based adaptation, BayPrAnoMeta replaces prototypes with task-specific probabilistic normality models and performs inner-loop adaptation via a Bayesian posterior predictive likelihood. We model normal support embeddings with a Normal-Inverse-Wishart (NIW) prior, producing a Student-$t$ predictive distribution that enables uncertainty-aware, heavy-tailed anomaly scoring and is essential for robustness in extreme few-shot settings. We further extend BayPrAnoMeta to a federated meta-learning framework with supervised contrastive regularization for heterogeneous industrial clients and prove convergence to stationary points of the resulting nonconvex objective. Experiments on the MVTec AD benchmark demonstrate consistent and significant AUROC improvements over MAML, Proto-MAML, and PatchCore-based methods in few-shot anomaly detection settings.

BayPrAnoMeta: Bayesian Proto-MAML for Few-Shot Industrial Image Anomaly Detection

TL;DR

BayPrAnoMeta reframes few-shot industrial anomaly detection by replacing deterministic prototypes with task-specific probabilistic normality models, using a Normal-Inverse-Wishart prior to obtain a multivariate Student- predictive for robust, uncertainty-aware scoring. The method extends Proto-MAML to a Bayesian inner-loop and a likelihood-based outer-loop objective, enabling well-defined performance even when the support size is smaller than the embedding dimension. The authors further extend the framework to a federated setting with supervised contrastive regularization to handle heterogeneous, privacy-constrained clients, and prove convergence to stationary points under standard assumptions. Empirical results on MVTec AD show consistent AUROC improvements over MAML, Proto-MAML, and PatchCore, with additional gains when combining federated learning and contrastive regularization, highlighting practical benefits for safe, scalable industrial anomaly detection.

Abstract

Industrial image anomaly detection is a challenging problem owing to extreme class imbalance and the scarcity of labeled defective samples, particularly in few-shot settings. We propose BayPrAnoMeta, a Bayesian generalization of Proto-MAML for few-shot industrial image anomaly detection. Unlike existing Proto-MAML approaches that rely on deterministic class prototypes and distance-based adaptation, BayPrAnoMeta replaces prototypes with task-specific probabilistic normality models and performs inner-loop adaptation via a Bayesian posterior predictive likelihood. We model normal support embeddings with a Normal-Inverse-Wishart (NIW) prior, producing a Student- predictive distribution that enables uncertainty-aware, heavy-tailed anomaly scoring and is essential for robustness in extreme few-shot settings. We further extend BayPrAnoMeta to a federated meta-learning framework with supervised contrastive regularization for heterogeneous industrial clients and prove convergence to stationary points of the resulting nonconvex objective. Experiments on the MVTec AD benchmark demonstrate consistent and significant AUROC improvements over MAML, Proto-MAML, and PatchCore-based methods in few-shot anomaly detection settings.
Paper Structure (49 sections, 5 theorems, 47 equations, 7 figures, 10 tables, 3 algorithms)

This paper contains 49 sections, 5 theorems, 47 equations, 7 figures, 10 tables, 3 algorithms.

Key Result

Proposition 1

Assume $\Lambda_0 \succ 0$ and $\nu_0>d-1$. Then for every $K\ge 1$, every support set $\mathcal{S}$ of size $K$, and every parameter $\theta$, the posterior predictive density $p_0(\cdot\mid \mathcal{S})$ is a proper multivariate Student-$t$ distribution with (i) strictly positive definite scale ma

Figures (7)

  • Figure 1: Top: Federated Contrastive BayPrAnoMeta framework, where locally each client uses Contrastive BayPrAnoMeta for industrial image anomaly detection. Bottom: (a) training framework of Contrastive BayPrAnoMeta of a particular client $c$ which uses the global embedding network $f_\theta$ and after the $k^{\text{th}}$ round of training sends the updated parameter $\theta_k^{(c)}$ to the global server, and (b) testing framework of Contrastive BayPrAnoMeta of that client $c$, which takes the globally trained parameter $\theta^*$ as input for adaptation during inference for anomaly detection.
  • Figure 2: Comparison of training and validation loss curves of Classical Proto-MAML and BayPrAnoMeta (Bayesian Proto-MAML).
  • Figure 3: Comparison of training and validation loss curves of Federated BayPrAnoMeta (Bayesian Proto-MAML) and Federated Contrastive BayPrAnoMeta (Bayesian Proto-MAML).
  • Figure 4: Comparison of training and validation loss curves of Centralized Contrastive BayPrAnoMeta (Bayesian Proto-MAML) and Federaed Contrastive Supervised BayPrAnoMeta (Bayesian Proto-MAML).
  • Figure 5: t-SNE visualizations. Upper (a) - (d): BayPrAnoMeta (Centralized). Lower (e) - (h): Contrastive BayPrAnoMeta (Centralized).
  • ...and 2 more figures

Theorems & Definitions (9)

  • Proposition 1: Few-shot well-posedness of the NIW--Student-$t$ predictive
  • Lemma 1: Smoothness of Student-t negative log-likelihood in the embedding
  • Theorem 6: Nonconvex convergence of Federated BayPrAnoMeta
  • proof : Proof of Proposition \ref{['prop:wellposed']}
  • Corollary 7
  • proof
  • Corollary 8
  • proof : Proof of Lemma \ref{['lem:t-smooth']}
  • proof : Proof of Theorem \ref{['thm:main']}