UACR: Uncertainty-Aware Routing for Explainable Industrial Anomaly Detection

UACR uses uncertainty-aware routing to dynamically allocate computation, balancing accuracy, latency, and explainability in industrial anomaly detection.
UACR is a two-stage uncertainty-aware cooperative routing framework for industrial anomaly detection. Stage one trains the detection module offline and calibrates the uncertainty estimator via hyperparameter search; stage two dispatches each sample online to a lightweight or complex detection path based on estimated uncertainty, giving ambiguous samples deeper analysis. On public datasets, accuracy improves by over 5.16%, latency drops by over 31.5%, and explainability rises by over 15%. Its core insight: uneven sample difficulty means uniform computation wastes resources or lacks precision, while on-demand allocation meets both real-time and reliability needs. Limitations include dependence on estimator calibration quality and added engineering complexity from multi-path scheduling.
Industrial anomaly detection requires not only accurate identification of anomalies but also trustworthy explanations for operators, all while meeting the strict latency constraints of online detection. However, existing methods typically apply a fixed computational path to all samples, making it difficult to strike a good balance among detection accuracy, inference efficiency, and explainability. To address this, researchers propose UACR—an uncertainty-aware cooperative routing framework designed to deliver reliable anomaly decisions and operator-facing explanations under an online detection budget, adaptively allocating computational resources so that ambiguous samples receive deeper analysis.

Two-Stage Framework: Offline Training and Online Adaptive Routing
The UACR framework consists of two stages. Stage one is offline training and routing hyperparameter search, which learns the anomaly detection module and calibrates the uncertainty estimator that drives routing. Stage two is uncertainty-aware adaptive routing, which collaboratively dispatches each input to different detection paths based on its estimated uncertainty. This design enables the system to dynamically adjust computational investment, allocating more resources to high-uncertainty samples and thereby optimizing the overall efficiency-accuracy trade-off.
Stage One: Offline Training and Hyperparameter Search
The core of this stage is training the anomaly detection module and calibrating the uncertainty estimator. The accuracy of uncertainty estimation directly determines the quality of routing decisions, so researchers use offline hyperparameter search to optimize the routing strategy, ensuring the estimator reliably reflects each sample's degree of ambiguity.
Uncertainty calibration is the process of aligning the estimator's output confidence with actual correctness rates. Common methods include Temperature Scaling and Conformal Prediction. In routing scenarios, only calibrated uncertainty scores can serve as reliable threshold criteria—if the estimator is overconfident, difficult samples will be mistakenly sent to lightweight paths; if it is overly conservative, large numbers of simple samples flood into complex paths, canceling out efficiency gains. Therefore, the offline stage typically adopts Expected Calibration Error (ECE) or Negative Log-Likelihood (NLL) as calibration objectives, and searches on the validation set for joint hyperparameters of routing thresholds and path allocation strategies.
Stage Two: Uncertainty-Aware Adaptive Routing
During online inference, each input first passes through uncertainty estimation and is then cooperatively dispatched to an appropriate detection path. Low-uncertainty samples take lightweight paths for fast processing, while high-uncertainty samples enter more complex analysis pipelines. This cooperative scheduling mechanism achieves on-demand allocation of computational resources, reducing average latency while maintaining accuracy.
Cooperative routing draws on the gating idea from Mixture-of-Experts (MoE) systems: a lightweight gating network decides which expert path to activate based on input features. Unlike MoE, UACR's gating signal comes from uncertainty estimation rather than learnable routing weights, and the paths are cascaded or parallel detection pipelines rather than homogeneous experts. The advantage of this design is that routing decisions have a clear statistical interpretation—the threshold directly corresponds to "how confident we are that the sample will be correctly classified"—making them easier for operators to understand and audit, and allowing the routing strategy to be adjusted without retraining the detector.
Experimental Results: Comprehensive Improvements in Accuracy, Latency, and Explainability
Experiments on multiple public datasets show that UACR achieves significant improvements over baseline methods: accuracy increases by over 5.16%, latency decreases by over 31.5%, and industrial inspection explainability improves by over 15%. These results validate the effectiveness of uncertainty-aware routing in balancing detection performance and efficiency.
Analysis: The Value and Limitations of Adaptive Computation
UACR's core insight is that sample difficulty in industrial anomaly detection is unevenly distributed, and a uniform computational path either wastes resources or underperforms on difficult samples. Through uncertainty-driven routing, the system can concentrate computation where it is truly needed, aligning with the dual requirements of real-time performance and reliability in actual production lines.
However, the method depends on the calibration quality of the uncertainty estimator. If the estimator fails on certain out-of-distribution samples, routing decisions may deviate from the optimal path. Additionally, multi-path cooperative scheduling increases system complexity, and practical deployment must consider engineering implementation costs. Future work could explore lighter-weight uncertainty estimation methods and extend routing strategies to more diverse industrial scenarios.
Out-of-Distribution (OOD) samples refer to inputs that differ significantly from the training distribution. In industrial settings, these may be images caused by novel defect types, sudden lighting changes, or sensor drift. Uncertainty estimators calibrated on the training set often produce unreliable scores on OOD samples—they may assign high uncertainty because features lie far from the training manifold (in which case routing to complex paths is still reasonable), or they may erroneously assign low uncertainty due to model over-generalization (in which case samples are missed by lightweight paths). Mitigation measures include incorporating auxiliary OOD detection signals, online monitoring of routing distribution drift, and setting up manual review fallbacks for low-confidence routing results.
One-line Summary
UACR uses uncertainty-aware routing to dynamically allocate computation, balancing accuracy, latency, and explainability in industrial anomaly detection.
Paragraph Summary
UACR is a two-stage uncertainty-aware cooperative routing framework for industrial anomaly detection. Stage one trains the detection module offline and calibrates the uncertainty estimator, optimizing the routing strategy through hyperparameter search; stage two, during online inference, dispatches each sample to a lightweight or complex detection path based on its estimated uncertainty, giving ambiguous samples deeper analysis. On multiple public datasets, the method improves accuracy by over 5.16%, reduces latency by over 31.5%, and boosts explainability by over 15%. Its core insight is that industrial sample difficulty is unevenly distributed—a uniform computational path either wastes resources or lacks precision—whereas on-demand computation allocation can simultaneously meet production line requirements for real-time performance and reliability. Limitations include the routing's heavy dependence on the calibration quality of the uncertainty estimator and the added engineering complexity of multi-path scheduling.
Related articles

Prompt Engineering for Beginners: From Writing Prompts to Engineering Thinking
Starting from the essence and four functions of prompts, this article systematically explains the six-step process, four success criteria, learning value, and practical limitations of prompt engineering to help you build a complete understanding.

Anthropic Launches Nasdaq IPO: AI Giant's Listing and Risk Disclosures
Anthropic officially launches its Nasdaq IPO under ticker ANT, with market valuation expected to potentially exceed SpaceX's record. The prospectus devotes nearly 100 pages to AI risks, while first-half revenue grew over 14x but net losses widened sharply, reigniting the AI bubble debate.

Rust cURL Clone Uses 4,832 unsafe Blocks—Is the Memory Safety Myth Broken?
A Rust cURL clone uses 4,832 unsafe keywords, challenging Rust's memory safety narrative. We analyze what unsafe really means, compare Fil-C, and examine rewrite motives.