The hardest defects in nut processing are the ones you can see but cannot distinguish — and the ones you cannot see at all. A walnut shell fragment is the same color as a walnut kernel. A stone that came in with the harvest looks like a nut to a color camera. A kernel with internal mold can be perfectly tan on the surface while carrying aflatoxin inside. These are not edge cases; they are exactly the defects that turn a sound container into an EU border rejection, a customer claim, or a recall.
A conventional color sorter is blind to all three. This article explains why, what the technologies that do solve them — AI shape/texturing and InGaAs near-infrared (NIR) vision — actually detect, and how optical sorting became a named control point for aflatoxin in the international nut trade.

Visible-light cameras read color; infrared sensors read what the object is made of.
The Three Hardest Sorting Challenges in Nuts
1. Same-color foreign material
After shelling, the residue stream is full of material that shares the kernel's color: shell fragments and pith (the woody diaphragm inside a walnut), almond and peanut hull slivers, pistachio shell chips, stems, and field-brought stones. To a visible-light (RGB) camera, a thin shell fragment over a kernel is a color match. This is the single most common failure of "cheap" nut sorting — the machine reports 99%+ purity on color and still ships shell.
The AFI standard used across international nut trade specifies foreign material under 0.1% and defective kernels under 4% for whole-kernel grades. Hitting 0.1% foreign material is impossible with color alone when the foreign material is the color of the nut.
2. Internal mold, insect damage and shrivel
Some defective kernels fail on substance, not surface: an insect bore-hole, a shriveled or twin kernel, or — worst — a kernel with internal mold growth and the mycotoxins that come with it. Surface color can be unremarkable. Aspergillus-driven aflatoxin contamination is strongly linked to insect damage (e.g. navel orangeworm in almonds), and the mold grows on kernels already opened by feeding insects, so a kernel that looks "mostly fine" can carry the problem.
3. Extraneous dense and low-density contaminants
Glass, hard plastic, metal fragments, and lighter foreign matter such as string or stick pieces enter from harvesting and processing. Some of these match the nut in color, and they are precisely the items that cause the most damaging brand and liability harm when they reach a consumer.

