Self-adapting Large Visual-Language Models to Edge Devices Across Visual Modalities

Kaiwen Cai, Zhekai Duan, Gaowen Liu, Charles Fleming, Chris Xiaoxuan Lu

Abstract

Deploying massive Vision-Language (VL) models like CLIP on edge devices is challenging due to severe hardware constraints and the prevalence of non-RGB sensors, such as depth or infrared cameras. This paper introduces EdgeVL, a framework designed to compress large VL models and adapt them to handle multiple visual modalities without requiring manual labels. By combining dual-modality knowledge distillation with quantization-aware contrastive learning, EdgeVL achieves up to a 93-fold reduction in model size while significantly boosting open-vocabulary classification accuracy on edge hardware.

Introduction

Vision-Language (VL) models, exemplified by CLIP, have revolutionized open-vocabulary visual recognition, enabling systems to classify images into text categories they have never explicitly encountered during training. However, transitioning these capabilities to edge devices—such as mobile robots, drones, and smart doorbells—presents three significant hurdles:

  1. Diverse Modalities: Edge devices often operate in challenging environments (e.g., darkness or fog) using non-RGB sensors like depth or infrared. Standard VL models, trained primarily on RGB data, perform poorly on these alternative inputs.
  2. Label Scarcity: While edge devices can collect vast amounts of data, this data is typically unlabeled. Traditional fine-tuning requires expensive human annotation, which is often impractical for specialized sensor data.
  3. Resource Constraints: The visual encoders in state-of-the-art VL models (e.g., ViT-G) require gigabytes of memory and massive computational power, exceeding the capabilities of memory-constrained edge hardware.

EdgeVL addresses these challenges by answering a critical question: How can we compress a massive VL model and adapt it to non-RGB data using only unlabeled, in-the-wild sensor streams?

Methodology

EdgeVL employs a label-free, two-stage pipeline to bridge the gap between high-performance VL models and edge-constrained hardware.

Stage 1: Dual-Modality Knowledge Distillation

To avoid the need for human labels, EdgeVL utilizes a pre-trained CLIP model as a "teacher." The process begins with an automated curation step: the teacher evaluates unlabeled RGB images collected by the edge device against a ChatGPT-generated list of scene labels. Images where the teacher exhibits high confidence are retained, while noisy data is discarded.

Because edge devices often feature co-located cameras (e.g., an RGB camera and a depth sensor recording simultaneously), EdgeVL leverages these paired streams. The system uses the teacher's high-quality RGB embeddings to supervise a much smaller "student" model (such as Swin-T). Crucially, the student is trained to map both the RGB image and its paired non-RGB counterpart to the teacher's RGB embedding space, ensuring cross-modal alignment.

Stage 2: Quantization-Aware Contrastive Learning

To further optimize the model for edge deployment, the student model must be quantized—converting 32-bit floating-point weights to 8-bit integers (INT8). Standard Post-Training Quantization (PTQ) often degrades the delicate feature space required for text-image alignment, leading to a loss in accuracy.

EdgeVL mitigates this through Quantization-Aware Training (QAT) combined with a novel contrastive learning loss. By mining "semi-hard" triplets based on the pseudo-labels generated in Stage 1, the model is forced to maintain the proximity of similar scenes and the distance between different scenes in the embedding space. This preserves the model's discriminative power and text-image alignment even at low bitrates.

Experimental Results

Datasets and Evaluation

The framework was evaluated on several datasets providing paired RGB and non-RGB imagery:

  • ScanNet: Indoor scenes with paired RGB and Depth images.
  • EuroSAT: Satellite imagery featuring paired RGB and Short Wave Infrared (SWIR) bands.
  • SUNRGBD & NYU2: Used for cross-dataset evaluation to test generalization in unseen environments.

Scene category labels for zero-shot evaluation were generated using GPT-4 to create a comprehensive superset of potential classes.

Performance and Efficiency

EdgeVL demonstrated significant improvements across both compression and accuracy metrics:

  • Model Compression: The framework achieved up to a 93x reduction in model size, shrinking the visual encoder from 5,213 MB (CLIP ViT-G) to just 56 MB (Swin-T).
  • Accuracy Gains: On non-RGB modalities where standard CLIP models struggle, EdgeVL outperformed the closest baseline methods by 10.2% on ScanNet and 13.9% on EuroSAT.
  • Hardware Throughput: When deployed on an NVIDIA Jetson Orin Nano, the INT8 EdgeVL model reduced latency by 44% and increased throughput by 42% compared to an unquantized ViT-B model.

Discussion and Insights

EdgeVL highlights three key insights for edge AI development. First, unlabeled adaptation is viable; by leveraging the confidence scores of pre-trained models on RGB data, we can automatically supervise the learning of new modalities. Second, RGB acts as a powerful regularizer; training a unified encoder for both RGB and non-RGB data improves performance on the latter by providing richer feature representations. Finally, quantization requires contrastive preservation; injecting contrastive loss during the quantization phase is essential to maintain the alignment necessary for open-vocabulary tasks.

Conclusion

EdgeVL provides a robust framework for bringing the power of large Vision-Language models to the edge. While the extreme compression results in a slight decrease in pure RGB accuracy compared to massive teacher models, the gains in non-RGB performance and hardware efficiency are substantial. Future research will focus on further refining these adaptation techniques to maintain high RGB performance while excelling in cross-modal tasks with limited adaptation data.

Summary updated

BibTeX
@inproceedings{cai2024self,
  author = {Kaiwen Cai and Zhekai Duan and Gaowen Liu and Charles Fleming and Chris Xiaoxuan Lu},
  title = {{Self-adapting Large Visual-Language Models to Edge Devices Across Visual Modalities}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-73390-1\_18},
}
Figure