Self-driving car

A small neural network drives a curvy highway through traffic. It keeps to its lane, decides when to brake and when to overtake, and signals before it moves over. It learned all of that by evolution, with no examples to copy, only distance covered and a great many crashed cars. Watch it, evolve your own, or take the wheel.

Road

1

Distance

0.00km

Speed

0km/h

Time

0s

Round0 / 45 s
Held-out roads

Network362 weights
00–04
lane to the left
15
speed
05–09
own lane
16
curve ahead
10–14
lane to the right
17–18
lane change
Speed
Road
Keys

←→change lane ↑raise set speed ↓brake Ragain

Brain

Pretrained

Highway

Three lanes

01Lane scan3 lanes, 90 m ahead, 45 back
02Network19 inputs, 362 weights
03ControlsPedal and lane
04PlannerBlinks 0.7 s, moves over in 2.6 s
05FitnessMeters covered, −300 for a crash
Hover for detailsTap for details

Anatomy

Live from the car in focus · gaps on a square-root scale

How it learns

Nobody shows the network how to drive. A population of random networks takes to the road, and the ones that get furthest become the parents of the next generation.

  1. 01Sixty cars with random weights start on the same road. The planner keeps each one in its lane, so even these drive; what they lack is any idea of when to brake or which lane to be in.
  2. 02Each drives until it crashes, falls behind a line moving at 18 km/h, or the round is up. Rounds start at 45 s and grow by half each time a car is still driving at the end, up to five minutes.
  3. 03Its score is the distance covered, minus 300 m for going out early.
  4. 04The best four carry over. The rest are children of tournament winners, crossed and mutated.
  5. 05Overtaking takes far longer to find than sixty cars and a few minutes allow. From pretrained starts the field from mutations of the shipped brain instead, which changes lanes from the first round.

Who decides what

The network chooses the pedal and the lane. A planner does the rest, the way a driver-assist system would: it blinks for 0.7 s, waits while a car is level with it in the target lane, moves over on a 2.6 s S-curve and steers along it with pure pursuit. The blue ribbon is that plan. Whether to overtake, and whether the gap is worth it, is the network's call alone. Its score loses a little for every second it cruises left of a free lane, so it learned to move back right after passing.

The trained driver

The brain in Watch came out of a longer run, headless in Node, on five-minute episodes in full traffic. These are its numbers on 30 roads it never saw. Traffic drives around it like people would: it keeps its distance, signals and overtakes, but it never makes room for a car that cuts in.

Mean distance–
Median distance–
Never crashed or fell behind–
Average speed–
Lane changes–
Weights–