Virtual Autonomous Car

Self Driving Car

The objective of the project was to develop a system which could allow a car to drive autonomously and find its path with the help of a minimum number of sensors to optimise the performance of the system.

Sensing has been done by the use of Ray-Casting which provides the input as the collision distance in a particular direction. These inputs are then fed to a neural network which gives the outputs to drive and steer the car, to train the network genetic programming approach has been taken which fuses multiple artificial neural networks(ANN) in order of their performance Resulting a better network.
Rays Cast in real time






Process Flow

Flow Chart


A car has been setup with four rays cast in the different directions, These rays calculate the distance of collision in left and right direction, Using the two rays going in the front it calculates the angle of the turn ahead and also the front collision distance by taking both their averages. These values along with the current speed of car are then fed to a feed forward neural network with a single hidden layer with 25 neurons, and output layer giving 2 values: steering factor and acceleration factor.
To train this neural network, multiple randomly generated networks are tested against a fitness function comprising average speed times distance to promote speed. These networks are selected by the use of Roulette wheel algorithm for crossover and mutation. The process results in new batch or generation of neural networks which is expected to perform better than the previous one.
Each generation contains 10 neural networks and each run count for a single network, It is possible to run complete generation of neural networks at once but that has not been implemented yet.

Result

A system capable of training itself by the use of machine learning resulting in an autonomous car capable of driving flawlessly on the track.


Source code and binaries available at GitHub Here

Comments

  1. From playing games to making games,
    A Huge Step towards progress :)

    ReplyDelete

Post a Comment

Share your thoughts in comments