DynaMO: Protecting Mobile DL Models through Coupling Obfuscated DL Operators

Mingyi Zhou, Xiang Gao, Xiao Chen, Chunyang Chen, John Grundy, Li Li

TL;DR

This paper introduces DynaMO, a novel dynamic obfuscation strategy to protect deep learning (DL) models deployed on mobile devices from reverse-engineering attacks. By coupling obfuscated operators with linear transformations, DynaMO significantly enhances security against dynamic instrumentation without introducing substantial performance overhead.

What Problem Does This Paper Address?

Deep learning (DL) models are increasingly deployed on mobile devices for on-device processing, offering benefits like reduced latency and enhanced privacy. However, this deployment makes these models vulnerable to reverse-engineering attacks. Attackers can unpack mobile applications, extract DL model information (like weights and computational graphs), and then either steal intellectual property or launch attacks. Existing model obfuscation techniques, which aim to protect these models, often rely on static or semi-dynamic methods. These methods are vulnerable to dynamic instrumentation attacks, where attackers can monitor the model's execution at runtime to extract sensitive information. The paper highlights that current obfuscation methods fail to adequately protect against attackers who can dynamically analyze the inference code and recover model information.

Methods

The paper proposes a two-pronged approach:

  1. DLModelExplorer (Attack Tool): To demonstrate the limitations of existing obfuscation methods, the authors developed DLModelExplorer. This tool uses dynamic instrumentation to:
  2. Identify the actual inference function of each operator.
  3. Extract sensitive data like model weights and computational graphs at runtime.
  4. Distinguish between valid and obfuscating operators. This tool effectively deobfuscates models protected by static or semi-dynamic methods, highlighting the need for more robust defenses.

  5. DynaMO (Defense Strategy): To counter dynamic instrumentation attacks, DynaMO is introduced as a fully dynamic model obfuscation strategy. It builds upon existing obfuscation techniques by adding a "coupling" step. The core ideas are:

  6. Operator Coupling: DynaMO randomly selects pairs of operators. One operator's weights are obfuscated using a linear transformation. The other (coupled) operator then applies a corresponding inverse linear transformation to recover the correct results.
  7. Linear Transformations: The obfuscation and recovery process relies on simple linear transformations of DL model weights. This is inspired by Homomorphic Encryption principles.
  8. Randomness and Coupling: The random selection of operator pairs and the use of linear transformations make it difficult for attackers to identify the obfuscation and recovery patterns, even if they can parse some information.
  9. Extra Obfuscating Operators: DynaMO can also leverage existing "extra obfuscating operators" (which don't affect the model output) as part of the coupling process, further increasing complexity for attackers.

Datasets

The paper evaluates its methods using 10 TFLite models from various tasks and sources, including:

  • Fruit recognition model
  • Skin cancer diagnosis model
  • MobileNet [12]
  • MNASNet [26]
  • SqueezeNet [15]
  • EfficientNet [27]
  • MiDaS [23]
  • LeNet [17]
  • PoseNet [16]
  • SSD [20]

The fruit recognition and skin cancer diagnosis models were collected from Android apps, while the others were sourced from the TensorFlow Hub.

Key Insights and Ideas

  • Dynamic Instrumentation is a Powerful Attack Vector: The paper convincingly demonstrates that even with static or semi-dynamic obfuscation, attackers can leverage dynamic instrumentation to extract critical model information at runtime.
  • Static Obfuscation is Insufficient: Existing methods like operator renaming and parameter encapsulation are vulnerable because they don't protect the runtime execution flow.
  • DynaMO's Dynamic Coupling is Key: The core innovation is the dynamic coupling of obfuscated operators with linear transformations. This introduces randomness and complexity that static analysis tools struggle to unravel.
  • Negligible Performance Overhead: A significant achievement is that DynaMO introduces only minimal performance and memory overhead, making it practical for resource-constrained mobile devices.
  • Theoretical Foundation for Obfuscation: The paper provides theoretical lemmas (Lemma 4.1 and Theorem 4.2) to justify the coupled weight transformation for both linear and non-linear operators, underpinning the robustness of DynaMO.

Key Results

  • DLModelExplorer Effectiveness: The attack tool achieved high deobfuscation rates, e.g., 98.76% weights extraction rate and 99.89% operator classification accuracy on various models, proving the vulnerability of existing methods.
  • DynaMO Resilience to Attack: When protected by DynaMO, DLModelExplorer's performance significantly degraded. For instance, the weights extraction rate dropped to 52.52%, and operator classification accuracy to 60.04%.
  • Minimal Performance Impact: DynaMO introduced negligible scaled maximal element-wise error (around 1.4×10⁻⁷) compared to existing methods. Time and RAM overheads were also minimal and comparable to existing obfuscation strategies.
  • Structure Similarity: DynaMO significantly decreased structure similarity (SS) from 0.98 to 0.58, indicating a substantial disruption of the model's recognizable structure.

Limitations and Future Work

  • Platform Specificity: The current work focuses on TFLite models. While the strategy is generalizable, its adaptation to other DL platforms might require further investigation due to potential unsupported model constructs.
  • Real-world Developer Evaluation: The authors acknowledge that they have not yet evaluated DynaMO with real-world mobile ML developers.
  • Side-Channel Attacks: The study did not evaluate DynaMO's resilience against side-channel attacks (e.g., RAM, CPU usage) that could be used to reconstruct models.
  • Future Work: The authors plan to optimize the obfuscation process and their prototype tool to further enhance efficiency and explore broader applicability.

Summary updated

BibTeX
@inproceedings{zhou2024dynamo,
  author = {Mingyi Zhou and Xiang Gao and Xiao Chen and Chunyang Chen and John Grundy and Li Li},
  title = {{DynaMO: Protecting Mobile DL Models through Coupling Obfuscated DL Operators}},
  booktitle = {ASE},
  year = {2024},
}
Figure