Skip to content

Khurram-Devs/Self-Driving-ML-JS

Repository files navigation

🧠 Self-Driving Car Simulation (Vanilla JS)

This project is a browser-based Self-Driving Car Simulator Built With Pure JavaScript, no external libraries or frameworks involved. It simulates autonomous cars learning to drive through neural networks and sensor input, improving with every generation using the concept of genetic mutation.

Simulation Screenshot

🚘 Features

  • Fully custom car control system (keyboard and AI)
  • Sensor system that detects the road and nearby vehicles
  • Collision detection
  • Neural network implementation from scratch
  • Visualizer for real-time network activity
  • Evolution system that mutates the best brain to train new generations

📂 How It Works

  1. A number of AI-controlled cars start the simulation.
  2. Each car uses its own neural network to navigate.
  3. The best-performing brain (based on distance traveled) is saved.
  4. In the next round, all cars use the saved brain—with mutations to explore new strategies.
  5. Over time, the AI improves at avoiding traffic and staying on the road.

🛠 Technologies

  • HTML5 + CSS3
  • Vanilla JavaScript
  • Canvas API (for rendering cars, roads, and visualizers)

📚 Tutorial Credit

This project is based on an excellent tutorial by Radu Mariescu-Istodor hosted on freeCodeCamp.org.
Huge thanks to them for the clear explanation and in-depth learning experience.

🧪 Demo

👉 Live Demo

🚀 Getting Started

  1. Clone the repo:
    git clone https://github.com/your-username/self-driving-car-js

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors