Source-linked AI summary

The Surprising Effectiveness of Representation Learning for Visual Imitation

Jyothish Pari, Nur Muhammad Shafiullah, Sridhar Pandian Arunachalam, Lerrel Pinto

arXiv:2112.01511v2cs.ROcs.AIcs.CVcs.LG

TL;DR

Visual imitation often struggles to generalize because representation learning and behavior learning are coupled. VINN decouples them by training an encoder offline and using non-parametric locally weighted regression over demonstration embeddings; it improves reported offline and real-robot performance over prior methods. Its current limitations include failure under drastic scene-marker changes and task-related self-supervised training.

  • Problem

    Visual imitation generalization may require hundreds of diverse demonstrations, task-specific priors, or large parametric models because representation and behavior learning are coupled.

  • Method

    VINN trains visual representations from offline data, then predicts actions with non-parametric Locally Weighted Regression over nearest demonstration embeddings.

  • Results

    VINN is competitive with end-to-end behavior cloning on offline MSE metrics and achieves 80% success on demonstrated doors and 40% on novel scenes, versus 53.3% and 3.3% for strongest baselines.

  • Takeaways & Limitations

    Decoupled representation and behavior learning provides a simple alternative to end-to-end behavior cloning across manipulation tasks and real-robot door opening.

  • Takeaways & Limitations

    VINN fails when large recognizable scene markers are removed and currently trains self-supervised representations on task-related data.

Abstract

from arXiv · show

While visual imitation learning offers one of the most effective ways of learning from visual demonstrations, generalizing from them requires either hundreds of diverse demonstrations, task specific priors, or large, hard-to-train parametric models. One reason such complexities arise is because standard visual imitation frameworks try to solve two coupled problems at once: learning a succinct but good representation from the diverse visual data, while simultaneously learning to associate the demonstrated actions with such representations. Such joint learning causes an interdependence between these two problems, which often results in needing large amounts of demonstrations for learning. To address this challenge, we instead propose to decouple representation learning from behavior learning for visual imitation. First, we learn a visual representation encoder from offline data using standard supervised and self-supervised learning methods. Once the representations are trained, we use non-parametric Locally Weighted Regression to predict the actions. We experimentally show that this simple decoupling improves the performance of visual imitation models on both offline demonstration datasets and real-robot door opening compared to prior work in visual imitation. All of our generated data, code, and robot videos are publicly available at https://jyopari.github.io/VINN/.

I. INTRODUCTION

VINN addresses limited visual imitation generalization by separating visual representation learning from behavior learning. It combines learned representations with non-parametric action prediction and reports competitive offline results plus improved real-robot door-opening generalization.

  • Visual imitation policies often generalize narrowly, requiring many demonstrations, task-specific priors, or large parametric models for diverse environments.
  • Standard behavior cloning couples representation learning with behavior learning, making it difficult to learn compact visual embeddings and action associations simultaneously.
  • VINN trains visual encoders on offline experience, then predicts actions by weighted averaging actions associated with nearest demonstration observations.
  • VINN is competitive with end-to-end behavior cloning on offline MSE metrics while using a simpler non-parametric behavior-learning procedure.
  • With 71 visual demonstrations, VINN succeeds 80% on demonstrated doors and 40% on novel scenes, versus baseline success rates of 53.3% and 3.3%.

II. RELATED WORK

Related work connects visual imitation to representation learning and non-parametric control. VINN combines self-supervised visual encoding with nearest-neighbor action prediction for robotic imitation.

  • Behavioral cloning is widely used for manipulation but may require transfer-learning techniques when robot morphology or viewpoint differs from demonstrations.
  • Representation learning extracts features for downstream tasks, especially when labeled data is scarce or difficult to collect.
  • Robotics has increasingly adopted unsupervised and semi-supervised representation learning because unlabeled data is available and useful for visual imitation.
  • Non-parametric models express predictions using previously observed training data rather than learned distribution parameters.
  • VINN applies a BYOL-style self-supervised encoder and weighted nearest-neighbor action prediction to visual imitation.
  • Locally Weighted Learning predicts a query response as a weighted aggregate of similar examples, including nearest-neighbor and k-nearest-neighbor variants.

III. APPROACH

VINN separates encoder training from action prediction. It learns embeddings from offline visual data, retrieves nearby demonstrations, and computes actions through distance-weighted averaging.

  • VINN has two stages: training an encoding network on offline visual data and querying demonstrations for nearest-neighbor action prediction.
  • The encoder can start from an ImageNet vision prior and be fine-tuned with task-relevant offline data.
  • BYOL trains the visual encoder by reducing discrepancies between representations of differently augmented views of the same image.
  • After self-supervised training, demonstration frames are encoded into a set of compact embeddings used for later retrieval.
  • Weighted averaging uses several neighbors rather than copying one neighbor’s action, supporting smoother predictions.
  • For a query embedding, VINN finds the k nearest demonstration embeddings and averages their associated actions with Euclidean-kernel weights.

