🐤 Neuroevolution

← Portfolio

A population of 150 neural networks teaches itself to play Flappy Bird — no trainer, no data, no backpropagation. Just natural selection: the ones that fly farther reproduce, their offspring inherit their brains with small mutations, and generation after generation the population sharpens up. Watch them go from chaos to mastery in ~10–15 generations.

Generation: 1 Alive: 150/150 Score now: 0 Record: 0
Speed: ×4

Learning curve (score / generation)

Each bar = the best score of a generation. It should climb as the population evolves.

Leader bird's brain

5 inputs → 6 hidden neurons → 1 output (flap?). Green edges = positive weight, red = negative; thickness = magnitude. Nodes flicker with the real activation, in real time.

🧬 How it works: each bird has a brain — a tiny neural network that takes 5 numbers (its own height, velocity, distance and the edges of the next gap) and decides whether to flap. At first the weights are random, so it flies chaotically. When they all die, the genetic algorithm picks parents in proportion to how far they got (fitness), combines their brains (crossover) and adds small mutations. The best bird passes untouched into the next generation (elitism). Repeat — and evolution solves the game on its own.