Safety-Calibrated Out-of-Distribution Prediction via Contrastive Embeddings for Safety-Critical Systems
Abstract
1. Introduction
- Nuclear power plant accident diagnosis is formulated as an out-of-distribution prediction problem subject to explicit safety constraints, prioritizing statistical control of false-alarm rates over heuristic thresholding.
- A causal, contrastive temporal representation framework is developed to structure multivariate sensor streams into compact, class-consistent manifolds on a hyperspherical embedding space.
- A k-nearest-neighbor density nonconformity score is introduced; ablated against prototype distance, entropy, and conservative maximum fusion; and split-conformal calibration is performed at the trajectory level under a monotone rejection policy, providing finite-sample control over the probability that a known accident run is ever rejected as unknown.
- SCOPE is evaluated on the NPPAD benchmark using a high-openness protocol, and reliability, per-family detection behavior, and time-to-rejection metrics are reported to characterize both safety compliance and operational responsiveness.
2. Related Works
2.1. Data-Driven Accident Diagnosis in Nuclear Power Plants
2.2. Out-of-Distribution Detection and Open Set Recognition
2.3. Contrastive Representation Learning
2.4. Conformal Prediction for Safety Calibration
3. Methodology
| Algorithm 1 SCOPE training and prototype construction. |
|
| Algorithm 2 SCOPE safety calibration and deployed decision rule. |
Compute run scores:
|
3.1. Problem Setup and Decision Rule
3.2. Causal Contrastive Representation Learning
3.3. Prototype Construction and Density-Based Nonconformity Scoring
3.3.1. Prototype Distance Score
3.3.2. Entropy Score
3.3.3. k-Nearest Neighbor Density Score
3.3.4. Deployed Nonconformity Score and Alternatives
3.4. Trajectory-Level Aggregation and Monotone Policy
3.5. Split-Conformal Calibration at the Trajectory Level
Finite-Sample Guarantee for Known Trajectories
3.6. Safety Margins for Run-Wise Exchangeability Violations
3.7. Deployed Decision Rule
4. Experimental Setup
4.1. Dataset and Preprocessing
4.2. Known and Unknown Accident Families
4.3. Data Splitting and Calibration Protocol
- Training set (50%): Used exclusively to learn the causal contrastive encoder and to construct class prototypes, as discussed via Algorithm 1.
- Validation set (10%): Used for model selection based on known-class macro-F1 performance without access to unknown families or calibration procedures.
- Calibration set (20%): Used solely to compute the split-conformal threshold on trajectory-level nonconformity scores as discussed via Algorithm 2.
- Test set (20% of known trajectories + all unknown trajectories): Used for final evaluation of safety compliance and OOD detection performance.
4.4. Evaluation Metrics
4.4.1. Safety Compliance
4.4.2. True Unknown Rate Detection
4.4.3. Classification Accuracy on Accepted Trajectories
4.4.4. Time-to-Rejection
4.5. Hyperparameter Selection and Sensitivity Analysis
5. Results and Discussion
5.1. Conformal Safety Compliance
5.2. OOD Detection Performance
5.3. Time-to-Rejection Analysis
5.4. Sensitivity Analysis
5.5. Discussion
6. Conclusions
Funding
Data Availability Statement
Conflicts of Interest
References
- Amodei, D.; Olah, C.; Steinhardt, J.; Christiano, P.; Schulman, J.; Mané, D. Concrete Problems in AI Safety. arXiv 2016, arXiv:1606.06565. [Google Scholar] [CrossRef]
- Hendrycks, D.; Gimpel, K. A Baseline for Detecting Misclassified and Out-of-Distribution Examples in Neural Networks. arXiv 2017. [Google Scholar] [CrossRef]
- Bendale, A.; Boult, T. Towards Open Set Deep Networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition; IEEE: New York, NY, USA, 2016; pp. 1563–1572. [Google Scholar]
- Kim, S.G.; Chae, Y.H.; Koo, S.R. Application of an open-set recognition method for detecting untrained accident scenarios in a nuclear power plant accident diagnosis model. Nucl. Eng. Des. 2024, 427, 113421. [Google Scholar] [CrossRef]
- Li, J.; Lin, M.; Wang, B.; Tian, R.; Tan, S.; Li, Y.; Chen, J. Open set recognition fault diagnosis framework based on convolutional prototype learning network for nuclear power plants. Energy 2024, 290, 130101. [Google Scholar] [CrossRef]
- Zhou, S.; Lin, M.; Huang, S.; Xiao, K. Open set compound fault recognition method for nuclear power plant based on label mask weighted prototype learning. Appl. Energy 2024, 369, 123603. [Google Scholar] [CrossRef]
- Vovk, V.; Gammerman, A.; Shafer, G. Algorithmic Learning in a Random World; Springer: New York, NY, USA, 2005. [Google Scholar] [CrossRef]
- Angelopoulos, A.N.; Bates, S. Conformal Prediction: A Gentle Introduction. Found. Trends Mach. Learn. 2023, 16, 494–591. [Google Scholar] [CrossRef]
- Zaffran, M.; Féron, O.; Goude, Y.; Josse, J.; Dieuleveut, A. Adaptive Conformal Predictions for Time Series. In Proceedings of the International Conference on Machine Learning; PMLR: Cambridge, MA, USA, 2022; pp. 25834–25866. [Google Scholar] [CrossRef]
- Lin, Z.; Trivedi, S.; Sun, J. Conformal Prediction Intervals with Temporal Dependence. arXiv 2022. [Google Scholar] [CrossRef]
- Khosla, P.; Teterwak, P.; Wang, C.; Sarna, A.; Tian, Y.; Isola, P.; Maschinot, A.; Liu, C.; Krishnan, D. Supervised contrastive learning. In Proceedings of the 34th International Conference on Neural Information Processing Systems, Red Hook, NY, USA, 6–12 December 2020. NIPS ’20. [Google Scholar]
- Wang, T.; Isola, P. Understanding contrastive representation learning through alignment and uniformity on the hypersphere. In Proceedings of the 37th International Conference on Machine Learning; JMLR.org: Norfolk, MA, USA, 2020; ICML’20. [Google Scholar]
- Qi, B.; Xiao, X.; Liang, J.; Po, L.c.C.; Zhang, L.; Tong, J. An open time-series simulated dataset covering various accidents for nuclear power plants. Sci. Data 2022, 9, 766. [Google Scholar] [CrossRef] [PubMed]
- Saeed, H.A.; Peng, M.; Wang, H.; Zhang, B. Novel fault diagnosis scheme utilizing deep learning networks. Prog. Nucl. Energy 2020, 118, 103066. [Google Scholar] [CrossRef]
- Lee, G.; Lee, S.J.; Lee, C. A convolutional neural network model for abnormality diagnosis in a nuclear power plant. Appl. Soft Comput. 2021, 99, 106874. [Google Scholar] [CrossRef]
- She, J.; Shi, T.; Xue, S.; Zhu, Y.; Lu, S.; Sun, P.; Cao, H. Diagnosis and Prediction for Loss of Coolant Accidents in Nuclear Power Plants Using Deep Learning Methods. Front. Energy Res. 2021, 9, 665262. [Google Scholar] [CrossRef]
- Bai, S.; Kolter, J.Z.; Koltun, V. An Empirical Evaluation of Generic Convolutional and Recurrent Networks for Sequence Modeling. arXiv 2018, arXiv:1803.01271. [Google Scholar] [CrossRef]
- An, J.; Cho, S. Variational autoencoder based anomaly detection using reconstruction probability. Spec. Lect. IE 2015, 2, 1–18. [Google Scholar]
- Liang, S.; Li, Y.; Srikant, R. Enhancing The Reliability of Out-of-distribution Image Detection in Neural Networks. arXiv 2018. [Google Scholar] [CrossRef]
- Liu, W.; Wang, X.; Owens, J.D.; Li, Y. Energy-based out-of-distribution detection. In Proceedings of the 34th International Conference on Neural Information Processing Systems, Red Hook, NY, USA, 6–12 December 2020. NIPS ’20. [Google Scholar]
- Fort, S.; Ren, J.; Lakshminarayanan, B. Exploring the limits of out-of-distribution detection. In Proceedings of the 35th International Conference on Neural Information Processing Systems, Red Hook, NY, USA, 6–14 December 2021. NIPS ’21. [Google Scholar]
- Antony Asir Daniel, V.; Vijayalakshmi, K.; Pawar, P.P.; Kumar, D.; Bhuvanesh, A.; Josephine Christilda, A. Enhanced affinity propagation clustering with a modified extreme learning machine for segmentation and classification of hyperspectral imaging. E-Prime-Adv. Electr. Eng. Electron. Energy 2024, 9, 100704. [Google Scholar] [CrossRef]
- Snell, J.; Swersky, K.; Zemel, R.S. Prototypical Networks for Few-shot Learning. In Proceedings of the Advances in Neural Information Processing Systems (NeurIPS); NeurIPS: Denver, CA, USA, 2017; Volume 30. [Google Scholar]
- Sun, Y.; Ming, Y.; Zhu, X.; Li, Y. Out-of-Distribution Detection with Deep Nearest Neighbors. In Proceedings of the 39th International Conference on Machine Learning (ICML); PMLR: Cambridge, MA, USA, 2022; Volume 162, pp. 20827–20840. [Google Scholar]
- Wilson, E.B. Probable Inference, the Law of Succession, and Statistical Inference. J. Am. Stat. Assoc. 1927, 22, 209–212. [Google Scholar] [CrossRef]
- International Atomic Energy Agency. Development and Review of Plant Specific Emergency Operating Procedures; Technical Report 48; International Atomic Energy Agency: Vienna, Austria, 2006. [Google Scholar]
- Todreas, N.E.; Kazimi, M.S. Nuclear Systems Volume I: Thermal Hydraulic Fundamentals, 3rd ed.; CRC Press: Boca Raton, FL, USA, 2021. [Google Scholar] [CrossRef]
- International Atomic Energy Agency. Accident Analysis for Nuclear Power Plants; IAEA Safety Report Series No. 23 STI/PUB/1131; International Atomic Energy Agency: Vienna, Austria, 2002. [Google Scholar]
- U.S. Nuclear Regulatory Commission. Severe Accident Risks: An Assessment for Five U.S. Nuclear Power Plants; Technical Report 1150; U.S. Nuclear Regulatory Commission: Washington, DC, USA, 1990.
- Guo, C.; Pleiss, G.; Sun, Y.; Weinberger, K.Q. On Calibration of Modern Neural Networks. In Proceedings of the 34th International Conference on Machine Learning (ICML); PMLR: Cambridge, MA, USA, 2017; Volume 70, pp. 1321–1330. [Google Scholar]
- Hanley, J.A.; McNeil, B.J. The Meaning and Use of the Area under a Receiver Operating Characteristic (ROC) Curve. Radiology 1982, 143, 29–36. [Google Scholar] [CrossRef] [PubMed]
- Lee, K.; Lee, K.; Lee, H.; Shin, J. A simple unified framework for detecting out-of-distribution samples and adversarial attacks. In Proceedings of the Advances in Neural Information Processing Systems; NeurIPS: Denver, CA, USA, 2018; Volume 31. [Google Scholar]
- Gal, Y.; Ghahramani, Z. Dropout as a Bayesian approximation: Representing model uncertainty in deep learning. In Proceedings of the International Conference on Machine Learning; PMLR: Cambridge, MA, USA, 2016; pp. 1050–1059. [Google Scholar]






