Contrastive Transformation for Self-supervised Correspondence Learning

Ning Wang, Wengang Zhou, Houqiang Li

Abstract

This paper presents a novel self-supervised framework for learning visual correspondence—the ability to match pixels or patches across video frames—from unlabeled video data. Traditional self-supervised methods primarily exploit intra-video temporal consistency, which often lacks the challenging negative examples necessary to learn highly discriminative features. We introduce a dual-transformation approach that combines standard intra-video tracking with a novel inter-video contrastive transformation. By treating frames from disparate videos as negative samples and enforcing consistency between intra- and inter-video reconstructions, our model learns robust feature embeddings without manual annotations. Our method, termed ContrastCorr, significantly outperforms existing self-supervised techniques and rivals fully-supervised algorithms on benchmarks such as DAVIS-2017 and OTB-2015.

Introduction

Learning visual correspondence is a fundamental challenge in computer vision, serving as the backbone for tasks like object tracking, optical flow, and video segmentation. While supervised learning has achieved remarkable success, it requires massive amounts of expensive, dense human annotations. Self-supervised learning offers a promising alternative by leveraging the natural temporal consistency of unlabeled videos.

However, current self-supervised approaches focus almost exclusively on intra-video analysis. Because objects and backgrounds within a single short clip are relatively stable, the network is not sufficiently challenged to distinguish between similar-looking but distinct instances. This lack of discriminative power limits the utility of the learned features. We address this by bridging the gap between fine-grained correspondence learning and contrastive learning, introducing a framework that utilizes cross-video information to provide a richer supervisory signal.

Methodology

Figure 2: The proposed framework for self-supervised correspondence learning, featuring patch-level tracking and dual-transformation consistency.

Our approach utilizes a dual-transformation pipeline to learn discriminative features from unlabeled videos. The process is divided into four main stages:

  1. Feature Extraction and Tracklet Generation: We use a Convolutional Neural Network (CNN) to extract deep features from video frames. Instead of artificial augmentations, we employ simple patch-level tracking to identify naturally occurring positive pairs across time, capturing realistic appearance changes.
  2. Intra-video Transformation: The network computes an affinity matrix (a pixel-to-pixel similarity map) between a reference frame and a target frame from the same video. This matrix is used to reconstruct the target frame by "copying" pixels from the reference.
  3. Inter-video Transformation: This is our core novelty. We introduce frames from completely different videos in the training batch as negative samples. A batch-level affinity matrix is computed, comparing the target frame to its true reference and all unrelated frames simultaneously.
  4. Consistency and Constraints: We enforce Intra-inter Consistency, requiring the network to produce the same reconstructed target frame regardless of whether it uses intra-video or inter-video affinity. This forces the network to assign near-zero similarity to negative samples from other videos. Additionally, a Sparsity Constraint is applied to the negative sub-affinity matrix to explicitly push unrelated pixel similarities toward zero.

Experimental Results

We trained our model on the TrackingNet dataset, using approximately 30,000 unlabeled videos. The learned features were then frozen and evaluated on several downstream benchmarks.

Video Object Segmentation (VOS)

On the DAVIS-2017 benchmark, ContrastCorr achieved 60.5% $\mathcal{J}$ (region similarity) and 65.5% $\mathcal{F}$ (contour accuracy). This represents a significant improvement over the previous state-of-the-art self-supervised method, UVC, by 3.8% and 4.8%, respectively. Notably, our self-supervised approach surpassed fully-supervised baselines like OSVOS and ImageNet-trained ResNet-18.

Figure 6: Qualitative comparison of video object segmentation results. Our method (a) shows superior tracking of complex shapes compared to baselines (b, c).

Visual Object Tracking (VOT)

On OTB-2015, our method reached a Distance Precision (DP) of 77.2 and an Area Under the Curve (AUC) of 61.1. These results outperform the unsupervised UDT tracker and the classic fully-supervised SiamFC, demonstrating the robustness of the learned correspondence features.

Pose and Part Tracking

In fine-grained matching tasks on J-HMDB (pose keypoints) and VIP (human parts), ContrastCorr outperformed UVC by 3.3% mIoU on semantic propagation and significantly beat ImageNet-supervised ResNet-18 on pose tracking ([email protected] of 61.1 vs 53.8).

Discussion and Conclusion

Our research highlights two key insights: first, that actual temporal changes in video provide a richer signal for correspondence than artificial image augmentations; and second, that incorporating negative samples from different videos is crucial for learning robust, discriminative features.

While the framework is highly effective, it currently relies on a pre-trained encoder-decoder for frame reconstruction and is memory-intensive due to the dense affinity matrices. Future work could involve integrating a memory mechanism to provide a larger bank of negative samples and longer-term context without increasing GPU memory requirements. Overall, ContrastCorr demonstrates that self-supervised correspondence learning can match and even exceed the performance of supervised methods by effectively leveraging cross-video contrastive signals.

Summary updated

BibTeX
@inproceedings{wang2021contrastive,
  author = {Ning Wang and Wengang Zhou and Houqiang Li},
  title = {{Contrastive Transformation for Self-supervised Correspondence Learning}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2021},
  doi = {10.1609/aaai.v35i11.17220},
}
Figure