Safety Implications of Explainable Artificial Intelligence in End-to-End Autonomous Driving

Shahin Atakishiyev, Mohammad Salameh, Randy Goebel Shahin Atakishiyev is a PhD Candidate in the Department of Computing Science at the University of Alberta, Edmonton, AB, Canada. Email address<EMAIL_ADDRESS>
Mohammad Salameh is a Principal Researcher at Huawei Technologies Canada, Edmonton, AB, Canada. Email<EMAIL_ADDRESS>Randy Goebel is a Fellow of the Alberta Machine Intelligence Institute, and Professor in the Department of Computing Science, University of Alberta, Edmonton, AB, Canada. Email<EMAIL_ADDRESS>Manuscript has been submitted to IEEE for possible publication.

The end-to-end learning pipeline is gradually creating a paradigm shift in the ongoing development of highly autonomous vehicles, largely due to advances in deep learning, the availability of large-scale training datasets, and improvements in integrated sensor devices. However, a lack of interpretability in real-time decisions with contemporary learning methods impedes user trust and attenuates the widespread deployment and commercialization of such vehicles. Moreover, the issue is exacerbated when these cars are involved in or cause traffic accidents. Such drawback raises serious safety concerns from societal and legal perspectives. Consequently, explainability in end-to-end autonomous driving is essential to enable the safety of vehicular automation. However, the safety and explainability aspects of autonomous driving have generally been investigated disjointly by researchers in today’s state of the art. In this paper, we aim to bridge the gaps between these topics and seek to answer the following research question: When and how can explanations improve safety of autonomous driving? In this regard, we first revisit established safety and state-of-the-art explainability techniques in autonomous driving. Furthermore, we present three critical case studies and show the pivotal role of explanations in enhancing self-driving safety. Finally, we describe our empirical investigation and reveal potential value, limitations, and caveats with practical explainable AI methods on their role of assuring safety and transparency for vehicle autonomy.

Autonomous driving, explainable artificial intelligence, vehicular safety, regulatory compliance

§ INTRODUCTION

Over the last two decades, interest in developing operationally safe and reliable autonomous vehicles (AVs) has gained significant momentum. In particular, it is expected that deployment of at least partially AVs on roads will significantly reduce traffic accidents, injury, fatality rates <cit.>, and improve environmental sustainability by reducing traffic density and greenhouse gas emission <cit.>. However, road accidents and the lack of interpretability of decisions leading to such AV crashes are key hindrances to wide adoption of this technology both by consumers and general society. While supervised learning techniques like deep neural networks have achieved impressive empirical results in the vision systems of automated cars, the interpretability of mapping environmental perception to real-time decisions mostly remains unclear in modern AVs.

The Society of Automotive Engineers (SAE) has defined a classification system to assess the level of autonomy in autonomous vehicles <cit.>. According to this classification, the automated decision-making ability of these vehicles ranges from Level 0 (no driving automation) to Level 5 (no human intervention in any traffic situation). Starting from Level 3, most human-controlled functions of a vehicle are replaced with autonomous control methods, and such systems are called  “highly-automated.” Consequently, the importance of interpretability of autonomous driving mainly emerges at Level 3, due to increased reliance on the end-to-end learning ability of the intelligent driving system.

In general, the need for explainable AI (XAI) in autonomous driving has cross-disciplinary perspectives <cit.>. From a sociotechnical standpoint, the design and development techniques of intelligent vehicles need to be human-centered: a consumer’s prior opinions and expectations from this technology need to be taken into account. Another viewpoint, the psychological perspective, focuses on road accidents and safety concerns with automated vehicles. Finally, a philosophical perspective highlights that explaining temporal decisions of such vehicles can help to expose causal inferences made to support chosen actions. In this context, transportation jurisdictions and their regulatory bodies have recently considered these perspectives in the emerging development of standards to which both autonomous vehicle manufacturers and developers must comply. Based on these societal and legal perspectives, the General Data Protection Regulation (GDPR) of the European Union launched a set of guidelines in 2016 and coined the term “right to explanation” to highlight the significance of explainability for consumers in autonomous systems <cit.>. Moreover, recent traffic accidents caused by autonomous vehicles remain another serious concern regarding the acceptance of AV technologies from consumers' point of view. Ultimately, attaining these positive aspects in self-driving vehicles can also help deal with responsibility and liability issues, particularly in forensic analysis of road accidents <cit.>.

