Action-Conditioned Contrastive Policy Pretraining

Qihang Zhang, Zhenghao Peng, Bolei Zhou

Abstract

Deep visuomotor policy learning, which aims to map raw visual observation to action, achieves promising results in control tasks such as robotic manipulation and autonomous driving. However, it requires a huge number of online interactions with the training environment, which limits its real-world application. Compared to the popular unsupervised feature learning for visual recognition, feature pretraining for visuomotor control tasks is much less explored. In this work, we aim to pretrain policy representations for driving tasks by watching hours-long uncurated YouTube videos. Specifically, we train an inverse dynamic model with a small amount of labeled data and use it to predict action labels for all the YouTube video frames. A new contrastive policy pretraining method is then developed to learn action-conditioned features from the video frames with pseudo action labels. Experiments show that the resulting action-conditioned features obtain substantial improvements for the downstream reinforcement learning and imitation learning tasks, outperforming the weights pretrained from previous unsupervised learning methods and ImageNet pretrained weight.

Introduction

Training autonomous driving agents to map raw camera pixels directly to steering and braking commands—a process known as deep visuomotor policy learning—is traditionally a data-intensive endeavor. Standard approaches rely on massive amounts of online interaction in simulators or expensive, curated expert demonstrations.

While the field of computer vision has been revolutionized by unsupervised pretraining methods like MoCo or SimCLR, these techniques are primarily optimized for visual recognition (identifying what an object is). In the context of driving, an AI must focus on decision-making. Standard visual models may over-index on irrelevant features like the texture of a building or the color of the sky. The central challenge addressed in this research is how to pretrain a model to prioritize action-relevant features using the millions of uncurated driving videos available online that lack explicit action labels.

Overview of the Action-Conditioned Contrastive (ACO) pipeline.

Methods: The ACO Framework

The researchers introduce Action-Conditioned COntrastive Learning (ACO), a two-stage pipeline designed to extract meaningful policy representations from "in-the-wild" video data.

1. Pseudo-Labeling with Inverse Dynamics

To bridge the gap between unlabeled YouTube videos and action-conditioned learning, the team first trains an inverse dynamics model on a small, labeled dataset (NuScenes). This model utilizes optical flow—the pattern of motion between consecutive frames—to predict the likely action (e.g., steering angle) taken by the driver. By focusing on motion vectors rather than raw RGB pixels, the model becomes more robust to visual clutter. This trained model is then used to generate "pseudo-action" labels for over 1.3 million frames of uncurated YouTube driving footage.

2. Dual-Branch Contrastive Learning

With pseudo-labels in hand, the model undergoes pretraining using a ResNet-34 encoder and a novel dual-branch contrastive objective:

  • Instance Contrastive Pair (ICP): This branch follows standard unsupervised learning by teaching the model that different augmentations of the same frame should have similar representations, building general visual awareness.
  • Action Contrastive Pair (ACP): This novel branch teaches the model that two entirely different scenes should have similar representations if they resulted in the same driving action (e.g., both scenes depict a sharp left turn).
The dual-branch contrastive learning architecture featuring ICP and ACP spaces.

By balancing these objectives, the model learns to group scenes based on their functional meaning for a driver, effectively using action as a filter to ignore irrelevant environmental distractors like weather or architecture.

Experimental Results

The effectiveness of ACO-pretrained weights was evaluated across several downstream tasks in the CARLA simulator and on real-world datasets:

  • Imitation Learning (IL): In CARLA, the ACO-pretrained model achieved a 96% success rate, significantly outperforming ImageNet-pretrained weights (90.7%) and standard MoCo (80.7%).
  • Reinforcement Learning (RL): When used to initialize a PPO (Proximal Policy Optimization) agent, ACO led to a 7% improvement in route completion over baseline methods.
  • Data Efficiency: ACO demonstrated remarkable sample efficiency; models pretrained with ACO and trained on only 20% of demonstration data often outperformed other methods using 40% or more of the data.
  • Feature Visualization: t-SNE visualizations confirmed that ACO features naturally cluster by action (e.g., left turn vs. straight), whereas standard contrastive methods primarily cluster by temporal proximity.

Conclusion

This work demonstrates that "watching" uncurated videos can provide a powerful signal for policy pretraining if the learning objective is conditioned on action. By leveraging inverse dynamics to label the vast amount of driving data available on the internet, ACO provides a scalable path toward more data-efficient and robust autonomous driving systems. Future work will look to address multi-action distributions and finding synergies between action-conditioned learning and traditional geometric augmentations.

Summary updated

BibTeX
@inproceedings{zhang2022action,
  author = {Qihang Zhang and Zhenghao Peng and Bolei Zhou},
  title = {{Action-Conditioned Contrastive Policy Pretraining}},
  booktitle = {European Conference on Computer Vision},
  year = {2022},
  url = {https://openreview.net/forum?id=-ufuNgvcmDoa},
}
Figure