Overview
An autonomous-vehicle training simulation built on NEAT (NeuroEvolution of Augmenting Topologies), a genetic algorithm that evolves both a neural network’s topology and its weights. Cars learn to drive 2D race tracks in a Pyglet simulation, and the work was published at ICORIS 2024.
The problem
Hand-designing a neural controller for driving — both its architecture and its weights — is hard and brittle. Evolutionary methods sidestep this by letting the network structure and its weights emerge together from selection pressure over generations. NEAT is well-suited because it grows the simplest effective topology incrementally and preserves diverse solutions via speciation, rather than fixing the architecture up front.
Building it
Each car is a 2D object equipped with distance sensors (rays cast around the vehicle). Those readings feed a neural network whose four outputs are accelerate, brake, turn left, and turn right. NEAT evolves a population of these networks across generations: the fitness function counts the checkpoints (track gates) a car passes, and a 30-second timer caps each generation so a single run can’t stall the simulation. The best car of each generation becomes the parent for the next, with crossover and mutation driving exploration.
I tested on three tracks of increasing difficulty and ran a hyperparameter study over population size and mutation rate, comparing the default setup against three tunings to see how each one converges.
Outcome
Tuning 2 (population 60, mutation rate 0.8) was the strongest overall, rising fastest in early generations. Its peak fitness on each track:
| Track | Checkpoints | Difficulty | Peak fitness, Tuning 2 |
|---|---|---|---|
| A | 33 | Easy | 84 |
| B | 37 | Medium | 98 |
| C | 46 | Hard | 100 |
How the four setups compared:
| Setup | Population | Mutation rate | How it did |
|---|---|---|---|
| Default | 40 | 0.6 | The baseline to compare against |
| Tuning 1 | 20 | 0.5 | Did relatively well only on the easy track |
| Tuning 2 | 60 | 0.8 | Strongest overall, fastest early progress |
| Tuning 3 | 80 | 0.4 | Slow early, but caught up on the hardest track |
Across all setups, the best scores landed around the 50th generation and didn’t improve meaningfully past the 100th. The work was published at the 2024 6th International Conference on Cybernetics and Intelligent System (ICORIS).
What I learned
The headline finding is that NEAT is genuinely sensitive to its hyperparameters — because it searches over topology and weights through random mutation, the right population/mutation balance matters more than it would for a fixed-length-chromosome GA, and the best setting shifts with track difficulty. That sensitivity is the main limitation to flag for future work, and it’s the throughline into the gradient-based RL I did later: NEAT discovers controller structure well, but careful tuning is the price of that flexibility.