Sagitto uses machine vision to measure colour
Food

Just Peanuts?

March 8, 2025
  •  
3 minute read
George Hill
Sagitto Ltd

This blog post looks at how NIR spectroscopy can help peanut breeders and manufacturers of peanut products. We focus on what NIR can tell us about the composition of peanut kernels and peanut butter; and as an example we use NIR to measure sucrose added to peanut butter.

About Peanuts

Peanuts (Arachis hypogaea L.), or groundnuts, are legumes - part of the pea family along with lentils, beans and chickpeas. Major producers of peanuts include China, India, Nigeria, USA, Burma, Senegal and Argentina1.

Fat makes up about 50% of the nutrients in peanuts, followed by protein (26%), carbohydrates 16% (5% sucrose and 11% other carbohydrates), and dietary fibre (9%).2 Measuring the fat composition of peanuts is important for manufacturers of peanut oil and peanut butter because it has a significant impact on both yield and quality of the finished product. Peanut varieties with high proportions of oleic acid (>80%) are especially important to peanut butter producers, since they have nearly twice the shelf life of peanuts with regular (50%) oleic acid content3.

Measuring the natural sugar content of peanuts is also important, since variations in sugar content will have an effect on the colour and taste of roasted peanuts and peanut butter. Roasting times and temperatures that are optimum for high-sugar peanuts might need to be altered for low-sugar peanuts.

Measuring Individual Peanut Kernels

Portable NIR spectroscopy can accurately measure the quality traits of individual peanut kernels

Plant breeders need to be able to evaluate thousands of plants quickly and efficiently, to ensure that they select the best candidates for their breeding programmes. They are often faced with having to take measurements from very small - and precious - sample quantities, perhaps just from one single plant. As a non-destructive technique, NIR analysis is very well suited to this process of high-throughput phenotyping. Better still, portable NIR instruments allow for rapid measurements of individual4 peanut kernels in the field or at the processing plant, without having to transport samples to a laboratory. Research5 has shown that portable NIR can be just as accurate as benchtop NIR in distinguishing between high oleic and regular oleic acid varieties, so it is well suited to checking peanuts at all stages - from harvest to roasting.

Craft vs Kraft

Like many New Zealanders, I grew up at time when peanut butter was always smooth and never crunchy, with oil that never separated thanks to the aid of emulsifiers, and with the sweet taste of added sugar. A pleasant and very predictable product, and a style typified by brands such as Kraft (Canada) or JIF and Skippy (USA). However since the launch of Pic's peanut butter in 2007 by Bruce 'Pic' Picot, New Zealand has experienced a boom in 'craft' peanut butter brands. All these makers of 'craft' peanut butter eschew emulsifiers and added sugar, and celebrate the unique flavours and textures of their products6.

Mapping with Linear Discriminant Analysis

We decided to explore 17 peanut butters sourced within New Zealand, using NIR spectroscopy to find out as much as we could without the aid of laboratory reference data or access to varietal information.

One technique that we often use in cases like this is to apply linear discriminant analysis to the spectra. The results of applying LDA to 16 of the 17 peanut butter brands that we surveyed are shown here.

(We should stress that the LDA plot simply measures differences in NIR spectra, which can be due to a wide range of factors. We are not making any judgement about the quality of the peanut butters that we have surveyed.)

2-D LDA plot of 16 peanut butter brands
2-D LDA plot of 16 peanut butter brands

As expected, the five brands with emulsifiers and added sugar were very different from the 'craft' peanut butters. One of these five - Lily's brand from the Philippines - has so much added sugar that we have excluded it from this LDA plot. JIF and Skippy are very similar and clustered to the far left. Woolworths Essential (made in China with added emulsifiers and a stated 8.9% of sugars) is next from the left, with Australia's Bega brand mid way towards the 'craft' peanut butters. Bega's label says that it has 3.1 gm/100gm of added sugar.

Pams - a New Zealand supermarket brand - has two versions : Pams, and Pams Deluxe. The latter's label says that it is made from hi-oleic acid peanuts. We are told that Pams Deluxe is made under contract by one of the 'craft' manufacturers, and we note that it is clustered with the 'craft' peanut butters. The Pams peanut butter doesn't state what type of peanut is used in its manufacture so it might be made from regular oleic acid peanuts. Since it is made in India it might also be made from a different variety to the Argentinian Runner variety used by most of the New Zealand 'craft' brands. Two other brands stand out: Ceres and Chantal. Both heavily promote their organic credentials, and this could be the reason they were separated in the LDA plot.

Drought Stress

Peanuts are a natural product, and therefore subject to the vagaries of nature. We can see an indication of this if we focus on one particular brand of 'craft' peanut butter, Fix and Fogg, and look at the variation between some of its batches over time. Batch 295 (and to a lesser extent 296) is quite different from the later batches. One plausible explanation put forward by the company is that batch 295 was one of the last to use Argentinian peanuts from the 2022/23 harvest. As reported7 in The Rio Times "In the past two seasons, droughts severely impacted Córdoba, Argentina’s main peanut-producing region. The 2022/23 harvest suffered significantly." It is not unreasonable to assume that drought stress has an impact on the roasting properties of peanuts, and that this might in turn be reflected in subtle differences in the NIR spectra.

2-D LDA plot of eight batches of the same brand of peanut butter
2-D LDA plot of eight batches of the same brand of peanut butter

One Lump Or Two?

