Supervise Thyself: Examining Self-Supervised Representations in Interactive Environments

Evan Racah, Christopher J. PalarXiv 2019

Introduction

Self-supervised learning (SSL) has emerged as a powerful paradigm for training reinforcement learning (RL) agents in environments where rewards are sparse. By defining auxiliary tasks that do not require external labels, agents can learn useful representations of their surroundings. However, the internal mechanisms of these learned representations—what the models actually "see" and prioritize—remain poorly understood. This paper investigates four popular SSL methods to determine how effectively they capture essential environmental features and generalize across visual variations.

Methodology

The study evaluates four distinct SSL approaches, all utilizing a shared convolutional neural network (CNN) encoder:

  1. Variational Autoencoder (VAE): Learns by reconstructing input images from a compressed latent space, prioritizing global visual fidelity.
  2. Inverse Model: Predicts the action taken between two consecutive frames, theoretically focusing on elements the agent can control.
  3. Temporal Distance Classification (TDC): Predicts the number of time steps separating two randomly sampled frames.
  4. Tuple Verification: Determines if a sequence of three frames is chronologically ordered.
Overview of the self-supervised learning architectures evaluated, including Temporal Distance Classification (TDC), Inverse Models, and Tuple Verification.

To analyze the learned features, the researchers employed Linear Probing, where a simple linear classifier is trained on fixed features to predict the $(x, y)$ coordinates of objects. Additionally, Feature Map Visualization was used to qualitatively assess the spatial attention of each model.

Experimental Setup

The methods were tested on two environments with varying complexity:

  • Flappy Bird: Characterized by simple graphics and discrete, predictable dynamics.
  • Sonic The Hedgehog: Features high-fidelity graphics, complex backgrounds, and non-linear physics.

To test robustness, the authors introduced FlappyBirdNight (color shifts) and Sonic Act 2 (new level layouts) to evaluate zero-shot generalization.

Key Insights: The Nature of Learned Representations

The evaluation revealed distinct biases inherent in each SSL task:

  • The Control Bias: Inverse models excel at localizing the agent. Because the agent's movement is the direct consequence of the predicted action, the model naturally learns to track the player character.
  • Temporal Signatures: TDC is particularly effective at identifying obstacles like pipes in Flappy Bird. Since these obstacles move at a constant velocity, their position serves as a reliable proxy for elapsed time.
  • Global vs. Local Focus: VAEs prioritize large-scale structures to minimize reconstruction error. In Flappy Bird, this often leads to ignoring the small bird in favor of the larger pipes or background.
Comparison of feature maps between a random CNN and the Inverse Model in Flappy Bird, illustrating the model's focus on the controllable agent.

Quantitative Results and Generalization

In Flappy Bird, the Inverse Model achieved a high localization accuracy of 91.67% for the bird's vertical position. Conversely, TDC dominated obstacle detection, reaching 92.36% accuracy for pipe horizontal positions.

However, performance significantly degraded in the more complex Sonic environment. The VAE was the most resilient, identifying Sonic with 53.82% accuracy, while temporal methods like TDC and Tuple Verification dropped to near-random levels (~10-11%). This suggests that complex, moving backgrounds in Sonic violate the static-landmark assumptions of temporal SSL tasks.

In terms of generalization, most models struggled with color changes in FlappyBirdNight. TDC proved the most robust, maintaining 46.9% accuracy for bird localization, indicating it had learned a more abstract relationship between the agent and obstacles rather than relying on specific pixel values.

Conclusion

This research demonstrates that the effectiveness of self-supervised representations is highly dependent on the alignment between the SSL task and the environment's dynamics. While Inverse Models are superior for agent tracking and TDC for obstacle localization, neither provides a universal solution for complex environments like Sonic. Future work should explore hybrid, multi-head architectures that combine these complementary strengths to build more robust and "state-aware" agents.

Summary updated

BibTeX
@misc{racah2019supervise,
  author = {Evan Racah and Christopher J. Pal},
  title = {{Supervise Thyself: Examining Self-Supervised Representations in Interactive Environments}},
  year = {2019},
  eprint = {1906.11951},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1906.11951},
}
Figure