Search-Based DNN Testing and Retraining With GAN-Enhanced Simulations

Mohammed Oualid Attaoui, Fabrizio Pastore, Lionel C. Briand

TL;DR

This paper introduces DESIGNATE, a novel approach to testing and retraining Deep Neural Networks (DNNs) for safety-critical systems. By combining meta-heuristic search, simulators, and Generative Adversarial Networks (GANs), DESIGNATE generates realistic, failure-inducing test images that bridge the gap between imperfect simulator fidelity and real-world data, leading to more effective DNN testing and improved reliability.

What Problem Does This Paper Address?

In safety-critical applications like autonomous vehicles, Deep Neural Networks (DNNs) are increasingly used for tasks like semantic segmentation. Ensuring the reliability of these DNNs is paramount, but traditional testing methods face challenges. Code inspection is difficult for DNNs, making automated testing crucial. While simulators can generate vast amounts of data, their fidelity is often imperfect, leading to test results that may not accurately reflect real-world performance. This "fidelity gap" can mask or falsely indicate DNN shortcomings. Furthermore, retraining DNNs with imperfect simulator data might not yield optimal improvements. This paper addresses the need for a testing and retraining methodology that leverages simulators while overcoming their fidelity limitations to produce realistic inputs that effectively reveal and fix DNN weaknesses.

Methods

DESIGNATE is built upon three core components:

  1. GAN-based Input Generation: This component uses a simulator to generate scene data (images and corresponding ground truth segmentation masks). A Generative Adversarial Network (GAN), specifically Pix2PixHD in this study, then transforms these simulated images into realistic ones. This GAN is trained on a relevant real-world dataset (e.g., Cityscapes for urban driving, AI4MARS for Martian exploration) to learn the mapping from simulated to realistic domains.
  2. Fitness Computation: To identify both failure-inducing and diverse situations, DESIGNATE employs two fitness functions:
  3. Accuracy Fitness ($F_{accuracy}$): Measures how poorly the DNN performs on the generated realistic image. This is typically based on metrics like Intersection over Union (IoU) for segmentation tasks.
  4. Similarity Fitness ($F_{similarity}$): Measures how similar a newly generated image is to those already in an archive. This encourages diversity by penalizing redundant images.
  5. Search Algorithm: A multi-objective search algorithm, specifically NSGA-II, is used to explore the input space. It aims to find a population of individuals (parameter sets for the simulator) that minimize both accuracy fitness and similarity fitness, thereby identifying diverse, failure-inducing realistic images. An archive is maintained to store the best non-dominated individuals and guide the search.

Datasets

  • Cityscapes: Used for training the Pix2PixHD GAN for urban driving scenarios and as a validation set for evaluating the road segmentation DNN.
  • AI4MARS: Used for training the Pix2PixHD GAN and the object detection DNN for Martian exploration scenarios.

The paper also mentions the use of a custom-built simulator for Martian terrain, leveraging Unreal Engine and AirSim plugins.

Key Insights and Ideas

  • Bridging the Fidelity Gap: The core idea is that GANs can transform imperfect simulator outputs into realistic images, making simulator-based testing more trustworthy and representative of real-world performance.
  • Dual Objective for Testing: Combining accuracy (finding failures) and diversity (finding different types of failures) is crucial for comprehensive DNN testing.
  • Realistic Data for Retraining: GAN-generated realistic images are more effective for retraining DNNs than raw simulator images, leading to better performance improvements.
  • Feature-Based Diversity is Key: Using feature-based distance for measuring image similarity is more effective than pixel-based distance for promoting meaningful diversity in test inputs.

Key Results

  • Improved Testing Effectiveness: DESIGNATE consistently outperformed baseline approaches (Random Search, TACTIC, DeepJanus) in generating images that led to the lowest DNN accuracy (worst performance) and maximized input diversity. For urban scenarios, DESIGNATE achieved a median IoUcar of 0.77 compared to 0.85 for Random and 0.82 for TACTIC.
  • Enhanced Retraining Performance: DNNs retrained with images generated by DESIGNATE showed significant accuracy improvements. For urban scenarios, DESIGNATE achieved the highest median IoUcar of 0.90 after retraining, outperforming the original model (0.82) and models retrained with other approaches.
  • Mars Rover Application: The approach was successfully applied to object detection for Mars rovers, demonstrating its versatility across different domains and DNN tasks.
  • GANs are Essential: Results showed that approaches without GANs (DESIGNATENOGAN, DeepJanus) performed worse, highlighting the necessity of GANs for generating realistic inputs for effective testing and retraining.

Limitations and Future Work

  • GAN Realism: While GANs improve realism, ensuring that generated images are always perfectly realistic and representative of the ground truth remains a challenge. The authors propose heuristics to identify potentially unrealistic images but acknowledge that this is hard to automate fully.
  • Out-of-Domain Detection: The paper suggests extending the approach with additional methods for identifying out-of-domain and out-of-distribution images.
  • Generalizability: While tested on two distinct environments (urban and Martian), further validation across a wider range of safety-critical systems and DNN architectures would be beneficial.
  • Computational Cost: Multi-objective search algorithms can be computationally intensive, and optimizing this aspect could be a future direction.

Summary updated

BibTeX
@article{attaoui2025search,
  author = {Mohammed Oualid Attaoui and Fabrizio Pastore and Lionel C. Briand},
  title = {{Search-Based DNN Testing and Retraining With GAN-Enhanced Simulations}},
  journal = {IEEE Trans. Software Eng.},
  year = {2025},
  doi = {10.1109/tse.2025.3540549},
}
Figure