Based on this broad problem context, it is interesting that the topic of safe autonomous driving has been distinguished from explainable autonomous driving and investigated mostly disjointly by automotive researchers. However, as autonomous driving technology is a safety-critical application of AI, these concepts must be explored together. Motivated by this gap, the main research question in the scope of this study is formulated as follows: When and how can XAI methods enhance safety of autonomous vehicles? With this focus in mind, our paper makes the following contributions:

* We provide a tour d'horizon of the safety and explainability concepts in autonomous driving;

* We present analytical case studies where explaining temporal decisions in both real-time and post-hoc manners can help improve self-driving safety;

* We perform an empirical study and describe potential opportunities, challenges, and limitations of practical XAI approaches while aiming to enhance self-driving safety.

The rest of the article is organized as follows. Section II covers the established safety principles in the context of autonomous driving. Current leading XAI approaches in computer vision, reinforcement learning methods, and large pretrained models are presented in Section III. In Section IV, we describe traffic scenarios where the explainability of a driving system can bring an enhanced safety benefit to automated cars. Finally, in Section V, we present our experiment on the “explainability-informed safety assessment” proposition and then provide an overall summary.

§ SAFETY OF AUTONOMOUS DRIVING

§.§ Software Safety

The safety of the deployed software system in autonomous driving is one of the most essential factors. As machine learning (ML) approaches play an essential role in enabling an automated vehicle to make intelligent decisions, these approaches need to be safety-compliant both theoretically and practically. The ISO 26262 standard has specifications to which the ML-based software architecture must conform. Part 6 of this standard, known as V-model (Figure <ref>), is dedicated to product development at the software level for road vehicles, and state-of-the-art autonomous driving must comply with these stringent safety standards.  The ISO 26262 standard has also established a risk classification system for the functional safety of automobiles, known as the Automotive Software Integrity Level (ASIL). This system groups risks into four categories labelled A, B, C, and D <cit.>. ASIL A class indicates the lowest degree while ASIL D class indicates the highest degree of hazard. The complexity and associated risks with autonomous driving software deepen with respect to increasing SAE-defined automation levels, as a huge amount of computation happens on collected sensor data. According to Salay et al., <cit.>, there are four safety issues with characteristics of ML on automotive software. The first one is the unstable behavior of a learning algorithm: As learning models are generally trained with local optimization algorithms, different training processes may yield different results on the same training dataset. Secondly, incompleteness of training is another negative factor as only using some subset of input may not represent all safety-critical scenarios. Furthermore, despite the so-called “error rate” metric being an outcome of the ML models, whether this estimate is practically reliable remains unclear. Finally, the lack of interpretability of models or explainability of decisions is another issue for any machine-learning intelligent driving system. The opaqueness of intelligent decision-making is a hindrance to safety assurance as it becomes harder for a user or examiner to trust if the model is operating as expected. Here we analyze the latter

V-model in ISO 26262. The figure drawn based on the content in <cit.>.

point and analytically and empirically show that interpretable ML techniques have immense potential to improve the safety of vehicle autonomy.

§.§ Hardware Reliability

The reliability of autonomous driving systems depends on an appropriate combination of AI-powered software with hardware architecture. The physical architecture of a driving system should have seamless integration with its operating software in order to achieve reliable automated driving.
ISO 26262 has defined functional safety of hardware systems by outlining the safety compliance process from the design specification to the production stage in modern autonomous cars <cit.>. These principles aim to identify and control hardware failure and prevent design faults in intelligent driving systems. These hardware failures could be systematic faults, arising during the design, development, and manufacturing stage, and random faults, occurring during the operational lifetime of an autonomous car due to possible casual defects, improper maintenance, and aging of hardware.

Modern autonomous vehicles typically have the following major hardware components: sensors, actuators, V2X[V2X here refers to "Vehicle to X"  where X can be any vehicle, road users, and communication infrastructure that an autonomous car can interact with.] communication interfaces, and control
hardware <cit.>. Sensors, such as vision cameras, lidar, radar,  global positioning systems (GPS), and inertial measurement units (IMUs) enable an autonomous car to sense its operational environment dynamically and help support real-time decisions based on the information fused from these data sources <cit.>. Actuators physically perform actions such as breaking, accelerating, and steering based on the obtained sensory information. Communication interface hardware powers a self-driving car to potentially interact with other surrounding vehicles, road users, and the infrastructure. Finally, control hardware ensures that a vehicle follows its predefined rule with proper steering angle, braking, and acceleration. Advanced driver-assistance systems (ADAS) are the most used control system in modern automated cars at present. So, as autonomous driving is a real-time decision-making process, these hardware components and their systematic integration must deliver low-latency, real-time, and high-speed data flow to the underlying ML software system.

