ACAV: A Framework for Automatic Causality Analysis in Autonomous Vehicle Accident Recordings

Huijia Sun, Christopher M. Poskitt, Yang Sun, Jun Sun, Yuqi Chen · DOI

Introduction

As Autonomous Driving Systems (ADSs) advance, the industry has shifted from simple road testing to high-fidelity simulation environments like SVL and CARLA. These platforms allow for "fuzzing"—the automated generation of thousands of edge-case scenarios to identify potential system failures. However, discovering a crash is only the first step. Modern ADSs are complex, multi-module architectures where perception, prediction, and planning components interact in real-time. When an accident occurs, determining the root cause is a labor-intensive process requiring engineers to manually sift through massive log files.

This paper introduces ACAV, an automated framework designed to perform "post-mortem" causality analysis on autonomous vehicle accident recordings. By simplifying dense driving logs and utilizing a novel diagnostic tool, ACAV identifies the specific module decisions—such as trajectory mispredictions or illegal maneuvers—that lead to collisions.

The Challenge of Post-Accident Debugging

In a typical ADS, modules pass high-frequency messages to one another. If a vehicle strikes a pedestrian, the failure could reside in any part of the stack: the perception module may have failed to detect the object, the prediction module might have incorrectly anticipated the pedestrian's path, or the planning module could have selected an unsafe speed. Manually replaying these logs to pinpoint the "smoking gun" is a significant bottleneck in the development lifecycle. ACAV addresses this by bridging the gap between knowing that a crash happened and understanding why.

Methodology

ACAV operates in two primary stages: recording simplification and causality analysis.

1. Accident Recording Simplification

Driving logs often contain lengthy segments of irrelevant data (e.g., driving on a straight, empty road) prior to an incident. ACAV employs feature extraction schemas to vectorize map data, perception outputs, and planning messages. It then utilizes a weighted voting method to prune segments of the recording that do not contribute to the accident. This process reduces the volume of data engineers must review by over 60% without losing critical context.

2. The Causality Analysis Tool (CAT)

The core of the framework is the Causality Analysis Tool (CAT). CAT identifies safety-critical frames based on traffic laws and the California Driver’s Handbook. It analyzes Station-Time (ST) graphs, which represent the AV’s planned path as a curve and obstacles as rectangular blocks. By comparing the AV’s internal plan against the "ground truth" (the actual outcome recorded), CAT identifies errors through a hierarchical logic chain:

  • Priority Prediction Error: Did the system ignore a critical object?
  • Trajectory Prediction Error: Did it misjudge the movement of an object?
  • Behavioral Planning Error: Did the system violate traffic laws (e.g., illegal overtake)?
  • Motion Planning Error: Was the planned speed or spacing insufficient?
  • Vehicle Out-of-Control: Did the vehicle lose physical traction or control?

This hierarchy ensures that if a prediction was fundamentally flawed, the planning module is not unfairly blamed for acting on incorrect data.

Experimental Evaluation

The researchers evaluated ACAV using the Baidu Apollo 7.0 ADS within the SVL simulator. The testing involved two primary datasets:

  1. General Accident Dataset: 110 recordings of intersections, merging, and tailgating accidents.
  2. Fault-Injected Dataset: 1,206 recordings where specific bugs were intentionally introduced into the Apollo source code to verify if ACAV could correctly localize the fault.

To demonstrate generalizability, the framework was also successfully applied to the Autoware.universe architecture.

Key Results

ACAV demonstrated high efficiency and diagnostic precision across all test cases:

  • Data Efficiency: The framework achieved a 62.23% reduction ratio in recording length while preserving all critical frames.
  • Diagnostic Accuracy: In the general accident dataset, ACAV correctly identified causal events in 93.64% of cases.
  • Fault Localization: On the fault-injected dataset, the system achieved 96.44% accuracy for prediction errors and 85.73% accuracy for planning errors.
  • Primary Causal Factors: The study found that "Vehicle Out-of-control" (often weather-related) and "Unsafe Motion Planning" were the most frequent causes of accidents in the simulated environments.

Limitations and Future Work

Despite its success, ACAV has limitations. It currently struggles with rear-end collisions because most ADS logic is biased toward forward-facing threats, making it difficult to extract causal planning data for hits from behind. Additionally, the system can fail in cases of extremely minor collisions where the distance involved is smaller than the system's computational precision.

Furthermore, while ACAV can identify that a prediction failed, it cannot yet explain why a deep learning model failed (e.g., sensor glare or occlusion). Future research will focus on moving from diagnosis to automated repair, using ACAV’s causality reports to suggest specific code fixes for the ADS.

Summary updated

BibTeX
@inproceedings{sun2024acav,
  author = {Huijia Sun and Christopher M. Poskitt and Yang Sun and Jun Sun and Yuqi Chen},
  title = {{ACAV: A Framework for Automatic Causality Analysis in Autonomous Vehicle Accident Recordings}},
  booktitle = {ICSE},
  year = {2024},
  doi = {10.1145/3597503.3639175},
}
Figure