Source-linked AI summary

DeepTest: Automated Testing of Deep-Neural-Network-driven Autonomous Cars

Yuchi Tian, Kexin Pei, Suman Jana, Baishakhi Ray

arXiv:1708.08559v2cs.SEcs.AIcs.LG

TL;DR

DNN-driven autonomous cars can produce dangerous corner-case behaviors, while existing testing depends heavily on manual data collection. DeepTest generates realistic transformed inputs, guides exploration with neuron coverage, and uses metamorphic relations to detect errors. It found thousands of erroneous behaviors across three top-performing Udacity challenge DNNs, while generated images may not exactly reproduce real-world conditions.

  • Problem

    DNN autonomous-driving systems can exhibit dangerous unseen corner-case behaviors, while existing testing relies heavily on manual labeled data or unguided simulation.

  • Method

    DeepTest generates realistic transformed test images, maximizes neuron coverage to explore DNN behavior, and applies domain-specific metamorphic relations as an automated test oracle.

  • Results

    6339 erroneous behaviors were detected across three Udacity challenge models, with transformed-error images showing MSE 0.41 versus 0.035 for corresponding original images.

  • Takeaways & Limitations

    DeepTest provides a systematic approach for testing DNN-driven autonomous cars and can be adapted to other DNN-based systems by customizing transformations and metamorphic relations.

  • Takeaways & Limitations

    The generated rain and fog images may not be exactly reproducible in reality because of unpredictable factors such as sun position and raindrop geometry.

Abstract

from arXiv · show

Recent advances in Deep Neural Networks (DNNs) have led to the development of DNN-driven autonomous cars that, using sensors like camera, LiDAR, etc., can drive without any human intervention. Most major manufacturers including Tesla, GM, Ford, BMW, and Waymo/Google are working on building and testing different types of autonomous vehicles. The lawmakers of several US states including California, Texas, and New York have passed new legislation to fast-track the process of testing and deployment of autonomous vehicles on their roads. However, despite their spectacular progress, DNNs, just like traditional software, often demonstrate incorrect or unexpected corner case behaviors that can lead to potentially fatal collisions. Several such real-world accidents involving autonomous cars have already happened including one which resulted in a fatality. Most existing testing techniques for DNN-driven vehicles are heavily dependent on the manual collection of test data under different driving conditions which become prohibitively expensive as the number of test conditions increases. In this paper, we design, implement and evaluate DeepTest, a systematic testing tool for automatically detecting erroneous behaviors of DNN-driven vehicles that can potentially lead to fatal crashes. First, our tool is designed to automatically generated test cases leveraging real-world changes in driving conditions like rain, fog, lighting conditions, etc. DeepTest systematically explores different parts of the DNN logic by generating test inputs that maximize the numbers of activated neurons. DeepTest found thousands of erroneous behaviors under different realistic driving conditions (e.g., blurring, rain, fog, etc.) many of which lead to potentially fatal crashes in three top performing DNNs in the Udacity self-driving car challenge.

1 INTRODUCTION

Autonomous cars have advanced rapidly, but DNN corner-case errors can cause dangerous crashes, while existing testing relies heavily on costly manual data collection. DeepTest addresses this gap with coverage-guided synthetic testing and metamorphic relations.

  • Motivation: DNN-driven autonomous cars can exhibit rare, previously unseen corner-case behaviors that may lead to fatal collisions.Reported accidents include a fatal Tesla crash caused by failure to detect a white truck against the bright sky.
  • Motivation: Existing testing mechanisms depend heavily on manually collected labeled data or ad hoc, unguided simulation, risking missed corner cases.Manual testing becomes challenging as driving conditions and possible inputs multiply.
  • Research challenge: Traditional branch or code coverage is poorly suited to DNNs because their logic is encoded through nonlinear neuron computations rather than control flow.The paper identifies systematic input exploration and high model coverage as particularly challenging for DNNs.
  • Approach: DeepTest uses neuron coverage to explore different parts of DNN logic and empirically links coverage changes with changes in driving actions.The method targets behaviors such as steering-angle changes.
  • Approach: 100% average neuron-coverage increase over manual test inputs is achieved by combining realistic image transformations.DeepTest also uses transformation-specific metamorphic relations to detect erroneous behaviors.

