MECAD: Multi-Expert Anomaly Detection
- The paper introduces MECAD, a framework that employs a multi-expert architecture to mitigate catastrophic forgetting in continual anomaly detection.
- It integrates a shared frozen feature extractor with PatchCore-style memory banks, coreset selection, and expert-specific replay buffers to achieve fast, efficient updates.
- Empirical evaluations on MVTec AD show improved AUROC and reduced forgetting, balancing expert specialization with stringent memory and computational constraints.
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 (Dahmardeh et al., 17 Dec 2025).
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 (Dahmardeh et al., 17 Dec 2025).
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 (Dahmardeh et al., 17 Dec 2025).
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 (Dahmardeh et al., 17 Dec 2025).
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 (Dahmardeh et al., 17 Dec 2025).
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 , and patch embeddings are formed at patch size (Dahmardeh et al., 17 Dec 2025).
The expert set is fixed as , with experiments varying 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 (Dahmardeh et al., 17 Dec 2025).
A similarity-driven router governs class-to-expert assignment. For a class with embeddings , MECAD computes the class centroid
For expert with memory embeddings , the expert centroid is
Assignment uses cosine similarity between these centroids,
0
followed by the thresholded rule
1
with 2 (Dahmardeh et al., 17 Dec 2025).
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 (Dahmardeh et al., 17 Dec 2025).
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:
3
where 4 is the nearest-neighbor distance in embedding space, consistent with PatchCore’s kNN scoring (Dahmardeh et al., 17 Dec 2025).
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 (Dahmardeh et al., 17 Dec 2025).
The coreset mechanism follows the standard objective of selecting a subset 5 of size 6 that minimizes the worst-case distance from embeddings to their representatives:
7
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 (Dahmardeh et al., 17 Dec 2025).
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 8 is assigned to expert 9, the memory update is
0
where 1 is the selected coreset for class 2, 3 denotes replay samples from previously assigned class 4, and 5 is the class set assigned to 6 (Dahmardeh et al., 17 Dec 2025).
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 (Dahmardeh et al., 17 Dec 2025).
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 (Dahmardeh et al., 17 Dec 2025).
When a new class arrives, MECAD performs the following sequence. Patch embeddings 7 are extracted and the class centroid 8 is computed. Similarity scores 9 are evaluated for all experts, and the class is assigned according to the threshold rule with 0. A coreset 1 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 2, 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 (Dahmardeh et al., 17 Dec 2025).
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 (Dahmardeh et al., 17 Dec 2025).
During inference for a test image from class 3, MECAD routes the image to expert 4, extracts patch embeddings 5, and computes the image-level anomaly score by nearest-neighbor distance against that expert’s memory bank (Dahmardeh et al., 17 Dec 2025). 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 (Dahmardeh et al., 17 Dec 2025).
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 (Dahmardeh et al., 17 Dec 2025).
Forgetting continues to improve as the number of experts increases. Reported forgetting values are severe for the single-expert setting at 6, improved for 5 experts at 7, and further reduced for 8 experts at 8 (Dahmardeh et al., 17 Dec 2025). 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 (Dahmardeh et al., 17 Dec 2025). 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 (Dahmardeh et al., 17 Dec 2025).
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 (Dahmardeh et al., 17 Dec 2025).
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 (Dahmardeh et al., 17 Dec 2025).
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 (Dahmardeh et al., 17 Dec 2025).
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 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 (Dahmardeh et al., 17 Dec 2025).
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 (Dahmardeh et al., 17 Dec 2025).
The acronym “MECAD” is also used ambiguously in adjacent literature. It may refer to “MECAD: A multi-expert architecture for continual anomaly detection” (Dahmardeh et al., 17 Dec 2025), but similarly spelled names appear elsewhere, including EMCAD, a medical image segmentation decoder sometimes informally referred to as MECAD (Rahman et al., 2024), and MECAD as the name of multimodal conversational emotion-cause datasets in later benchmark papers (Pan et al., 17 Jun 2026, Liang et al., 26 Aug 2025). In the anomaly detection context, however, MECAD specifically denotes the multi-expert continual anomaly detection framework introduced for MVTec AD and industrial inspection scenarios (Dahmardeh et al., 17 Dec 2025).