I work for a mill that cleans and sorts grains and beans (taking the rocks out, stems out, etc.), and it's fascinating to see the parallel invention of something really similar! We have a bunch of different steps:
1) Air is blown through the product and any dust is taken out.
2) The product is run through a bunch of screens that take out anything too big or too small.
3) The product is put through a gravity separator to separate based on mass.
4) Finally, the product is put through an optical sorter (https://www.youtube.com/watch?v=O0gWUeqzk_o) which uses blasts of air to push out unwanted materials from a stream of falling product. I'm sure you could use the same process for Legos. Not sure about how to distinguish between branded and unbranded Legos though.
What is the %age by weight of 'trash' versus 'good stuff' for such a sorter? I do use screens for various pre-sorting stages, not shown in the article. The sorter is only good for parts up to 40 mm and anything that isn't a wheel or round so it will roll away while being imaged. That's by far the bulk though so for me if it does that part well it is already more than worth it. Branded/unbranded: spectrum is different (far more different than you would say by looking at it with the naked eye), weight does not match for the part (though this can be very close with really good fakes), logo on the studs is different. I've been thinking about doing that gravity thing, but a bit more fancy, rather than just a binary sort to shoot parts in several directions, an alternative is a spiral slide under a steep angle where parts are fed in at the top and ejected when they reach the right bin. That's a lot more complicated to make than what I have right now mechanically and also the time available for a classification operation would be much shorter, but it would allow for a much larger number of output bins without taking up a whole lot of space. So maybe a next generation, if I still need it (this one is going through piles of lego now).
> How many bins are you organizing your Lego into?
Seven, so it takes multiple passes before it is done. > Or was this more just a proof of concept thing? Tough question :) No, it's for real it really has to sort through the 2000 kg, but if it needs to be beefed up or changed to get to the end then I'll do it. The next step 'up' would be a machine designed from scratch incorporating all the lessons learned with essentially unchanged software. There are still some limitations that could be addressed but then you'd lose the training set and you'd have to start all over from scratch. That might be worth it to get the last 1% error or so, so if this ever becomes 'real' then I'd have to do that. I highly doubt it will get to that though. time will tell. > Plans to launch a Lego sorting service? ;-) Not at present, though you're not the first person to think of that, parents with kids are suggesting I should make it mobile to visit people at their homes for $x / shot :) Still, that will only happen if I really have nothing better to do, which means likely never.
It seems like the wheel problem could be solved by a dowel rod that would keep things rolling along until they fell over? I suppose that unfortunately gives another way for the thing to get clogged up?
I'm surprised that this strategy isn't more quicksort-ish, I was expecting a first pass into warm or cool colors, then another pass into large or small lego, etc.
Everybody that hasn't sorted lego in bulk says the same thing :) The color sort would not help because in the end the idea is to get the same shaped parts in to a bin, not the same colored parts. Our brains are much better at picking a red part out of a background of similar shaped parts than they are at picking out a red part of a certain shape from a background of other red parts with different shapes.
As for the multiple passes, that's actually how it works, the first pass sorts into the 7 most common categories and then quickly works down from there. But the 'runoff' bin is by far the largest at the end of every run. After 3 passes the bulk has completely disappeared and most of the remains are sufficiently rare to be dumped into the right container individually. It goes pretty quickly: first pass: 7 bins, second pass: 7 bins again, but 49 if you put the first seven through again (but in larger volume accumulated from several runs on smaller lots). And so on. Since the bulk of the lego is in those first 49 and the value is in the remainder it doesn't take long to add value to a pile. As for the mechanics, any obstruction, no matter how well intended will immediately become a point for a bridge to anchor to.
What is the back of the enveloper calculation of doing it by hand? Doesn't seem like it would take a few high school students that long to go through the 2000kg and come out with a very nicely sorted set of Lego bricks.
Sorting beans was the exact thing I was thinking of when watching this. I process a lot of chickpeas at home, and the quality of the dried chickpeas going in is quite mixed. There are some split ones (not good for sprouting), and some duds which won't soak or sprout even though they're whole.
I think that people might pay for the convenience of getting a bag full of proper chickpeas with no duds and no stones (I've heard of this, but never really seen it). Maybe some day Suraj and NuPak will go a little further with their cleaning and get rid of damaged beans and not just stones. Though, frankly I think they could do better than average with a specific gravity/densimetric sorter; it would probably require fewer passes through the optical sorter as well.
Sorting beans is a well-solved problem using a sort of waterfall (of beans) where computer vision selects the bad beans and air jets eject them.
The equipment costs money; and reduces the volume of "product" left for sale. Your problem is capitalism - the companies don't do that because it lowers their profit.
High-speed optical sorters are the sort of behind-the-scenes tech that make me feel like I'm living in the future. I have vivid memories as a child watching people winnow rice by hand using wide, flat bamboo baskets.
Had I seen something like the optical sorter back then, I would have thought it (Arthur C. Clarkeian) magic!
I work in a steel mill we use a similar setup with an optical camera to size streams of Ore and Coke particles. One thing you could look into is using a vibrating feeder (sometimes called a 'vibro') this is what we use to stop screens from 'pegging' - similar issue to the bridging problem mentioned in the article.
> it's fascinating to see the parallel invention of something really similar!
This isn't parallel invention - the principal of optical sorting and air ejection are well known and understood. (Which is not to lessen the achievement in building this, but building and inventing are not the same thing.)
Dunno who here is old enough to remember but back in the day every bag of chips used to contain a few burnt chips. Well, thanks to those computer vision air blasting sorting machines theres no more burnt ones in the bag! They all get air blasted out and now chips are uniform.
Thanks for sharing such a cool build and helping keep alive a hope of mine. I dream of a day I have enough time/capital to build/buy a Lego sorter, a robotic Lego brick separator (perhaps using high-resolution ultrasound/radar to detect where to insert the separator and where to push), pair that with an automated storage system in a subterranean vertical tunnel with robot arms similar to a robotic tape library keeping track of all detected parts and minifigs according to BrickLink categorization. Let the system keep it all organized (for example, bin overflows into multiple bins are automatically tracked as a single part and color combination), and I even have the choice to have it dump a random assortment into a big laundry-size bin, and build like a kid again, yet have it clean up after itself once I'm done.
There are a few businesses that buy (unsorted, bulk) legos and then sell sets or sorted bulk legos.
Here's a fun one in Taipei: http://www.brickfinder.net/2017/03/22/taiwan-lego-store-visi... (They also custom print on the surface of the parts; I saw an awesome Trump Lego man there complete with red hat.) I bet these people would love to talk about this machine!
There are a lot. There are two main specialized marketplaces, Bricklink and Brickowl, with hundreds of sellers (most of them operate on both sites). Most sellers also have a brick and mortar shop, others only operate online.
How do you deal with parts that are stuck together? I actually noticed one in your demo video, and was curious. This seems like it would be very difficult to classify, even in a sense to sort them into a "take these apart" bin.
They have a category all by themselves, get taken apart after the first run and then simply made to go through again in the next batch. The neural net is surprisingly good at classifying 'mess' as a category!
That's a nice solution. I'm reminded of a short video I watched on the Lego factory. One segment of it discussed the machine that put the minifigs' heads on their bodies. There's a big hopper of bodies that get drawn up onto a belt and then a camera makes sure each body is facing the right direction before putting the head on.
What do they do with bodies that are facing backwards? Is there a little side channel that flips them around? Nope, they just get tossed back into the hopper to try again. It's effectively random which way they'll be facing when they get picked up, so they'll eventually get through. I thought that was a nice illustration of keeping things simple and taking advantage of processes you already have, and seems similar in spirit to this.
That's exactly what I love about this whole project. It's an endless series of seemingly simple puzzles. Then you start solving them and they turn out to be much more complicated than you thought. Until you hit the solution and then it's simple again.
And because it's effectively a coin toss, the average number of passes through the machine is just 2!
Just a remark from a Lego nerd: it's attaching arms to bodies, not heads. The neck has a stripe on the front, so that is where the camera looks at to determine which side is facing up.
Are "mess" and "unknown" the same bin? I would expect that they get grouped together as a "human intervention" bin. It would be very surprising if you went so far as to train the neural net to recognize pieces stuck together as something different than an unrecognized piece.
What about pieces that, put together, equal another larger piece? Say, a few "flat" pieces of the same color to make a larger 1 unit tall brick? Can you see the seams on these?
No, it would miserably fail at that unless I fed a whole bunch of such composites in and tried to teach it the difference between the two. Even then I'm not sure if it would work but it doesn't happen often enough to be a problem.
Comments (211) 39 threads
1) Air is blown through the product and any dust is taken out. 2) The product is run through a bunch of screens that take out anything too big or too small. 3) The product is put through a gravity separator to separate based on mass. 4) Finally, the product is put through an optical sorter (https://www.youtube.com/watch?v=O0gWUeqzk_o) which uses blasts of air to push out unwanted materials from a stream of falling product.
I'm sure you could use the same process for Legos. Not sure about how to distinguish between branded and unbranded Legos though.
What is the %age by weight of 'trash' versus 'good stuff' for such a sorter?
I do use screens for various pre-sorting stages, not shown in the article. The sorter is only good for parts up to 40 mm and anything that isn't a wheel or round so it will roll away while being imaged.
That's by far the bulk though so for me if it does that part well it is already more than worth it.
Branded/unbranded: spectrum is different (far more different than you would say by looking at it with the naked eye), weight does not match for the part (though this can be very close with really good fakes), logo on the studs is different.
I've been thinking about doing that gravity thing, but a bit more fancy, rather than just a binary sort to shoot parts in several directions, an alternative is a spiral slide under a steep angle where parts are fed in at the top and ejected when they reach the right bin.
That's a lot more complicated to make than what I have right now mechanically and also the time available for a classification operation would be much shorter, but it would allow for a much larger number of output bins without taking up a whole lot of space. So maybe a next generation, if I still need it (this one is going through piles of lego now).
Plans to launch a Lego sorting service? ;-)
The VCs should start lining up in ...five...four...three...
:)
Continue this thread — 10 replies
Seven, so it takes multiple passes before it is done.
> Or was this more just a proof of concept thing?
Tough question :) No, it's for real it really has to sort through the 2000 kg, but if it needs to be beefed up or changed to get to the end then I'll do it. The next step 'up' would be a machine designed from scratch incorporating all the lessons learned with essentially unchanged software. There are still some limitations that could be addressed but then you'd lose the training set and you'd have to start all over from scratch. That might be worth it to get the last 1% error or so, so if this ever becomes 'real' then I'd have to do that. I highly doubt it will get to that though. time will tell.
> Plans to launch a Lego sorting service? ;-)
Not at present, though you're not the first person to think of that, parents with kids are suggesting I should make it mobile to visit people at their homes for $x / shot :) Still, that will only happen if I really have nothing better to do, which means likely never.
Continue this thread — 6 replies
I'm surprised that this strategy isn't more quicksort-ish, I was expecting a first pass into warm or cool colors, then another pass into large or small lego, etc.
As for the multiple passes, that's actually how it works, the first pass sorts into the 7 most common categories and then quickly works down from there. But the 'runoff' bin is by far the largest at the end of every run. After 3 passes the bulk has completely disappeared and most of the remains are sufficiently rare to be dumped into the right container individually. It goes pretty quickly: first pass: 7 bins, second pass: 7 bins again, but 49 if you put the first seven through again (but in larger volume accumulated from several runs on smaller lots). And so on. Since the bulk of the lego is in those first 49 and the value is in the remainder it doesn't take long to add value to a pile.
As for the mechanics, any obstruction, no matter how well intended will immediately become a point for a bridge to anchor to.
I think that people might pay for the convenience of getting a bag full of proper chickpeas with no duds and no stones (I've heard of this, but never really seen it).
Maybe some day Suraj and NuPak will go a little further with their cleaning and get rid of damaged beans and not just stones.
Though, frankly I think they could do better than average with a specific gravity/densimetric sorter; it would probably require fewer passes through the optical sorter as well.
The equipment costs money; and reduces the volume of "product" left for sale. Your problem is capitalism - the companies don't do that because it lowers their profit.
Had I seen something like the optical sorter back then, I would have thought it (Arthur C. Clarkeian) magic!
https://www.youtube.com/watch?v=YvU2KEl5_ZE
https://youtu.be/vbSww5SBqN4?t=75
https://youtu.be/zYimxuEAEtk?t=67
This isn't parallel invention - the principal of optical sorting and air ejection are well known and understood. (Which is not to lessen the achievement in building this, but building and inventing are not the same thing.)
Here's a fun one in Taipei: http://www.brickfinder.net/2017/03/22/taiwan-lego-store-visi...
(They also custom print on the surface of the parts; I saw an awesome Trump Lego man there complete with red hat.)
I bet these people would love to talk about this machine!
This is really amazing, awesome work!
Continue this thread — 5 replies
Continue this thread — 16 replies
What do they do with bodies that are facing backwards? Is there a little side channel that flips them around? Nope, they just get tossed back into the hopper to try again. It's effectively random which way they'll be facing when they get picked up, so they'll eventually get through.
I thought that was a nice illustration of keeping things simple and taking advantage of processes you already have, and seems similar in spirit to this.
Continue this thread — 1 reply
Just a remark from a Lego nerd: it's attaching arms to bodies, not heads. The neck has a stripe on the front, so that is where the camera looks at to determine which side is facing up.
Continue this thread — 2 replies
All comments shown.
Couldn't load more comments. Check your connection and try again.