Live data from Hacker News

Lane Following Autopilot with Keras and Tensorflow

wroscoe.github.io

11–20 of 78 posts

Re: Lane Following Autopilot with Keras and Tensorflow

#11
post #10
post #6

Earlier quoted context omitted.

> trivially done using control algorithms Is it really trivial? Honest question... Which control algorithms are you speaking of?

As u/gumby said, I was thinking of a PID controller. Basically, the car would continuously measure how far away it is from the line and compare that with the "expected" (computed) value. Based on the error between the two values, the controller would adjust some variable (e.g., wheel angle). Computing how much of an adjustment is required is where the PID part comes in. The controller uses the D erivative (rate of ch…

For context, a hardware PID controller is a commodity part you can buy for a couple of dollars.

Re: Lane Following Autopilot with Keras and Tensorflow

#12
post #5
post #3

Nicely done! But I'm assuming that this is more of an exercise rather than a real-world application of ML? I say this because the task of keeping a car between two lines is trivially done using control algorithms. Of course, the CV part -- "seeing" the lines -- requires some form of ML to work in the real world.

Obviously, "Lane Following Autopilot using my brain and controls theory" would not make it to the top of HN. Welcome to the new era where Tensorflow replaces Lyapunov and ML spares you the need of understanding hard problems... until you need guarantees and safety... but but it's ok let's add more data.

[deleted]

Re: Lane Following Autopilot with Keras and Tensorflow

#13
post #5
post #3

Nicely done! But I'm assuming that this is more of an exercise rather than a real-world application of ML? I say this because the task of keeping a car between two lines is trivially done using control algorithms. Of course, the CV part -- "seeing" the lines -- requires some form of ML to work in the real world.

Obviously, "Lane Following Autopilot using my brain and controls theory" would not make it to the top of HN. Welcome to the new era where Tensorflow replaces Lyapunov and ML spares you the need of understanding hard problems... until you need guarantees and safety... but but it's ok let's add more data.

I agree with you. If you can leverage control theory from the 1950s to solve your problem, what's the point?

However, I will state that using e.g. Lyapunov functions to prove the stability of the system requires a model of the system. And even if you need a guarantee for your system, that guarantee is only as good as the fidelity of your model. For an inexpensive RC car, with slippage and saturation, without torque control or inertial sensing, you're going to have a hard time doing something that sounds as principled as what you suggest.

Re: Lane Following Autopilot with Keras and Tensorflow

#14
Great summary, I always think it's best when machine learning projects have visuals and videos to showcase what is actually being learned.

This simple project is a good example of supervised learning from what I can tell - the network will learn to steer "as good as" the human that provides the training data. For a different (and more complex) flavor of algorithm, check out reinforcement learning, where the "agent" (computer system) can actually learn to outperform humans. Stanford's autonomous helicopters always come to mind - http://heli.stanford.edu/

Re: Lane Following Autopilot with Keras and Tensorflow

#15
post #10
post #6

Earlier quoted context omitted.

> trivially done using control algorithms Is it really trivial? Honest question... Which control algorithms are you speaking of?

As u/gumby said, I was thinking of a PID controller. Basically, the car would continuously measure how far away it is from the line and compare that with the "expected" (computed) value. Based on the error between the two values, the controller would adjust some variable (e.g., wheel angle). Computing how much of an adjustment is required is where the PID part comes in. The controller uses the D erivative (rate of ch…

I think it's important to ponder that a PID controller is , in almost every case it is used, a heuristic controller which achieves pretty mediocre performance. Unless the plant is second-order linear system, with constant gains, and maybe some non-constant biasing (what the I term is supposed to handle), a PID controller is theoretically inappropriate, and requires tuning.

The handful of parameters you need to adjust in a PID controller parameterizes a very small class of controllers. For a given control problem, the controller you want might fall outside that class. People try to expand the class of "PID" controllers in all sorts of ways (e.g. anti-windup), but from where I stand it's just hacks on top of hacks.

It makes sense to consider a much wider class of controllers, with many more parameters, to possibly achieve better performance, or at least to avoid having an expert tune some gains in place of collecting bucket-loads of data.

Re: Lane Following Autopilot with Keras and Tensorflow

#16
post #3

Nicely done! But I'm assuming that this is more of an exercise rather than a real-world application of ML? I say this because the task of keeping a car between two lines is trivially done using control algorithms. Of course, the CV part -- "seeing" the lines -- requires some form of ML to work in the real world.

This is primarily a fun toy problem.

It uses a Raspberry Pi and ~50 lines of code. So I don't think anyone should expect it to do something that's impossible with other approaches.

Re: Lane Following Autopilot with Keras and Tensorflow

#17
post #5

Earlier quoted context omitted.

Obviously, "Lane Following Autopilot using my brain and controls theory" would not make it to the top of HN. Welcome to the new era where Tensorflow replaces Lyapunov and ML spares you the need of understanding hard problems... until you need guarantees and safety... but but it's ok let's add more data.

I agree with you. If you can leverage control theory from the 1950s to solve your problem, what's the point? However, I will state that using e.g. Lyapunov functions to prove the stability of the system requires a model of the system. And even if you need a guarantee for your system, that guarantee is only as good as the fidelity of your model. For an inexpensive RC car, with slippage and saturation, without torque c…

[deleted]

Re: Lane Following Autopilot with Keras and Tensorflow

#18
post #5
post #3

Nicely done! But I'm assuming that this is more of an exercise rather than a real-world application of ML? I say this because the task of keeping a car between two lines is trivially done using control algorithms. Of course, the CV part -- "seeing" the lines -- requires some form of ML to work in the real world.

Obviously, "Lane Following Autopilot using my brain and controls theory" would not make it to the top of HN. Welcome to the new era where Tensorflow replaces Lyapunov and ML spares you the need of understanding hard problems... until you need guarantees and safety... but but it's ok let's add more data.

Why learn to walk when crawling is effective? When crawling you have hard guarantees that you won't fall down.

Re: Lane Following Autopilot with Keras and Tensorflow

#20
post #5
post #3

Nicely done! But I'm assuming that this is more of an exercise rather than a real-world application of ML? I say this because the task of keeping a car between two lines is trivially done using control algorithms. Of course, the CV part -- "seeing" the lines -- requires some form of ML to work in the real world.

Obviously, "Lane Following Autopilot using my brain and controls theory" would not make it to the top of HN. Welcome to the new era where Tensorflow replaces Lyapunov and ML spares you the need of understanding hard problems... until you need guarantees and safety... but but it's ok let's add more data.

Also, general autonomous driving isn't as hard as it sounds. Given a list of time-dependent coordinates of obstacles, it should be pretty easy to navigate around such that no collision occurs. The hardest part is testing, but this is just a matter of tedious work and doesn't require great intellectual effort.
Post reply on HN