Cycling Neuroevolution

Just watch the AI riders race and evolve, or use the left/right arrow keys to control the power output of a human rider and try racing against them as they learn!

Click or use up/down arrow keys to select a rider and see their neural controller. Press 'r' or wait to return to default race view which shows the top 5 riders. Space to force evolution before race distance. Reload (Ctrl+R or Cmd+R) to reset with new riders and randomly generated terrain (try this if nothing interesting is happening!). Turn on sound effects and music with the sliders.

All the riders have the same physical characteristics, but different brains, which evolve over multiple races over the same randomly generated stage. Each rider is controlled by a small feedforward neural network (12 inputs, 5 hidden, 1 output) whose inputs are percepts (speed, power, battery level, average gradient over the next 100m, average gradient over the next 1000m, distance and relative speed to the rider ahead, distance and relative speed to the rider behind, riders nearby within 5m, race position, fraction of race completed) and whose output determines how the rider's power output will change per timestep (scaled by Power Multiplier). The network weights are randomly initialised. The red/blue colouring of the input nodes shows the current positive/negative contribution of each input to the output change. After each race we select the 10 leading riders, and generate a new generation of some exact copies and some with small weight mutations, which will lead to different behaviour. Watch the population of riders hopefully slowly improve their average speed over a few generations. Basic good strategy is to try hard going uphill and recover going down (because the air resistance force is proportional to velocity squared). You may also sometimes see dedicated drafters or sprinters emerge...

The cycling physics is based on rider + bike weighing 87kg, and simulates slope and air resistance effects with a drag area CwA of 0.32 and a coefficient of rolling resistance Cr of 0.004. Drafting reduces air resistance by up to about 40% behind a single rider, and stacks with diminishing returns when several riders are lined up ahead (capped at 60%). Physiologically, the riders have aerobic threshold power of 250W, and a "Wprime" anaerobic battery of 15000J which discharges above that threshold and recovers beneath it. The riders have a maximum sprint power of 750W, but this decreases linearly with battery level. Each rider's current Wprime level is displayed as a battery under their bike, and their current power output is visualised with a blue arrow, which extends in green to represent effective additional power due to drafting.

Andrew Davison, Imperial College London, 2025/2026. Suggestions welcome at x.com/ajddavison. Partly inspired by this.

Sound: Bicycle Freewheeling .wav by jacko4526 — https://freesound.org/s/656004/ — License: Attribution 4.0. Cycling.WAV by 14FPanskaBubik_Lukas — https://freesound.org/s/418531/ — License: Creative Commons 0. Wind Whistling Window Frame.wav by pavelvon — https://freesound.org/s/396533/ — License: Creative Commons 0.

Music composed and arranged by Adela Davison de Agapito, 2024.

Cycling sprite licensed from iStock — istockphoto.com

Evolution Parameters

Save/Load Rider

Sound mix