# Data-driven Design of Context-aware Monitors for Hazard Prediction in Artificial Pancreas Systems

arXiv: https://arxiv.org/abs/2104.02545 · HTML: https://mlsanity.com/paper/2104.02545/

## Key facts

- Cited by 5 papers in the map (data through 14 Oct 2026).
- Builds on 16 of its 99 references that are in the map.
- First posted on arXiv 6 Apr 2021.

## Builds on (most cited first, 16 of 16)

- [Adam: A Method for Stochastic Optimization](https://mlsanity.com/paper/1412.6980/) (2014)
- [Explaining and Harnessing Adversarial Examples](https://mlsanity.com/paper/1412.6572/) (2014)
- [Evaluating Real-time Anomaly Detection Algorithms - the Numenta Anomaly Benchmark](https://mlsanity.com/paper/1510.03336/) (2015)
- [Machine Learning for Neuroimaging with Scikit-Learn](https://mlsanity.com/paper/1412.3919/) (2014)
- [Precision and Recall for Time Series](https://mlsanity.com/paper/1803.03639/) (2018)
- [Robust Online Monitoring of Signal Temporal Logic](https://mlsanity.com/paper/1506.08234/) (2015)
- [A Theory of Formal Synthesis via Inductive Learning](https://mlsanity.com/paper/1505.03953/) (2015)
- [ML-based Fault Injection for Autonomous Vehicles: A Case for Bayesian Fault Injection](https://mlsanity.com/paper/1907.01051/) (2019)
- [Real-Time Context-aware Detection of Unsafe Events in Robot-Assisted Surgery](https://mlsanity.com/paper/2005.03611/) (2020)
- [To Make a Robot Secure: An Experimental Analysis of Cyber Security Threats Against Teleoperated Surgical Robots](https://mlsanity.com/paper/1504.04339/) (2015)
- [Shield Synthesis for Real: Enforcing Safety in Cyber-Physical Systems](https://mlsanity.com/paper/1908.05402/) (2019)
- [Statistical Evaluation of Anomaly Detectors for Sequences](https://mlsanity.com/paper/2008.05788/) (2020)
- [Context-aware Monitoring in Robotic Surgery](https://mlsanity.com/paper/1901.09802/) (2019)
- [On-board Deep-learning-based Unmanned Aerial Vehicle Fault Cause Detection and Identification](https://mlsanity.com/paper/2005.00336/) (2020)
- [A Primal-Dual Quasi-Newton Method for Exact Consensus Optimization](https://mlsanity.com/paper/1809.01212/) (2018)
- [A Logic-Based Learning Approach to Explore Diabetes Patient Behaviors](https://mlsanity.com/paper/1906.10073/) (2019)

## Built on by (most cited first, 5 of 5)

- [Robustness Testing of Data and Knowledge Driven Anomaly Detection in Cyber-Physical Systems](https://mlsanity.com/paper/2204.09183/) (2022)
- [Short: Basal-Adjust: Trend Prediction Alerts and Adjusted Basal Rates for Hyperglycemia Prevention](https://mlsanity.com/paper/2303.09913/) (2023)
- [KnowSafe: Combined Knowledge and Data Driven Hazard Mitigation in Artificial Pancreas Systems](https://mlsanity.com/paper/2311.07460/) (2023)
- [Integrating Neural Differential Forecasting with Safe Reinforcement Learning for Blood Glucose Regulation](https://mlsanity.com/paper/2511.12417/) (2025)
- [Spatiotemporal-Aware Bit-Flip Injection on DNN-based Advanced Driver Assistance Systems (extended version)](https://mlsanity.com/paper/2604.03753/) (2026)

## Abstract (arXiv)

Medical Cyber-physical Systems (MCPS) are vulnerable to accidental or malicious faults that can target their controllers and cause safety hazards and harm to patients. This paper proposes a combined model and data-driven approach for designing context-aware monitors that can detect early signs of hazards and mitigate them in MCPS. We present a framework for formal specification of unsafe system context using Signal Temporal Logic (STL) combined with an optimization method for patient-specific refinement of STL formulas based on real or simulated faulty data from the closed-loop system for the generation of monitor logic. We evaluate our approach in simulation using two state-of-the-art closed-loop Artificial Pancreas Systems (APS). The results show the context-aware monitor achieves up to 1.4 times increase in average hazard prediction accuracy (F1-score) over several baseline monitors, reduces false-positive and false-negative rates, and enables hazard mitigation with a 54% success rate while decreasing the average risk for patients.
