National Nut Grower Fruit Growers News Vegetable Growers News Organic Grower Spudman Product Processing GPN Mag
National Nut Grower National Nut Grower

September/October 2025
Smarter screening: New imaging tech targets aflatoxin in pistachios
By Heather Morse

For pistachio growers and processors, postharvest aflatoxin contamination is a constant concern. The toxic compounds, produced by Aspergillus fungi, pose serious health risks to consumers and can also threaten global market access.

Growers and processors who export pistachios must comply with strict aflatoxin regulations; limits in the European Union, for example, are among the tightest in the world. Undetected aflatoxin contamination can result in rejected shipments, financial losses and strained market relationships.

Until now, aflatoxin testing has relied heavily on chemical analysis methods like thin-layer chromatography (TLC) or high-performance liquid chromatography (HPLC). While accurate, these techniques are destructive, time-intensive and costly. Nuts must be ground, treated with solvents and removed from the supply chain. Even when aflatoxin contamination is limited to a few nuts, processors often discard entire lots, generating significant waste.

Researchers in the U.K. have found that hyperspectral imaging (HSI) combined with advanced machine learning can detect and classify pistachio aflatoxin levels with high accuracy, all without destroying the product.

Shifting from samples to scans

Hyperspectral imaging captures information across hundreds of narrow spectral bands, well beyond the visible red, green and blue of a standard camera. Each nut has a unique chemical “fingerprint,” allowing subtle differences — such as those caused by aflatoxin — to be detected.

The research team tested several machine learning models on hyperspectral images of pistachios. Their dataset included 300 images of nuts grouped into three contamination levels: low (<8 µg/kg), medium (>160 µg/kg) and high (>300 µg/kg). By training AI algorithms on these images, the team aimed to classify nuts according to aflatoxin risk.

Among the models tested, a Residual Network (ResNet) deep learning approach performed best, achieving up to 96.7% accuracy when analyzing a single wavelength (866 nm). Other models, including k-means clustering and autoencoders, also showed promise, but the ResNet’s performance stood out.

The team also identified five key wavelengths that consistently indicated aflatoxin presence: 400, 585, 705, 866 and 1002 nm. This opens the door to developing multispectral sensors — simpler, lower-cost devices that target only the most important wavelengths instead of capturing full hyperspectral images.

Three images of pistachios in bowls shown in different wavelengths.
RGB representation of the 453.8 nm wavelength at the three different aflatoxin levels: (a) Less than 8 μg/kg, (b) greater than 160 μg/kg, and (c) greater than 300 μg/kg. Photo courtesy of Sensors journal/MDPI.

Aflatoxin detection made easier

For processors, the potential benefits are clear. Instead of grinding samples and discarding potentially marketable nuts, hyperspectral imaging could allow for non-destructive, inline scanning for aflatoxin. Nuts could be checked continuously in postharvest processing as they move along the processing line, improving accuracy and reducing waste.

This approach also allows for more frequent testing in smaller batches. A rapid scanning system could catch aflatoxin hotspots that traditional sampling might miss, protecting both product quality and market access.

Balancing costs and practicality

While the technology is promising, commercial adoption won’t happen overnight. Hyperspectral imaging systems are still relatively expensive and require powerful computers to process the large amounts of data they generate. The AI learning models also need lots of carefully labeled images to work accurately — something the research team pointed out as a current limitation.

However, narrowing detection down to just a handful of wavelengths could make practical systems more feasible. Instead of a bulky hyperspectral setup, future devices could be designed as compact multispectral cameras integrated directly onto processing lines.

This mirrors developments in other crops, where optical sorting systems already use color and near-infrared sensors to separate nuts, fruits and grains by size, shape or surface defects.

A broader context for nut safety

The pistachio study also adds to a growing body of research exploring advanced imaging in tree nuts. Previous work has applied hyperspectral imaging to detect internal damage in almonds or to separate walnut shells from kernels. As researchers continue to refine these tools, the nut industry could benefit from a range of imaging-based solutions for postharvest challenges.

At the same time, regulators and trade partners are paying closer attention to aflatoxin levels. Global demand for pistachios has surged over the past two decades, with U.S. production rising from $200 million in 2000 to more than $2.5 billion in 2018. With more pistachios entering international markets, consistent safety testing is critical for protecting consumer trust and maintaining market access.

Working toward widespread implementation

The road from university research to commercial adoption is never straightforward. More data, larger validation studies and collaboration with equipment manufacturers will be needed before hyperspectral imaging becomes standard in nut processing.

Still, the findings are encouraging. A system that delivers rapid, non-destructive and accurate aflatoxin detection could reduce waste, lower costs and strengthen food safety while helping growers and processors stay competitive.



Be sure to check out our other specialty agriculture brands

produceprocessingsm Organic Grower

75 Applewood Drive, Suite A
P.O. Box 128
Sparta, MI 49345
frontdesk@greatamericanpublish.com
616.520.2137
Get one year of National Nut Grower in both print and digital editions.

Interested in reading the print edition of National Nut Grower?

Subscribe Today »