Shell fragments, pith and same-color stones are invisible to a color-only machine.
Why Color Sorting Cannot Solve These — and What InGaAs / NIR Does
Color sorting reads reflected visible light: red, green, blue. It answers "what shade is this object?" Same-color defects are invisible to that question by definition.
Near-infrared vision answers a different question: "what is this object made of?"
InGaAs (indium gallium arsenide) sensors image in the short-wave infrared band, where molecular bonds in the product absorb and reflect light differently. The practical consequence for nuts:
- Nut kernels are oil-rich. Shell, pith, stone, glass and most plastics are not. In the SWIR band the difference between a fatty kernel and a woody or mineral contaminant is large and unambiguous, even when both are identical to the eye. That is how InGaAs sorters achieve shell-fragment and same-color stone/glass removal that color machines cannot.
- Sub-surface and moisture differences reveal defects that have not discolored the surface — hidden mold, internal insect damage, and early-stage aflatoxin that visible cameras miss.
- NIR (near-infrared) channels are the broader family; InGaAs is the high-end sensor implementation used for "invisible" and "same-color" sorting on nuts and seeds.
This is not speculative or vendor-specific marketing — it is the established architecture of the nut-sorting category. Major sorter manufacturers document exactly these mechanisms: Bühler's MultiVision platform combines visible and infrared wavelengths plus shape detection specifically to remove same-color foreign material and mycotoxins including aflatoxin in peanuts and tree nuts. Alapros states that InGaAs "allows the separation of defects which cannot be distinguished visually … [and] shells from nut kernels." Hefei Meyer lists dedicated infrared (CI/KI) series for "nut shell and kernel separation" and removal of glass, stone and metal, and a CG series using NIR/InGaAs/UV for harmful impurities. The whole category converges on the same point: for same-color and sub-surface defects, you need infrared material sensing, not more color pixels.
How AI Adds the Shape and Texture Layer
Alongside the spectral hardware, modern sorters layer AI / machine-vision deep learning to handle defects that are neither purely color nor purely material: wrinkled skins, small insect bore-holes, shriveled and twin-lobe kernels, and the characteristic outline of a half versus a chip.
This matters for the yield/ purity balance in a specific way. A rule-based color sorter set aggressively enough to catch a pale moldy kernel will also reject good pale kernels — high purity, terrible carryover. AI classification improves the separation between the two, so you can hold a strict defect threshold without dumping saleable product. Our ValueSort imaging platform runs deep-learning classification that recognizes good and defective product on color, shape and texture together, with documented detection down to 0.03 mm disease spots, and stores the learned profiles so the same criteria hold lot to lot.
A practical honesty note for buyers: color + shape AI (what a high-end RGB sorter does) and InGaAs/NIR material sensing (what a chemical-composition sorter does) are different capability tiers. Many processors need both: AI for shape and surface defects, NIR/InGaAs for same-color shell, stone and internal mold. When you compare quotes, ask explicitly which spectral channels are on the machine, and test the defects that matter to you on your own sample. (Ask us which spectral configurations are available as standard or optional on your model.)
Optical Sorting as a Food-Safety Control Point
The strongest argument for investing in spectral and AI sorting is regulatory, and it is well documented.
The European Union sets the strictest practical bar. Under Commission Regulation (EU) 2023/915, maximum aflatoxin levels for nuts placed on the market for the final consumer are tight — for almonds, pistachios and apricot kernels, 8 µg/kg AFB1 and 10 µg/kg for the sum of B1+B2+G1+G2; for hazelnuts and Brazil nuts, 5 µg/kg AFB1 and 10 µg/kg total. Crucially, the same regulation allows a higher limit for nuts "to be subjected to sorting or other physical treatment" before reaching the consumer — a clear signal that the law treats mechanical/optical sorting as the step that brings a lot into compliance.
The California almond industry makes sorting an explicit CCP. Its Voluntary Aflatoxin Sampling Program (VASP) and industry HACCP flow chart list Mechanical / Optical / Manual Sorting as Critical Control Point #1 for aflatoxin, and require that a failed lot be "further processed with electronic, hand or other sorting means to remove damaged nuts and lower levels of aflatoxin" before it can be re-tested for an EU-bound shipment. In other words: sorting is not a quality nicety — it is the designated intervention that saves an entire container from rejection.
The mechanism is well understood because the contaminant concentrates in the defects. Because aflatoxin-bearing kernels are disproportionately the insect-damaged, moldy and discolored ones, removing a small fraction of visibly and spectrally flagged rejects pulls a much larger fraction of the total aflatoxin out of the lot. The California nut industry reports that routine electronic and hand sorting significantly reduces aflatoxin in a given lot — and InGaAs/NIR extends that removal to the contaminated kernels that have not yet discolored, the ones color sorting alone lets through.
Building the Compliance Case Into Your Line
For a nut exporter, the sorting step should be specified to produce evidence, not just output:
- A named defect list per product — black/moldy, insect, shriveled, shell, pith, stone, glass, plastic — with the target removal rate for each.
- Documented removal on your own sample, including the same-color defects that a color demo cannot show.
- A re-sort pass on the reject stream to recover good kernel — this is where a multi-grade machine (our double-deck CS-LA1200D, which separates three grades in one pass) protects yield while holding purity.
- A stable optical system that does not drift mid-shift on oily, dusty kernels, so the QA numbers you sign are the numbers you ship.
A lot that clears its color defects but still carries shell fragments and an un-discolored moldy kernel is not a compliant lot — and that is exactly the gap InGaAs/NIR and AI were built to close.
Conclusion
Same-color shell, hidden internal mold and stone/glass contaminants are the defects that actually damage a nut brand, and a color-only sorter cannot see them. The category has converged on the answer: AI for shape and surface, infrared (InGaAs/NIR) for material composition and sub-surface defects, and a re-sort pass to recover yield — which is why optical sorting is written into EU aflatoxin logic and the almond industry's HACCP as a control point, not an option.
If you are facing high shell-fragment carryover or EU rejection risk, talk to us about a multi-spectral nut sorting configuration and run your hardest defects on a free sample test: Request a nut defect-removal test.
FAQ
Can a color sorter remove shell fragments from nut kernels?
A color-only sorter generally cannot, because shell fragments share the kernel's color. Removing same-color shell is done with infrared material sensing (InGaAs/NIR), which detects the difference between an oil-rich kernel and a woody, oil-free shell fragment, often combined with AI shape recognition.
Can optical sorting reduce aflatoxin in nuts?
Yes. Aflatoxin concentrates in moldy, insect-damaged and discolored kernels, so removing those rejects lowers the lot's aflatoxin. The California almond industry treats mechanical/optical/manual sorting as a Critical Control Point for aflatoxin, and EU Regulation 2023/915 allows a higher pre-sort limit precisely because sorting is the compliance step. NIR/InGaAs additionally reaches contaminated kernels that have not yet discolored.
What is the difference between NIR and InGaAs sorting?
Near-infrared (NIR) is the broader spectral family used to read composition rather than color. InGaAs is a specific high-end sensor for the short-wave infrared band, used for the hardest "same-color" and sub-surface defects such as shell-from-kernel separation and internal mold. InGaAs is generally the higher capability tier.
What are the EU aflatoxin limits for nuts?
For nuts sold to the final consumer, EU Regulation 2023/915 sets 8 µg/kg AFB1 and 10 µg/kg total (B1+B2+G1+G2) for almonds, pistachios and apricot kernels, and 5 µg/kg AFB1 and 10 µg/kg total for hazelnuts and Brazil nuts. Higher limits apply only to nuts destined for further sorting/physical treatment. Always confirm the current limit and sampling rules with your destination market.