C. Deployment in real-robot door opening

The experiments combine offline visual imitation datasets with closed-loop real-robot door opening. Door-opening demonstrations are collected from kitchen environments, encoded from video, and used for nearest-neighbor action prediction.

  • Data collection: Door-opening demonstrations are collected with a GoPro-mounted reacher-grabber, while SfM extracts camera motion as translational actions.A separate gripper network predicts one of four gripper states.
  • Representation and action prediction: VINN trains ImageNet-pretrained BYOL encoders on demonstration frames without action information, then uses the same dataset for k-NN action prediction.The framework can also use unlabelled offline or task-agnostic play data for representation learning.
  • Robot execution: Robot execution is closed-loop: each observation is queried for a translational action and gripper state before the robot moves.Action scaling mitigates SfM inaccuracies, and gripper-state mappings are tuned per experiment.
  • Evaluation: The evaluation covers offline Pushing, Stacking, and Door-Opening datasets plus real-robot door opening.The study explicitly probes performance with few demonstrations, where imitation algorithms often struggle.
  • Dataset scale: The Door Opening dataset contains 71 training and 21 testing demonstrations, compared with roughly 750 and 930 training demonstrations for Stacking and Pushing.Pushing and Stacking are also subsampled to 71 training demonstrations and 21 testing demonstrations for matched low-data evaluation.

B. Baselines

The study compares random, open-loop, parametric, representation-based, and nearest-neighbor baselines. VINN uses self-supervised representations followed by locally weighted regression for action prediction.

  • Compared methods: The baselines include Random Action, Open Loop, end-to-end Behavioral Cloning, BC on Representations, and Implicit Behavioral Cloning.These methods provide progressively different action-prediction and representation-learning choices.
  • Open Loop: The Open Loop baseline predicts the average action at each timestep across all demonstrations.It approximates p(a | t) rather than the state-conditioned p(a | s) targeted by behavioral cloning.
  • Representation-based BC: BC on Representations freezes self-supervised BYOL encodings and performs behavioral cloning on top of them.The passage identifies this baseline as similar to prior work and reports better real-robot performance than end-to-end BC.
  • ImageNet baseline: ImageNet features + NN uses pretrained ImageNet representations without dataset-specific finetuning.This isolates the contribution of self-supervised pretraining on domain-related data.
  • VINN: VINN compares BYOL, SimCLR, and VICReg self-supervised representations and predicts actions with locally weighted regression.All three representation-learning alternatives start from an ImageNet-pretrained ResNet-50.

C. Training Details

The models use ResNet-50 encoders and are evaluated across offline tasks and real-robot rollouts. Results favor nearest-neighbor methods in low-data settings, with VINN particularly strong on Stacking, Door Opening, and cabinet-door opening.

  • Training Details: Each encoder uses a ResNet-50 with its final linear layer removed; VINN trains the encoder with BYOL loss.End-to-end BC adds a three-layer MLP and uses MSE loss.
  • Offline evaluation: Nearest-neighbor methods are competitive or better in low-data settings, while ImageNet-initialized end-to-end BC can perform better with many demonstrations.The comparison uses MSE on Pushing, Stacking, and Door-Opening tasks across multiple dataset subsamples.
  • Offline evaluation: VINN is significantly better on Stacking and Door-Opening when training demonstrations number fewer than 20.On Pushing, BYOL may miss task-relevant representations, whereas VICReg can significantly improve performance.
  • Robot evaluation: The real-robot evaluation runs 30 rollouts across three cabinets with randomized starting positions and records handle grasping and full door opening.The table reports success percentages for both outcomes.
  • Robot evaluation: VINN opens cabinet doors more successfully than all BC variants when test and training environments differ minimally.The reported comparison concerns the real-robot door-opening task.
  • Robot evaluation: Nearest-neighbor translation actions typically re-center the robot rather than pushing it further out of distribution.This behavior is presented as a recovery mechanism after deviations during execution.

F. To What Extent does VINN Generalize to Novel Scenes?

