Hazards in Deep Learning Testing: Prevalence, Impact and Recommendations

Salah Ghamizi, Maxime Cordy, Yuejun Guo, Mike Papadakis, Yves Le TraonarXiv 2023 · DOI

TL;DR

This paper identifies and analyzes 10 common "hazards" or pitfalls in empirical evaluations of deep learning (DL) testing methods that can invalidate research findings. The authors propose a set of 10 good practices to mitigate these hazards, aiming to improve the rigor and reliability of DL testing research.

What Problem Does This Paper Address?

The field of machine learning (ML) testing is rapidly growing, with researchers developing new techniques to evaluate and improve ML models. However, empirical studies in this area are highly sensitive to various parameters and assumptions, making them prone to errors that can lead to misleading conclusions. This is particularly true for deep learning (DL) models, which have unique characteristics that differ from traditional software. The authors highlight that a lack of standardized methodology and awareness of common pitfalls can lead to overestimating the effectiveness of DL testing methods, hindering progress and adoption. This paper aims to address this by systematically identifying, analyzing the prevalence of, and demonstrating the impact of these evaluation hazards.

Methods

The authors conducted a multi-stage study:

  1. Literature Survey and Hazard Identification: They surveyed existing literature on ML testing to identify 10 common empirical evaluation hazards.
  2. Prevalence Analysis: They analyzed 30 influential papers from top-tier Software Engineering (SE) venues that propose DL testing techniques. For each paper, they assessed the presence and severity of the identified hazards using a 5-scale evaluation (N/A, Absent, Fair, Adequate, Unknown).
  3. Impact Analysis: To demonstrate the criticality of these hazards, they performed experiments on six popular ML testing methods and their underlying metrics. They evaluated how the presence of these hazards could alter experimental conclusions, particularly in the context of test selection and model repair.

Datasets

The study primarily used the CIFAR-10 dataset and its variants for evaluating models and testing methods. Specifically, they used:

  • CIFAR-10: A standard dataset for image classification.
  • CIFAR-10C: A dataset containing CIFAR-10 images with common corruptions (e.g., rotation, brightness change) to emulate distribution shifts and evaluate generalization.
  • Adversarial Examples: Generated using AutoAttack-8 and PGD attacks on CIFAR-10 to evaluate robustness.

The paper also mentions using models pretrained on CIFAR-10, some of which were robustified using state-of-the-art data augmentation and adversarial training techniques.

Key Insights and Ideas

  • Ubiquitous Hazards: All 10 identified hazards have the potential to invalidate experimental findings in DL testing research. Even in top-tier SE venues, papers often fail to adequately address at least three hazards.
  • Impact on Conclusions: The presence of these hazards can significantly alter the perceived effectiveness of DL testing methods, leading to overestimations of correctness, robustness, and generalization.
  • Beyond Bug Discovery: The definition of ML testing should emphasize improving the model, not just discovering bugs, as ML models are often tolerant of a certain proportion of errors.
  • Data Leakage is Critical: Using the same data for training/retraining and evaluation (data leakage) is a significant hazard that can artificially inflate performance metrics.
  • SoTA Matters: Evaluating DL testing methods against state-of-the-art (SoTA) attacks and baselines is crucial for a realistic assessment of their effectiveness, especially for robustness.
  • Hyperparameter Tuning is Key: Suboptimal hyperparameter settings for both the ML model and the testing method itself can lead to unreliable results.

Key Results

  • Prevalence: The study found that a significant number of papers inadequately addressed the identified hazards. For instance, seven out of 30 papers used outdated models (H1), and 12 papers did not use data augmentation during training (H3).
  • Impact of Data Leakage (H6): In their impact analysis, data leakage led to overestimating correctness and robustness by as much as 7% and 12%, respectively, for certain models.
  • Impact of SoTA Evaluation (H7): Evaluating robustness against weak attacks (like FGSM) can give a false sense of security, as models perform poorly against stronger attacks (like AutoAttack).
  • Impact of Hyperparameters (H4): Changing hyperparameters for testing metrics like neuron coverage and LSA showed varying correlations with model performance, indicating the need for careful tuning.
  • Adversarial Training Dominance: Adversarial training consistently yielded better improvements in robustness compared to other selection metrics, highlighting its importance for robust models.

Limitations and Future Work

  • Focus on Image Classification: The study primarily focused on image classification tasks. The authors recommend extending the assessment of DL testing techniques to other domains like NLP, code, and tabular data, as well as datasets with specific behaviors like temporal drifts or class imbalance.
  • Dataset Relevance: The authors note that some commonly used datasets (e.g., MNIST) are not relevant for evaluating robustness due to their simplicity and size.
  • Experimental Cost: Deep learning experiments are computationally expensive, which can limit the scope of evaluations. The authors suggest considering computation cost as an evaluation criterion and exploring adaptive evaluations.
  • Threats to Validity: The authors acknowledge that their goal was not a systematic evaluation of all 30 papers but rather to demonstrate the impact of hazards. They believe their selection of six testing methods was sufficient to cover the ten hazards.
  • Future Work: The paper calls for increased awareness of these hazards within the software engineering community and suggests developing standardized expectations for empirical research in DL testing. They also provide a replication package to facilitate further research.

Summary updated

BibTeX
@misc{ghamizi2023hazards,
  author = {Salah Ghamizi and Maxime Cordy and Yuejun Guo and Mike Papadakis and Yves Le Traon},
  title = {{Hazards in Deep Learning Testing: Prevalence, Impact and Recommendations}},
  year = {2023},
  eprint = {2309.05381},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2309.05381},
}
Figure