Manuscript Offprint

arXiv:2608.22716

TEE-X: TEE-aware Acceleration Framework for Large Vision Models at the Edge

Kurt M Wilson, Mohaiminul Al Nahian, Abeer Matar A. Almalky, Sadat Shahriyar, Souvik Kundu, Zhishan Guo, Abdullah Al Arafat, Adnan Siraj Rakin

Abstract

Despite their remarkable success, machine learning models, particularly in vision applications, are alarmingly vulnerable to a range of security threats. One key factor in the attack landscape is the distinction between white-box and black-box threat models, as the latter poses challenges that limit attack effectiveness when access to model information is limited. As a result, using Trusted Execution Environments (TEEs) enhances security for machine learning applications by protecting model confidentiality and execution integrity, effectively shifting the execution environment from the white-box to the black-box side of the threat model spectrum. While adopting TEEs for large vision models, e.g., Vision Transformers (ViTs), is crucial for enhancing security and privacy, significant challenges related to memory constraints and increased computational latency must be addressed, especially in time-sensitive edge applications where safety and privacy are paramount. The objective of this work is to enable large vision models to be fully hosted within TEEs, achieving GPU-level inference latency for time-sensitive edge vision applications while maintaining performance. To this end, we propose TEE-X, a TEE-aware acceleration framework that introduces a sensitivity-aware modularization technique and enables vectorization in TEE inference. This design is validated on OP-TEE for Arm TrustZone, configured to optimize performance on the NVIDIA Jetson AGX Xavier for efficient edge vision applications using ViT models. The findings reveal that TEE-X delivers an effective TEE-aware acceleration framework that achieves minimal accuracy-latency trade-offs while ensuring fast and secure edge inference for vision models.

1 Introduction

Machine learning (ML) models have made significant strides across various tasks, demonstrating strong performance in many areas, particularly in vision applications [6, 4]. Despite their success, prior studies have demonstrated that these models remain highly vulnerable to a broad spectrum of security attacks, including: memory fault injections [56, 8, 38, 39, 52, 1, 63, 65], sidechannels [21, 13, 9, 41, 51, 54, 61, 26, 27], and adversarial attacks [5, 28, 62, 17, 2, 36, 30, 19, 53, 58, 34, 10, 29]. These vulnerabilities highlight the ongoing need for improved security measures in the deployment of ML models, especially in vision applications, that are susceptible to these attacks.

Figure

Figure 1: Overview of attack types categorized according to different threat model settings.

As shown in Figure 1, these attacks are generally classified based on their threat assumptions, which range from white-box to black-box scenarios. In white-box attacks, adversaries are assumed to have complete access to the target model, including its architecture and parameters [2, 30, 19, 53, 58, 34, 10, 29], thereby substantially simplifying the attack process and often leading to a significant impact on model security. In contrast, black-box attacks represent a considerably more challenging threat model, where adversaries have no direct access to the model internals and can only interact with the system through input-output queries.

or indirect observations [53, 45, 47]. Consequently, the effectiveness and feasibility of attacks in black-box settings are substantially constrained compared to those in white-box settings.

As a result, being on the black-box side of the spectrum has motivated the security community to adopt Trusted Execution Environments (TEEs) for ML applications, which provide an isolated and protected execution enclave often constraining the attack threat model more closer to a black-box spectrum [14, 33, 46, 23, 11, 25, 43, 42, 49, 35]. These TEEs have been adopted as a defensive mechanism to enforce two primary objectives, model confidentiality (privacy) and execution integrity during inference (security). By isolating model execution within protected hardware boundaries, TEEs effectively shift the attack surface from the white-box to the black-box side of the spectrum (as shown in Fig. 1). While adopting TEEs for ML models to provide security and privacy protection is pivotal, the key challenge in adopting TEEs, especially for large vision models such as Vision Transformers (ViTs), stems from the memory and computational (e.g., latency) bottlenecks they introduce. Deploying a large vision model inside a TEE presents three primary bottlenecks: i) The memory capacity of the TEE is limited, which makes it challenging for some of the larger models to fit inside a TEE. ii) Executing these models within TEE introduces considerable computational overhead and inference latency compared to native GPU execution. iii) The above two challenges become further exacerbated in edge applications [55], where inference is time sensitive, at the same time, TEE-enabled inference is even more important in edge applications where safety (e.g., self-driving car [37]) and privacy (e.g., healthcare [18]) are a priority.

To address this, existing approaches for deploying ML models within TEEs have adopted two alternative design choices. The first category is based on model partitioning, where parts or layers of the network are executed within the secure enclave, while the remaining components are offloaded to the untrusted environment to alleviate the stringent memory constraints imposed by TEEs [33, 46, 23, 49]. The second category adopts operation-aware execution strategies, selectively placing sensitive operations inside the TEE while offloading computationally intensive operations to on-chip memory or external accelerators to improve execution efficiency [14, 35]. While these methods are effective at partially reducing inference costs (e.g., latency), they still fall short of GPU-only inference time, which is critical, especially for edge applications. At the same time, exiting the TEE at any stage of model inference still leaves the attacker with additional information (e.g., layers) outside the TEE to exploit. This motivated our proposed approach to designing an acceleration method that enables hosting entire large vision models inside TEEs while achieving on-par GPU inference latency and maintaining model performance.

