Skip to main content
QUICK REVIEW

[Paper Review] FlapAI Bird: Training an Agent to Play Flappy Bird Using Reinforcement Learning Techniques

Tai Vu, Leon King Tran|arXiv (Cornell University)|Mar 21, 2020
Reinforcement Learning in RoboticsComputer Science5 references8 citations
TL;DR

This paper proposes training an AI agent to play Flappy Bird using modified Q-Learning and SARSA reinforcement learning algorithms with techniques like epsilon-greedy exploration, state discretization, and backward Q-value updates. The best-performing agent achieved a maximum in-game score of 2069, significantly outperforming the baseline, with Q-Learning and discretization proving more effective than deep neural network function approximators under limited training resources.

ABSTRACT

Reinforcement learning is one of the most popular approaches for automated game playing. This method allows an agent to estimate the expected utility of its state in order to make optimal actions in an unknown environment. We seek to apply reinforcement learning algorithms to the game Flappy Bird. We implement SARSA and Q-Learning with some modifications such as $ε$-greedy policy, discretization and backward updates. We find that SARSA and Q-Learning outperform the baseline, regularly achieving scores of 1400+, with the highest in-game score of 2069.

Motivation & Objective

  • To investigate the effectiveness of tabular Q-Learning and SARSA in training an agent to play Flappy Bird.
  • To evaluate the impact of state discretization, epsilon-greedy exploration, and backward Q-value updates on learning performance.
  • To compare function approximation methods—including linear regression, feedforward neural networks, and convolutional neural networks—against tabular methods under limited training iterations.
  • To determine whether deep learning-based function approximators outperform simpler tabular methods in this environment with constrained compute.
  • To identify optimal hyperparameter configurations that maximize agent performance within 8,000 training iterations.

Proposed method

  • The agents were trained using OpenAI Gym's Flappy Bird environment, with state representations based on relative positions of the bird and pipes, and bird velocity.
  • SARSA and Q-Learning algorithms were implemented with epsilon-greedy exploration, where epsilon was set to 0.1 or 0.0 to balance exploration and exploitation.
  • State discretization was applied using 10×10 and 20×20 grids to reduce state space complexity and improve convergence.
  • Backward Q-value updates were used to propagate rewards from terminal states back through the trajectory, accelerating convergence to true Q-values.
  • Function approximation was tested using linear regression, feedforward neural networks (FFNN), and convolutional neural networks (CNN), with inputs including image frames and velocity features.
  • The reward function assigned +1 for passing each pipe, -1000 for game over, and 0 otherwise, shaping sparse rewards to guide learning.

Experimental results

Research questions

  • RQ1Does Q-Learning with state discretization outperform baseline agents and function approximation methods in Flappy Bird?
  • RQ2How does backward Q-value update improve convergence speed and final performance compared to forward updates?
  • RQ3To what extent do function approximators like linear models, FFNNs, and CNNs improve performance over tabular Q-Learning with limited training iterations?
  • RQ4How does epsilon-greedy exploration affect the performance of Q-Learning and SARSA agents in this environment?
  • RQ5Can a simpler tabular approach with discretization outperform more complex deep learning models when training is constrained?

Key findings

  • The Q-Learning agent with 10×10 discretization, backward updates, and epsilon=0 achieved the highest maximum score of 2069.
  • SARSA agents outperformed the baseline, reaching a maximum score of 832, but were outperformed by Q-Learning agents.
  • All Q-Learning and SARSA agents with discretization and backward updates significantly outperformed the baseline, which averaged only 0.13 points.
  • Function approximation methods—linear regression, FFNN, and CNN—performed at or slightly above the baseline, with mean scores between 0.21 and 0.33, indicating poor learning under limited iterations.
  • The CNN agent, despite using image input and a more complex architecture, failed to outperform simpler models due to insufficient training (only 8,000 iterations) and inadequate feature engineering.
  • Backward Q-value updates accelerated convergence by allowing earlier states to learn from terminal state rewards, improving learning efficiency.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.