Lurker News

Comments (211) 39 threads

Earlier comments
ben10401 reply#
My wife and I are in the process of packing up our house to move, and we are cursing our five year old kid's collection of Lego right now.

This was perfect timing for a good laugh from the title and an interesting read. Thanks!

jacquesm#
I can send you some more if you want?
fest1 reply#
Cool build! I'm really interested in the classification process:

1) What's the input image resolution?
2) How many classes you have?
3) How many samples per class did you need to achieve acceptable accuracy?
4) How long did the training take? How many epochs did it require?

jacquesm2 replies#
1) 640x242

2) the 1000 most common lego parts, 'other' and 'mess'. In the end the idea is to get to 20K classes and to sort directly into sets. This is very much a pipe dream at the moment but I think it is doable given a large enough set of samples. The problem is that you have to see all those parts at least a hundred times or so before it gets detected reliably.
3) too little :( The training data is still woefully insufficient but it is now good enough to bootstrap the rest. This took a while to achieve because without any sorted lego to begin with you have nothing to train with. So the first 20Kg or so were sorted by hand and imaged on the sorter without any actual sorting happening (everything into the run-off bin), then labeling the results by hand until the accuracy of the test set (500 parts or so) went over 80%. That was a week ago and since then it's been improving steadily day-by-day.
4) one training run per night, typically a few 100 epochs on the current set but, this will change soon. The machine is now expanding the training set rapidly with associated improvement in accuracy. This means that the training sessions are taking longer and longer but I'll be running fewer of them. What I'll probably do is offload training to one machine which will drop off a new set once per week or so and inference on another which is doing the sorting and capturing the new training data.
Checking the logged images for errors still takes up a bit of time though, but with the current error rate that is very well manageable. (Before it was an endless nightmare).

fest1 reply#
By expanding the training set you mean that a each new sample is added to next training set by default?

Do you use artificial augmentation of the training set (random rotations, translations)?
Somewhat related aside: I have also worked on a classification task (albeit, much simpler one): detect the direction of grain in a piece of wood. I built the first version by manually extracting features (essentially, a few direction sensitive Gabor filters) so that I could collect a training dataset for CNN.
Turned out that accuracy of manual version was more than enough (~98%) so I didn't get to play with fun stuff :(
Demo of the system I'm talking about: https://youtu.be/vGa0tFXPffE

jacquesm1 reply#
> By expanding the training set you mean that a each new sample is added to next training set by default?

Every part that passes through the machine is logged and will be made part of the training set for the next round of training.
> Do you use artificial augmentation of the training set (random rotations, translations)?
Yes, quite a bit. But this is not of the same quality as really having more samples though it is definitely useful.
> Somewhat related aside: I have also worked on a classification task (albeit, much simpler one): detect the direction of grain in a piece of wood. I built the first version by manually extracting features (essentially, a few direction sensitive Gabor filters) so that I could collect a training dataset for CNN.
> Turned out that accuracy of manual version was more than enough (~98%) so I didn't get to play with fun stuff :(
Find a harder task!
> Demo of the system I'm talking about: https://youtu.be/vGa0tFXPffE
Slick! Do you use that to determine orientation prior to lamination so the laminate does not warp when it ages?

Continue this thread — 1 reply

nemik1 reply#
For more training data, I wonder if you could make Lego parts in Sketchup or some 3D program, then render them in a 'scene' similar to your camera setup using a renderer like Maxwell or V-Ray or whatever. Then you could maybe be able to generate unlimited numbers of sample images to train on.

I'm doing a similar experiment now to train a model to parse out an image of a blood pressure monitor that's a 7-segment LCD display. To do it I separated out each segment of the display as masks with Gimp/Photoshop and then I can create my own images by just overlaying them on top of an image of a blank LCD display. That gets me basically unlimited training photos. If you could render the 3D parts from various angles, colours, etc then something similar might be possible.
Also, you said you're doing modified VGG and into 20k classes. That works, but another thing to maybe try is use binary_crossentropy as the loss function and a sigmoid (instead of softmax) on the final activation layer, to be able to do multiclass classification. Then your labels could be a vector of shape possibilities, colour possibilities, or whatever you could divide your 20k classes into.

jacquesm1 reply#
I've tried the rendering trick but it didn't work well enough, the real pictures seem to give much better results when used on unseen data.

> Also, you said you're doing modified VGG and into 20k classes. That works,
Right now there are 1002 classes, the 1000 most common lego parts, 'mess' and 'other'.
> but another thing to maybe try is use binary_crossentropy as the loss function and a sigmoid (instead of softmax) on the final activation layer, to be able to do multiclass classification. Then your labels could be a vector of shape possibilities, colour possibilities, or whatever you could divide your 20k classes into.
Ok, I can try that. Thank you!

Continue this thread — 1 reply

PhasmaFelis1 reply#
This is really cool.

I am kinda boggled that you thought "Huh, Lego, think I'll get into that" and immediately ordered two metric tons of Lego. o_O
I get that you thought (for some reason) that you would only win some small fraction of your bids, but ordering, say, a quarter-ton of Lego at a go isn't reasonable either. The whole episode is pretty hilarious.

jacquesm#
Live and learn :)

You should have seen my face. Also, try to explain to your s.o. that you're about to buy an extra garage solely to house something that you have no idea how it will all work out and when - and if - it will ever go away again. And that was two years ago.
It really is hilarious. For me it's more or less business as usual though, I take lots of chances. Some work out and some don't. This one is still undecided.

tomcam1 reply#
Fascinating. It touches on the discolored and counterfeit parts but doesn't say how they are detected – I assume there was a lot of manual training of the neural net?
jacquesm2 replies#
It's basically bootstrapped. Use the machine to sort a few kilos, pick out the mistakes, update the training set, let it train overnight, rinse, repeat. After many such cycles it is getting pretty good. The best part is when I think it has made a mistake but actually it is right and I'm wrong :)
tomcam#
> when I think it has made a mistake but actually it is right and I'm wrong

SWEET

icelancer1 reply#
>The best part is when I think it has made a mistake but actually it is right and I'm wrong :)

This is always an awesome, awesome feeling and one I live for when training neural nets.

jacquesm1 reply#
The annoying part is that I can't always figure out by looking at the image what makes it make the right decision. That's a feeling I don't normally have with software, I can usually trace back the reason why.

Continue this thread — 1 reply

Load more comments