Hacker News new | ask | show | jobs
by Animats 3417 days ago
Here's the commercial version.[1] This machine is sorting peas by color. Peas. Individual peas. Each individual pea is examined by cameras for size, color, and looking like a pea. Rejects are kicked into the reject hopper by an air jet. There are machines like this for most fruit. Typical throughput is a ton per hour. Most fruit and berries go through such machines today. That's why the fruit at the supermarket is so consistent.

The process looks like magic. Color-mixed items go in, and single-color items come out, on a line going so fast that no human can see what's happening. It's amazing to see computer vision systems that fast.

These machines work by putting the items on a conveyor belt, then dropping them on a much faster conveyor to spread them out. The fast conveyor goes past cameras, and at the end, launches the items into free flight for a few inches. While in flight, computer-controlled air jets knock out the rejects.

[1] https://www.youtube.com/watch?v=JyGR6A5MWG0

11 comments

A friend of mine works for a consulting company specializing in optics. They invented a machine for one client which sorts wheat grains. The machine does spectrography of each individual grain, looking for moulds and fungi as well as heavy metals and more. It's a big rotating drum with small chambers for each grain. After doing the spectrography it shoots each grain off into either the selected or rejected direction.

But it doesn't just reject every bad seed, instead it will optimize to keep within legally accepted limits.

> But it doesn't just reject every bad seed, instead it will optimize to keep within legally accepted limits.

This is just... I guess the emotion you feel when reading the last paragraph defines you as either technical guy (outrage / resignation, depending on your age and experience) or managerial guy (pure delight).

I am guessing there is a switch that makes it sort properly, you know, for VIP?

In all fairness, wasting food needlessly can have important environmental impact issues, and if the legal limits are well calibrated, getting the "allowed" dose of fungus might be a good thing from an immunological perspective. Heavy metals not so much...
Arguably, separating out grains, etc., that would be actually unsafe to eat is not really wasting food. Throwing out food that is perfectly edible is wasteful.
In the 1970s, the USA sold a large amount of wheat to the USSR in a famous deal.

The contract stipulated that the wheat would contain something like <1% sand. US wheat at the time had effectively no sand at all, so they mixed in 1% of pure sand, staying just within the contract terms.

(I heard this from a friend whose friend knew something about it; in searching I can’t find a source online, so the story might be apocryphal. I also might be off on the precise percentage.)

Grain elevator contracts contain an allowed foreign material allowance. Farmer's bringing in their grain get docked for any foreign material. Then the elevators add foreign material to the grain as train cars are loaded. It's crazy but that's just how the industry has always worked.
Do you have a source for this? What kind of material do they add?
Sounds illegal - https://www.gipsa.usda.gov/fgis/grainhandling.aspx

Except -

"Recombine or add broken corn and broken kernels to whole grain of the same kind, provided, that no dockage or foreign material, including dust, has been added to the broken corn or broken kernels;"

There's also the 'story' of the Japanese firm who included 10 broken 'X's' with the delivery of X, since the contract stated 10 broken X's per 10000.

I think you'll find neither story is true.

Like most Urban Legends it's a bit silly, people are people whatever the culture. They have common sense.

In the Google SRE book they say that if a service has reliability much better than the stated SLO they artificially introduce errors to get closer to the error budget.

This is to prevent over-reliance on the measured SLO rather than the stated SLO in upstream services.

This sounds very very odd?

Why ride the line? It'd take one major issue then you're way over you error budget?

For testing/simulations I can see why you'd introduce the errors.

Usually they include 10 Xs more for the broken ones.
That doesn't sound like a very nice thing to do. I wonder if capitalism is to blame, as I would certainly blame capitalism, or good old fashioned egotistical rivalry that I'm told was common in many areas of life then between the USSR and the US.

I'd say that feeding humans or even livestock is more important than profits. Or at least, it ought to be.

Unfortunately for some profit is still more important than human health or the environment [0]

"Trafigura, Vitol and BP exporting dirty diesel to Africa, says Swiss NGO

"Traders blend cheap fuel with sulphur levels many times the European limit for sale in African countries, says Public Eye"

[0] https://www.theguardian.com/world/2016/sep/15/trafigura-vito...

