---
title: 'MECAD: Multi-Expert Anomaly Detection'
url: https://www.emergentmind.com/topics/mecad
type: topic
---

# MECAD: Multi-Expert Anomaly Detection

Searching arXiv for the MECAD paper and closely related ambiguous uses of the acronym.
MECAD is a continual anomaly detection framework that uses a multi-expert architecture to learn sequentially from a stream of object classes while retaining performance on previously seen classes. It is designed for industrial inspection settings in which product types, manufacturing conditions, and defect patterns evolve over time, and where models must adapt without full retraining and without labeled anomalies. In its primary formulation, MECAD combines a shared frozen feature extraction backbone, similarity-driven expert assignment, PatchCore-style memory banks, coreset selection, and expert-specific replay buffers to balance computational efficiency, specialized knowledge retention, and adaptability [2512.15323].

## 1. Problem setting and design rationale

Continual anomaly detection (CAD) is the setting where an anomaly detector must learn sequentially from a stream of object classes, or tasks, while retaining performance on previously seen classes. MECAD addresses three core difficulties identified for this setting: catastrophic forgetting, evolving product types, and memory/computation constraints [2512.15323].

Catastrophic forgetting arises because updating a single model to handle new classes often degrades performance on earlier classes. In industrial inspection, this problem is amplified by the fact that new classes may introduce distinct normal appearance statistics. MECAD therefore adopts a multi-expert rather than monolithic design. The stated rationale is that splitting the system into experts that specialize in subsets of classes reduces interference between dissimilar classes, preserves knowledge via expert-specific memory banks, and enables targeted updates in which only the assigned expert is modified [2512.15323].

This specialization mechanism is paired with a non-parametric anomaly detection formulation. MECAD does not perform end-to-end fine-tuning of the backbone and does not introduce per-expert learned weights. Instead, each expert stores representative normal patch embeddings in a memory bank and produces anomaly scores through nearest-neighbor distances in embedding space. This design directly targets the industrial constraints emphasized in the paper: low overhead, fast updates, and limited storage [2512.15323].

A plausible implication is that MECAD positions continual anomaly detection as a memory-management and routing problem rather than as repeated gradient-based retraining. That interpretation is consistent with the paper’s emphasis on expert isolation, replay, and coreset-based compression [2512.15323].

## 2. Architectural components

MECAD uses a shared feature extraction backbone based on WideResNet-50 pre-trained on ImageNet, with features taken from intermediate layers 2 and 3. Images are resized to $224 \times 224$, and patch embeddings are formed at patch size $32 \times 32$ [2512.15323].

The expert set is fixed as $E = \{E_1, \ldots, E_N\}$, with experiments varying $N$ from 1 to 8. Each expert operates as a PatchCore-style memory bank of normal patch embeddings for the classes assigned to it. Experts do not share memory; instead, each stores representative patch descriptors of normal data for its own assigned classes [2512.15323].

A similarity-driven router governs class-to-expert assignment. For a class $c$ with embeddings $\{f(x)\}_{x \in c}$, MECAD computes the class centroid

$$
\mu_c = \frac{1}{|c|} \sum_{x \in c} f(x).
$$

For expert $E_i$ with memory embeddings $M_{E_i}$, the expert centroid is

$$
\mu_{E_i} = \frac{1}{|M_{E_i}|} \sum_{z \in M_{E_i}} z.
$$

Assignment uses cosine similarity between these centroids,

$$
\mathrm{sim}(c, E_i) = \frac{\langle \mu_c, \mu_{E_i} \rangle}{\|\mu_c\| \cdot \|\mu_{E_i}\|},
$$

followed by the thresholded rule

$$
\mathcal{A}(c) =
\begin{cases}
\arg \max_i \mathrm{sim}(c, E_i), & \text{if } \max_i \mathrm{sim}(c, E_i) \ge \theta \\
E_{\emptyset}, & \text{otherwise}
\end{cases}
$$

with $\theta = 0.9$ [2512.15323].

Several practical details constrain this routing process. The first class is assigned to the first expert by default. MECAD also limits how many classes can be assigned per expert through per-expert memory budgets, which act as implicit capacity constraints. The stated purpose is to balance specialization and avoid expert overloading [2512.15323].

