Neural Network Flappy Bird

Neural Network Implementation of Flappy Bird

Published on Aug 25, 2022

Reading time: 1 minutes.


Built with

JavaScript
TensorFlow
P5.js

Game Website

This program utilizes Tensorflow.js to train a “bird” to play the game flappy bird automatically. This website allows you to see the training of a bird in real time, as well as see a pre-trained model play the game.

Game Training Screenshot of a generation of birds training

The neural networks representing a bird’s actions/brain are trained via a genetic algorithm, where populations of birds are trained at a time. The algorithm selects top performing birds based on a fitness value and breeds a new generation with permutations to further train the neural networks. Graphics are done with the P5.js library. The website is built with vanilla JavaScript. (with HTML and CSS)