A convolutional network learns to flap by dying repeatedly
It generalizes DeepMind’s Atari DQN to Flappy Bird, training a convolutional network to avoid pipes from raw pixels alone.

What it does
This project is a Python implementation of a Deep Q-Network that learns to play Flappy Bird. It feeds stacked, preprocessed game frames into a convolutional neural network and lets the agent decide when to flap and when to do nothing. The code is largely an adaptation of existing work—specifically the FlapPyBird game engine and a prior DeepLearningVideoGames DQN implementation—tied together to target this specific bird.
The interesting bit The author tweaked the standard DQN exploration schedule: instead of starting epsilon at 1, they start at 0.1 because a high random-action rate makes the bird flap manically, hug the top of the screen, and die clumsily. They also strip the background from frames to speed up convergence, which is a nice reminder that even “general” algorithms need domain-specific babysitting.
Key highlights
- Trains on raw 80×80 grayscale pixel stacks; no hand-crafted game state required.
- Uses a three-layer convnet with max pooling and 256 fully-connected ReLU nodes.
- Epsilon-greedy exploration is tuned for Flappy Bird’s physics: high randomness causes over-flapping, so epsilon anneals from 0.1 down.
- The first 10,000 steps are purely random to seed the replay buffer before training begins.
- Explicitly built on top of
FlapPyBirdandDeepLearningVideoGames—more adaptation than reinvention.
Caveats
- Dependencies list TensorFlow 0.7, which is years out of date and likely a compatibility headache on modern systems.
- The README includes a manual checkpoint-path fix in the FAQ, suggesting saved model loading is brittle.
- The project is explicitly described as “highly based” on two other repos, so expect glue code rather than novel architecture.
Verdict Worth a look if you want a concise, well-documented reference implementation of DQN applied to a simple 2D game. Skip it if you are looking for a state-of-the-art agent or a dependency stack from this decade.
Frequently asked
- What is yenchenlin/DeepLearningFlappyBird?
- It generalizes DeepMind’s Atari DQN to Flappy Bird, training a convolutional network to avoid pipes from raw pixels alone.
- Is DeepLearningFlappyBird open source?
- Yes — yenchenlin/DeepLearningFlappyBird is open source, released under the MIT license.
- What language is DeepLearningFlappyBird written in?
- yenchenlin/DeepLearningFlappyBird is primarily written in Python.
- How popular is DeepLearningFlappyBird?
- yenchenlin/DeepLearningFlappyBird has 6.8k stars on GitHub.
- Where can I find DeepLearningFlappyBird?
- yenchenlin/DeepLearningFlappyBird is on GitHub at https://github.com/yenchenlin/DeepLearningFlappyBird.