ModelObfuscator: Obfuscating Model Information to Protect Deployed ML-Based Systems

Mingyi Zhou, Xiang Gao, Jing Wu, John C. Grundy, Xiao Chen, Chunyang Chen, Li Li

TL;DR

This paper introduces ModelObfuscator, a novel technique to protect on-device deep learning models from sophisticated attacks like reverse engineering and model extraction. By applying a suite of obfuscation strategies to both the model's structure and its associated TFLite library, ModelObfuscator significantly increases the difficulty for attackers to steal intellectual property or launch white-box attacks, all while maintaining model performance.

What Problem Does This Paper Address?

The increasing prevalence of deep learning (DL) models on edge devices and mobile applications (on-device models) offers benefits like reduced latency and enhanced privacy by keeping data local. However, this deployment paradigm exposes these models to significant security risks. Unlike cloud-based models, on-device models are embedded within applications, making them vulnerable to unpacking and reverse engineering. Attackers can then extract crucial information like model architecture and parameters, enabling powerful white-box attacks, model inversion, and intellectual property theft. Existing defenses often focus on cloud-based models or are insufficient against sophisticated reverse engineering techniques targeting on-device deployments. This paper addresses the critical need for robust protection mechanisms specifically for on-device DL models against these advanced threats.

Methods

The core of ModelObfuscator lies in its five novel obfuscation strategies designed to hide key information within on-device DL models, particularly those using the TensorFlow Lite (TFLite) framework:

  • Renaming: This involves randomly renaming layers and their associated components. This simple yet effective method breaks the direct mapping between layer names and their functions, making it harder for attackers to infer the model's architecture.
  • Parameter Encapsulation: Instead of storing model parameters separately, they are embedded within custom source code for each layer. This hides the explicit parameter values and their shapes, which are critical for many attack types.
  • Neural Structure Obfuscation: This strategy modifies the model's architecture to confuse attackers. Two approaches are used: randomizing output shapes or aligning them to the largest shape within the network. This makes it difficult to match the obfuscated structure to known architectures.
  • Shortcut Injection: Random shortcuts are introduced between layers, altering the flow of information and further obscuring the original network topology.
  • Extra Layer Injection: Additional layers are inserted into the network. These layers are designed to be computationally simple and do not affect the model's prediction accuracy, but they significantly disrupt the spatial relationships and overall structure, making reverse engineering more challenging.

ModelObfuscator is implemented as an end-to-end tool that parses the original TFLite model, applies these obfuscation techniques, and then recompiles a compatible TFLite library that can execute the obfuscated model.

Datasets

The paper evaluates ModelObfuscator on a diverse set of 10 TFLite models. These include:

  • A fruit recognition model and a skin cancer diagnosis model, sourced from real-world Android applications.
  • Several well-known benchmark models: MobileNet, MNASNet, SqueezeNet, EfficientNet, MiDaS, LeNet, PoseNet, and SSD, obtained from the TensorFlow Hub.

This selection ensures a comprehensive evaluation across various model architectures and complexities.

Key Insights and Ideas

  • On-device models are a distinct security challenge: The paper highlights that the direct embedding of DL models within applications creates unique vulnerabilities not fully addressed by existing security measures for cloud-based models.
  • Obfuscation is key to defending against reverse engineering: By borrowing principles from code obfuscation, the authors demonstrate that similar techniques can be applied to DL models to hide critical information like structure and parameters.
  • A multi-pronged approach is most effective: No single obfuscation strategy is a silver bullet. Combining renaming, parameter encapsulation, structure modification, and layer injection provides a much stronger defense against various attack vectors.
  • Performance impact can be minimal: A crucial finding is that ModelObfuscator's obfuscation techniques can be applied with negligible impact on inference latency and acceptable increases in memory usage, making it practical for resource-constrained devices.
  • Model conversion tools are a primary attack vector: The paper shows that many existing model parsing and conversion tools fail when faced with obfuscated models, effectively blocking common methods for extracting model information.

Key Results

  • Effective Defense Against Parsing: ModelObfuscator successfully prevented all tested model parsing tools (model conversion, buffer parsing, and feature analysis) from extracting information from the obfuscated models.
  • Negligible Time Overhead: The obfuscation process introduced an average time overhead of approximately 1% for inference, which is considered negligible.
  • Acceptable Memory Overhead: The memory cost increased by approximately 20% on average, which is deemed acceptable for most mobile devices.
  • No Impact on Prediction Accuracy: The obfuscation strategies did not affect the prediction accuracy of the models, as verified by testing with 1,000 random inputs.
  • Increased Library Size: The primary drawback is an increase in the TFLite library size, particularly due to renaming, which requires new APIs. However, the model file size itself is reduced.
  • Resilience to White-box Attacks: Obfuscated models could not be successfully converted to formats usable by standard white-box attack tools (like FGSM, BIM, PGD), demonstrating robustness against these sophisticated attacks.

Limitations and Future Work

  • Increased Library Size: The authors acknowledge that the obfuscation process, especially renaming, can significantly increase the size of the TFLite library. This could be a concern for applications with strict size constraints.
  • Query-Based Attacks: ModelObfuscator does not directly defend against query-based attacks, which infer model behavior through input-output pairs without needing direct access to the model's internal structure. However, these attacks are noted as being less effective than white-box attacks.
  • Future Work: The authors suggest optimizing model obfuscation to further reduce the library size as a key area for future research. They also imply that exploring defenses against query-based attacks in conjunction with their current methods would be beneficial.

Summary updated

BibTeX
@inproceedings{zhou2023modelobfuscator,
  author = {Mingyi Zhou and Xiang Gao and Jing Wu and John C. Grundy and Xiao Chen and Chunyang Chen and Li Li},
  title = {{ModelObfuscator: Obfuscating Model Information to Protect Deployed ML-Based Systems}},
  booktitle = {In Proceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis (ISSTA'23)},
  year = {2023},
  url = {https://openreview.net/forum?id=RBNDq3OvUZ},
}
Figure