§.§ Cybersecurity

Security of driving systems is yet another essential aspect of safe autonomous driving. ISO/SAE 21434 standard provides thorough guidelines and development strategies for the cybersecurity management of road vehicles <cit.>. With increasing reliance on big data, AI, and vehicular communication technologies, today’s state-of-the-art autonomous vehicles are more prone to cyber-attacks. Such vulnerabilities, in turn, can impact driving safety adversely and cause severe damage to road users, such as passengers, pedestrians, and bystanders <cit.>. As two well-known examples of cybersecurity issues, Tencent Keen Security Lab controlled susceptible features of Tesla Models S, X, and BMW self-driving vehicles using remote attacks in their two subsequent studies <cit.>. These studies have disclosed that an attacker could have easily controlled the mentioned self-driving cars both in parking and driving positions. Such flaws are a significant hazard to users' lives and demonstrate the need for more robust measures against cyber hacking.

§.§ Human Intervention in Takeover Situations

Autonomous vehicles may require takeover by backup drivers due to potential unexpected scenarios such as adverse weather conditions, approached construction zones, missed lane boundaries <cit.>, and related issues in terms of software, hardware failures, and cybersecurity issues, covered above (see Figure <ref>). Vehicular takeover situations also become essential for highly automated driving, at Level 3 and beyond. The transition of control from a car's intelligent driving system to the human operator happens in a short time interval and consists of two primary steps: 1) an autonomous car makes a takeover request (TOR), and a human driver should receive this request immediately and take over the control of the steering wheel and pedals, and 2) the post-takeover step, where the driver takes over the control of the car and manually performs the decisive action safely as per the traffic scenario <cit.>. The time granularity of these steps may vary from situation to situation, but the overall length of takeover cases is usually a few seconds. Consequently, a human actor must dominate takeover situations in the allotted time interval; otherwise, collision or other serious consequences may become inevitable. It is also necessary to specify that a self-driving car needs to be supplied with a relevant user interface or dashboard to alert the human driver on time and ensure a smooth transition from an autonomous mode to the human takeover mode.

§.§ Fail-safe Capability

While the transition to highly automated driving is a significant change in the intelligent capabilities of self-driving vehicles, the immense need to operate safely in possible failure cases also escalates. A fail-safe is the ability of an automated car to take control and bring it to a safe stop position in case the primary autonomous functions fail or encounter an error and there is no backup driver in the vehicle <cit.>. The nature of failure may be hardware, software, or communication-related and in general, such breakdowns can be classified into two

Potential takeover situations: (a) The blind corner ahead reduces an autonomous vehicle's perception ability, and (b) Autopilot perceives edge-markings of an exit lane as the current lane (upper left), steers right and the car exits the road incorrectly (upper right). Images adapted from <cit.>.

groups: AV component-based failures and infrastructure-based failures <cit.>. The fail-safe ability in these cases can be achieved through a proper combination of sensor data, algorithms, and other vehicular technologies aiming to discern and respond to potential dangers while in motion. State-of-the-art solutions against potential AVs failures include road segment-based countermeasures (e.g., speed bump, speed limit reduction pedestrian barriers), intersection-based countermeasures (e.g., high-visibility crosswalks, split phase timings), and overall effective infrastructure countermeasures (e.g, highways without potholes, well-maintained signs and markings) <cit.>. In this sense, some studies have leveraged the concept of formal verification for fail-safe motion planning of self-driving vehicles <cit.>.

Therefore, if we approach an autonomous driving architecture as a holistic eco-system, achieving acceptable driving safety in real-time is a considerably challenging task. Reliable integration of cyber-physical and software components is vital to accomplish safe driving and a fail-safe ability along its motion trajectory (see Figure <ref>).
In general, the established definition of safe autonomous driving requires risk minimization and assurance in seven key tasks namely, pedestrian detection, drowsy driver detection, vehicle detection, road detection, lane detection, traffic sign detection, and collision
avoidance as identified by <cit.>.  In the rest of our paper, we analytically and empirically show how interpretability can amplify safety of driving both during the trip and via a retrospective analysis.

§ EXPLAINABILITY OF AI IN AUTONOMOUS DRIVING

§.§ The Necessity of Explanations for Autonomous Vehicles

Explainability of AI in autonomous driving refers to the ability of an intelligent driving system to provide explanations for its temporal decisions and actions. The need for explanations in the context of autonomous driving systems has cross-disciplinary motivation as described above.
With that said, it is noteworthy to underscore that achieving the explainability of AI in autonomous driving is a challenging task. First of all, the “black-box” nature of deep learning algorithms makes the