At inference time, test images are routed to the expert assigned to their class. The image-level anomaly score is defined by nearest-neighbor distances between test patches and the selected expert’s memory bank:

$$
s_{\mathrm{image}} = \max_{p \in P} s(p, M_{E_i}),
$$

where $s$ is the nearest-neighbor distance in embedding space, consistent with PatchCore’s kNN scoring [2512.15323].

## 3. Memory organization, coreset selection, and replay

Memory management in MECAD is explicitly two-level. First, coreset selection compresses a class’s patch embeddings into a compact representative subset. Second, each expert maintains a replay buffer of past samples from previously assigned classes, which are interleaved during expert updates [2512.15323].

The coreset mechanism follows the standard objective of selecting a subset $S$ of size $k$ that minimizes the worst-case distance from embeddings to their representatives:

$$
\min_{S: |S| = k} \max_x d(x, S),
\qquad
d(x, S) = \min_{s \in S} \|f(x) - s\|.
$$

In practice, representative patches are selected from the class embedding pool to respect the per-class budget of 400 samples. The expert memory bank is the union over assigned classes subject to the per-expert budget of 2400 samples. Selection is performed once per arriving class, and redundant patches are discarded to preserve memory [2512.15323].

Replay is expert-specific. Each expert keeps a buffer with randomly selected samples from its previously assigned classes, using a replay ratio of 0.2. When a class $c$ is assigned to expert $E_i$, the memory update is

$$
\mathcal{M}_{E_i} = S_c \cup \{r \mid r \in \mathcal{R}_{E_i,j},\; j \in \mathcal{C}_{E_i} \setminus \{c\}\},
$$

where $S_c$ is the selected coreset for class $c$, $\mathcal{R}_{E_i,j}$ denotes replay samples from previously assigned class $j$, and $\mathcal{C}_{E_i}$ is the class set assigned to $E_i$ [2512.15323].

This organization is central to MECAD’s treatment of forgetting. The paper attributes improved retention to two interacting mechanisms: update isolation, because only the assigned expert is modified, and replay, because earlier class embeddings remain represented during updates to that expert’s memory [2512.15323].

## 4. Incremental learning procedure and inference behavior

MECAD enables incremental integration of new classes without full retraining. Initialization fixes the number of experts, initializes empty memory banks and centroids, and loads a pre-trained WideResNet-50 backbone whose weights remain frozen throughout [2512.15323].

When a new class arrives, MECAD performs the following sequence. Patch embeddings $F_c$ are extracted and the class centroid $\mu_c$ is computed. Similarity scores $\mathrm{sim}(c, E_i)$ are evaluated for all experts, and the class is assigned according to the threshold rule with $\theta = 0.9$. A coreset $S_c \subset F_c$ of size at most 400 is then selected. Replay items are sampled from the assigned expert’s buffer with ratio 0.2. The expert memory is updated to $\mathcal{M}_{E_i} \leftarrow S_c \cup R$, trimmed to satisfy the per-expert budget of at most 2400, and the expert centroid is recomputed. No update is performed on other experts, and there is no end-to-end fine-tuning of the backbone [2512.15323].

This makes MECAD non-parametric at the expert level. The paper explicitly states that there are no per-expert learned weights or gradient-based optimization, and consequently no explicit training loss functions such as reconstruction, one-class, or distillation losses. Likewise, no optimizers, learning rates, batch sizes, or epochs are applicable; the “training” phase is memory construction via coreset selection and replay [2512.15323].

During inference for a test image from class $c$, MECAD routes the image to expert $E_i = \mathcal{A}(c)$, extracts patch embeddings $P$, and computes the image-level anomaly score by nearest-neighbor distance against that expert’s memory bank [2512.15323]. This routing-to-one-expert design means inference scales with the selected expert’s memory size rather than the total memory over all classes.

## 5. Empirical evaluation and ablation behavior

MECAD is evaluated on the MVTec AD dataset, which contains 15 categories and 5,354 high-resolution images. Each category has normal training images and both normal and anomalous test images with pixel-level ground truth for anomalies. The primary metric is image-level AUROC. The evaluation also reports forgetting, defined operationally as the average decline in performance on previously learned classes, and memory usage as per-expert utilization [2512.15323].

