Book a Demo
Application Note

NIR Predicting Trans-Fats in Butter and Margarine


Butter and margarine are one of the most popular fat ingredients used for culinary purposes. It is used as is or as a frying medium for several preparations. Trans-fat is naturally present in butter. Conventional methods to analyze the trans-fat are based in instrumental separation of the compounds by gas chromatography. This method is costly, time-consuming, and requires a fully equipped laboratory.

NIR has shown a good performance predicting trans-fats in butter and margarine. The objective of this article is to show the performance of NeoSpectra Scanner predicting trans- fats using transflectance accessory. NeoSpectra has added the transflectance accessory to its portfolio showing a unique capability to analyze samples in a liquid form.


The per capita consumption of butter in the United States reached 6.5 pounds per person in 2021, whereas margarine consumption in 2010 was reported at 3.6 pounds per person according to USDA data (2021). Trans Fatty Acids (TFAs) are naturally present in food from ruminants, specifically in meat and dairy products. In cow milk, butter contains trans vaccenic acid (C18:1 trans 11) at levels ranging from 2 to 4%. However, TFAs in margarine primarily originate from elaidic (C18:1 trans 9) and linolelaidic acids (9-12 trans- C18:1). The conventional method for quantifying TFAs in both butter and margarine is Gas Chromatography with Flame Ionization (GC- FID). This method involves a complex analysis process that requires hours of preparation, including derivatization to volatile FAME.

How NIR works

NIR is a secondary analytical method that relies on the datacoming from the reference laboratory (GC-FID), reference data, to build PLSregression with the spectra. Once it is calibrated, the PLS model enablespredicting fatty acid composition using only the spectra generated by the NIRspectrometer. Results can then be obtained in less than 2 minutes by theinstrument.

Experiment design

In order to demonstrate the ability of NeoSpectra Scanner to predict Trans-fat in butters and margarines following experimentation was conducted.

Sample sets:

A total of 90 butters and 20 margarines were collected from a local store in Ohio, USA. Samples were melted in a 65°C oven for 15 minutes. The water contained in the butter and margarine was separated by gravity.


Reference methods

Gas Chromatography (FID) was used to analyze the fatty acid profile from the extracted fat. Results are expressed in grams of fatty acid per 100g of sample.

Table 1: Constituent description

Calibration and validation sets

Cross-validation Venetian blinds were used to evaluate the model performance.

Measurement conditions

Setup: Diffuse reflection

● Accessory: Transflectance with 0.25 mm OPL

● Spectral range: 1350 – 2550 nm

● Scan time: of 5s

● Resolution of 16nm at λ=1,550nm

●  Spot size = 10 mm2

● Temperature: Room temperature

● Averaging: Each sample was measured 2times with NeoSpectra Scanner and averaged for the analysis.


Calibration Model Development

Partial least squares regression (PLS) models were constructed to establish the linear relationship between the spectra and composition, determined through laboratory chemical analysis. PLS is employed to reduce spectrum data, originally comprising 257 variables (wavelengths), into a limited number of latent variables (L.V.). This reduction in complexity aims to enhance the interpretability of the data.

The selection of latent variables is based on their correlation with the responses (trans-fat levels in this context), prioritizing those with high correlation and avoiding adding random noise to the model.

Data Analysis

To assess the performance of the Partial Least Squares (PLS) model, a cross-validation technique was employed. This involved calculating the prediction error (root mean square of errors for all samples) and the coefficient of determination (R2CV) between predicted contents and the reference data obtained from chemical analysis. The cross-validation technique entails dividing the data into calibration and validation sets. The calibration set is utilized for training the PLS model, while the validation set is reserved for evaluating the model's performance.

In each iteration, the validation and calibration sets are combined, and a new portion of data is designated as the validation set. The process is then repeated, involving model training and validation on the updated sets. This iterative procedure continues until each sample has been represented at least once in the validation set, thereby providing a comprehensive assessment of the PLS model's predictive capabilities.

Figure 1: Spectra of the butters and margarines collected using transflectance accessory at room temperature after removing the water.

Results and Discussion

Results from the cross-validation are shown in Figure 2.

Figure 2: Prediction versus measured trans-fats levels in butter and margarine using PLSr with NeoSpectra spectra.

In order to quantify the accuracy of the model, the following statistical characteristics are summarized in:

R2 : Determination coefficient. The closer to 1 the better.

SECV: Standard Error of Cross-Validation.

Table 2: Performance of the calibration model and the cross-validation statistic.

The findings presented in this study show that Neospectra provided an average error of cross-validation of 0.31%. Compared to the standard deviation of the population, it can be seen that the models are capable of dividing the population into more than 3 and a half regions (low, medium, medium-high, and high levels) suggesting that the NeoSpectra Scanner provides excellent results to predict trans-fats levels in butter samples. (Table 2). Figure 2 shows a good lineality between the predicted levels and the measured levels of trans-fats. Unlike other traditional and emerging technologies for butter and margarine analysis, NeoSpectra uniquely integrates a set of features, enabling cost-effective, rapid, widespread, user-friendly, and precise fat analysis on-spot and in the laboratory with minimal sample preparation.


The NeoSpectra Scanner has demonstrated excellent performance in analyzing trans-fats using the transflectance accessory in butter and margarines. Margarines were used as a 0 trans-fats to ensure that model can detected low levels. Industrial application of this technology would allow rapid screening for trans-fat content. NeoSpectra has potential for a more rapid and affordable detection of trans fatty acids in butter and margarine samples than FT-IR or GC.


This article was made possible by the contributions of The Ohio State University professor Luis Rodriguez-Saona and master student Celeste Matos. Special acknowledgment for their valuable contributions and data.

Book a Demo with the neospectra team

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

View Also

Monitoring Sugar Content in Cereal with NIR Analysis

Breakfast cereals, especially whole grain and high fiber, provide key nutrients and improve nutrition and cognitive function. NeoSpectra spectral sensors are a great potential alternative for the analysis of sugar content in cereal.

NIR Predicting Trans-Fats in Butter and Margarine

Butter and margarine are popular fats, often used as is or for frying. Traditional transfat analysis via gas chromatography is costly and time-consuming. NeoSpectra Scanner offers a quick and effective NIR method to predict trans fats.

Ready to Streamline analysis processes for your business ?

See NeoSpectra in action and learn how it can enhance your analysis workflows. Complete the form to request a demo and we’ll be glad to guide you through its unique features.

Contact us