Towards Black-box Attacks on Deep Learning Apps

Hongchen Cao, Shuai Li, Yuming Zhou, Ming Fan, Xuejiao Zhao, Yutian TangarXiv 2021

Abstract

Deep learning is a powerful weapon to boost application performance in many fields, including face recognition, object detection, image classification, natural language understanding, and recommendation system. With the rapid increase in the computing power of mobile devices, developers can embed deep learning models into their apps for building more competitive products with more accurate and faster responses. Although there are several works about adversarial attacks against deep learning models in mobile apps, they all need information about the models' internals (i.e., structures, weights) or need to modify the models. In this paper, we propose an effective black-box approach by training a substitute model to spoof the deep learning system inside the apps. To evaluate our approach, we select 10 real-world deep-learning apps with high popularity from Google Play to perform black-box adversarial attacks. Through the study, we find three factors that can influence the performance of attacks. Our approach can reach a relatively high attack success rate of 66.60% on average. Compared with other adversarial attacks on mobile deep learning models, in terms of the average attack success rates, our approach outperforms counterparts by 27.63%.

Introduction

Deep learning (DL) is now a staple in mobile apps for everything from face recognition to plant identification. While researchers have long known that DL models are vulnerable to adversarial examples (inputs designed to fool a model), most existing attacks are "white-box," meaning the attacker needs full access to the model's architecture and weights.

In the real world, app developers often protect their models using encryption or hash codes, making white-box attacks impossible. Even "black-box" claims in previous literature often assumed some knowledge of the model's structure. This paper addresses the gap of attacking a truly "blind" target where the attacker can only query the model (input data and receive a prediction) without knowing how it works internally.

Methodology

The authors propose a three-stage pipeline to bridge the gap between a hidden "Teacher" model (the one inside the app) and an attacker-controlled "Student" model.

Overview of the proposed black-box adversarial attack pipeline.
  1. Teaching Dataset Preparation: The researchers first reverse-engineer the victim app to find the API calls used to invoke the DL model. They then instrument a DummyActivity into the app's code, allowing them to feed large amounts of unlabeled data into the app's actual model to generate "ground truth" labels.
  2. Student Model Learning: Using the newly labeled dataset, they train a substitute "Student" model. The goal is to mimic the specific decision boundaries of the hidden "Teacher."
  3. Adversarial Example Generation: Once the Student model is trained, standard adversarial attack algorithms (like FGSM, PGD, or MIFGSM) generate perturbed images. Due to the property of transferability, an image that fools the Student model is highly likely to also fool the Teacher model inside the app.

Experimental Setup

The study evaluated the attack on 10 real-world apps from the Google Play Store, covering diverse tasks like fruit rot detection, skin cancer identification, and actor recognition. To train the Student models, they used several public datasets depending on the app's functionality, including ImageNet, Kaggle-Fruit, TensorFlow-Flowers, and HAM10000.

Analysis and Insights

Impact of Architecture

The researchers found that more complex student architectures were significantly better at mimicking the teacher models than "small" nets like MobileNet. As shown in the data, VGG-based student models achieved the highest success rates, suggesting that a more sophisticated student has more "flexibility" to adjust its weights to match the teacher's behavior.

Attack success rates across different student model architectures.

Key Findings

  • The "Blind Attack" Failure: Comparing their method against a "blind attack" (using a pre-trained model without distillation) showed the blind attack was 2-4 times less effective, proving that generating a specific teaching dataset from the victim app is essential.
  • Diminishing Returns on Data: There is a "sweet spot" for the teaching dataset size. Once the student model reaches about 85-90% accuracy relative to the teacher, adding more data provides negligible improvements in attack success.
  • MIFGSM Effectiveness: Among seven different attack algorithms tested, MIFGSM (Momentum Iterative Fast Gradient Sign Method) was the most effective, likely because its momentum term helps generate more transferable adversarial examples.

Results

The pipeline achieved an average attack success rate of 66.60% across the 10 commercial apps, outperforming the previous leading method by 27.63%. The study confirmed that adversarial examples generated on a well-trained substitute model transfer effectively to hidden, on-device models, even when the architectures are completely different.

Conclusion

While effective, the method faces hurdles such as heavy code obfuscation, which makes it harder to "hook" into the model for label generation. As a countermeasure, the authors suggest that developers avoid using common open-source models without modification and consider training on private datasets to make it harder for attackers to find a matching student model.

Summary updated

BibTeX
@misc{cao2021towards,
  author = {Hongchen Cao and Shuai Li and Yuming Zhou and Ming Fan and Xuejiao Zhao and Yutian Tang},
  title = {{Towards Black-box Attacks on Deep Learning Apps}},
  year = {2021},
  eprint = {2107.12732},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2107.12732},
}
Figure