VINN’s real-world generalization is tested under visual modifications and across representation and controller design choices. The results show strong performance under substantial occlusion, with failure only under complete visual occlusion, while ablations expose the importance of representation quality and non-parametric control.

  • Novel-scene generalization: VINN succeeds under significant cabinet modifications but completely fails when the cabinet’s visual landscape is fully occluded.Without coherent visual markers, the encoder cannot convey useful information to the k-NN controller; BC-rep fails completely under the reported comparison.
  • Novel-scene generalization: A good MSE loss is not sufficient for real-world performance, but low MSE appears necessary for good real-world performance.This relationship allows offline MSE evaluation to help test hypotheses before expensive robot deployment.
  • Representation design: BYOL performs best for Door Opening and Stacking, whereas VICReg performs better for Pushing; VINN uses BYOL because it requires less tuning overall.The comparison concerns normalized MSE losses across the three self-supervised encoders.
  • Representation design: Removing ImageNet pretraining substantially worsens VINN, while removing self-supervised fine-tuning only slightly worsens offline MSE but harms real-world performance.These ablations connect representation quality to nearest-neighbor quality and to policy performance both offline and online.
  • Controller design: BC-Rep is closest to VINN overall, but the gap becomes more pronounced as the training–test domain gap or policy horizon grows.The experiments indicate that the non-parametric policy may improve robustness to out-of-distribution samples.
  • Controller design: Around k = 10 gives low validation loss while averaging only a few actions; increasing k beyond 20 provides no significant improvement.Too-small k can make actions nonsmooth, whereas too-large k allows unrelated examples to influence predictions.

H. Computational Considerations

VINN’s nearest-neighbor implementation has linear search cost, but its runtime remains practical for the small demonstration datasets considered.

  • O(n) nearest-neighbor search scales linearly with the training-dataset size under the current naive implementation.The authors note that compiled indexes such as FAISS can accelerate searches beyond the naive method.
  • VINN remains practical because it targets small demonstration datasets and nearest-neighbor search can be accelerated with compiled indexes.The authors cite FAISS as an example of an optimized library capable of searches over billion-example datasets.
  • 0.074 seconds for image encoding and 0.038 seconds for nearest-neighbor regression impose only a small speed penalty for the evaluated robotic tasks.

APPENDIX

The appendix pseudocode implements VINN by encoding a query, computing distances to dataset embeddings, selecting nearest neighbors, and averaging their actions with distance-based weights.

  • The top k neighbor distances are converted into weights with softmax over their negatives.
  • The predicted action is initialized as a three-dimensional zero vector and accumulated from weighted neighbor actions.
  • The query image is encoded before distances to dataset embeddings are computed.
  • The implementation scans the dataset, records distances and associated translations, then sorts candidates by distance.

B. Network Architectures and Training Details

The appendix describes implementation and training details for random, open-loop, behavioral-cloning, implicit behavioral-cloning, and VINN baselines.

  • Random Action: Random actions are normalized three-dimensional vectors sampled from [−1, 1]3.
  • Open Loop: Open-loop actions use the average action at each frame index across demonstrations.
  • Behavioral Cloning: Behavioral-cloning baselines use a ResNet50 encoder, a three-layer 2048–1024–3 MLP, and a linear four-state gripper model.Training uses 8000 epochs, Adam, and a 0.001 learning rate; representation-based BC trains substantially faster than end-to-end BC.
  • Implicit Behavioral Cloning: IBC experiments use the official repository, DFO action sampling, and constrained three-dimensional actions bounded within [−1, 1]3.The reported MSE selects the highest-valued action among 256 sampled actions.
  • VINN: VINN uses BYOL-trained ResNet50 representations with a 2048-dimensional representation vector.The encoder is fine-tuned for 100 epochs on demonstration datasets using Adam and a 3 × 10−4 learning rate.

C. Robot details

The robot experiments use a Hello Robot Stretch, custom demonstration hardware, wrist-mounted cameras, and inverse kinematics to execute predicted end-effector movements.

  • Robot platform: Hello Robot’s Stretch provides a 6-DoF end-effector through its wrist, arm, lift, base rotation, and lateral motion.
  • Motion execution: The translation model predicts gripper ∆(x, y, z), which inverse kinematics converts into robot-joint movements.The inverse-kinematics model accounts for self-collision avoidance but not environment-collision avoidance.
  • Robot observations: Robot observations come from a wrist-mounted webcam streamed to a machine running VINN, which returns predicted actions.
  • Demonstration collection: Demonstrations use a reacher-grabber tool fitted with a GoPro camera through the DemoAT collection framework.
  • Hardware modification: The robot gripper and reacher-grabber use simple three-dimensional printed nubs for easier resets.
  • Demonstration processing: GoPro footage is distortion-corrected with ffmpeg and sampled at one frame per second.
Loading 2112.01511v2…