Evaluation of DQN and Double DQN Algorithms in Flappy Bird Environment

Zhenyu ChenAdvances 2024 · OpenAlex

TL;DR

This paper evaluates the performance of Deep Q-Networks (DQN) and Double Deep Q-Networks (DDQN) in the high-stakes, high-frequency environment of Flappy Bird. The study confirms that while standard DQN suffers from significant Q-value overestimation, DDQN successfully mitigates this bias, leading to more stable training and faster convergence over 3 million timesteps.

What Problem Does This Paper Address?

In Deep Reinforcement Learning (DRL), agents learn to make sequential decisions by maximizing a reward signal. A cornerstone algorithm, the Deep Q-Network (DQN), uses a neural network to estimate the "value" (Q-value) of taking a specific action in a given state.

However, DQN has a well-documented flaw: overestimation bias. Because DQN uses the same network to both select and evaluate an action, it tends to over-optimistically estimate rewards. This can lead to unstable learning and sub-optimal policies. The author explores whether the Double DQN (DDQN) architecture—which decouples action selection from action evaluation—can effectively solve this problem in a fast-paced game environment like Flappy Bird.

Methods

The author implemented and compared three variations: a traditional DQN, an "enhanced" DQN (optimized for training speed), and a Double DQN.

  • Environment Setup: The study used an open-source Flappy Bird environment built with OpenAI Gym and Pygame.
  • State Representation: To capture motion, the agent doesn't just look at one frame; it receives a stack of the four most recent frames as input.
  • The "Double" Mechanism: Unlike standard DQN, DDQN uses two separate sets of weights (an "online" network and a "target" network). The online network selects the best action, while the target network calculates the value of that action. This separation prevents the agent from "tripping over its own feet" by overestimating the value of noisy or lucky actions.
  • Hyperparameters: The agent used an $\epsilon$-greedy policy for exploration, with $\epsilon$ decaying from 0.1 down to 0.0001. Decisions were made roughly every 0.03 seconds.

Datasets

As is standard in reinforcement learning research, no static dataset was used. Instead, the agent generated its own data through interaction with the OpenAI Gym / Pygame Flappy Bird environment. The "experience" was stored in a replay memory in the form of $(s, a, r, s_{t+1})$ tuples.

Key Insights and Ideas

  • The "Breakthrough" Phenomenon: The agents didn't learn linearly. In both DQN and DDQN, performance remained relatively poor for the first 20,000 episodes. However, between 20,000 and 25,000 episodes, the agents hit a "breakthrough" point where rewards spiked, indicating the neural network finally converged on a successful flight strategy.
  • Stability vs. Speed: In early training (the first 3,000 episodes), DDQN actually appeared "worse" or more conservative than DQN. This is because DQN’s overestimation can sometimes look like rapid progress, whereas DDQN’s more realistic valuations lead to a more stable, albeit initially slower-looking, learning curve.
  • Sensitivity to Exploration: The author noted that if the initial exploration rate ($\epsilon$) is too high, the bird flaps too frequently, leading to highly inefficient training. Fine-tuning the balance between exploration and exploitation was critical for survival.

Key Results

  • Convergence: DDQN converged slightly faster than the enhanced DQN.
  • Training Duration: Mastery of the environment required approximately 3 million timesteps.
  • Performance: While both algorithms eventually mastered the game, DDQN demonstrated a more stable training loss trajectory, substantiating its ability to mitigate overestimation issues.
  • Reward Structure: The agent successfully learned to prioritize survival (earning +0.1 per 4 frames) and pipe navigation (+1.0 per pipe) while avoiding collisions (-1.0).

Limitations and Future Work

The paper notes a few areas for further exploration:

  • Computational Cost: Achieving "mastery" required a significant amount of training data (3 million steps), which may be computationally expensive for more complex environments.
  • Generalization: While successful in Flappy Bird, the author suggests that the next step is testing these architectures in more diverse and high-dimensional applications like robotics and autonomous systems.
  • Optimization Details: While the paper mentions an "enhanced DQN," the specific architectural tweaks used to "speed up training" compared to the traditional version are not detailed extensively, leaving room for more granular ablation studies.

Summary updated

BibTeX
@inproceedings{chen2024evaluation,
  author = {Zhenyu Chen},
  title = {{Evaluation of DQN and Double DQN Algorithms in Flappy Bird Environment}},
  booktitle = {Advances},
  year = {2024},
  doi = {10.2991/978-94-6463-370-2\_24},
}

Loading related content...

Figure