Barrier-Certified Learning-Enabled Safe Control Design for Systems Operating in Uncertain Environments Zahra Marvi, Student Member, IEEE, and Bahare Kiumarsi, Member, IEEE Abstract—This paper presents learning-enabled barrier- certified safe controllers for systems that operate in a shared environment for which multiple systems with uncertain dynamics and behaviors interact. That is, safety constraints are imposed by not only the ego system’s own physical limitations but also other systems operating nearby. Since the model of the external agent is required to impose control barrier functions (CBFs) as safety constraints, a safety-aware loss function is defined and minimized to learn the uncertain and unknown behavior of external agents. More specifically, the loss function is defined based on barrier function error, instead of the system model error, and is minimized for both current samples as well as past samples stored in the memory to assure a fast and generalizable learning algorithm for approximating the safe set. The proposed model learning and CBF are then integrated together to form a learning-enabled zeroing CBF (L-ZCBF), which employs the approximated trajectory information of the external agents provided by the learned model but shrinks the safety boundary in case of an imminent safety violation using instantaneous sensory observations. It is shown that the proposed L-ZCBF assures the safety guarantees during learning and even in the face of inaccurate or simplified approximation of external agents, which is crucial in safety-critical applications in highly interactive environments. The efficacy of the proposed method is examined in a simulation of safe maneuver control of a vehicle in an urban area. Index Terms—Control barrier functions (CBFs), experience replay, learning, safety-critical systems, uncertainty. I. Introduction T O deploy safety-critical systems in the real world, it is of vital importance to assure that their states evolve within a safe set under which satisfaction of their safety constraints is guaranteed. These safety constraints might be imposed either internally by physical limitations of the system (e.g., actuator saturation) or by external environmental factors (e.g., surrounding agents). Examples of environmental factors that affect the safety of a control system are a robot sharing its operational space with other robots in a factory and an autonomous car running in a shared road with other vehicles. Satisfaction of safety constraints is crucial and needs to be considered during the control design phase because their violation can have catastrophic consequences. Moreover, conflicts can always arise between safety and performance requirements, and, in a conflicting situation, safety objectives must always be prioritized to the performance. For example, in the adaptive cruise control system, the system’s performance level that can be achieved without safety violation in terms of reaching the desired speed depends on the traffic situation and assuring a safe maneuver (maintaining a safe distance from the vehicle ahead) must be prioritized to the performance. Safe control methods based on control barrier functions (CBFs) have been successfully designed for a broad range of applications. This includes adaptive cruise control problem in [1], [2], safe control of robots [3], [4] and collision-free multi- agents systems [5], [6]. These methods generally integrate CBFs and control Lyapunov functions and solve a point-wise quadratic programming optimization problem to certify the safety and stability of a nominal controller. CBFs are conceptually similar to Lyapunov functions and are used to ensure forward invariance of a specific set. However, these methods require complete knowledge of the system dynamics as well as the feasible set. Nevertheless, for the systems that operate in uncertain environments, the safe or feasible set is uncertain: safety criteria are affected by some external factors with possibly uncertain or unknown behaviors which are not known a priori. For example, in autonomous vehicles, the operation platform of vehicles is highly complicated and shared between autonomous, semi- autonomous, and human driving vehicles and pedestrians. Therefore, it is necessary to design a controller that can ensure the safety of the system despite the uncertainty in the feasible set due to the existence of unknown external agents while reaching as much performance as possible. To account for uncertainties in designing safe controllers, several robust and adaptive approaches are presented. In [7], robustness of zeroing CBFs (ZCBFs) under model perturbation is investigated. It is shown that the existence of ZCBF ensures the input-to-state stability of the safe set under perturbations. However, external agents that affect the safety of the ego system cannot be modeled as perturbation. The fuzzy logic method is employed to model decentralized uncertain systems in [8]. In [9], neural networks (NNs) are used to estimate the uncertain system, and a finite-time control Manuscript received May 4, 2021; revised July 8, 2021 and August 30, 2021; accepted September 23, 2021. Recommended by Associate Editor Qinglai Wei. (Corresponding author: Bahare Kiumarsi.) Citation: Z. Marvi and B. Kiumarsi, “Barrier-certified learning-enabled safe control design for systems operating in uncertain environments,” IEEE/CAA J. Autom. Sinica, vol. 9, no. 3, pp. 437–449, Mar. 2022. The authors are with the Department of Electrical and Computer Engineering, Michigan State University, MI 48824 USA (e-mail: marvizah@msu.edu; kiumarsi@msu.edu). Color versions of one or more of the figures in this paper are available online at http://ieeexplore.ieee.org. Digital Object Identifier 10.1109/JAS.2021.1004347 IEEE/CAA JOURNAL OF AUTOMATICA SINICA, VOL. 9, NO. 3, MARCH 2022 437