Abstract
Real-time video inference on edge devices is frequently compromised by "data drift," where environmental changes—such as shifting weather or lighting conditions—degrade the performance of pre-trained lightweight models. While cloud-only solutions offer high accuracy, they are often impractical due to extreme bandwidth requirements and high latency. This paper introduces Shoggoth, an edge-cloud collaborative framework designed to maintain high inference accuracy through adaptive online learning. By employing decoupled knowledge distillation and a novel activation-based replay memory, Shoggoth enables edge devices to fine-tune models in real-time. Experimental results demonstrate that Shoggoth improves mean Average Precision (mAP) by up to 20% compared to static edge models while reducing uplink bandwidth by 24x relative to cloud-centric approaches.
1. Introduction
The deployment of deep learning models for real-time video tasks, such as traffic monitoring and autonomous driving, necessitates a balance between computational efficiency and model accuracy. Edge devices, while providing low-latency processing, are typically restricted to lightweight models that lack the capacity to generalize across diverse environmental conditions. This phenomenon, known as data drift, occurs when the visual distribution of the input data shifts (e.g., from day to night), leading to a significant drop in model reliability.
Existing paradigms generally fall into two categories: edge-only execution, which suffers from poor adaptability, and cloud-only execution, which incurs prohibitive communication costs. Shoggoth addresses this gap by proposing a collaborative architecture that allows the edge model to adapt to new environments dynamically using guidance from a powerful cloud-based "teacher" model.
2. Methodology
2.1 Decoupled Knowledge Distillation
Shoggoth utilizes a teacher-student architecture. A high-capacity model (e.g., Mask R-CNN) resides in the cloud, serving as the teacher. The edge device runs a lightweight student model, such as YOLOv4 with a ResNet18 backbone. Periodically, selected frames are transmitted to the cloud, where the teacher generates high-quality labels. These labels are sent back to the edge to serve as the ground truth for local fine-tuning.
2.2 Adaptive Training with Replay Memory
To mitigate "catastrophic forgetting"—where a model learns new environmental features but loses the ability to recognize previous ones—Shoggoth implements a replay memory. Unlike traditional methods that store raw images, Shoggoth stores activation volumes from a specific "Replay Layer." This approach significantly reduces the memory footprint on the edge device.
During the update phase, the system uses mini-batch Stochastic Gradient Descent (SGD) to update the network's "head" (the final classification and localization layers). To maintain stability, the early feature-extraction layers are kept relatively stable, preventing the "aging effect" where stored activations become incompatible with a rapidly changing backbone.
2.3 Adaptive Frame Sampling
Continuous transmission of video frames to the cloud is inefficient. Shoggoth employs a closed-loop controller to dynamically adjust the sampling rate based on three primary metrics:
- Scene Change Rate ($\phi$): Measures the variance in the teacher's labels over time.
- Inference Accuracy ($\alpha$): Monitors the student model's current confidence levels.
- Resource Usage ($\lambda$): Evaluates the current computational load on the edge hardware.
This mechanism ensures that bandwidth is preserved during static scenes and prioritized during rapid environmental transitions.
2.4 Batch Renormalization (BRN)
Standard Batch Normalization (BN) is often unstable when training with the very small batch sizes required by edge hardware. Shoggoth replaces standard BN with Batch Renormalization (BRN) to ensure stable learning and convergence during the online adaptation process.
3. Evaluation
3.1 Experimental Setup
The framework was evaluated using three major benchmarks: UA-DETRAC (traffic monitoring), KITTI (autonomous driving), and the Waymo Open Dataset. To simulate real-world temporal shifts, images were concatenated into chronological streams. Testing was conducted on an NVIDIA Jetson TX2 edge module.
3.2 Performance Metrics
- Accuracy: Shoggoth achieved a 15%–20% mAP improvement over static edge-only strategies.
- Efficiency: The system maintained an average of 27.3 FPS on the Jetson TX2, demonstrating that the overhead of online learning does not preclude real-time performance (30 FPS baseline).
- Bandwidth: Compared to cloud-only inference, Shoggoth reduced uplink bandwidth by 24x and downlink bandwidth by 350x.
4. Discussion and Conclusion
Shoggoth demonstrates that edge-cloud collaboration, when paired with intelligent sampling and memory management, can effectively solve the problem of data drift in real-time video analytics. By focusing adaptation on the model's head and utilizing activation-based replay, the system achieves a "sweet spot" between the high accuracy of the cloud and the low latency of the edge.
Future work will focus on reducing the dependency on the cloud teacher in extreme edge cases and extending the framework to more complex tasks such as instance segmentation and depth estimation. Additionally, further testing on lower-power microcontrollers will help determine the ultimate scalability of the Shoggoth architecture.
Summary updated