If we take a look at the NIR spectra for peanut butters that have emulsifiers and sucrose added, we don't need any fancy mathematics to see that these alter the NIR absorbance spectrum.

NIR spectra of peanut butters that have added sucrose
NIR spectra of peanut butters that have added sucrose, compared to the mean of those that don't

The Lily's Classic peanut butter has an exceptionally high sucrose content compared to all the other brands that we surveyed. This reflects local taste in the Philippines, where the brand is very popular. Out of curiosity we thought we'd see if we could estimate the percentage of added sugar in Lily's Classic, by creating an artificial training set. We mixed 25 portions of smooth 'craft' peanut butter with increasing proportions of powdered sucrose. We hoped that this would allow us to create a predictive model that would approximately measure the percentage of added sucrose in our five 'classic' peanut butters.

As we expected, it was easy to produce a regression model to predict the proportion of sugar in our training8 dataset. When we scanned the Lily's Classic peanut butter and ran it against this model, we found that it had the equivalent of almost 20% added sucrose.

Lilys Classic peanut butter measured with miniature NIR spectrometer and Sagitto machine learning model
Lily's Classic peanut butter measured with miniature NIR spectrometer and Sagitto machine learning model

Results for the other four 'classic' peanut butters were consistent with their labelling

Conclusion

In this blog post we have focused on what NIR can tell us about the composition of peanut kernels and peanut butter. Since we have not had laboratory reference data or a range of peanut varieties to work with, we have had to tease out information from linear discriminant analysis, and use an experiment to measure sucrose added to peanut butter. Writing about peanuts from a country where peanuts are not grown feels rather like being a medieval cartographer creating a Mappa Mundi. Nevertheless we hope that this blog post demonstrates the enormous potential for NIR spectroscopy to benefit all stages of peanut production, from breeding new varieties to creating delicious peanut butter.

Acknowledgements

A special acknowledgement to Dr Hongwei Yu. His extensive research into the application of NIR spectroscopy to peanuts and peanut products inspired the writing of this blogpost. An acknowledgement also to all the peanut growers and peanut butter producers who contributed the material for Sagitto to scan and then consume with pleasure, especially New Zealand's wonderful 'craft' peanut butter manufacturers such as

And last but not least: a salute to the late President Jimmy Carter - so much more than just a peanut farmer.

References

  1. USDA Foreign Agricultural Service - Peanut 2024 World Production
  2. Novel spectroscopic approaches for the characterisation of quality- and identity-related key features of peanuts and peanut butters Yu, Hongwei, 10 Jun 2022, Wageningen: Wageningen University. 157 p.
  3. Stephen T. Talcott, Sharyn Passeretti, Christopher E. Duncan, Daniel W. Gorbet, Polyphenolic content and sensory properties of normal and high oleic acid peanuts, Food Chemistry, Volume 90, Issue 3, 2005, Pages 379-388, ISSN 0308-8146
  4. Hongwei Yu, Hongzhi Liu, Sara W. Erasmus, Simeng Zhao, Qiang Wang, Saskia M. van Ruth
    Rapid high-throughput determination of major components and amino acids in a single peanut kernel based on portable near-infrared spectroscopy combined with chemometrics, Industrial Crops and Products, Volume 158, 2020, 112956, ISSN 0926-6690
  5. Hongwei Yu, Hongzhi Liu, Qiang Wang, Saskia van Ruth Evaluation of portable and benchtop NIR for classification of high oleic acid peanuts and fatty acid quantitation, LWT, Volume 128, 2020, 109398, ISSN 0023-6438
  6. Though in reality most use high oleic acid Runner peanuts from Argentina
  7. Argentina’s Peanut Industry: A Global Export Leader Betting on a Bumper Crop, The Rio Times, 24 October 2024
  8. We couldn't mix more than 50% sugar with smooth peanut butter - at that stage the physics takes over, and we just get a brown powdery crumble

Subscribe to Sagitto's Blog

Get industry insights that you won't delete, straight in your inbox.
We use contact information you provide to us to contact you about our relevant content, products, and services. You may unsubscribe from these communications at any time. For information, check out our Privacy Policy.
George Hill
Sagitto Ltd
Sagitto's founder, George Hill, first started working with artificial intelligence during the 1980s, while developing 'expert systems' within Bank of America in London. On returning to New Zealand, he undertook part-time study with the University of Waikato's Machine Learning Group while working for Hill Laboratories, a well-known New Zealand commercial testing laboratory. This led to the formation of Sagitto Limited, dedicated to combining the power of artificial intelligence and machine learning with spectroscopy.

More news

Data Science

Learning From Durum Flour

Good pasta is made from durum wheat flour rather than the softer wheat varieties used in bread. However being more expensive, durum flour ('semola rimacinata') is sometimes adulterated with other wheat flour. For a bit of fun, we've created a model that has the potential to detect adulteration of durum wheat flour. And we use this to demonstrate how Sagitto evaluates calibration models.

Read Article
Machine Vision

More Than Meets The Eye

We often make decisions based on colour. For example, we know that yellow bananas are riper than green bananas and therefore we expect them to be sweeter. But what if we could also see beyond the visible spectrum? Could we make even better decisions by combining visible image data with near infrared data?

Read Article
Data Science

A Journey Of Discovery

The process of building accurate predictive models for spectroscopy instruments is often a journey of discovery, with many twists and turns. Once we have an initial model, every step of the process deserves scrutiny. Are we using the best method of sample preparation? Is our reference data accurate and reliable?

Read Article