Abstract
As AI applications for mobile devices become more prevalent, there is an increasing need for faster execution and lower energy consumption for neural model inference. Historically, the models run on mobile devices have been smaller and simpler in comparison to large state-of-the-art research models, which can only run on the cloud. However, cloud-only inference has drawbacks such as increased network bandwidth consumption and higher latency. In addition, cloud-only inference requires the input data (images, audio) to be fully transferred to the cloud, creating concerns about potential privacy breaches. We demonstrate an alternative approach: shared mobile-cloud inference. Partial inference is performed on the mobile in order to reduce the dimensionality of the input data and arrive at a compact feature tensor, which is a latent space representation of the input signal. The feature tensor is then transmitted to the server for further inference. This strategy can improve inference latency, energy consumption, and network bandwidth usage, as well as provide privacy protection, because the original signal never leaves the mobile. Further performance gain can be achieved by compressing the feature tensor before its transmission.
Introduction
AI developers currently face a significant trade-off when deploying large-scale deep learning models like ResNet or VGG on mobile hardware. Mobile-only inference is often slow and energy-intensive, as mobile GPUs lack the computational power of desktop-grade hardware. Conversely, cloud-only inference requires uploading raw, high-resolution data to a server, which consumes substantial bandwidth, introduces network latency, and raises privacy concerns as sensitive user data leaves the device.
To address this dilemma, we propose Shared Mobile-Cloud Inference, a collaborative approach that splits neural network execution between the edge device and the cloud.
Methods: Collaborative Architecture
The core of this approach involves "splitting" a neural network into two segments. The mobile device executes the initial layers (the edge sub-model), producing an intermediate "feature tensor." This compact representation is then transmitted to a cloud server, which runs the remaining layers (the cloud sub-model) to complete the inference.
Key technical components include:
- Optimal Split Points: Identifying layers where the intermediate data is naturally compact and suitable for transmission.
- 8-bit Quantization: Converting 32-bit floating-point tensors into 8-bit integers to achieve a 4x reduction in transmission data with negligible accuracy loss.
- Pipelined Execution: Allowing the mobile device to process subsequent frames while the server completes previous inferences, maximizing overall throughput.
The system was validated using an Android application built with TensorFlow Lite, communicating with servers equipped with NVIDIA GeForce GTX TITAN X GPUs.
Key Results and Performance Benchmarks
The research evaluated pre-trained models like ResNet-34 and VGG on a Samsung Galaxy S10, focusing on system-level metrics rather than just static accuracy.
- Latency Gains: Shared inference with 8-bit quantization consistently outperformed cloud-only inference. On the test hardware, a full ResNet-34 inference took 160 ms on the mobile device alone, compared to just 20 ms on the server.
- The Network "Sweet Spot": For ResNet-34, shared inference with quantization becomes faster than mobile-only inference once upload speeds exceed approximately 450 KB/s.
Discussion: Why It Works
A critical insight from this work is the role of Batch Normalization (BatchNorm). BatchNorm layers make models inherently "split-friendly" by forcing neuron outputs into a predictable, normally distributed range (typically -2 to 2). This distribution allows for highly efficient 8-bit quantization without significant information loss. Furthermore, transmitting feature tensors instead of raw signals provides a layer of privacy, as the original input never leaves the mobile device.
Limitations and Future Work
While promising, several challenges remain for future research:
- Custom Codecs: Current image/video codecs (like JPEG) are optimized for human perception. Future work should focus on developing codecs specifically designed for the mathematical properties of feature tensors.
- Split-Aware Architectures: Most existing models were designed for monolithic execution. Designing architectures specifically for distributed edge-cloud environments could yield even greater efficiencies.
- Network Volatility: Performance remains dependent on network conditions; in extremely low-bandwidth scenarios, mobile-only inference may still be the optimal choice.
Summary updated