A diagram of safe autonomous driving. In (a), an autonomous car (i.e., ego car) interacts with the dynamic and stationary objects in the environment safely and keeps a distance from them. In (b), the ego car faces with unexpected action of the other vehicle, understands its limited motion ability at that moment, and comes to a standstill as it can not drive safely at that time step.

learning process difficult to understand. In addition, the complexity of driving itself is another issue; an intelligent driving system may work with incomplete and imperfect sensor systems and thus can face unpredictable circumstances that may force an automated vehicle to make decisions based on uncertain or incomplete information. Finally, another factor that necessitates explainability is the potential mismatch between the performance of machine learning algorithms in a simulation environment and the effectiveness of such algorithms on automated vehicles deployed in the real world. In this context, Lipton  <cit.> posits that solely relying on predictive metrics is not enough to evaluate the learned system; explanations of the model decisions are needed as additional information. Hence, action-reflecting explanations can provide an extra insight into the driving behavior of autonomous vehicles.

§.§ Explaining: How and to whom?

Explanations for autonomous driving actions can be intrinsic and post-hoc from the perspective of the moment in time they are delivered to end users <cit.>. Intrinsic explanations in autonomous driving refer to explanations that the driving system achieves inherently given the deployed algorithms are internally interpretable and do not depend on external factors or observations. On the other hand, post-hoc explanations are retrospective rationales to understand why a particular decision was made by the driving system in a specific time step. In other words, we want to know what key factors contributed to the particular driving decision.  In general, both types of explanation can be useful in autonomous driving: While intrinsic explanations may have the potential of immediate help to end-users (e.g., such as passengers or backup drivers trust the vehicle during the trip in a real-time manner), post-hoc explanations are useful for post-accident investigations, to confirm critical decisions of the vehicles that led to a road mishap. We will shed more light on the suitability of such explanations with relevant case studies in Section IV. Another important point is the appropriate delivery of explanations for effective human-machine teaming <cit.>. As the stakeholders could have diverse technical knowledge and physical and cognitive abilities, explanation provision must consider these interaction nuances. For instance, while an ordinary passenger may need an intelligible explanation of autonomous driving actions, perhaps in a natural language, a system engineer may demand a more detailed and technically rich explanation. Hence, autonomous driving researchers have attempted to classify end users for their identity, technical knowledge and functional and cognitive capabilities for explanation delivery purpose <cit.>.
In this context, we explore the interpretability of self-driving decisions from relevant AI approaches. In the next section, we provide an overview of these approaches.

§.§ Explainable Vision in Autonomous Driving

Computer vision technology plays a significant role in the perception ability of autonomous driving. These techniques allow self-driving vehicles to sense and understand their operational environment and make appropriate decisions along the trip <cit.>. Environmental perception in autonomous driving is achieved through a broad combination of multi-modal sensors, such as video cameras, GPS, lidar, radar, and other sensors that collect data about the environment. ML approaches are currently dominated by a convolutional neural network (CNN or ConvNet) architecture and its augmented variants, to analyze and interpret this data for actionable decisions using several steps of convolutional filters. In a standard CNN network, A set of 2D arrays, also known as feature maps make an output for each stage. In this way, the deep network uses the most representative features of an image and makes a final prediction with a predictive model learned from the provided input.
The crucial tasks associated with vision methods include detecting and tracking objects, capturing traffic lights and other indicative signage, understanding the vehicle’s physical location in the driving environment,  generating a 3D high-definition (HD) map of the surroundings, and predicting the behavior of other dynamic objects in the environment <cit.>.

However, there are several foundational challenges with the perception ability of self-driving vehicles. First, adverse weather conditions (i.e., snow, rain, dense fog, improper lighting) can impede the sensing functionality of the intelligent driving system. In addition, computing resources must process massive sensor data on time to enable the autonomous system to perform the intended actions. Finally, as the state-of-the-art vision techniques are primarily based on deep learning methods, the opaque nature of these approaches is another downside. In this context, explainable computer vision in autonomous driving systems is an emerging research area aiming to ensure that a self-driving vehicle’s decisions are based on the actual information gathered from sensors. Moreover, it is necessary to understand
how automated vehicles interpret and react to their driving environment.

Perception-based explanations are usually post-hoc or intrinsic by design, as discussed above. We cover details of such explanation generation techniques with applications to autonomous driving models in the following subsections.

§.§.§ Post-hoc Explanations

