Deep Reinforcement Learning (DRL) algorithms have been increasingly employed during the last decade to solve various decision-making problems such as autonomous driving and robotics. However, these algorithms have faced great challenges when deployed in safety-critical environments since they often exhibit erroneous behaviors that can lead to potentially critical errors. One way to assess the safety of DRL agents is to test them to detect possible faults leading to critical failures during their execution. This raises the question of how we can efficiently test DRL policies to ensure their correctness and adherence to safety requirements. Most existing works on testing DRL agents use adversarial attacks that perturb states or actions of the agent. However, such attacks often lead to unrealistic states of the environment. Their main goal is to test the robustness of DRL agents rather than testing the compliance of agents' policies with respect to requirements. Due to the huge state space of DRL environments, the high cost of test execution, and the black-box nature of DRL algorithms, the exhaustive testing of DRL agents is impossible. In this paper, we propose a Search-based Testing Approach of Reinforcement Learning Agents (STARLA) to test the policy of a DRL agent by effectively searching for failing executions of the agent within a limited testing budget. We use machine learning models and a dedicated genetic algorithm to narrow the search towards faulty episodes. We apply STARLA on Deep-Q-Learning agents which are widely used as benchmarks and show that it significantly outperforms Random Testing by detecting more faults related to the agent's policy. We also investigate how to extract rules that characterize faulty episodes of the DRL agent using our search results. Such rules can be used to understand the conditions under which the agent fails and thus assess its deployment risks.
翻译:近十年来,深度强化学习(DRL)算法已经被广泛应用于自动驾驶和机器人等诸多决策问题的解决中。然而,DRL算法在安全关键环境中的应用面临巨大挑战,因为它们经常表现出可能导致潜在危险的错误行为。一种评估DRL智能体安全性的方法是通过测试来检测可能导致其执行期间出现关键故障的故障。这引发了一个问题:我们如何高效地测试DRL策略以确保其正确性和对安全要求的遵守。大多数现有的测试DRL智能体的工作使用敌对攻击来扰乱智能体的状态或动作。然而,这种攻击往往会导致环境出现不现实的状态。它们的主要目的是测试DRL智能体的稳健性,而不是测试智能体政策的合规性。由于DRL环境的巨大状态空间、测试执行的高成本以及DRL算法的黑盒性质,无法对DRL智能体进行详尽测试。在本文中,我们提出了一种基于搜索的强化学习智能体(STARLA)测试方法,通过在有限的测试预算内有效地搜索智能体的失败执行情况来测试DRL智能体的策略。我们使用机器学习模型和专门的遗传算法来缩小失败情况的搜索范围。我们将STARLA应用于广泛用作基准的Deep-Q-Learning智能体,并显示它比随机测试表现更优秀,可以检测到更多与智能体策略相关的故障。我们还研究了如何使用我们的搜索结果提取表征DRL智能体故障情况的规则。这样的规则可以用于了解智能体不成功的条件,从而评估其部署风险。