| OOD Family | No. of Trajectories | Transient Severity * | Evaluation Status |
|---|---|---|---|
| Statistically Valid Families () | |||
| LLB (Letdown Line Break) | 101 | Mild (small-break CVCS) | Primary |
| MD (Moderator Dilution) | 100 | Mild (slow reactivity) | Primary |
| RW (Rod Withdrawal) | 100 | Severe (rapid reactivity) | Primary |
| LR (Load Rejection) | 99 | Mild (turbine transient) | Primary |
| RI (Rod Insertion) | 82 | Severe (rapid reactivity) | Primary |
| Singleton Families () | |||
| ATWS (Anticipated Transient Without Scram) | 1 | Severe | Descriptive only |
| LACP (Loss of AC Power) | 1 | Severe | Descriptive only |
| LOF (Loss of Flow) | 1 | Severe | Descriptive only |
| Normal (Normal Operation) | 1 | Baseline | Descriptive only |
| SP (Seizure of Primary Pump) | 1 | Severe | Descriptive only |
| TT (Turbine Trip) | 1 | Mild | Descriptive only |
| Total (Primary, 98.8% of OOD) | 482 | ||
| Total (All) | 488 | ||
| Target | Corrected | Empirical FPR (↓) | TUR (↑) |
|---|---|---|---|
| 0.01 | 0.007 | ||
| 0.05 | 0.033 | ||
| 0.10 | 0.066 |
| OOD Score | Run-Level AUROC (↑) |
|---|---|
| OpenMax [3] | |
| MSP [2] | |
| Energy [20] | |
| Autoencoder (recon.) ∗ [18] | |
| MC-dropout entropy [33] | |
| ODIN [19] | |
| Mahalanobis [32] | |
| SCOPE (-NN density) |
| OOD Family | No. of Trajectories | Detection Rate (%) (↑) | Median TTR (s) (↓) |
|---|---|---|---|
| RW (Rod Withdrawal) | 100 | 290 | |
| LR (Load Rejection) | 99 | 302 | |
| RI (Rod Insertion) | 82 | 290 | |
| LLB (Letdown Line Break) | 101 | 290 | |
| MD (Moderator Dilution) | 100 | — | |
| Overall (Valid) | 482 | ≈81 | 290 |
| Nonconformity Score | AUROC (↑) | TUR (↑) | FPR |
|---|---|---|---|
| Prototype-only | |||
| Entropy-only | |||
| Hybrid (max fusion) | |||
| Density (deployed) |
| Parameter | Value | Mean F1 (↑) | Peak F1 (↑) | Std (↓) | Tuning Gap (↓) |
|---|---|---|---|---|---|
| Window Size (L) | 30 steps | 0.945 | 0.987 | 0.116 | 0.042 |
| 60 steps | 0.986 | 0.987 | 0.004 | 0.001 | |
| 90 steps | 0.930 | 0.987 | 0.107 | 0.057 | |
| Temperature () | 0.05 | 0.970 | 0.987 | 0.043 | 0.017 |
| 0.07 | 0.945 | 0.987 | 0.116 | 0.042 | |
| 0.10 | 0.946 | 0.987 | 0.105 | 0.041 | |
| Embedding Dim (D) | 32 | 0.950 | 0.987 | 0.106 | 0.037 |
| 64 | 0.940 | 0.987 | 0.115 | 0.047 | |
| 128 | 0.971 | 0.987 | 0.043 | 0.016 | |
| k-NN Neighbors (k) | 5 | 0.954 | 0.987 | 0.095 | 0.034 |
| 10 | 0.954 | 0.987 | 0.095 | 0.034 | |
| 20 | 0.954 | 0.987 | 0.095 | 0.034 | |
| k-NN Weight (w) | 0.3 | 0.954 | 0.987 | 0.095 | 0.034 |
| 0.5 | 0.954 | 0.987 | 0.095 | 0.034 | |
| 0.7 | 0.954 | 0.987 | 0.095 | 0.034 |
| k | 1 | 5 | 10 | 20 | 50 |
|---|---|---|---|---|---|
| AUROC (↑) | 0.868 ±0.030 | 0.859 ±0.033 | 0.852 ±0.033 | 0.836 ±0.032 | 0.826 ±0.028 |
| FPR ( = 0.05) |
| Withheld Family | FPR (Known) (↓) | Detection of Withheld (↑) | Overall AUROC (↑) |
|---|---|---|---|
| LOCA | |||
| SGTR | |||
| MSLB | |||
| FLB |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Aseeri, A.O. Safety-Calibrated Out-of-Distribution Prediction via Contrastive Embeddings for Safety-Critical Systems. Electronics 2026, 15, 2408. https://doi.org/10.3390/electronics15112408
Aseeri AO. Safety-Calibrated Out-of-Distribution Prediction via Contrastive Embeddings for Safety-Critical Systems. Electronics. 2026; 15(11):2408. https://doi.org/10.3390/electronics15112408
Chicago/Turabian StyleAseeri, Ahmad O. 2026. "Safety-Calibrated Out-of-Distribution Prediction via Contrastive Embeddings for Safety-Critical Systems" Electronics 15, no. 11: 2408. https://doi.org/10.3390/electronics15112408
APA StyleAseeri, A. O. (2026). Safety-Calibrated Out-of-Distribution Prediction via Contrastive Embeddings for Safety-Critical Systems. Electronics, 15(11), 2408. https://doi.org/10.3390/electronics15112408