Or classical capitalism, because 99 ton of wheat plus one ton of sand is one ton of wheat cheaper than 100 tons of wheat. Sand is heavy and cheap.
I just happen to have bought some sand recently, and it isn't that cheap. Especially not the type of sand that you'd feel comfortable mixing into food.

Where I am, a ton of sand aggregate using in construction is ~$100 per ton. The better sand used in gardens, the brown sand (it's used to repel water so you don't over-water crops) is more than than.

Considering the wheat/ton spot price is $160 per ton at the moment, I don't think the actual prices would be too different.

[0] http://www.indexmundi.com/commodities/?commodity=wheat&month...

Perhaps it's 1% by volume instead of by weight.
A good compromise would have been to put a small bag of sand in the bottom of the container.
Though we'd want that to be okay. The Russians might then reject saying you sent us 999 kgs of wheat and 1 kg of sand.

Also, diplomatically, this might be more difficult to defend. Although allowing this would've been in the best interest of both nations. Cue the human condition :)

Speaking of legally accepted limits, a college friend told me of his first engineering job as a chemical engineer where the factory refined sugar and graded it based on impurities sold at different prices. Sometimes a batch turned out too good so his manager would insist on pouring an amount of sand into the mix to make sure it would meet the agreed upon impurity target.
Well, kind of both. As an engineer I applaud the fact that it optimizes for maximum usage while remaining in-spec. I'd still hope they preferentially discard the really nasty stuff. A few slightly discoloured grains per kg is much better than an entire dead mouse every 100kg.
You'd be surprised how disgustingly high the legal limits are for food to be considered defective in the US, though.

http://www.fda.gov/Food/GuidanceRegulation/GuidanceDocuments...

I have relatives in Australia who worked for the sugar industry.

Turns out that unrefined sugar is kept in gigantic open barns, and moved around with bulldozers --- not a clean process. Of course, birds and animals get in, and frequently die there, and then the sugar does... sugar things... to them.

As a result there is apparently a legal limit as to the maximum permissible number of crystallised parrots per tonne in Australian sugar.

It seems far more reasonable to me that increasing the true positive rate (bad grains rejected) will also increase the false positive rate (good grains rejected), so it's not the value of the bad grains included (which is almost certainly very small) but instead the value of the good grains which would accidentally be destroyed.
According to my friend, no; it could definitely do a "better" job to select the best grain. But obviously no one is interested in rejecting grain that could be legally sold.

Further, I'm guessing that there will always be some trace amounts of heavy metals, poisons and such in any grains so it's necessarily about setting a limit and optimizing the mix for the largest clean yield (in itself an interesting problem since the regulations are not for each grain but instead for all of the grain taken together).

There's a similar issue, IMO, with new home construction. There's a minimum legal quality limit for having a home be sellable, and anything past that basically doesn't get done. It's made worse by the home evaluation metrics - square footage, bathrooms/bedrooms, and location are most of what matters for getting a mortgage (and thus for bidding on and pricing a house).

Like, if you look closely at a 100 year old house, you'll find details like "the awnings over the window are just long enough to shade the window in the summer and short enough to get sun in the winter" that basically don't make it into modern homes.

I don't really think this has to do with legal limits; you could probably sell a hut as a "house" in most places if you wanted to, as long as it was compliant with the building codes. The problem isn't that the government won't let you call it that, the problem is that nobody will buy just a hut, they want an actual house.

While it may or may not be the case that 'house quality' has declined over the decades, that's driven by economic factors: do house buyers want to pay 1.2x or whatever for those extra details? I would conjecture that home developers are not stupid, and that they have tried adding those (presumably expensive) details, and found that they were unable to recoup those costs in an increased price.

My house has a number of details that would never be put in a spec house, because only someone like me would be willing to pay for them. I expect when this house is sold, it will garner a 0% premium for those features.

For example, it has GFCI breakers for all circuits, not just the bathroom ones. For another, it has a stainless steel sill plate (which keeps wood boring insects from coming up through cracks in the foundation).

A list of which would make for an interest design book.
that seems implausible to me, for two major reasons:

