On Compositions of Transformations in Contrastive Self-Supervised Learning

Mandela Patrick, Yuki Markus Asano, Polina Kuznetsova, Ruth Fong, João F. Henriques, Geoffrey Zweig, Andrea Vedaldi

Abstract

In the image domain, excellent representations can be learned by inducing invariance to content-preserving transformations via noise contrastive learning. In this paper, we generalize contrastive learning to a wider set of transformations, and their compositions, for which either invariance or distinctiveness is sought. We show that it is not immediately obvious how existing methods such as SimCLR can be extended to do so. Instead, we introduce a number of formal requirements that all contrastive formulations must satisfy, and propose a practical construction which satisfies these requirements. In order to maximise the reach of this analysis, we express all components of noise contrastive formulations as the choice of certain generalized transformations of the data (GDTs), including data sampling. We then consider videos as an example of data in which a large variety of transformations are applicable, accounting for the extra modalities -- for which we analyze audio and text -- and the dimension of time. We find that being invariant to certain transformations and distinctive to others is critical to learning effective video representations, improving the state-of-the-art for multiple benchmarks by a large margin, and even surpassing supervised pretraining.

Introduction

Self-supervised learning (SSL) has primarily focused on inducing invariance to content-preserving transformations, such as cropping or color jittering in images. However, video data introduces complex temporal and multi-modal dimensions (audio, text) where simple invariance is insufficient. For instance, should a model be invariant to time-reversal or temporal shifts, or should it recognize these as distinct features? This paper addresses the lack of a formal framework for handling compositions of transformations where both invariance and distinctiveness are required.

Methodology: Generalized Data Transformations (GDTs)

The authors propose Generalized Data Transformations (GDTs), a unified framework that treats all operations—from data sampling to modality extraction—as transformations.

Compositional Loss and Hierarchical Sampling

A generalized contrastive loss is introduced using a contrast function $c(T, T')$. When $c=1$, representations are pulled together (invariance); when $c=0$, they are pushed apart (distinctiveness). To optimize this, a hierarchical sampling strategy is employed to reduce gradient variance and improve learning efficiency.

Cross-modal NCE learning: Attractive forces pull related modalities together, while repulsive forces push distinct samples apart.

Multi-Modal Integration

The framework composes five transformation types: data-sampling, time-shifting, modality splicing (separating audio/video), time-reversal, and standard augmentations. This allows the model to learn cross-modal correlations, which are essential for robust video representations.

Experimental Results

The GDT framework was evaluated on UCF-101 and HMDB-51 after pretraining on large-scale datasets like Kinetics-400, HowTo100M, and IG65M.

State-of-the-Art Performance

GDT significantly outperforms previous self-supervised methods. On HMDB-51, it achieved 67.4% accuracy, surpassing supervised pretraining (65.1%). On UCF-101, pretraining on IG65M led to 95.2% accuracy.

Comparison of GDT against existing methods on HMDB and UCF benchmarks for kNN and Retrieval tasks.

Key Insights

  • Beyond Invariance: Distinctiveness to temporal shifts and the "arrow of time" is critical for video SSL. In image SSL, we almost always want invariance, but video requires a more nuanced approach.
  • Cross-Modal Synergy: Linking audio and video provides a substantial performance boost over unimodal approaches.
  • Retrieval Superiority: GDT features are inherently more meaningful, as evidenced by superior performance in frozen retrieval tasks compared to methods like SeLaVi and CoCLR.

Conclusion

The GDT framework demonstrates that mastering the balance between invariance and distinctiveness is key to advancing self-supervised video representation learning. While the current selection of transformations is manual, future work may involve automated discovery via Bayesian optimization to further generalize the approach across diverse datasets.

Summary updated

BibTeX
@inproceedings{patrick2020compositions,
  author = {Mandela Patrick and Yuki Markus Asano and Polina Kuznetsova and Ruth Fong and João F. Henriques and Geoffrey Zweig and Andrea Vedaldi},
  title = {{On Compositions of Transformations in Contrastive Self-Supervised Learning}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2020},
}
Figure