This is an interesting story that combines AI and LEGO.
Even second-hand Lego isn’t cheap. Bulk unsorted Lego sells for roughly €10 per kilogram (about US $11/kg), boxed sets go for €40/kg, and collections of rare parts and Lego Technic pieces much more.
Consequently, there exists a cottage industry of people who buy new sets and bulk Lego and manually sort all the pieces into more valuable groupings.
The biggest challenge of course was identification.