Skip to content

ishaantek/self-driving-car

Repository files navigation

Self-Driving Car Simulation with Neural Networks

Introduction

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.

Motivation

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.

Technologies Used

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.

Installation and Setup

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.

How It Works

Simulation Overview

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.

Neural Network Architecture

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.

Genetic Algorithm

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.

self-driving-car

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published