2 BACKGROUND

Autonomous-driving DNNs process sensor inputs through layered neurons to produce driving decisions. The paper describes feed-forward CNNs and recurrent RNNs, emphasizing convolutional weight sharing and temporal input processing.

  • Deep learning for autonomous driving: The autonomous-car perception DNN receives camera, LiDAR, and IR sensor inputs and produces steering, braking, and acceleration decisions.This paper focuses on camera input and steering-angle output.
  • Deep learning for autonomous driving: A feed-forward DNN stacks processing layers that increasingly abstract inputs from raw pixels to semantic concepts before producing steering decisions.Neurons apply nonlinear activation functions to weighted inputs, with edge weights learned from labeled training data.
  • CNN architecture: CNNs use convolution layers whose locally connected neurons share weights through kernels applied across the input space.Weight sharing reduces trainable parameters and training time and fits image recognition.
  • RNN architecture: RNNs include loops that feed information from previous inputs into current predictions, enabling sequence-based steering-angle prediction.The lower row of Figure 3 shows the recurrent structure and its unrolled sequence representation.
  • RNN architecture: RNN training can suffer from vanishing or exploding gradients, while LSTM is designed to address this problem.The paper evaluates two CNNs and one RNN among its tested models.

3 METHODOLOGY

DeepTest systematically explores DNN input-output behavior by maximizing neuron coverage, generating realistic transformed images, combining transformations greedily, and checking metamorphic relations. This approach addresses the difficulty of exhaustive exploration, realistic test synthesis, and manual oracle construction for autonomous-driving DNNs.

  • 3.1 Systematic Testing with Neuron Coverage: DeepTest uses neuron coverage to partition and systematically explore the input space of autonomous-driving DNNs.Neuron coverage is the ratio of uniquely activated neurons to total neurons; a neuron is activated when its scaled output exceeds 0.2.
  • 3.2 Increasing Coverage with Synthetic Images: Neuron coverage is maximized by generating realistic synthetic images from seed images through transformations that mimic camera, weather, and object changes.The transformations include brightness, contrast, affine changes, blurring, fog, and rain effects.
  • 3.3 Combining Transformations to Increase Coverage: DeepTest combines transformations with a greedy search that prioritizes transformations previously found to increase neuron coverage.The search repeatedly generates images from seed inputs and explores successful transformations in depth-first order.
  • 3.4 Creating a Test Oracle with Metamorphic Relations: Metamorphic relations provide a test oracle by comparing vehicle behavior across transformed versions of the same image.For example, steering should not change significantly under lighting, weather, blurring, or small affine transformations.
  • 3.4 Creating a Test Oracle with Metamorphic Relations: DeepTest balances false positives and false negatives because a given image can admit multiple safely tolerated steering angles.Tighter relations may produce many false positives, whereas more permissive relations may produce many false negatives.

4 IMPLEMENTATION

DeepTest is evaluated on three high-performing Udacity self-driving challenge DNNs implemented with Keras. The implementation measures neuron coverage and steering outputs while using the transformations and parameters listed for synthetic-image generation.

  • Models and Dataset: DeepTest evaluates Rambo, Chauffeur, and Epoch, which ranked 2nd, 3rd, and 6th in the Udacity self-driving challenge.The models were selected because their implementations use the Keras framework supported by the prototype.
  • Model Outputs: The evaluated models output steering angles for a vehicle heading forward, with the Udacity dataset using a maximum steering angle of +/- 25 degree.The steering angle represents the rotation between the vehicle heading direction and the steering-wheel axle heading direction.
  • Synthetic-Image Generation: Table 4 lists the transformations and parameters DeepTest uses to generate synthetic images.These transformations support testing under varied realistic image conditions.

5 RESULTS

