Skip to content

Thb1t/AI_driving_genetic_version

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

12 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš— Driving AI with NEAT (NeuroEvolution)

This project showcases an AI that learns to drive a car in a 2D environment using the NEAT algorithm (NeuroEvolution of Augmenting Topologies). No hardcoded pathfinding โ€” the agent evolves behaviors through generations, mutation, and selection. ๐Ÿงฌ

๐Ÿง  What It Does

๐ŸŽฎ The AI controls a car in a simple 2D driving simulation with checkpoints built with Pygame.

๐Ÿงฌ It learns using NEAT: networks are evaluated based on how far and how safely they drive.

๐Ÿ‘๏ธ A visual interface displays the car in action as it learns and improves over generations.

๐Ÿš€ Features

๐Ÿ”„ No supervised learning โ€“ only evolution by fitness

๐Ÿง  Networks evolve topologies and weights

๐Ÿ“Š Real-time simulation with visualization

๐Ÿ† Tracks best fitness, average scores, and generation progress

Here is an image of what it looks like :

Image_cars

There is sevral cars for a generation and we select the best. (Grays had hit a wall, reds are normal and the green is the best of this generation)

๐Ÿ“ฆ Dependencies

  • Python 3.x ๐Ÿ
  • any lib : this time, I don't use neat-python for neuroevolution
  • Pygame for visualization ๐ŸŽฎ

๐Ÿ“ Notes & Observations

โณ Like any evolutionary approach, early generations perform terribly โ€” driving in circles or crashing instantly โ€” but over time, the network learns basic control and navigation.

Image_cars

Here, we can see that over 13 generations, the best path have been found (in less than 5 min). So, it is really quick !

About

AI learns to drive with genetic mutation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages