Mac Two is now autonomous!!

MAC One Project
Meetech - We Love Tech
4 min readSep 7, 2020

In the first article, we introduced you to the different steps in the realization of the Mac Two project. In the second article, we turned Mac Two into a remote-controlled vehicle. The third phase, which is making the car autonoumous will be detailed below. Question is : Will we be able to make this car autonomous?

Spoiler alert: YES! But it’s how we got there that is exciting.

This mission was given to the Machine Learning and Data Lab. To know more about the MLDL at Wavestone, click here.

Add-in hardware and approach used in the process

We used the Raspberry Pi — Camera eye fish, mounted it on the car to capture images for processing. Also, we dived in different approaches to build our driving model, here’s a sample of possiblibilities.

After a benchmark of the best built autonomous cars (1/10 ratio), we decided to use Supervised Learning. This approach is used by the winners of the previous IronCar (http://www.ironcar.org/).

What is Machine Learning?

Machine learning algorithms use computational methods to “learn” information directly from data without relying on a predetermined equation as a model.

The algorithms improve their performance as the number of samples available for learning increases.

What is Supervised Learning?

Finds patterns (and develops predictive models) using both, input data (images of the road) and output data (steering angle).

All Supervised Learning techniques can solve Classification or Regression issues.

Binary classification. The algorithm classifies data into two categories.

Multiclass classification. This requires the algorithm to choose between more than two types of answers for a target variable.

Regression. Regression models predict continuous values, while classification models consider categorical ones. For instance, predicting net profit as a measurement of the customer lifetime value is a standard regression problem.

We chose Regression. Our model will predict a steering angle between 0° and 180°.

The main difficulty is to create the Data

We did it in two ways:

  • Mac Two Data : We drove the car with the joystick into Wavestone’s hallways and each image taken had an associated angle (really fun!)
  • We found a simulator that helped us create simulated data

We have made several code optimizations and choose a fast and light machine learning model.

This allowed us to make an average of 20 decisions per second!

Get Deep into the Science:

If you want to know more about Deep Learning: here is a great introduction video !

Nvidia Paper Architecture

We used the architecture developed by Nvidia paper “End to End Learning for Self-Driving Cars “.

Here is our architecture and you can see five convolutions. The purpose of a convolution is to break the scales to allow the processing of small amounts of information

It allows to extract features from the input images as you can see in the next image

Extract from the paper: How the CNN “sees” an unpaved road. Top: subset of the camera image sent to the CNN. Bottom left: Activation of the first layer feature maps. Bottom right: Activation of the second layer feature maps. This demonstrates that the CNN learned to detect useful road features on its own, i. e., with only the human steering angle as training signal. We never explicitly trained it to detect the outlines of roads.

It works! How to make it work better?

We now want to add a way to manage speed. From the beginning, we carried out tests at a constant speed.

Problem: we have no way to access the speed in real time!

We only have access to the predicted angle.

In variable speed: We use a Gaussian function : for example, if the predicted angle is 90° (straight), the induced speed is maximum. The more the car turns, the lower the speed is.

To add the notion of braking, we use the history of angles predicted. We then have an idea of our speed and our place on the circuit (enter a turn at high speed => BRAKE).

Great video produced and directed by MBS and JG :

In the beginning, Mac Two is driven remotely with the app. Then we start the autopilot and it flies ! The last circuit was not trained on.

Thank you for reading us !

--

--