This AI-controlled LEGO sorter is like a childhood dream of mine.

General
This AI-controlled LEGO sorter is like a childhood dream of mine.

Tired of sorting through LEGO? 25-year-old Daniel West was, too. That is, until his skill and determination created the incredible "Universal Lego Sorter," a machine built from more than 10,000 Lego bricks itself and a bunch of other mechanical parts that utilizes deep-learning AI to sort "every brick ever made" into one of 18 output buckets at a rate of one every two seconds. piece, and classifies them into one of 18 output buckets.

While this is not the first automated LEGO sorter, nor the first to use AI, West's project stands out in that the AI is trained using 3D renderings of LEGO parts. Thus, even if it has never seen the actual part, it can recognize and classify it.

Here's how it works.

First, you put in the Lego! A large amount of Legos can be put into the input bucket. The fed parts are separated by a series of belts that push rows of parts onto a "vibrating feeder." This section prevents the parts from overlapping each other and moves them steadily to the next section.

Once separated, the parts are dropped one by one into a sealed, brilliantly lit, white brick covered scanner section where the Raspberry Pi Camera Module V2 records streaming video footage of each part. This footage is processed by the Raspberry Pi 3 Model B+ into a series of images, and ultimately these images are relayed to a more powerful computer for classification.

Okay, so this process is not entirely driven by the Raspberry Pi, but it is about running a neural network on the Raspberry Pi. In a chat with PC Gamer, West admitted that using an RTX 2060 laptop was a bit much. Admitting that using an RTX 2060 laptop is a bit much, he noted that "with something like the Jetson Nano, you could run the machine completely self-contained."

The AI algorithms we are talking about are commonly used in sorting machines. It uses a convolutional neural network, which is basically a super-powerful tool for object recognition and classification. It's been trained on a 3D model of a Lego brick, so as long as the 3D model of the brick shown exists, it should be able to classify it. No problem.

Just don't feed them lint balls, chewing gum wrappers, or other trash that is common in the Lego hoard.

West goes into more detail about the process of teaching AI here.

The radio-controlled buggy motors used for the vibrating feeders were probably the hardest parts to find, West says. And it seems he had no shortage of Lego parts to use.

The project took about three years to complete, but it was not without hurdles. West recalls the "reality gap" problem associated with training the machine with synthesized, fake data, such as 3D models. He explains,

"I experimented unsuccessfully for years before I found a way to solve this problem."

He admits that at one point he was even prepared to abandon the project. But we are all very glad he didn't.

West's next plans are "sorter-related work that I can't talk about (yet)," and he is likely to return to the game development scene soon. In fact, we've written about West's game development work before in PC Gamer, if you'd like to get a better peek into the eclectic mindset we're dealing with here.

As always, keep creating.

Categories