Post-hoc explanations describe actions retrospectively based on visual data from the video camera and other sensors. In this case, a model is trained first, and explanations then try to justify the recorded decisions of such a pre-trained model. There are several potential advantages of perception-based post-hoc explanations for autonomous driving systems. First, they can help find and debug bias and possible errors that affect the predictive performance of the pre-trained model. Furthermore, such explanations do not have any negative impact on the acquired predictive outcome. Finally, post-hoc reasoning can provide extra insights for further investigation, such as identifying additional visual inputs that should be fed to the model to improve the existing model's robustness. Overall, post-hoc explanations can be local and global depending on their task coverage. Local explanatory techniques justify the output of a particular task in the predictive model. On the other hand, global explanations describe the decisions of the entire predictive model. We summarize these techniques separately, below.

(1.1) Local Explanations: There are two types of vision-based local explanations: (a) saliency methods, which shows which components of an image have more influence on the predictive output, and (b) counterfactual explanations that intend to find a causal relationship in image components that influence the predictive model's outcome.

(1.1.1) Saliency methods: Zablocki et al. <cit.> identify three main approaches to saliency (i.e., heatmap)-based post-hoc explanations: backpropagation methods, perturbation methods, and local approximation methods.  Backpropagation methods compute the gradient of the output with respect to its input and create a saliency map based on the most crucial part of the image. This technique was initially proposed by Zeiler and Fergus <cit.> and further augmented by Layer-wise Relevance Propagation <cit.>, Class Activation Mapping <cit.>,
deepLift <cit.>, Integrated Gradients <cit.>, Gradient-weighted Class Activation Mapping (Grad-CAM) <cit.>, and Grad-CAM ++ approaches <cit.>. Furthermore, perturbation-based saliency methods modify portions of an input and then observe how such changes affect the prediction of the model (cf. counterfactual considerations). Such methods are mainly pixel-wise alterations <cit.> and reduced transparency in parts of an image <cit.>. Finally, local approximation methods explain the prediction of a model using a separate and easy model; this simplified model explains individual prediction in the proximity of an instance. LIME <cit.> and
SHAP <cit.> are two well-known approaches in this context.

These saliency methods have been recently applied to autonomous driving tasks. In particular, Bojarski et al. <cit.> used a CNN method to map raw pixels to steering command and achieved impressive results, and subsequent work focused on the interpretability aspect of such end-to-end learning. In those

A causal effect of removing a pedestrian from a scene: The driving behavior changes from "Stop" to "Go" by showing that the eliminated object is a risk object for the "Stop" command. Graphics credit: <cit.>

subsequent studies, Bojarski et al. leverage saliency maps to explain the decision of their CNN architecture <cit.>.
These methods have also been used to investigate failure cases in unexpected scenarios <cit.>. Some other notable research has also leveraged post-hoc saliency methods; these works include a causal attention mechanism <cit.>, driving affordances <cit.>, and driving behavior understanding <cit.>.

(1.1.2) Counterfactual Explanations:
These explanations aim to identify causal relationships between different events by considering how the outcome of a model would have been different if the provided input had been modified in some way. In autonomous driving, the following can be a typical example of a counterfactual explanation: “Given the traffic scene, how can it be modified so that the car turns right instead of driving straight?” In this case, the decision made by the car becomes different from its actual prediction. We can also say that counterfactual explanations can be used to assess the potential consequences of different actions or decisions made by a self-driving vehicle. If we distinguish these explanations from saliency maps (cf. comments above), we can conclude that saliency methods focus on finding out distinctive parts of the input that have more impact on the model’s prediction with “What” questions whereas counterfactual interventions could serve a purpose for the “What if” type questions <cit.>.

Despite post-hoc saliency methods being more popular
in the state of the art, counterfactual explanation techniques have also recently been applied in some autonomous driving tasks.
For instance, in the ChauffeurNet model, some parts of the input are modified by eliminating specific objects from a scene to understand the impact of such intervention in the prediction of the model <cit.>. In a further study, Li et al. <cit.> approach this task by finding out and removal of so-called “risk objects” to observe the causal effects in driving behavior (see Figure <ref>). Moreover, Jacobs et al. <cit.> explain the behavior of their presented vision model, STEEX, with a pretrained generative model that solely intervenes with the style of the parts of the image by proposing region-targeted counterfactual explanations. Finally, in the most recent work, Zemni et al. <cit.> extend STEEX by introducing its augmented version, OCTET. This approach overcomes STEEX's two limitations by 1) not being dependent on annotated segmentation masks and 2) leveraging the entire semantic layout of a driving scene as an intermediate

Taxonomy of visual explanations for self-driving models. Classification is partially based on  <cit.>.