RNN-Test: Adversarial Testing Framework for Recurrent Neural Network Systems

Jianmin Guo, Yue Zhao, Xueying Han, Yu Jiang, Jiaguang SunarXiv 2019

TL;DR

Recurrent Neural Networks (RNNs), crucial for sequential data like text and speech, are vulnerable to adversarial attacks. This paper introduces RNN-Test, a novel framework that generates adversarial inputs for RNNs by maximizing RNN state inconsistency and leveraging new state-based coverage metrics, outperforming existing methods.

What Problem Does This Paper Address?

While adversarial testing has seen significant progress for Convolutional Neural Networks (CNNs), it remains a challenge for Recurrent Neural Networks (RNNs), especially for tasks involving sequential outputs without explicit class labels. Existing methods often struggle to adapt to the unique sequential nature of RNNs, and current coverage metrics, designed for CNNs, don't effectively capture RNNs' internal logic. This gap leaves critical RNN applications vulnerable to attacks that could lead to incorrect predictions and potential security risks. The paper aims to bridge this gap by developing a robust adversarial testing framework specifically for RNNs.

Methods

The core of RNN-Test lies in its novel adversarial testing methodology. It focuses on the intrinsic sequential processing structure of RNNs, ignoring task-specific components. The framework employs a state inconsistency guided search that aims to maximize the divergence between RNN states (hidden and cell states), effectively creating inputs that lead to unusual model behavior. This is complemented by two new state-based coverage metrics: Hidden State Coverage (HS_C) for general RNNs and Cell State Coverage (CS_C) for LSTM models. These metrics are designed to explore RNN inference logics more effectively than traditional neuron-based metrics. RNN-Test then formulates a joint optimization problem to simultaneously maximize state inconsistency and state coverage, solving it via a gradient-based approach to generate subtle perturbations. For discrete inputs (like text), a procedure called GEN_ADV is used to find the nearest valid word/character embedding after applying perturbations.

Datasets

The paper evaluates RNN-Test on three RNN models for sequential tasks:

  • PTB language model: A standard RNN model for text generation.
  • Spell checker model: A seq2seq model for correcting spelling mistakes.
  • DeepSpeech ASR model: A state-of-the-art speech-to-text model.

For comparison, they also use an MNIST-LSTM model, which is an image classifier, to compare with a prior work (testRNN). The datasets used include the Penn Tree Bank dataset, Gutenberg books, and the Common Voice corpus.

Key Insights and Ideas

  • RNNs have unique vulnerabilities: The sequential nature of RNNs, particularly their reliance on hidden and cell states, presents distinct attack surfaces compared to CNNs.
  • State-based coverage is crucial for RNNs: Traditional neuron coverage metrics are insufficient for RNNs. New metrics that capture the dynamics of hidden and cell states are essential for effective testing.
  • Maximizing state inconsistency is a powerful attack vector: By intentionally creating conflicting RNN states, adversarial inputs can be generated that exploit RNNs' internal logic.
  • Coverage guidance can diversify adversarial attacks: Using coverage metrics not only helps find adversarial inputs but also generates a wider variety of perturbations, leading to more diverse attack scenarios.
  • Adversarial inputs can improve models: The generated adversarial inputs can be used to retrain RNN models, leading to improved robustness and reduced overfitting.

Key Results

RNN-Test demonstrated strong performance across various RNN models:

  • It outperformed FGSM-based and DLFuzz-based methods in generating adversarial inputs, achieving higher success/generation rates (e.g., 2.78% to 32.5% higher success rate).
  • Compared to the relevant work testRNN on the MNIST-LSTM model, RNN-Test achieved 52.65% to 66.45% higher adversary rate.
  • The proposed state coverage metrics (HS_C and CS_C) outperformed neuron coverage guidance by a significant margin (4.17% to 97.22% higher success rate).
  • Adversarial inputs generated by RNN-Test were found to be high quality, causing sharp performance degradation with minute perturbations and high time efficiency.
  • Retraining with adversarial inputs on the PTB language model led to a 12.582% decrease in test perplexity.

Limitations and Future Work

  • Parameter sensitivity: The performance of RNN-Test is influenced by parameters like the number of selected states, weights for joint objectives, and perturbation scaling. Further exploration of these parameters is needed.
  • Coverage metric splitting: The way cell state coverage (CS_C) sections are split can impact performance, and this aspect warrants further investigation.
  • Generalization to all RNN variants: While designed to be general, the framework might require adaptation for highly complex or specialized RNN structures.
  • Real-world adversarial audio: The paper acknowledges the challenge of adversarial audio attacks becoming invalid when played over-the-air and suggests this as a future research direction.
  • Correlation between coverage and robustness: While coverage guidance is beneficial, the paper notes that a direct, strong correlation between coverage values and model robustness is not always guaranteed and suggests considering model performance metrics more heavily.

Summary updated

BibTeX
@misc{guo2019rnn,
  author = {Jianmin Guo and Yue Zhao and Xueying Han and Yu Jiang and Jiaguang Sun},
  title = {{RNN-Test: Adversarial Testing Framework for Recurrent Neural Network Systems}},
  year = {2019},
  eprint = {1911.06155},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1911.06155},
}

Loading related content...

Figure