DeepTest evaluates neuron coverage as a guide for exploring DNN behavior and uses realistic transformations with metamorphic relations to detect erroneous autonomous-driving outputs. Across three models, it reports statistically supported coverage differences, thousands of erroneous behaviors, and some false positives.

  • Neuron coverage and test outputs: Neuron coverage varies significantly across different input-output pairs, supporting neuron-coverage-directed testing for finding corner cases.The study examines coverage alongside steering angle and steering direction; direction differences are statistically significant for all three overall models.
  • Transformation diversity: Different image transformations activate different neurons for all evaluated models except Chauffeur-LSTM.The authors attribute the exception to LSTM state persistence, which makes increasing coverage with single transformations harder.
  • Transformation diversity: Cumulative neuron coverage increases as the number of transformations grows across the evaluated models.DeepTest compares cumulative transformations with coverage-guided search using transformed images generated from seed images.
  • Erroneous behaviors: MSE is 0.41 for metamorphic-relation violations versus 0.035 for corresponding original images.The larger deviations were statistically confirmed and also occurred for composite rain, fog, and coverage-guided-search images.
  • Erroneous behaviors: 6,339 erroneous behaviors are detected across Chauffeur, Epoch, and Rambo at λ = 5 and ϵ = 0.03.For rain, fog, and guided search, the reported counts are 4,448, 741, and 821, respectively; simple transformations report 330 violations under the same thresholds.
  • Erroneous behaviors: Manual review identifies false positives, including synthetic images that DeepTest labels erroneous although the model output is safe.The authors state that all authors reviewed the images and agreed on the false positives.
  • Downstream effect: Retraining with DeepTest-generated synthetic data can improve DNN accuracy by up to 46%.This result is reported as an evaluation outcome for using synthetic data generated by DeepTest.

6 THREATS TO VALIDITY

DeepTest’s validity is constrained by the realism and coverage of its synthetic transformations and by testing only steering angle outputs.

  • The transformations are realistic but not exhaustive, so they may miss some realistic driving cases.
  • Synthetic rain and fog images may not exactly reproduce reality because environmental factors are unpredictable.
  • Testing was restricted to steering angle because the evaluated models did not support braking and acceleration.

7 RELATED WORK

Related work covers ADAS testing, metamorphic testing, machine-learning evaluation, DNN verification, adversarial attacks, and traditional test amplification, while DeepTest combines gray-box neuron coverage with realistic transformations and metamorphic relations.

  • Testing of driver assistance systems: ADAS testing uses expert-selected critical scenarios and multi-objective search to target safety-critical warning behaviors.
  • Testing of driver assistance systems: DeepTest differs from ADAS testing by targeting image recognition and steering logic while systematically maximizing neuron coverage inside a DNN.
  • Testing and verification of machine learning: Black-box evaluation on random labeled inputs cannot expose diverse corner cases without access to model internals.
  • Testing and verification of machine learning: DeepTest uses neuron coverage for guided testing of a single DNN and metamorphic relations to detect erroneous behaviors without multiple models.
  • Testing and verification of machine learning: Existing verification techniques cannot verify a rich set of properties for real-world-sized DNNs, whereas DeepTest tests safety-critical behaviors without theoretical guarantees.
  • Adversarial machine learning: Adversarial-attack work seeks minimally perturbed inputs causing incorrect predictions, whereas DeepTest seeks diverse corner cases under realistic conditions.
  • Test amplification: Traditional test amplification generates cases from seeds to increase code coverage, but DeepTest is designed for DNNs.
  • Metamorphic testing: Metamorphic testing detects bugs by checking domain-specific relations across outputs from multiple executions when manual specifications are unavailable.

8 CONCLUSION

DeepTest automates testing of DNN-driven autonomous cars by combining synthetic realistic transformations, neuron-coverage maximization, and domain-specific metamorphic relations. The approach is adaptable to other DNN-based systems by customizing those components.

  • DeepTest maximizes DNN neuron coverage using synthetic test images generated from seed images with realistic transformations.
  • Domain-specific metamorphic relations identify erroneous DNN behaviors without requiring detailed specifications.
  • The tool can be adapted to other DNN-based systems by customizing transformations and metamorphic relations.
Loading 1708.08559v2…