Towards Practical Robustness Analysis for DNNs based on PAC-Model Learning

Renjue Li, Pengfei Yang, Cheng-Chao Huang, Youcheng Sun, Bai Xue, Lijun Zhang

TL;DR

This paper introduces DEEPPAC, a novel framework for analyzing the local robustness of Deep Neural Networks (DNNs) by learning an "affine PAC model." This approach offers a more practical and accurate way to assess DNN robustness compared to existing methods, especially for complex, high-dimensional models.

What Problem Does This Paper Address?

Deep Neural Networks (DNNs) are increasingly used in critical applications, making their robustness a paramount concern. Adversarial attacks can easily fool even highly accurate DNNs, meaning their predictions can change drastically with small, imperceptible input perturbations. Analyzing this "local robustness" is crucial for ensuring trustworthiness. Existing methods for this analysis fall into a few categories:

  • Formal Verification: Provides strong guarantees but is often too conservative and struggles to scale to the size of modern DNNs.
  • Statistical Methods: Offer a probabilistic guarantee (PAC robustness) but tend to produce overly large bounds, making them less practical.
  • Adversarial Attacks: Can efficiently find adversarial examples, providing an upper bound on robustness, but lack any formal guarantee of soundness.

The challenge is to find a method that is both practical (scalable and efficient) and provides meaningful, accurate robustness guarantees for large-scale DNNs.

Methods

The core innovation of DEEPPAC is its PAC-model learning approach. Instead of directly analyzing the complex DNN, it learns a simpler affine PAC model that approximates the DNN's local behavior within a given input region. This affine model is guaranteed to be "probably approximately correct" (PAC) with respect to the original DNN's behavior, meaning it stays within a bounded margin with a specified confidence and error rate.

The framework operates in three stages:

  1. Sampling: A set of input samples is drawn from the local region of interest around a specific input.
  2. Learning: An affine function (the PAC model) is learned from these samples to approximate the DNN's score difference function (which measures the difference in scores between the correct and incorrect class predictions). This learning is framed as a linear programming (LP) optimization problem.
  3. Analyzing: The learned PAC model is used to infer the robustness property. If the PAC model's "upper bound" (the model plus its margin) is always negative within the region, the DNN is considered PAC-model robust.

To enhance scalability for complex DNNs and high-dimensional inputs, DEEPPAC employs several strategies:

  • Component-based learning: Breaks down the analysis of multi-output DNNs into smaller, independent LP problems for each output component.
  • Focused learning: A two-phase approach that first identifies "key features" and then refines their coefficients, reducing the overall number of variables.
  • Stepwise splitting: For extremely high-dimensional inputs like images, it partitions input dimensions into groups and iteratively refines coefficients for significant groups.

Datasets

The evaluation of DEEPPAC was performed on three standard datasets:

  • MNIST: A dataset of handwritten digits.
  • CIFAR-10: A dataset of small color images in 10 classes.
  • ImageNet: A large-scale dataset of diverse images in 1000 classes.

The paper does not introduce new benchmarks but uses these standard datasets to evaluate DEEPPAC against existing methods on a variety of DNN models trained on them.

Key Insights and Ideas

  • Learning a model is more faithful than direct statistical sampling: By learning an explicit PAC model of the DNN's local behavior, DEEPPAC can capture more nuanced information than purely statistical methods, leading to tighter and more accurate robustness bounds.
  • Affine models are surprisingly effective for local approximation: The paper leverages the fact that DNNs behave like affine functions in small regions, making this a computationally tractable and effective abstraction.
  • Scalability through clever optimization: The proposed component-based, focused, and stepwise splitting strategies are crucial for making robustness analysis practical for large-scale, real-world DNNs, especially those with high-dimensional inputs like ImageNet.
  • PAC-model robustness is a stronger property than PAC robustness: The paper proves that if a DNN is PAC-model robust, it is also PAC robust, indicating that their approach provides a more stringent and informative guarantee.

Key Results

  • Improved Accuracy and Precision: DEEPPAC consistently outperforms the state-of-the-art statistical method PROVERO in estimating the maximum robustness radius, providing tighter bounds that fall within the range of formal verification (ERAN) and adversarial attack (PGD) results.
  • Scalability: DEEPPAC successfully scales to complex DNNs on ImageNet, a task that is challenging or impossible for many formal verification tools. It achieves this with significantly less running time and fewer samples compared to PROVERO.
  • Efficiency: The method is efficient, with running times often in the order of seconds or minutes, even for large models and datasets.
  • Parameter Tolerance: DEEPPAC demonstrates good tolerance to variations in its parameters (error rate, significance level, sample size), meaning its results remain reasonably accurate even with less stringent configurations.
  • Correlation with Testing Metrics: DEEPPAC's robustness estimates show a strong correlation with DNN testing prioritization metrics like DeepGini, suggesting its results are meaningful and can inform testing strategies.

Limitations and Future Work

  • Affine Model Limitation: The current framework relies on affine PAC models. The authors suggest learning more complex PAC models in the future to potentially capture more intricate DNN behaviors.
  • Practicality of Strict Robustness: While the PAC-model robustness is a practical relaxation, the paper acknowledges that strict robustness (where the PAC upper bound is strictly negative) is still desirable and that their method can provide tighter bounds for this as well.
  • Combination with DNN Testing: The paper highlights the promising correlation between DEEPPAC's results and DNN testing metrics, suggesting future work could explore combining these approaches for more comprehensive analysis and test selection.
  • Generalizing Robustness Properties: The authors note that real-world applications might require more complex robustness properties (e.g., considering multiple correct labels simultaneously), and DEEPPAC's flexible difference function could be adapted for such scenarios.

Summary updated

BibTeX
@inproceedings{li2022towards,
  author = {Renjue Li and Pengfei Yang and Cheng-Chao Huang and Youcheng Sun and Bai Xue and Lijun Zhang},
  title = {{Towards Practical Robustness Analysis for DNNs based on PAC-Model Learning}},
  booktitle = {ICSE},
  year = {2022},
  doi = {10.1145/3510003.3510143},
}
Figure