The main ablation varies the number of experts from 1 to 8. Average AUROC across the 15 classes is reported as 0.7494 for 1 expert, 0.7793 for 2 experts, 0.8212 for 3 experts, 0.8269 for 4 experts, 0.8259 for 5 experts, and approximately 0.823 to 0.824 for 6 to 8 experts. The paper identifies the 5-expert configuration as the optimal balance, although the numerical peak in AUROC occurs at 4 experts [2512.15323].

Forgetting continues to improve as the number of experts increases. Reported forgetting values are severe for the single-expert setting at $-0.3736$, improved for 5 experts at $-0.1396$, and further reduced for 8 experts at $-0.0816$ [2512.15323]. This establishes the central empirical trade-off in MECAD: performance plateaus beyond roughly 4 to 5 experts, while specialization still yields better knowledge retention.

The paper also reports per-category AUROC highlights for the 5-expert configuration. The range extends from 0.4384 on screw to 1.0000 on leather [2512.15323]. This indicates substantial class-dependent variability, with some object categories remaining difficult even under the multi-expert design.

Memory utilization in the 5-expert configuration is also reported and illustrates the system’s specialization patterns:

| Expert | Utilization | Assigned classes |
|---|---:|---|
| Expert 0 | 83.33% | bottle, cable, capsule, hazelnut, metal_nut |
| Expert 1 | 50% | carpet, wood, zipper |
| Expert 2 | 16.67% | grid |
| Expert 3 | 16.67% | leather |
| Expert 4 | 83.33% | pill, screw, tile, toothbrush, transistor |

These assignments are presented as evidence that similar classes are naturally grouped by the similarity-driven router. The paper gives the example of texture classes such as carpet, wood, and zipper being assigned together, which aligns with the centroid-based assignment mechanism [2512.15323].

Conceptual baselines discussed include PatchCore, PaDiM, DRAEM, and continual learning baselines such as EWC, LwF, and iCaRL, but explicit numerical comparisons to those baselines are not reported. MECAD’s empirical focus is instead the variation in expert count and the analysis of forgetting versus performance [2512.15323].

## 6. Efficiency, limitations, and nomenclature

MECAD’s computational profile is defined by targeted updates and bounded memory. The paper states that a single GPU with 16 GB suffices, and that overhead remains low because only memory banks are updated and the backbone is not fine-tuned. Per-class memory is capped at 400 samples and per-expert memory at 2400. Since only one expert is updated for each new class, compute is reduced relative to retraining a single global model [2512.15323].

Inference is similarly structured for scalability. Each image is routed to a single expert, and kNN search is carried out only within that expert’s memory bank. This means inference latency scales with per-expert memory size rather than with all classes, which the paper presents as supportive of industrial throughput needs [2512.15323].

Several limitations are explicitly identified. The expert assignment mechanism depends on class similarity measured by centroids, so misassignment can occur when classes are superficially similar at the centroid level but differ in fine-grained patterns, especially with the high threshold $\theta = 0.9$. Performance also depends on the fixed feature extractor; rare anomalies or domain shift may require feature adaptation. Some categories, including screw and transistor, remain challenging, suggesting the need for richer features or adaptive memory strategies [2512.15323].

Future directions proposed for MECAD include more sophisticated gating, such as multi-prototype experts and adaptive thresholds; replay selection beyond random sampling; alternative coreset strategies such as k-center greedy or submodular optimization; and lightweight feature adaptation methods such as feature distillation without heavy retraining [2512.15323].

The acronym “MECAD” is also used ambiguously in adjacent literature. It may refer to “MECAD: A multi-expert architecture for continual anomaly detection” [2512.15323], but similarly spelled names appear elsewhere, including EMCAD, a medical image segmentation decoder sometimes informally referred to as MECAD [2405.06880], and MECAD as the name of multimodal conversational emotion-cause datasets in later benchmark papers [2606.18893; 2508.18740]. In the anomaly detection context, however, MECAD specifically denotes the multi-expert continual anomaly detection framework introduced for MVTec AD and industrial inspection scenarios [2512.15323].

Source: https://www.emergentmind.com/topics/mecad