To this end, we propose TEE-X, a TEE-aware acceleration framework to run the entire model inference inside secure enclaves. Unlike prior approaches that rely on model partitioning or offloading operations to untrusted accelerators, TEE-X enables complete in-enclave execution by designing a novel sensitivity-aware modularization technique combined with TEE-aware computational budget assignment for each module. On the TEE side, for the first time, vectorization is enabled using Arm Neon SIMD instructions to perform a multiply-accumulate operation, providing GPU-like parallelism. The proposed optimization is designed to achieve two objectives: i) TEE-X ensures secure, fully protected model inference using the strong security benefits of TEEs. ii) Meeting the performance demands of large-scale edge vision applications (ref. Figure 2). To evaluate our proposed solution, we stress test TEE-X on an edge vision

Figure

Figure 2: Comparison of DeiT-small inference in: GPU, TEE, and accelerated using TEE-X.

application where the evaluation model is ViTs due to their substantially larger model sizes and higher computational complexity compared to other vision architectures, and on TrustZone within an Armv8 edge device (NVIDIA Jetson AGX Xavier) using a limited trusted memory carveout size. The results demonstrate that TEE-X provides an effective TEE-aware acceleration framework that achieves negligible accuracy-latency trade-offs while ensuring faster, more secure edge inference for vision models.

References (62)

  • Deep-troj: An inference stage trojan insertion algorithm through efficient weight replacement attack
  • Threat of adversarial attacks on deep learning in computer vision: A survey
  • End-to-end object detection with transformers
  • Towards evaluating the robustness of neural networks
  • Crossvit: Cross-attention multi-scale vision transformer for image classification
  • Imagenet: A large-scale hierarchical image database
  • One-bit flip is all you need: When bit-flip attack meets model training
  • Enhancing adversarial transferability with partial blocks on vision transformer
  • Mlcapsule: Guarded offline deployment of machine learning as a service
  • Deep residual learning for image recognition
  • Security analysis of deep neural networks operating in the presence of cache side-channel attacks, 2020
  • Model protection: Real-time privacy-preserving inference service for model privacy at the edge
  • MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications
  • Bluethunder: A 2-level directional predictor based side-channel attack against sgx
  • Adversarial examples are not bugs, they are features
  • Computer vision to enhance healthcare domain: An overview of features, implementation, and opportunities
  • Adversarial token attacks on vision transformers (opens arXiv in a new tab)
  • Amd memory encryption
  • Flipping bits in memory without accessing them: An experimental study of dram disturbance errors
  • Learning multiple layers of features from tiny images
  • Occlumency: Privacy-preserving remote deep-learning inference using sgx
  • Q-vit: Accurate and fully quantized low-bit vision transformer
  • Lasagna: Accelerating secure deep learning inference in sgx-enabled edge cloud
  • GPUHammer: Rowhammer attacks on GPU memories are practical
  • GPUBreach: Privilege escalation attacks on GPUs using rowhammer
  • Delving into transferable adversarial examples and black-box attacks (opens arXiv in a new tab)
  • Dbia: Data-free backdoor attack against transformer networks
  • On the robustness of vision transformers to adversarial examples
  • Innovative instructions and software model for isolated execution
  • Boosting the transferability of adversarial attack on vision transformer with adaptive token tuning
  • Darknetz: towards model privacy at the edge using trusted execution environments
  • On improving adversarial transferability of vision transformers (opens arXiv in a new tab)
  • Secureinfer: Heterogeneous tee-gpu architecture for privacy-critical tensors for large language model deployment (opens arXiv in a new tab)
  • Practical black-box attacks against machine learning
  • Multi-modal fusion transformer for end-to-end autonomous driving
  • Bit-flip attack: Crushing neural network with progressive bit search
  • Tbt: Targeted neural network attack with bit trojan
  • T-bfa: Targeted bit-flip adversarial weight attack
  • Exploiting the dram rowhammer bug to gain kernel privileges
  • Occlum: Secure and efficient multitasking inside a single enclave of intel sgx
  • Model stealing attacks against inductive graph neural networks
  • Decision-based black-box attack against vision transformers via patch-wise adversarial removal
  • Shadownet: A secure and efficient on-device model inference system for convolutional neural networks
  • Black-box adversarial attack against transformer-based object detection models in vehicular networks
  • Training data-efficient image transformers & distillation through attention
  • Slalom: Fast, verifiable and private execution of neural networks in trusted hardware (opens arXiv in a new tab)
  • Foreshadow: Extracting the keys to the intel {SGX} kingdom with transient {Out-of-Order} execution
  • Drammer: Deterministic rowhammer attacks on mobile platforms
  • Your scale factors are my weapon: Targeted bit-flip attacks on vision transformers via scale factor manipulation
  • Generating transferable adversarial examples against vision transformers
  • One bit flips, one cloud flops: Cross-VM row hammer attacks and privilege escalation
  • Edge deep learning in computer vision and medical diagnostics: a comprehensive survey
  • {DeepHammer}: Depleting the intelligence of deep neural networks through targeted chain of bit flips
  • Width & depth pruning for vision transformers
  • You are catching my attention: Are vision transformers bad learners under backdoor attacks? In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 24605–24615, 2023
  • Shufflenet: An extremely efficient convolutional neural network for mobile devices
  • Interface-based side channel in tee-assisted networked services
  • Pthammer: Cross-user-kernel-boundary rowhammer through implicit accesses
  • On evaluating adversarial robustness of large vision-language models
  • Trojvit: Trojan insertion in vision transformers
  • Query-efficient hard-label black-box attack against vision transformers
  • What makes vision transformers robust towards bit-flip attack? In International Conference on Pattern Recognition, pages 424–438