Beyond the Model: Data Pre-processing Attack to Deep Learning Models in Android Apps

Ye Sang, Yujin Huang, Shuo Huang, Helei Cui · DOI

Abstract

As Deep Learning (DL) models migrate from cloud environments to mobile devices to enhance privacy and reduce latency, the security landscape of mobile applications has evolved. While existing research primarily focuses on adversarial examples and model protection, this paper identifies a critical vulnerability in the data pre-processing pipeline. By manipulating the steps that prepare raw input for model inference—such as image resizing and rotation—attackers can compromise application integrity without direct interaction with the neural network. Our study demonstrates a high success rate in injecting malicious code into obfuscated Android applications, leading to significant accuracy degradation and increased computational latency.

Introduction

The proliferation of powerful mobile hardware has enabled developers to deploy complex Deep Learning models directly onto Android devices. Frameworks like TensorFlow Lite (TFLite) and Google’s MLKit facilitate this transition. However, the security focus has remained largely on the "brain" of the system—the model weights and architecture. This paper shifts the focus to the "nervous system": the pre-processing pipeline.

Data pre-processing is the essential bridge between raw sensor data (e.g., camera frames) and the specific input requirements of a DL model. Because these pipelines are often implemented using standard Android APIs and predictable logic, they present a significant, yet overlooked, attack surface.

Methodology: The Black-Box Attack Pipeline

The researchers developed a three-phase attack strategy designed to function without prior knowledge of the model's internal parameters.

1. Pre-processing Rule Summarization

The first step involves identifying standard patterns used by popular frameworks. For instance, TFLite models often require specific input dimensions (e.g., 224x224 or 640x320) and color normalization. By understanding these conventions, an attacker can predict the expected transformations.

2. DL App Identification

The attack targets Android Package Kits (APKs) by scanning for specific markers. Using tools like apktool and dex2jar, the researchers identified apps containing TFLite-related file suffixes (.tflite, .tfl) or calls to MLKit APIs.

3. Semantic-Based Code Injection

The most significant challenge in this pipeline is code obfuscation, where developers scramble variable and method names to hinder reverse engineering. To bypass this, the authors employed a "semantic search" strategy. Instead of looking for specific names, they searched for:

  • Numerical Constants: Specific image format IDs or resolution values.
  • Vanilla Android APIs: Methods like getHeight(), getWidth(), or rotate(), which are typically excluded from obfuscation to maintain compatibility with the Android OS.

Once these "hook" points were identified, malicious code was injected to alter the data flow—for example, forcing a 90-degree rotation or inflating image resolution—before the data reached the model's input layer.

Empirical Study and Results

The researchers conducted a large-scale analysis to validate the feasibility of this attack using a real-world dataset.

Dataset

  • Initial Crawl: 1,046 mobile apps from the Google Play Store across diverse categories including Finance and Medicine.
  • TFLite Identification: 517 apps were found to utilize TFLite.
  • MLKit Focus: 320 apps using the MLKit framework were selected for the primary attack study.

Key Findings

The results indicate a widespread vulnerability in the mobile AI ecosystem:

  • High Injection Success: The attack successfully injected malicious logic into 81.56% (261 out of 320) of the targeted MLKit apps.
  • Functional Disruption: In qualitative tests on "Selfie Segmentation" and "Face Detection" apps, tampering with rotation parameters caused the models to fail entirely. The AI features became non-functional, as the model could no longer recognize features in the incorrectly oriented data.
  • Latency and "Sponge Poisoning": By modifying resolution parameters, the researchers could artificially inflate the computational load. For example, increasing an image resolution from 166x144 to 960x720 caused a massive spike in inference time. This "sponge poisoning" drains the device's battery and creates a Denial-of-Service (DoS) effect, making the app appear sluggish to the user.

Discussion: Logic vs. Mathematics

A key insight from this research is that logic-based attacks can be more effective and easier to implement than traditional adversarial attacks. While adversarial examples require complex gradient calculations and mathematical optimization, a pre-processing attack simply exploits the logic of data handling. If an attacker can convince a model that a portrait image is actually in landscape, the model's mathematical robustness becomes irrelevant.

Furthermore, the study highlights that standard obfuscation techniques are insufficient. Because pre-processing logic must eventually interact with the Android system's standard APIs, the "semantic" footprint of these operations remains visible to determined attackers.

Conclusion and Future Work

This paper demonstrates that the security of mobile AI extends far beyond the model itself. The data pre-processing pipeline is a critical vulnerability that can be exploited to degrade performance and destroy model accuracy.

Future research directions include extending these findings to Natural Language Processing (NLP)—where manipulating word embeddings or normalization could have similar effects—and exploring post-processing attacks, where the attacker manipulates the model's output probabilities to change the final classification result.

Summary updated

BibTeX
@inproceedings{sang2023beyond,
  author = {Ye Sang and Yujin Huang and Shuo Huang and Helei Cui},
  title = {{Beyond the Model: Data Pre-processing Attack to Deep Learning Models in Android Apps}},
  booktitle = {SecTL@AsiaCCS},
  year = {2023},
  url = {https://openreview.net/forum?id=TAVMlPegPk},
}
Figure