# Autonomous Car – Learning Algorithms

Genetic algorithm and Backpropagation in autonomous cars

Autonomous cars need learning in order to recognize their environment and behave consistently. Neural networks give us the opportunity to develop complex behaviors and tasks like driving.

I have implemented two algorithms that are widely used in machine learning: backpropagation (supervised learning) and genetic algorithm (reinforcement learning).

## Supervised Learning (Backpropagation)

This is the most used algorithm and compared to the rest, this is the most powerful and needs fewer resources to be performed. However, there is a disadvantage, we need training data for the learning process and thus is really restrictive.

## Reinforcement Learning (Genetic Algorithm)

It is an algorithm that was inspired by the theory of evolution by Charles Darwin.
The implementation simulates the process of natural selection where the fittest individuals have higher probabilities to transfer their genes to the next generation. It is usually divided into 4 parts.

#### Initialization

Genes frequently use Boolean representation (0 or 1). However, here we use a real number in between -1 and 1 to depict the gene value. We now need to design the neural net topology, for example: if I use 5 sticks to measure the distance to the nearest object and we want to return acceleration, right and left turn, this represents 5 inputs and 3 outputs, and you can change the hidden layers topology. We have used 4 layers in our experiments. Then, to initialize the weight values one can select a random number, in the interval [-1..1].

#### Selection

This process orders individuals from each generation, according to their fitness. The
fitness function returns a probability to transmit ”genes” to the next generation.
There are different variants of this step. I have designed a function that uses 2 variables: accuracy and diversity. Genetic algorithm, like others, have a paramount problem while you are trying to reach the global minimum, it usually comes to a standstill in a local minimum. To solve this problem, I have used a measure of the distance from one individual to the rest of the individuals.
The accuracy can be measured using the positioning system that can tell us the percentage of the circuit traveled, by the individual. Once we have the accuracy and the diversity of each individual, we can transform absolute data to relative. The result will be given with a real number between 0 and 1.

#### Crossover

The elements we have chosen will experiment with the crossover operation. It is the process of exchanging genes among parents to reach a new individual made by progenitors. This part can be modified as you may require. It will be possible to design it with some hyper-parameters: crossover rate, number of progenitors.

#### Mutation

We change some of the genes with a random number generator. By the fact that if decimal numbers, we need some hyper-parameters: mutation rate, mutation change.

## 12 thoughts on “Autonomous Car – Learning Algorithms”

1. I will immediately snatch your rss as I can not find
you’ve any? Please let me know so that I may subscribe.
this blog, I have read all that, so now me also commenting
at this place. Hi there! Someone in my Myspace group shared this site with us
so I came to take a look. I’m definitely loving the information. I’m book-marking and will be tweeting this
to my followers! Wonderful blog and wonderful design. http://samsung.com

2. garrett sherwin says:

I could not refrain from commenting. Perfectly written!

3. judi bola says:

Ꮋowⅾy! Someone in my space ցroup shared this ѕite with us so I came to check it out.
I’m definitely loving the information. I’m book-mаrking and will be tweeting this to my folloѡers! Great blog and terrific design.

4. wendierb says:

I’ll bookmark your blog and take a look at again here frequently.
I am somewhat certain I’ll be told plenty of new stuff right here! Good luck for the next!

5. Sanford-Grassi says:

I do ƅerlieve all thee ideas yoᥙ’ve offered to your post. They are very cοnvincing ɑnd will certainly work.
Nonetheless, the posts are too brief for novices. May you please lengthen them a littlе from next time? Ƭhanks for tһe рost.

6. Frank says:

Is going to be back ceaselessly to check up on new posts

7. darbygarling says:

Greetings! I’ve been following your web site for a while
now and finally got the courage to go ahead and give you a shout out from Kingwood Tx!

Just wanted to tell you keep up the excellent
work!

8. sabrinacarruthers says:

Somebody essentially assists to make significantly posts
I would state. That is the first time I frequented your website page and thus far? I amazed with the research you made to make this particular put up incredible. Wonderful activity!

9. Rodney says:

if that would be ok. I’m definitely enjoying your blog and look forward to new updates.

10. rolandogaudette says:

Greetings from Ohio! I’m bored at work so I
decided to check out your site on my iPhone during lunch break.
I love the info you provide here and can’t wait to take a look when I get home.

11. Blaine says:

What’s Going down i am new to this, I stumbled upon this I have