MobileVOS: Real-Time Video Object Segmentation Contrastive Learning meets Knowledge Distillation

TL;DR

MobileVOS combines contrastive learning and knowledge distillation to enable real-time video object segmentation on mobile devices, with 32x fewer parameters and 5x faster inference.

cs.CV 🔴 Advanced 2023-03-14 18 views
Roy Miles Mehmet Kerim Yucel Bruno Manganelli Albert Saa-Garriga
video segmentation knowledge distillation contrastive learning mobile AI real-time

Key Findings

Methodology

This paper introduces a unified framework that integrates knowledge distillation with supervised pixel-wise contrastive learning, focusing on structural information transfer via correlation matrices. The teacher model, with infinite memory, guides the student with limited memory through a pixel-wise representation distillation loss, which maximizes mutual information between their features. Boundary-aware sampling selectively focuses on boundary pixels to improve convergence and detail preservation. The combined loss includes structure-related, contrastive, and logit distillation components, optimized end-to-end. Experiments on DAVIS and YouTube benchmarks show the model achieves competitive accuracy with significantly reduced parameters and inference speed up to 5 times faster, suitable for mobile deployment.

Key Results

  • On DAVIS 2016, MobileVOS ResNet18 achieves J&F of 90.4, just 0.3 below STCN, but runs 4 times faster with 3 times fewer parameters.
  • On DAVIS 2017, the ResNet18 version reaches J&F of 89.7, close to the 90.4 of the teacher, with 5x speed and 1/8 parameters.
  • On YouTube-VOS, the model maintains high accuracy with 90 FPS inference, parameters at 1/4 of competing methods, demonstrating excellent mobile suitability.

Significance

This work addresses the challenge of deploying high-performance video segmentation on resource-constrained devices. By combining knowledge distillation with contrastive learning, it effectively compresses models while maintaining accuracy. The approach enables real-time processing on smartphones and edge devices, facilitating applications like mobile video editing, surveillance, and augmented reality. Theoretically, it advances understanding of structural information transfer and mutual information maximization in dense prediction tasks, opening new avenues for lightweight yet accurate models.

Technical Contribution

The key innovation lies in designing a pixel-wise structure-aware distillation loss grounded in mutual information theory, coupled with a boundary-focused sampling strategy. This enables effective structural knowledge transfer from large teacher models to small student networks without architectural complexity. The framework unifies contrastive learning and distillation, providing a theoretically sound basis for mutual information maximization. The resulting models are highly compact, parameter-efficient, and capable of real-time inference, pushing the boundary of lightweight dense prediction models.

Novelty

This is the first work to unify knowledge distillation with supervised contrastive learning specifically for semi-supervised video object segmentation. The boundary-aware sampling and correlation matrix-based structural loss are novel contributions that significantly improve the structural fidelity of limited-memory models. Unlike prior methods relying on complex architectures or memory modules, this approach achieves high performance through loss design, enabling efficient deployment on mobile hardware.

Limitations

  • Despite improvements, boundary prediction errors still occur under severe occlusion or fast motion, limited by the finite memory and sampling strategy.
  • Performance heavily depends on the teacher model quality; if the teacher is weak, the student’s performance may degrade.
  • On ultra-low-power devices, further energy optimization is necessary to sustain long-term operation without overheating or excessive battery drain.

Future Work

Future directions include integrating multi-modal cues like depth and optical flow to enhance boundary robustness, developing adaptive sampling strategies for complex scenes, and optimizing model architectures for even lower power consumption. Extending the framework to multi-task settings such as tracking and action recognition is also promising, aiming to build a comprehensive edge AI platform for real-time video understanding.

AI Executive Summary

Video object segmentation (VOS) is a fundamental task in computer vision, enabling applications from video editing to autonomous driving. Despite recent advances with deep neural networks, deploying these models on mobile devices remains challenging due to their large size and computational demands. This paper introduces MobileVOS, a lightweight yet high-performing framework that unifies contrastive learning and knowledge distillation to address this bottleneck. The core idea is to transfer structural information from a large teacher model with infinite memory to a small student network with limited memory, using a pixel-wise correlation matrix-based loss grounded in mutual information theory. Boundary-aware sampling focuses training on object edges, improving boundary accuracy and convergence. The combined loss enables the student model to learn discriminative features efficiently, achieving competitive accuracy on DAVIS and YouTube benchmarks while running up to 5 times faster with 32 times fewer parameters. Extensive experiments demonstrate the model’s suitability for real-time mobile deployment, with inference speeds exceeding 90 FPS on a Samsung Galaxy S22. This work significantly advances the feasibility of real-time, on-device video analysis, opening new possibilities for edge AI applications. Future work will explore multi-modal fusion, adaptive sampling, and further hardware-aware optimizations to enhance robustness and efficiency in complex scenarios, ultimately pushing the frontier of lightweight dense prediction models.

Deep Analysis

Background

Video object segmentation has evolved from early template-matching and handcrafted feature methods to deep learning-based approaches like OSVOS, STM, and XMem, which leverage temporal memory and feature matching. While these models achieve high accuracy, their large parameter count and computational complexity hinder deployment on resource-limited devices. Recent efforts focus on model compression, lightweight backbones (e.g., MobileNet), and efficient memory management, yet a gap remains in achieving real-time performance on mobile hardware without sacrificing accuracy. The challenge lies in balancing model size, speed, and robustness, especially in complex scenes with occlusion and boundary ambiguity.

Core Problem

Existing high-performance models are too resource-intensive for mobile deployment, limiting real-time applications. Limited memory networks struggle with boundary precision and occlusion, and architectural complexity increases energy consumption. The core issue is how to effectively transfer rich structural information from large models to small, fast networks, ensuring accurate boundary delineation and temporal consistency under strict computational constraints. Addressing this requires innovative loss functions and training strategies that can enhance feature discriminability and structural fidelity within limited parameters.

Innovation

This work introduces a novel pixel-wise structure distillation loss based on mutual information maximization, enabling effective structural knowledge transfer from teacher to student. It combines supervised contrastive learning with boundary-aware sampling, focusing training on boundary pixels to improve detail accuracy. The framework simplifies architecture requirements, avoiding complex memory modules, and achieves significant parameter reduction (32x) while boosting inference speed (5x). The theoretical grounding in information theory provides robustness and generality, making it adaptable to various dense prediction tasks. This approach marks a shift from architectural complexity to loss function innovation for model compression.

Methodology

  • �� Teacher-student architecture with the teacher having infinite memory and the student limited to recent frames. • Construction of pixel-wise correlation matrices (Cs, Ct) from normalized feature representations to encode structural relationships. • Design of a structure-related loss (Lrepr) that maximizes mutual information between student and teacher features, regularized by correlation alignment. • Incorporation of boundary-aware sampling, which selects pixels near object edges using Sobel edge detection, reducing computational load and emphasizing boundary details. • Integration of supervised contrastive loss (LSupCon) by interpolating the target correlation matrix with ground-truth labels, controlled by a hyperparameter ω. • Combining structure loss, contrastive loss, and logit distillation (KL divergence) into a unified multi-objective training pipeline. • End-to-end training with pre-trained teacher models, optimizing for accuracy and efficiency.

Experiments

The models are trained on DAVIS 2016/2017 and YouTube-VOS datasets, using a pre-trained STCN as teacher. Architectures include MobileNetV2 and ResNet18 backbones, with boundary sampling and multi-loss optimization. Evaluation metrics include J&F, FPS, and parameter count, tested on NVIDIA A40, 1080Ti, and mobile GPU. Ablation studies verify the contribution of each component, showing structure loss and boundary sampling significantly improve boundary accuracy and convergence. The models are deployed on a Samsung Galaxy S22, demonstrating real-time inference at over 90 FPS with minimal latency. Model soups are used to enhance robustness and performance stability across different scenarios.

Results

MobileVOS ResNet18 achieves J&F of 90.4 on DAVIS 2016, with 4x speed and 3x fewer parameters compared to STCN. On DAVIS 2017, J&F reaches 89.7, close to the teacher, with 5x faster inference. On YouTube-VOS, the model maintains high accuracy at 90 FPS, with parameters only 1/4 of competing methods. These results confirm the effectiveness of the proposed loss and training strategy, enabling high-quality, real-time segmentation on mobile devices while reducing computational costs dramatically.

Applications

This approach enables real-time video analysis on smartphones, drones, and embedded systems, facilitating applications like live video editing, augmented reality, and surveillance. Its low computational footprint makes it suitable for edge AI, reducing reliance on cloud processing. Future integration with multi-modal sensors (depth, optical flow) could further enhance robustness, supporting broader deployment in autonomous vehicles, smart cameras, and wearable devices, transforming mobile video understanding.

Limitations & Outlook

Despite significant progress, boundary prediction errors under severe occlusion or rapid motion remain. Dependence on teacher model quality limits performance if the teacher is weak. The boundary sampling strategy may miss some critical pixels in highly complex scenes. Additionally, further energy-efficient hardware-aware design is needed for sustained operation on ultra-low-power devices. Future work should address these issues by exploring adaptive sampling, multi-modal fusion, and hardware-specific optimizations to improve robustness and efficiency in diverse real-world scenarios.

Plain Language Accessible to non-experts

想象你在厨房里准备一道菜,厨师需要各种食材、调料,还要确保菜色漂亮、味道好。普通厨师(模型)可能需要很多时间和材料(参数)才能做出好菜,但如果有个经验丰富的大厨(教师模型)提前示范,后续的小厨师(学生模型)只需学习关键步骤和技巧,就能快速做出接近的菜肴。这里,知识蒸馏就像让小厨师学习大厨的经验,而对比学习则像反复练习边缘和细节,确保每个菜都色香味俱佳。边界感知采样就像专门关注菜的边缘部分,确保每个细节都完美。最终,这个系统让手机也能像大厨一样快速、漂亮地完成视频中的目标分割,既省时又省力。

ELI14 Explained like you're 14

想象你在学校里学画画,老师给你一幅很棒的画(大模型),你可以观察学习它的技巧。但你没有那么多时间和材料(参数少),怎么办?这时候,你可以让老师教你一些关键技巧(知识蒸馏),比如怎么画边缘、怎么用颜色。你还可以反复练习画边界部分(边界感知采样),确保画得更细致。通过这种方式,你用更少的时间和材料,也能画出接近老师水平的画(模型性能),而且还很快。这就像让手机用更少的计算资源,快速准确地识别视频中的物体,效果还不错。这种学习方法让普通人也能用上专业的技术,变得更聪明、更快。

Glossary

Knowledge Distillation (知识蒸馏)

一种模型压缩技术,通过让小模型模仿大模型的输出或中间特征,提升小模型性能。技术上涉及输出软标签和中间特征的传递。

在本文中,知识蒸馏用于将具有无限记忆的教师模型的结构信息传递给有限记忆的学生模型。

Supervised Contrastive Learning (有监督对比学习)

一种利用标签信息,通过最大化相似类别样本间的相似度、最小化不同类别样本间的相似度,增强特征判别性的学习方法。

本文将其作为联合损失的一部分,用于提升像素级特征的区分能力。

Boundary-aware Sampling (边界感知采样)

一种只在目标边界区域采样像素的策略,减少计算量,增强模型对边界细节的关注。

该策略在训练中帮助模型更好地识别目标轮廓。

Mutual Information (互信息)

衡量两个随机变量共享信息量的指标,最大化互信息有助于传递结构信息。

本文通过最大化学生与教师表示的互信息,实现结构信息的有效传递。

Open Questions Unanswered questions from this research

  • 1 如何进一步提升有限记忆模型在极端遮挡和复杂背景下的表现,仍需探索更鲁棒的结构信息传递机制和多模态融合策略。

Abstract

This paper tackles the problem of semi-supervised video object segmentation on resource-constrained devices, such as mobile phones. We formulate this problem as a distillation task, whereby we demonstrate that small space-time-memory networks with finite memory can achieve competitive results with state of the art, but at a fraction of the computational cost (32 milliseconds per frame on a Samsung Galaxy S22). Specifically, we provide a theoretically grounded framework that unifies knowledge distillation with supervised contrastive representation learning. These models are able to jointly benefit from both pixel-wise contrastive learning and distillation from a pre-trained teacher. We validate this loss by achieving competitive J&F to state of the art on both the standard DAVIS and YouTube benchmarks, despite running up to 5x faster, and with 32x fewer parameters.

cs.CV