Imitation Learning from Pixel-Level Demonstrations by HashReward

Xin-Qiang Cai, Yao-Xiang Ding, Yuan Jiang, Zhi-Hua ZhouAAMAS 2021

TL;DR

This paper tackles the challenge of imitation learning (IL) in high-dimensional environments, like games played with raw pixel inputs, where existing methods often fail. They introduce HashReward, a novel IL algorithm that uses supervised hashing to balance the crucial trade-off between learning a discriminative reward function and reducing dimensionality, leading to significantly improved performance.

What Problem Does This Paper Address?

Imitation learning (IL) aims to train an agent to mimic expert behavior from demonstrations, offering a way to bypass the often complex and delicate reward function design required by traditional reinforcement learning (RL). However, a major hurdle arises when dealing with high-dimensional state spaces, such as raw pixel inputs from video games. In these scenarios, even state-of-the-art IL algorithms, like Generative Adversarial Imitation Learning (GAIL), struggle to generalize effectively. The authors identify that the core issue lies in the difficulty of training a powerful discriminator that can provide meaningful rewards. In high-dimensional spaces with limited expert data, discriminators tend to overfit to the discrimination task, failing to generate accurate rewards for the agent to learn from. This paper seeks to bridge this gap by developing an IL method that can effectively learn from high-dimensional pixel-level demonstrations.

Methods

The paper proposes HashReward, an imitation learning algorithm designed to address the discrimination-rewarding trade-off in high-dimensional environments. The core idea is to integrate dimensionality reduction (DR) and discriminative training into a unified procedure, rather than treating them as separate steps.

HashReward utilizes a supervised hashing strategy. This involves:

  • Autoencoder Pretraining: An autoencoder is first trained on expert and random policy demonstrations to learn a compressed representation (hashing code) of the states. This helps in reducing the dimensionality of the input.
  • Joint Training of Hashing and Discriminator: The hashing code, along with the action signal, forms the input to the discriminator. The loss function for training the discriminator has two components:
  • Hashing Training Loss ($L_H$): This part focuses on reconstructing the original states from the hashing codes, ensuring that the compressed representation retains essential information. It also includes terms that encourage the hashing codes to be binary and to group similar states together.
  • Discriminator Training Loss ($L_D$): This is similar to the adversarial loss in standard IL methods but operates on the hashing codes. Crucially, $L_H$ incorporates supervised information by penalizing dissimilar hashing codes for states with different labels (expert vs. learner) and rewarding similar codes for states with the same label. This supervised signal is backpropagated to train the hashing code layer, ensuring that the dimensionality reduction process preserves discriminative information.

This integrated approach aims to create hashing codes that are both compact and informative for discrimination, thereby enabling the discriminator to provide stable and accurate rewards for policy learning.

Datasets

The paper evaluates HashReward on two benchmark environments:

  • Arcade Learning Environment (ALE): 15 Atari games were used, with observations being raw pixel inputs (84x84x4 state space). Expert policies were trained using DQN.
  • MuJoCo: 5 continuous control simulators were used, with observations being pixel inputs rendered by a camera (84x84x1 state space). Expert policies were trained using DDPG.

The paper collected 20 expert trajectories for each game and conducted 3 trials with different random seeds for each environment.

Key Insights and Ideas

  • The Discrimination-Reward Trade-off is Key: The paper's central insight is that the failure of existing IL methods in high-dimensional settings stems from an inability to balance the discriminator's ability to discriminate between expert and agent behavior with its ability to provide positive rewards for good agent behavior.
  • Dimensionality Reduction Alone Isn't Enough: Simply applying off-the-shelf unsupervised dimensionality reduction techniques (like autoencoders or unsupervised hashing) can lead to the loss of crucial discriminative information, hindering effective reward generation.
  • Supervised Hashing is the Solution: By incorporating a supervised signal directly into the hashing process, HashReward ensures that the learned low-dimensional representations retain the discriminative power needed for effective imitation learning. This makes the dimensionality reduction process "aware" of what information is important for distinguishing expert from agent behavior.
  • Unified Learning is Crucial: Treating dimensionality reduction and discriminator training as intertwined processes, rather than sequential steps, is essential for success in high-dimensional IL.

Key Results

HashReward significantly outperforms state-of-the-art imitation learning methods on both Atari and MuJoCo environments.

  • Atari: HashReward achieved the best performance on 12 out of 15 games, often reaching near-expert level rewards. For example, it achieved expert-level rewards on Boxing, Qbert, SpaceInvaders, UpNDown, Zaxxon, and Hopper.
  • MuJoCo: HashReward also demonstrated superior performance, outperforming contenders by significant margins.
  • Qualitative Analysis: Visualizations of generated sequences on Pong showed HashReward successfully learning the expert's "kill-shot" strategy, which other methods failed to replicate. t-SNE visualizations of learned embeddings confirmed that HashReward creates more clustered and overlapping representations between expert and agent policies as learning progresses, indicating a more effective learning of the underlying state-action manifold.

Limitations and Future Work

  • Limitations: The paper acknowledges that while HashReward significantly improves performance, achieving perfect expert-level performance across all tasks remains a challenge. The effectiveness of the supervised hashing approach is dependent on the quality and quantity of expert demonstrations.
  • Future Work: The authors suggest that HashReward's approach of learning meaningful embeddings could be extended to other challenging IL problems, particularly those requiring exploration, such as games like Montezuma's Revenge. They also express interest in exploring other hashing strategies that incorporate effective semantic information.

Summary updated

BibTeX
@inproceedings{cai2021imitation,
  author = {Xin-Qiang Cai and Yao-Xiang Ding and Yuan Jiang and Zhi-Hua Zhou},
  title = {{Imitation Learning from Pixel-Level Demonstrations by HashReward}},
  booktitle = {AAMAS},
  year = {2021},
  url = {https://openreview.net/forum?id=8cR9OOCO6h},
}
Figure