r/javahelp • • Jun 06 '16

Anyone interested in building an convolutional neural network using low-level java libs to recognize street signals and execute action based on them

Hi,

my idea is to build a very simple mobile cam app that pre-processes the camera capture in that way

  • that it takes the red and green channel

  • from a small region of interest (where we expect the signal to appear)

  • to max pool the ROI (to reduce amounts of data)

  • the app has a button which should be manually pressed whenever the signal turns from red to green.

  • and to transmit the data to a simple web application

Should be realized in a streaming, the web app receive a constant stream of data to feed the network

The network should be a convolutional neural network. When trained it should be able to recognize the turn from a red to a yellow and green light (r = red light, g = green light, b = red and green light)

When confident the model should trigger the execution of sending back 'button press' command to the mobile app.

The network should get trained constantly, the model should be updated regularly.

Thanks. Is there anyone who feels confident to program that in a few weeks with me?

0 Upvotes

5 comments sorted by

1

u/0x68656c6c6f Jun 06 '16

I've actually done a very similar project with a webcam and neural network to determine the amount of open spaces in a parking lot.

One thing I would suggest is that you capture a bunch of images and then classify them offline to use for your training--it will be a lot more efficient that way. You don't necessarily have to train in real time.

1

u/[deleted] Jun 06 '16

One thing I would suggest is that you capture a bunch of images and then classify them offline to use for your training--it will be a lot more efficient that way. You don't necessarily have to train in real time.

Would be even more efficient to use a trained model, but that's not want I want. I want to let the ai learn by experiencing, like a baby. Actually, I would like to train only one sequence of images (stream) while on the streets. When the light turns green, I press the button. When a batch if image / press data is processed the new model will be put it place. I want to see how long the ai needs to suggest a key press like I would. When it does it correctly several times, I wouldn't need to push the button anymore. Now the ai is 'robust' enough to understand what action comes after green lights.

That's basically the idea behind that. I don't want to build the best possible image recognition app, I want to simulate learning by doing. I am the father of the ai, and teach my little baby in real time to push the button when it's green. hoping it learns fast, then I go to the next problem.

1

u/0x68656c6c6f Jun 06 '16

How do you know when it's good enough? Say you wait until you get five correct answers in a row, and then stop. Maybe if you kept going you might get a bunch of failures after that.

I would suggest using something more rigorous, such as k-fold cross validation.

1

u/[deleted] Jun 06 '16 edited Jun 06 '16

I hope it makes sense. I do not want to do the common training, test phases but make the whole process more fluent, and enable the network to continuosly learn from errors and 'teachers'.

  1. no training data available, when I push the button, image and button state added to training data set. (possible combinations: green signal + pushed state, red + button deactivated, all correct, because I don't make errors)

  2. if training data set reaches specific size, training starts.

  3. If training done, the network changes the state of the button based on presented image (can be a stream of images)

  4. if false I override the push, the image at the time I corrected the button state and the new button state are added to the existing training set. ie. red signal network says green and program pushes button, I deactivate, same image that triggered the button push and new deactivated button state added to training set

  5. training with updated training set.

I do acknowledge that the system is not robust and probably will create many false classifications, but as I teach it only when it is wrong (no matter if false positive or negative), it should learn from that. If it's bad in particular situations, I would only correct the network in these situations and it would learn more from these situations.

Does it make sense? It's more like a baby learns. If it creates false results, you just don't delete the whole training set and restart, you try to override the bad habits, by putting more efforts into the parts it doesn't do well.

Let's call it continous error-dependent reinforcement. = always backpropagate when error occured, in contrast to backpropagation that is based on a fixed set of training data and evaluated against a test set (or part of the training set).

1

u/0x68656c6c6f Jun 07 '16

Ok, I see what you are going for. I'm not sure if you're going to be able to train on such a small amount of data, but I'm interested to know how it turns out. Good luck!