Skip to content

A gamified machine learning experience where the user gets to create a custom track and watch the AI learn its way through it.

Notifications You must be signed in to change notification settings

BatuhanGumus/Machine-Learning-Self-Driving-Car

Repository files navigation

GitHub license

Machine-Learning-Self-Driving-Car

A gamified machine learning experience where the user gets to create a custom track and watch the AI learn its way through it.

MLCars.mp4

Warning

I made this game such a long time ago while self-learning machine learning to make a neural network from scratch. I can almost guarantee that this will not work in newer Unity versions.

Game Features

  1. Generate custom track with the track tools.
    • start and finish line.
    • reward lines.
    • helpful undo and loop features.
  2. Begin training!
  3. Speed up the simulation and watch as the cars get better at driving as the generations go by.

Machine Learning Details

Inputs

  1. several raycasts from the car to get the distance to walls
  2. cars normalized speed

Outputs

  1. cars acceleration
  2. steering rotation

Activation Method

Hyperbolic tangent activation! A range from -1 to 1 felt adequate for gas and break acceleration and steering rotation.
private double Activation(double inp)
{
  return Math.Tanh(inp); //Hyperbolic tangent activation
}

Scoring

Passing a green line will add points, wasting time and hitting the wall will substract points.

Learning Method

Simple mitotis evolution! Kill the worse performing half and copy and mutate the better performing half.

Future Plans

  • A challange mode to test the AI cars that you thought.
  • Smoother track building experience.
  • GPU based Neural Network.
  • AI saving to be able to close the game and continue teaching later.

About

A gamified machine learning experience where the user gets to create a custom track and watch the AI learn its way through it.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages