Optical Flow boosts Unsupervised Localization and Segmentation

Xinyu Zhang, Abdeslam Boularias · DOI

Abstract

Recent advancements in self-supervised learning, such as DINO, have demonstrated the potential of Vision Transformers (ViTs) to learn meaningful representations from static images without human labels. However, these models often struggle to accurately delineate object boundaries in complex scenes. This paper explores the integration of motion cues—specifically optical flow—from unlabeled videos to enhance unsupervised localization and segmentation. By leveraging the Gestalt principle of "common fate," we introduce a fine-tuning procedure that aligns the internal feature representations of a ViT with the motion patterns observed in video sequences. Our resulting model, FlowDINO, achieves state-of-the-art performance on several benchmarks, including Pascal VOC and COCO, while maintaining strong discriminative capabilities on ImageNet.

Introduction

Identifying and segmenting objects within an image is a fundamental task in computer vision. Traditionally, this requires large-scale datasets with pixel-level annotations, which are costly and time-consuming to produce. While self-supervised models trained on static images have made significant progress, they often lack the inherent understanding of "objectness" that motion provides.

Humans naturally use motion to distinguish objects from their backgrounds. If a group of pixels moves together independently of the surrounding environment, they likely belong to the same entity. This research aims to transfer this "motion intelligence" into static image models by using optical flow as a natural, supervision-free teacher.

Methodology

The proposed approach involves a fine-tuning pipeline for Vision Transformers that utilizes unlabeled video data to refine spatial representations.

Motion Extraction and Preprocessing

The process begins by extracting optical flow from adjacent frames in unlabeled videos using the RAFT model. To isolate the motion of objects from camera movement, the authors subtract the average flow and normalize the resulting vectors. This step ensures the model focuses on independent object motion rather than global scene shifts.

The Common Fate Loss

The core of the method is a novel loss function based on the "common fate" principle. The image is divided into local patches, and for each neighborhood, two similarity matrices are calculated:

  1. Feature Similarity: Measures the similarity between the ViT’s internal representations for different patches.
  2. Flow Similarity: Measures the similarity of the actual motion vectors for those same patches.

The model is trained to minimize the Kullback-Leibler (KL) Divergence between these two matrices. By forcing feature similarity to mirror flow similarity, the model learns that pixels moving together should have similar feature representations. The authors found that applying this principle locally is crucial, as global motion similarities can often be coincidental.

Training Strategy

To prevent the model from losing its ability to recognize static objects (a common issue in motion-only training), the authors employ a joint loss. This combines the motion-based loss from video data with a standard self-supervised loss on ImageNet, ensuring the model retains high discriminative power for classification tasks.

Experiments and Results

The researchers evaluated the fine-tuned "FlowDINO" model across multiple localization and segmentation benchmarks.

Datasets

Training was conducted using video datasets such as UVO, VSPW, YouTube-VOS, and Moments-in-Time, alongside ImageNet for static image consistency. Evaluation focused on standard benchmarks including Pascal VOC 2007/2012 and COCO-20k.

Performance Metrics

FlowDINO demonstrated significant improvements over previous state-of-the-art (SOTA) unsupervised methods:

  • Unsupervised Localization: On Pascal VOC 2012, the model achieved a 68.5 CorLoc score, representing a +2.8 point increase over the previous leader, Deep-Spectral.
  • Unsupervised Segmentation: On the Cocostuff-27 benchmark, the model reached 46.1 mIoU, outperforming the previous best (Leopart) by 2.0 points.

Ablation studies confirmed that these gains were specifically driven by the optical flow loss rather than simply increasing the volume of training data.

Discussion and Limitations

While FlowDINO sets a new standard for unsupervised segmentation, several challenges remain. The current background subtraction method is relatively simple and can occasionally produce "ghost" motion artifacts in the presence of lens distortion or complex camera rotations. Additionally, the model's reliance on optical flow means it may struggle with very small or slow-moving objects where the motion signal is weak.

Future work could involve extending the temporal window beyond two frames to capture long-term spatio-temporal correspondences and making the motion-alignment loss more architecture-agnostic to support a wider range of vision models.

Conclusion

By treating motion as a "free" supervisory signal, this work demonstrates that optical flow can significantly boost the ability of Vision Transformers to localize and segment objects without any human intervention. FlowDINO bridges the gap between static image understanding and dynamic scene perception, providing a scalable path toward more robust and autonomous visual systems.

Summary updated

BibTeX
@inproceedings{zhang2023optical,
  author = {Xinyu Zhang and Abdeslam Boularias},
  title = {{Optical Flow boosts Unsupervised Localization and Segmentation}},
  booktitle = {IEEE/RSJ International Conference on Intelligent Robots and Systems},
  year = {2023},
  doi = {10.1109/iros55552.2023.10342195},
}
Figure