Self Driving Robot Lane Detection

A Self Driving Robot Created with Roboflow

About Me

Hello everyone!

First, a bit about me. I am a high school student in the US, and I love making software and machine learning projects.

The Project

For this project, I really wanted to make a self driving car, but I’m not going to risk my car for this project, so I decided to make it with some things lying around my house. I used the following:

  • 1x LEGO Functions: Power Functions Motor Set 8293
  • 4x LEGO Functions Power Functions M-Motor 8883
  • 1x LEGO Functions: Power Functions IR Receiver 8884

I then used a IR transmitter connected to a Raspberry Pi 4 to control the motors and IR receiver on the robot itself. I then created a REST API with express.js (I know, not the best way to do it, but it was the fastest to get up and running) running on the Pi so I can send requests from my computer to control the motors. I then created a Python library so I can easily control the robot through Python.

Now the next major issue: how am I going to deal with and label the data coming from the robot to see what lanes and paths the robot can travel in? This is where the amazing Roboflow came into play. I have used Roboflow before and it is by far the best and easiest way to create and train datasets. I spent several hours labeling data for the road and lanes. Sadly, because I needed to use instance segmentation to separate the lanes, turns, and paths for the robot, I couldn’t use the Roboflow Train feature. This would have made my life easier and I wish I could have used it because Roboflow.js has the best FPS in browser by far, and amazing accuracy.

I ended up using Meta’s Detectron 2 model to train on all of this data, and I got some amazing results.

Below are some of the results.

Results

With this image, we can see that the robot is driving in the middle of an intersection.
Input Image:


Predictions Image:
Here is the key to the numbers:

  1. Right Lane
  2. Left Lane
  3. Left Turn
  4. Right Turn
  5. Straight


In this image, we can see that it pretty much nails all of the turns in the intersection. The left turn (seen in red) and the straight through the intersection (seen in dark blue) are both extremely accurate. A different example is seen below.

With this image, we can see the robot right before it enters the intersection.
Sadly, I cannot post the before image because I am a new user and can only post 2 links per post.

Predictions Image:

  1. Right Lane
  2. Left Lane
  3. Left Turn
  4. Right Turn
  5. Straight

ewf

We can see that all of the right turn (blue), straight (purple), and left turn (bright green) segmentations have worked beautifully.

My next step will be getting this model to run in realtime on a laptop, which will be the next challenge. This is currently running on a customized Colab notebook. This is why Roboflow Train is superior. I can easily use it in realtime and it is accurate.

Anyways, I hoped you enjoyed this quick show and tell, and I will keep working on this project with the help of Roboflow!

Links:
Coming soon, I don’t have permission to post them yet.

1 Like

About the model:

2 Likes

This is excellent work @James!! Please email me at mohamed@roboflow.com so I can add some extra features and training credits to your account!