FlowRetrieval: Flow-Guided Data Retrieval for Few-Shot Imitation Learning

Li-Heng Lin, Yuchen Cui, Amber Xie, Tianyu Hua, Dorsa Sadigh

TL;DR

This paper introduces FLOWRETRIEVAL, a novel method for few-shot imitation learning in robotics that addresses the challenge of data scarcity. By leveraging optical flow to identify and retrieve motion-similar data from prior, diverse datasets, FLOWRETRIEVAL significantly improves policy performance compared to existing retrieval methods, even when prior data is visually dissimilar to the target task.

What Problem Does This Paper Address?

Imitation learning, a powerful technique for teaching robots new skills, typically requires a vast amount of demonstration data to achieve reliable performance. This high data demand makes it impractical for robots to quickly adapt to new tasks or slightly different environments. While retrieval-based methods aim to alleviate this by reusing past experiences, they often fall into two extremes: either requiring visually identical scenarios (which is rare in the real world) or relying on high-level language descriptions that may not capture the crucial low-level motion details needed for effective policy learning. This paper tackles the problem of efficiently adapting policies with limited target demonstrations by developing a more robust and effective data retrieval mechanism that focuses on motion similarity.

Methods

FLOWRETRIEVAL consists of three main stages:

  1. Motion-Centric Pretraining: The core idea is to learn a latent space that captures motion similarity. This is achieved by computing optical flow between consecutive frames of robot observations and then training a Variational Autoencoder (VAE) to embed this optical flow data. This creates a representation that is less sensitive to visual appearance and more focused on movement.
  2. Data Retrieval: Using the learned motion-centric latent space, the system retrieves relevant data from a large prior dataset. For a given target task demonstration, it computes the optical flow and then finds prior data points whose optical flow embeddings are closest in the latent space. The top-ranked data points are selected.
  3. Flow-Guided Policy Learning: The retrieved data is then used to augment the limited target task demonstrations. Crucially, the policy is trained not only to perform the target action but also with an auxiliary loss that encourages it to predict the optical flow. This "flow-guided" learning helps the policy focus on motion-relevant features and learn more robust representations, even when the retrieved data might have visual differences.

Datasets

The paper evaluates FLOWRETRIEVAL on several robotics manipulation tasks:

  • Simulation:
    • Square Assembly: A peg insertion task adapted from the Robomimic benchmark.
  • LIBERO-Can: A pick-and-place task from the LIBERO benchmark.
  • Real Robot:
    • Bridge-Pot and Bridge-Microwave: Tasks in a toy kitchen setting using a ViperX arm.
  • Franka-Pen-in-Cup: A pick-up and place task using a Franka Emika Panda robot arm.

The prior datasets used include subsets of the Bridge-V2 dataset, the LIBERO benchmark, and the DROID dataset.

Key Insights and Ideas

  • Motion Similarity is Key: The paper's central insight is that motion similarity, rather than just visual similarity or high-level semantic descriptions, is a more effective criterion for retrieving relevant prior data for imitation learning. This is because low-level motion often captures the underlying dynamics and object interactions crucial for policy success.
  • Optical Flow as a Motion Descriptor: Optical flow is identified as a powerful representation for capturing motion patterns, being robust to changes in visual appearance, object textures, and backgrounds.
  • Decoupling Retrieval and Learning: By separating the data retrieval process from the policy learning, the authors can independently evaluate the effectiveness of their retrieval method and then demonstrate how this retrieved data, combined with flow-guided learning, leads to superior policy performance.
  • Auxiliary Flow Prediction for Policy Learning: Using optical flow prediction as an auxiliary task during policy training helps the model learn motion-centric representations without imposing the burden of learning a complex visual-to-action mapping directly from dense visual guidance.

Key Results

FLOWRETRIEVAL significantly outperforms existing methods across various tasks:

  • Average Improvement: Achieves an average of 14% higher success rate than other retrieval-based methods and 27% higher than the best retrieval-based prior method.
  • Simulation: Shows a +10% improvement in success rate.
  • Real Robot: Demonstrates a +19% improvement in success rate.
  • Franka-Pen-in-Cup: Achieves a 3.7x performance improvement compared to a baseline that learns from all prior and target data.
  • Qualitative Analysis: Visualizations show that FLOWRETRIEVAL successfully retrieves data with similar motion patterns, even when visual scenes are different, while baselines often retrieve visually similar but motionally dissimilar or even adversarial data.

Limitations and Future Work

  • Computational Overhead: The current implementation requires processing prior data for each new target task to calculate similarity scores, which can be computationally expensive for very large datasets. The authors suggest caching embeddings and sub-sampling as potential solutions.
  • Retrieval Threshold Tuning: The optimal retrieval threshold is task-dependent and currently requires manual tuning. Future work could explore automating this threshold discovery process.
  • Generalization to Diverse Environments: While FLOWRETRIEVAL shows promise, further work is needed to ensure robust generalization across a wider range of task complexities and environmental variations.

Summary updated

BibTeX
@inproceedings{lin2024flowretrieval,
  author = {Li-Heng Lin and Yuchen Cui and Amber Xie and Tianyu Hua and Dorsa Sadigh},
  title = {{FlowRetrieval: Flow-Guided Data Retrieval for Few-Shot Imitation Learning}},
  booktitle = {Conference on Robot Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=FHnVRmeqxf},
}
Figure