Skip to content

thatfreakcoder/FlappyBird-NEAT-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Flappy Bird with NeuroEvolution of Augmenting Topologies (NEAT)

NeuroEvolution of Augmenting Topologies is a method for evolving artificial neural networks with a Genetic Algorithm. NEAT implements the idea that it is most effective to start evolution with small, simple neural networks and allow them to become increasingly complex over generations.
NEAT and Genetic Algorithm has the ability to add or remove a neural node hence making the network complex over time and improving the result, by analyzing the fitness of the population of each generation.

Running the Algorithm

Clone the Repository by running
git clone "https://github.com/thatfreakcoder/FlappyBird-NEAT-AI"
or downloading it via the DOWNLOAD button
Install the dependencies by running
pip install -r requirements.txt
and then finally run the game by running
python main.py

My NEAT Configuration

Configuration File for Genetic Algorith can be found here

  • I am using a population size of 10 because of the simplicity of the task, more population might mean the desired network will be randomly formed in the first generation, without any training or `learning` from the parent genomes
  • Default Activation Function used is ReLU, with a switch option of TanH and Sigmoid functions, with a mutability rate of 0.7
  • Network Type is a Fully Connected Feed Forward Neural Network. Genomes Information is passed on the the mutated offsprings for better understanding of the network and imporving fitness score.
  • Neural Network is of shape [3, 1] with 3 input layers and 1 output layer with no Hidden Layers.
  • Connection Add / Remove Probability is set to 0.6 / 0.4

OUTCOME

I was able to get a very well trained outcome in the 2nd Generation and was able to achieve a score of 196 (screenshot was taken before the game ended).

if you liked the project, please star ⭐ the repo :)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages