This project is a simulation of self-driving cars using neural networks. It demonstrates the basic concepts of machine learning and artificial intelligence applied in the context of autonomous vehicles. The simulation environment includes a road with obstacles, where multiple self-driving cars navigate and learn to avoid crashes over time.
I'm just starting out in learning about machine learning, neural networks, and other forms of artificial intelligence. This hands-on project served as a practical way to understand the fundamentals of neural networks and their application in a simple yet intriguing domain.
This project is built using plain JavaScript, with minimal supporting HTML and CSS for presenting the simulation. No external libraries or frameworks were used, emphasizing the raw implementation of neural networks and the genetic algorithm.
No installation is necessary to run this project. Simply clone or download the repository, and open the index.html file in a web browser to start the simulation. Reload the page to restart the simulation.
The simulation creates a road environment with fixed obstacles. A specified number of self-driving cars (e.g., 1000) are generated, each equipped with a neural network having random weights and biases. These cars navigate the road, trying to avoid obstacles and learning from their performance.
Each car's movement is controlled by a neural network. The network makes decisions based on sensory inputs, guiding the car through the environment. The architecture is simplistic, but enough to demonstrate basic decision-making in an AI-controlled vehicle.
The project utilizes a genetic algorithm to improve the performance of the neural networks over time. The best-performing car's neural network is saved, and in subsequent runs, new cars are generated by mutating this network's configuration. This iterative process gradually leads to better navigation strategies.