1. you're suggesting that the machine has a zero percent false positive rate, which I believe given the circumstances is physically impossible. for this type of machine, there must necessarily be some increasing function relating false positive to true positive rate. perhaps doubling true positives from (making up some numbers) 0.0001% to 0.0002% only wastes 0.01% of the available grain, but either way, I refuse to believe that increasing the true positive rate is truly "free".

2. you're effectively stating that the grain processors take out most of the bad grain, then dump it back in. given that the allowable percentages of "bad material" are (as far as I know) quite low, I don't really see why they would bother reducing the amount thrown away from, say, 0.0001% to 0.00008% to save that tiny amount of money.

The legal limits probably don't specify rejection criteria on a per-grain basis - they probably say something like "No more than x.x% trace of fungus Y in a given batch", so being able to calibrate on the fly is pretty important.
I know, it's horrible, right?! But also perfectly obvious.

I haven't seen the machine but I envision a panel of knobs you can turn to adjust the acceptable levels of mercury, ergot fungus, mildew... ;-)

I think it probably has to be your first gig as a technical guy to not feel resignation. I mean, "good" grains and "bad" grains? They don't come labeled. It's a noisy, messy spectrum.
So if someone reacts with delight to that last paragraph, then they must lack technical knowledge? This seems inaccurate.
You seem to have missed the point of the remark. It isn't about technical knowledge, it is about differing priorities.
I apologize in advance for my ignorance. Why are the different kinds of wheat grains mixed in the first place?
Because a field of wheat isn't uniform. The goal is to make all the wheat perfect, but nature foils that by spoiling some of the wheat with mold/fungi; other parts of the field may grow over soil that has a higher heavy metal content. As truckloads of this non-uniform wheat are processed, the machinery sorts the grains to get a mostly uniform end product, rejecting grains that fall outside of an acceptable threshold.
I took a tour of a company where they build machines like this last year, it's amazing. One guy was telling about a customer who bought several machines from them, then buys rejected products from big manufacturers who have less sensitive machines, and find the good product out of those rejects and sells that again. Almost literally finding needles in haystacks, and making money from it (and reducing food waste). (not sure if the guy was supposed to talk about this, so keeping it vague on what the product was)
I worked on a cranberry farm one summer where they used a cranberry grader to sort remove the fruit from the vines and separate the good from the bad. It is basically a bunch of boards at a slight angle so that any damaged or very small cranberries would bounce out, away from the good cranberries. Next the fruit rolls down a large comb like board where it is sorted by size. It is generally sold at that point and Ocean Spray would sort it by color depending on the final product. It was amazing how well such a simple and easy to repair machine worked
That's incredibly fast. The precision timing to actuate the puff of air from above is super impressive, a bit too long or too short or mistimed and a whole pile of good stuff gets rejected or bad stuff ends up in the product. Amazing video, thank you for posting that.
Another one for grape sorting: https://www.youtube.com/watch?v=AamACDnwRts

You feed the whole grape clusters, machine remove each individual berry from stem and then rejects all the unripe/damaged berries and little debris. All in speed of many tons per hour.

All of those are incredible machines, I wish I can buy it for my winery, but even small machines costs something like mid sized house.

The fact that the air jet can target individual bad peas out of that torrent is incredible. Computationally, probably not that difficult, but the timing required must be ridiculous.
Long ago I visited a company that made agricultural sorting equipment. They were trying to develop a new machine for sorting ears of corn. Among the requirements, the machine had to be capable of rejecting a dead rat.

My partners and I were bidding to design the machine... we didn't get the job.

So live rats are OK? :O
https://www.youtube.com/watch?v=Lz88nsWL4kw there's also similar sorting machines for larger items (tomatoes in this case) that use mechanical paddles instead of air bursts to shoot down unwanted items.

Speaking of air bursts, here's an example of the sort of valve that gets used to actuate (with precise timing constraints) the air burst:

http://www.matrixairvalves.com/sorting-manifolds.php

I just fell into a serious rabbit hole watching every video I could find on this. The speed and accuracy of these things is wild, thanks for sharing it.
This one is cool also (conveyor belt that can do all sorts of fun stuff): https://www.youtube.com/watch?list=PLKfWL8IXgKBte4TfD53pLaHO...
There is a technology similar to this for sorting cells based on biological properties and fluorescent markers called Flow Cytometry. The machines typically allow "user defined" gates and schemes through interactive software.