Lego Machine Uses Machine Learning To Sort Itself Out

In our opinion, the primary evidence of a properly lived childhood is an enormous box of every conceivable Lego piece, from simple bricks to girders and gears, all with a small town’s worth of minifigs swimming through it. It takes years of birthdays and Christmases to accumulate a Lego collection best measured by the pound, but like anything worth doing, it’s worth overdoing.

But what to do with such a collection? Digging through it to find Just the Right Piece™ can be frustrating, and bringing order to the chaos with manual sorting is just so impractical. How about putting some of those bricks to work with a machine-vision Lego sorter built from Lego?

[Daniel West]’s approach is hardly new – we’ve even featured brick-built Lego sorters before – but we’re impressed by its architecture. First, the mechanical system is amazing. It uses a series of conveyors to transport bricks from a hopper, winnowing the stream down as it goes. The final step is a vibratory feeder that places one piece on a conveyor at a time. Those pass under a camera attached to a Raspberry Pi, where OpenCV does background subtraction from the video stream, applies bounding boxes to the parts, and runs the images through a convolutional neural network (CNN) that’s been trained on a database of every Lego part. Servo-controlled gates then direct the parts into one of 18 bins. See it in action in the video below.

We must admit that we’re not sure what the sorting criteria are, as some bins seem nearly as chaotic as the input mix. Still, we appreciate the fine engineering, and award extra style points for all the Lego goodness.

[via The Verge]

Thanks to [my wife] for the tip.

8 thoughts on “Lego Machine Uses Machine Learning To Sort Itself Out

  1. Another project where I’m wondering when perfect conditions for classic machine vision pattern recognition are created and a database of objects available, why a neural net has been thrown in there to slow everything down.

      1. I don’t see that analogy as particularly accurate, it’s more like, why buy $3 worth of standard plastic extrusion when it only takes $10 of filament and 12 hours to 3D print it.

    1. Can we build a robot to assemble lego? Can we split it into lots of cube sats? Can we make them find each other in orbit and then make a slow journey to Pluto to build it into a planet?

      Please say we can :)

Leave a Reply to Mark Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.