Learning From Imperfect Demonstrations From Agents With Varying Dynamics

Zhangjie Cao, Dorsa Sadigh

Abstract

Imitation learning typically requires optimal demonstrations from agents with identical dynamics. We present a framework that relaxes these constraints, allowing robots to learn from sub-optimal data and demonstrations provided by agents with different physical configurations. By scoring trajectories based on their feasibility for the target robot and their rectified optimality relative to their starting states, our method effectively filters diverse datasets to train high-performing policies.

Introduction: The Challenge of Imperfect Data

Standard imitation learning (IL) relies on the assumption that demonstrations are provided by an expert who is both optimal and shares the exact physical "body" (dynamics) as the learner. In practice, collecting such high-quality data is often prohibitively expensive. Real-world datasets frequently contain "imperfect" demonstrations, such as shaky human teleoperation or data from robots with different joint configurations (e.g., a 7-DoF arm teaching a 3-DoF arm).

Examples of diverse demonstrations: 3-DoF optimal (red), 7-DoF optimal (blue), and 3-DoF suboptimal (purple).

When a robot blindly mimics a different agent or a sub-optimal path, the resulting policy is often poor. The core challenge addressed here is determining which parts of a diverse, messy dataset are actually worth imitating for a specific target robot.

Methodology: Feasibility and Rectified Optimality

The proposed framework introduces a scoring function $w(\xi)$ to weight each demonstration trajectory $\xi$. This score is the product of two distinct components:

  1. Feasibility Score ($w_f$): This measures the likelihood that a demonstrated state transition can be achieved by the target robot. An inverse dynamics model is trained to predict the action required for the target robot to move between two states. If no valid action exists to replicate a transition, it receives a low feasibility score.
  2. Optimality Score ($w_o$): Traditional optimality metrics based on total return can be biased; a perfect trajectory starting far from a goal will have a lower return than one starting nearby. To fix this, the authors use a rectifying function ($f_{rec}$) that estimates the maximum possible return from a specific starting state. The optimality score is then calculated based on how close the demonstration's return is to this "local" maximum.
The proposed framework weights demonstrations based on feasibility and rectified optimality to train an imitation learning policy.

These scores create a sampling distribution for training. During the imitation learning process (using GAIL as a backbone), the algorithm samples more frequently from transitions that are both feasible and optimal for the target robot.

Experimental Evaluation

The method was evaluated across five environments, including MuJoCo simulations (Reacher, Swimmer, Ant), 2D driving tasks, and a real-world Franka Panda robot arm setup. The datasets included a mix of optimal and sub-optimal data from agents with varying dynamics.

Key Results

The proposed approach consistently outperformed baselines that only addressed sub-optimality (like 2IWIL) or only addressed varying dynamics (like SAIL).

  • Performance Gains: In the "Ant" environment, the method achieved an expected return of ~1979, significantly higher than the best baseline (IC-GAIL) at ~1532.
  • Real-World Application: On a physical Franka Panda robot, the method successfully learned to navigate around obstacles, achieving a return of -500, compared to -876 for the best baseline.
  • Ablation Studies: Removing either the feasibility or optimality component led to a sharp drop in performance, confirming that both are essential for handling "messy" data.

Discussion and Future Work

A key insight of this work is that "return is relative." By rectifying scores based on starting positions, the robot avoids the bias of only learning from "easy" scenarios. Furthermore, focusing on feasibility rather than direct joint-to-joint correspondence makes the approach highly flexible across different robot morphologies.

However, the method depends on the accuracy of the learned inverse dynamics model, which can be challenging in high-dimensional spaces or environments with complex contact physics. Future work may involve incorporating structural environmental knowledge to improve the efficiency and robustness of these learned models.

Summary updated

BibTeX
@article{cao2021learning,
  author = {Zhangjie Cao and Dorsa Sadigh},
  title = {{Learning From Imperfect Demonstrations From Agents With Varying Dynamics}},
  journal = {IEEE Robotics Autom. Lett.},
  year = {2021},
  doi = {10.1109/lra.2021.3068912},
}
Figure