Method and system for predicting content of acrylamide in Badam based on machine learning

By using a machine learning-based approach and combining a portable colorimeter and moisture meter with an SVR model, the acrylamide content in almonds can be predicted quickly and at low cost. This solves the problems of long detection time and high cost in existing technologies and achieves high-precision real-time quality control.

CN121577478APending Publication Date: 2026-02-27ZHEJIANG FORESTRY UNIVERSITY +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511665693.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-13
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

In existing technologies, the methods for detecting acrylamide content in almonds are time-consuming, costly, and difficult to detect in real time, which cannot meet the needs of industrial production. Furthermore, there is a lack of specific model parameter optimization and complete process for almonds.

Method used

A machine learning-based approach was adopted, using a portable colorimeter and moisture meter to measure the color index and moisture content of roasted almonds. A support vector regression (SVR) prediction model was constructed using radial basis functions to predict acrylamide content, simplifying the sample pretreatment process and optimizing the model parameters.

Benefits of technology

It reduces the detection time from 4-6 hours to within 0.5 hours, reduces equipment costs by more than 80%, and achieves a prediction accuracy with a relative error of ≤10%, meeting industrial quality control requirements. It is easy to operate and can be directly integrated into the production line.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121577478A_ABST
    Figure CN121577478A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a system for predicting the content of acrylamide in almonds based on machine learning. The method comprises the following steps: firstly, pretreating an almonds sample; secondly, the color index and the moisture content of the almonds are measured; an SVR prediction model is constructed and verified; and finally predicting the content of acrylamide in the almonds. According to the method, on the basis of the high correlation between the acrylamide content and the color and moisture content in the Badam baking process, the SVR regression model is adopted, and the rapid prediction of the acrylamide content is realized through easily detected color and moisture indexes; compared with traditional GC-MS detection, the method has the advantages that the detection period is remarkably shortened, no complex instrument is needed, and the method can be used for rapid detection of almond product research and development so as to control the acrylamide content of the product.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of food processing technology, specifically to a method and system for predicting acrylamide content in almonds based on machine learning. Background Technology

[0002] Roasting almonds is a key process in imparting their nutty aroma and improving their taste, but high-temperature roasting can cause asparagine to undergo a Maillard reaction with reducing sugars, producing acrylamide (AA). The International Agency for Research on Cancer (IARC) classifies acrylamide as a Group 2A carcinogen, and long-term intake may pose health risks. Currently, the industry primarily relies on gas chromatography-mass spectrometry (GC-MS) or high-performance liquid chromatography (HPLC) for the detection of acrylamide in almonds. These methods require complex sample pretreatment (such as extraction, purification, and derivatization), have detection cycles of 4-6 hours, and involve expensive instruments and specialized operation, failing to meet the needs of enterprises for timely measurement and adjustment in production.

[0003] Existing research (see the "Color Difference, Moisture Content, and Browning Index Table of Roasted Almonds" in the specific implementation plan) shows that during the almond roasting process, acrylamide content is highly correlated with color indicators (browning index BI, brightness L*, red-green value a*, yellow-blue value b*) and moisture content: as the roasting temperature increases (110-150℃) and the roasting time prolongs (10-30 min), BI significantly increases (20.97-61.72), moisture content decreases (4.06%-2.06%), and acrylamide content rises from undetectable to 2832.25 μg / kg. The Pearson correlation coefficient r > 0.85. Furthermore, the determination of color and moisture content has the advantages of being "rapid, simple, and low-cost"—it can be completed using a portable colorimeter and moisture meter, without the need for professional pretreatment.

[0004] While some studies have mentioned the correlation between color and moisture content on acrylamide, a standardized prediction method has not yet been developed. This is because there is a lack of specific model parameter optimization for almonds, and the complete process from sample pretreatment to model validation is not clearly defined, making direct application to industrial production difficult. Therefore, developing an acrylamide prediction method and system based on easily measurable indicators has become an urgent need for the almond processing industry. Summary of the Invention

[0005] To address the problems of existing acrylamide detection methods being "time-consuming, costly, and difficult to detect in real time," this invention provides a machine learning-based method and system for predicting acrylamide content in almonds.

[0006] In a first aspect, the present invention provides a method for predicting acrylamide content in almonds based on machine learning, comprising the following steps:

[0007] Sample pretreatment: the baked almond was pretreated and sealed for standby use;

[0008] Color index determination: the color index of the pretreated almond powder was determined using a color difference meter;

[0009] Moisture content determination: the almond powder was placed in a weighing bottle and heated to constant weight, and the moisture content was calculated by the weight difference;

[0010] Prediction model construction: samples under different baking parameters were collected, the color index, moisture content and real acrylamide content of each group of samples were determined, the color index and moisture content were used as input features, and the real acrylamide content was used as output variable, the training set and test set were divided in proportion, the SVR prediction model was constructed by using radial basis function, and the model parameters were optimized to predict the acrylamide content of almond;

[0011] Acrylamide content prediction: the color index and moisture content of the almond sample to be predicted were input into the constructed SVR prediction model, and the acrylamide prediction content was output.

[0012] In a second aspect, the present application provides an almond acrylamide content prediction system based on machine learning, comprising:

[0013] Sample pretreatment module: used for pretreating the baked almond and sealing it for standby use;

[0014] Color index determination module: used for determining the color index of the pretreated almond powder using a color difference meter;

[0015] Moisture content determination module: used for placing the almond powder in a weighing bottle, heating to constant weight, and calculating the moisture content by the weight difference;

[0016] Prediction model construction module: used for collecting samples under different baking parameters, determining the color index, moisture content and real acrylamide content of each group of samples, using the color index and moisture content as input features, and the real acrylamide content as output variable, dividing the training set and test set in proportion, constructing the SVR prediction model by using radial basis function, and predicting the acrylamide content of almond by optimizing the model parameters;

[0017] Acrylamide content prediction module: used for inputting the color index and moisture content of the almond sample to be predicted into the constructed SVR prediction model, and outputting the acrylamide prediction content.

[0018] The beneficial effects of the present application are:

[0019] First, the detection efficiency is improved: from 4-6h of traditional GC-MS to 0.5h (including sample pretreatment and index determination), which can realize real-time feedback of the rationality of the baking process;

[0020] Second, cost reduction: without expensive instruments such as GC-MS, portable colorimeter and oven can meet the needs, equipment investment is reduced by more than 80%;

[0021] Third, high prediction accuracy: SVR model R 2 =0.96, RMSE=195.7688 μg / kg, relative error ≤10%, which meets the industry quality control requirements;

[0022] Fourth, easy to land: standardization of steps, no need for professional testers, can be directly integrated into the quality monitoring link of pistachio baking production line. BRIEF DESCRIPTION OF DRAWINGS

[0023] Figure 1 The color chart of pistachio under different baking temperatures and times provided by the embodiment of the present application;

[0024] Figure 2 The SVR prediction model performance chart of acrylamide (AA) provided by the embodiment of the present application. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application will be further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not to limit the present application.

[0026] In view of the above problems, the present application provides a method for predicting the content of acrylamide in pistachio based on machine learning, which realizes rapid prediction through "easy-to-measure indicators + intelligent model", that is, taking the color and luster indicators (L*, a*, b*, BI) and moisture content of pistachio after baking as input characteristics, based on the high correlation between the two and acrylamide, an SVR (Support Vector Regression) prediction model is constructed. The model performs better than PLS-R (Partial Least Squares Regression) in a small sample scenario, and can achieve high-precision prediction through parameter optimization, which specifically includes the following method steps:

[0027] Step S1: sample pretreatment

[0028] In one embodiment, the baked pistachio is selected, the seed coat is removed, crushed and passed through an 80-mesh sieve, the powder under the sieve is dried in a hot air drying oven at 85℃ for 4h, and then cooled to room temperature and sealed for standby. Through pretreatment, the uniformity of the sample is ensured, and the interference of particle size and residual moisture on the index determination is avoided.

[0029] Step S2: color and luster index determination

[0030] In one embodiment, the L* (brightness), a* (red-green value), b* (yellow-blue value) of the almond powder in step S1 are determined by using the portable color difference meter standardization method, and the browning index BI is calculated according to the formula to ensure the accuracy of the input characteristics, and the BI calculation formula is:

[0031] BI = 100(x-0.31) / 0.17

[0032] wherein x = (a*+1.75L*) / (5.645L*+a*-3.012b*).

[0033] Step S3: Moisture content determination

[0034] In one embodiment, the almond powder dried in step S1 is placed in a weighing bottle and heated to constant weight in a 105°C oven by using the 105°C constant weight method, and the moisture content is calculated according to the weight difference.

[0035] Step S4: Construction of SVR prediction model

[0036] In one embodiment, almond samples under different baking parameters (temperature 110-150°C, time 10-30 min) are collected, such as 15 groups of samples prepared according to the baking parameters (110°C / 130°C / 150°C, 10 min / 15 min / 20 min / 25 min / 30 min), with 3 parallel samples in each group. The L*, a*, b*, BI, moisture content and acrylamide true content (determined by GC-MS method) of each group of samples are determined, the L*, a*, b*, BI and moisture content are used as input characteristics, and the acrylamide content is used as output variable. The training set and test set are divided in a ratio of 7:3. Radial basis function (RBF) is used as kernel function, and model parameters c (penalty coefficient) and g (kernel function parameter) are optimized by 5-fold cross-validation to construct the SVR prediction model, realizing the mapping of "input easily measurable index → output acrylamide content".

[0037] In one embodiment, the determination of the true content of acrylamide uses the GC-MS method, and the chromatographic column is a polar capillary column (30 m x 0.25 mm x 0.25 μm), with a temperature program of initial 70°C for 2 min, increasing to 220°C at 7°C / min and maintaining for 2 min, with high-purity helium as carrier gas at a flow rate of 0.8 mL / min; the mass spectrometry uses electron ionization mode (70 eV) to monitor ions m / z 72 (acrylamide) and m / z 75 (deuterated internal standard).

[0038] In one embodiment, the SVR model parameters are optimized by dividing the data set (a total of 45 samples: 3 temperatures x 5 times x 3 parallel samples) into 5 groups of 9 samples each by "random sampling without replacement"; each time 4 groups are used as the training set (36 samples) and 1 group is used as the validation set (9 samples), and the cycle is repeated 5 times to ensure that each sample participates in the validation. The minimum mean square error (MSE) of the training set is used as the objective function, and the corresponding MSE is calculated by traversing all c-g combinations; finally, the parameter combination that minimizes the average MSE of the 5 cross-validation is selected, and the optimal parameters corresponding to acrylamide in this application are obtained: c = 32, g = 1, CVmse = 0.0078361.

[0039] In one embodiment, MATLAB R2023a software is used for model construction, and SVR model data is used. The input features, output variables, training set, test set, radial basis function (RBF), 5-fold cross-validation optimized model parameters c (penalty coefficient) and g (kernel function parameter) in step S4 are run in R code form and output the model results.

[0040] Step S6: Acrylamide content prediction

[0041] In one embodiment, 10-15 groups of baked almond samples are randomly selected, and the L*, a*, b*, BI, and moisture content of the almond sample to be predicted are input into the SVR prediction model constructed in step S4. Z-score standardization is used to eliminate dimensional differences, ensuring that the contribution weights of each feature to the model are consistent. Then, the 5-dimensional standardized input features are mapped to a high-dimensional feature space through the RBF kernel function. In the high-dimensional feature space, the optimal hyperplane is found by solving the convex quadratic programming problem, which maximizes the "gap" of all samples to the hyperplane. Finally, the acrylamide AA content prediction value is obtained.

[0042] Further, the obtained acrylamide AA content prediction value is compared with the acrylamide content determined by GC-MS method to verify the model, and the relative error between the predicted value and the true value is calculated. When the relative error is ≤10%, the model verification is qualified.

[0043] To clearly illustrate the present application, the following will be described in detail in conjunction with specific embodiments:

[0044] Example 1

[0045] 1. Experimental materials and instruments

[0046] Samples: Almond (Zhejiang Lin'an, moisture content 4.52%) was selected, and 15 groups of samples were prepared according to the baking parameters (110℃ / 130℃ / 150℃, 10min / 15min / 20min / 25min / 30min), and each group had 3 parallel samples;

[0047] Instrument: NH310 portable color difference meter (Shenzhen Sen Times), FA1004B electronic balance (Shanghai Precision Instruments), HWS-24 electric heating constant temperature water bath (Shanghai Yiheng), DLN36 commercial electric oven (Kaiping Pigeon Hengchang), Shimadzu 2010SE GC-MS (for determining the true value of acrylamide).

[0048] 2. Forecasting method implementation steps

[0049] (1) Sample pretreatment: remove the seed coat of each group of almonds, pass through an 80-mesh sieve, take 20 g of the sieved powder, and dry in a hot air oven at 85°C for 4 h. After cooling to room temperature, seal;

[0050] (2) Color index determination: spread the almond powder evenly on a transparent plate, and use the colorimeter to measure L*, a*, and b*. Measure each sample 5 times and take the average value. Calculate BI according to the formula:

[0051] Example: For the 150°C / 30min sample, L* = 56.47, a* = 11.05, b* = 21.42, x = (11.05 + 1.75 x 56.47) / (5.645 x 56.47 + 11.05 - 3.012 x 21.42) = 109.87 / 297.52 ≈ 0.369, BI = 100 x (0.369 - 0.31) / 0.17 ≈ 34.71;

[0052] As Figure 1 shown, the brightness of the roasted almonds decreases to varying degrees. The higher the roasting temperature and the longer the roasting time, the more obvious the decrease in brightness. This indicates that the Maillard reaction and caramelization produce colored compounds, causing the almonds to darken during roasting.

[0053] (3) Moisture content determination: weigh 2.0 g of the dried powder into a constant weight weighing bottle (mass m1), heat in a 105°C oven until constant weight (mass m2), and the moisture content = (m1 + m sample - m2) / m sample x 100%; Example: The moisture content of the 150°C / 30min sample is 2.06%;

[0054] (4) SVR model construction:

[0055] Data collection: 3 groups of samples with a total of 15 data points, L*, a*, b*, BI, moisture content, and the true value of acrylamide (GC-MS method) were determined for each group. Some data are shown in the table below:

[0056] Color difference, moisture content, and browning index table of roasted almonds

[0057]

[0058]

[0059] Model training: The training set (13 data points) and the test set (5 data points) were divided according to 7:3, the RBF kernel function was used, and the parameters were optimized by 5-fold cross-validation: c = 15, g = 0.2;

[0060] Model performance: The training set R 2 = 0.97, RMSE = 168 pg / kg, and the test set R 2 = 0.96, RMSE = 195.7688 pg / kg;

[0061] (5) Acrylamide prediction: Taking the almond sample baked at 150℃ / 25min, the L* = 59.15, a* = 10.70, b* = 23.00, BI = 61.72, and the moisture content = 2.07% were determined, and the SVR model was input to output the predicted value = 2610.1 pg / kg; the true value measured by GC-MS was = 2738.2 pg / kg, the relative error = 4.7% < 10%, and the model prediction was qualified.

[0062] Specifically, as shown in Figure 2 , the embodiments of the present application aim to verify the prediction accuracy of the SVR model for acrylamide concentration. Each scatter point in the figure represents a sample, and the coordinates (X, Y) of the sample are the measured AA concentration and the model predicted AA concentration of the sample. The distribution trend of the scatter points is used to intuitively show the consistency of the predicted value and the measured value.

[0063] Ideally, if the prediction is completely accurate, all scatter points should fall on a diagonal line (Y = X line). The scatter points in the figure are closely distributed around the diagonal line, indicating that the model prediction is highly consistent with the actual measured value. The correlation coefficient R = 0.9603, which indicates that there is a high positive correlation between the measured value and the predicted value, close to 1, indicating that the SVR model can accurately capture the trend of acrylamide concentration. The root mean square error RMSE = 195.7688 ng / kg, which represents the average error size of the model prediction, with the unit of ng / kg. The low RMSE value further proves that the model prediction accuracy is high, and the error is within an acceptable range. The figure proves the effectiveness and reliability of the SVR model in acrylamide concentration prediction.

[0064] Example Two

[0065] In the embodiments of the present application, Australian almonds (moisture content 4.38%) were selected, 15 groups of samples were prepared according to the baking parameters (110℃ / 130℃ / 150℃, 10min / 15min / 20min / 25min / 30min), each group had 3 parallel samples, and the steps of Example One were repeated, and the results were as follows:

[0066] SVR model parameters: c = 15, g = 0.2, test set R 2 = 0.96, RMSE = 195.7688 μg / kg;

[0067] Acrylamide prediction: Take the almond sample baked at 150°C / 30min, determine its L* = 56.47, a* = 11.05, b* = 21.42, BI = 61.25, moisture content = 2.06%, input the SVR model, output the predicted value = 2597.8 μg / kg; use GC-MS to determine the true value = 2832.3 μg / kg, relative error = 8.3%≤10%, the model prediction is qualified.

[0068] Example Three

[0069] In the examples of the present application, Australian almonds (moisture content 4.38%) were selected, 15 groups of samples were prepared according to the baking parameters (110°C / 130°C / 150°C, 10min / 15min / 20min / 25min / 30min), each group had 3 parallel samples, the steps of Example One were repeated, and the results were as follows:

[0070] SVR model parameters: c = 15, g = 0.2, test set R 2 = 0.96, RMSE = 195.7688 μg / kg;

[0071] Acrylamide prediction: Take the almond sample baked at 130°C / 30min, determine its L* = 66.19, a* = 7.29, b* = 22.76, BI = 49.52, moisture content = 2.49%, input the SVR model, output the predicted value = 1524.3 μg / kg; use GC-MS to determine the true value = 1637.1 μg / kg, relative error = 6.9%≤10%, the model prediction is qualified.

[0072] Example Four

[0073] In the examples of the present application, Australian almonds (moisture content 4.38%) were selected, 15 groups of samples were prepared according to the baking parameters (110°C / 130°C / 150°C, 10min / 15min / 20min / 25min / 30min), each group had 3 parallel samples, the steps of Example One were repeated, and the results were as follows:

[0074] SVR model parameters: c = 15, g = 0.2, test set R 2 = 0.96, RMSE = 195.7688 μg / kg;

[0075] Aldehyde prediction: take the almond sample baked at 130℃ / 20min, measure its L* = 71.63, a* = 5.96, b* = 22.31, BI = 42.79, moisture content = 3.27%, input the SVR model, output the predicted value = 654.9 μg / kg; the real value measured by GC-MS = 627.1 μg / kg, the relative error = 4.4% ≤ 10%, the model prediction is qualified.

[0076] The above examples show that the present application can quickly predict the acrylamide content of baked almond based on color and moisture content by "standardized pretreatment-precise index determination-optimized SVR model". In practical application, the model parameters (c, g) can be fine-tuned according to different almond varieties, but the core process and protection scope are within the scope defined in the claims of the present application.

[0077] Based on the same concept of the above method examples, the present application also provides an almond acrylamide content prediction system based on machine learning, comprising:

[0078] Sample pretreatment module: for pretreating the baked almond and sealing for standby;

[0079] Color index determination module: for determining the color index of the pretreated almond powder using a color difference meter;

[0080] Moisture content determination module: for placing the almond powder into a weighing bottle, heating to constant weight, and calculating the moisture content by weight difference;

[0081] Prediction model construction module: for collecting samples under different baking parameters, determining the color index, moisture content and real acrylamide content of each group of samples, taking the color index and moisture content as input features, and the real acrylamide content as output variable, dividing the training set and test set in proportion, constructing an SVR prediction model using a radial basis function, and predicting the acrylamide content of almond by optimizing the model parameters;

[0082] Acrylamide content prediction module: for inputting the color index and moisture content of the almond sample to be predicted into the constructed SVR prediction model, and outputting the predicted acrylamide content.

[0083] The technical features of the above examples can be combined in any way. To make the description concise, not all possible combinations of the technical features in the above examples are described, however, as long as the combinations of the technical features do not exist contradictory, they should be considered as the scope of the present application.

[0084] The above-described embodiments are merely illustrative of several embodiments of the present application, and the description is relatively specific and detailed, but should not be understood as a limitation on the scope of the patent. It should be noted that for those skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the scope of the present application. Therefore, the scope of protection of the present application should be subject to the appended claims.

Claims

1. A method for predicting the content of acrylamide in almonds based on machine learning, characterized by, The method comprises the following steps: Sample pretreatment: the baked almond is pretreated and sealed for standby; Color index determination: a color difference meter is used to determine the color index of the pretreated almond powder; Moisture content determination: the almond powder is placed in a weighing bottle and heated to constant weight, and the moisture content is calculated by the weight difference; Prediction model construction: samples under different baking parameters are collected, the color index, moisture content, and acrylamide real content of each group of samples are determined, the color index and moisture content are used as input features, and the acrylamide real content is used as an output variable, the training set and the test set are divided in proportion, the radial basis function is used to construct an SVR prediction model, and the model parameters are optimized to predict the acrylamide content of the almond; Acrylamide content prediction: the color index and moisture content of the sample to be predicted are input into the constructed SVR prediction model, and the acrylamide prediction content is output.

2. The method of claim 1, wherein, The pretreatment includes peeling, crushing, sieving, drying, and cooling.

3. The method according to claim 1 or 2, characterized in that, The color index includes brightness L*, red-green value a*, yellow-blue value b*, and browning index BI.

4. The method of claim 3, wherein, 15 groups of samples are prepared according to the baking parameters, and 3 parallel samples are set in each group, wherein the temperature includes 110°C, 130°C, and 150°C, and the time includes 10 min, 15 min, 20 min, 25 min, and 30 min.

5. The method of claim 1, wherein, The radial basis function is used as a kernel function, the penalty coefficient c and the kernel function parameter g are optimized by 5-fold cross-validation, the standardized 5-dimensional input features are mapped to a high-dimensional feature space, the optimal hyperplane that maximizes the separation between all samples is found by solving a convex quadratic programming problem, and the acrylamide content is predicted.

6. The method according to claim 1 or 5, characterized in that, The real content of acrylamide is determined by GC-MS method, which comprises: Chromatographic conditions: Agilent 7890A GC, DB-5 column, 30 m x 0.25 mm x 0.25 μm, initial 40 °C for 2 min, then ramped to 280 °C at 5 °C / min, hold for 2 min, carrier gas: high purity helium, flow rate: 1 mL / min. Chromatographic conditions: polar capillary column, initial 70 °C for 2 min, then ramped to 220 °C at Mass spectrometry conditions: electron ionization mode is used, and the monitoring ions are m / z 72 and m / z 75.

7. The method of claim 1, wherein, Z-score standardization is used to eliminate the dimension difference of the input features, and ensure that the contribution weight of each feature to the model is consistent.

8. The method according to claim 1 or 7, characterized in that, When optimizing the model parameters, the samples are randomly divided into 5 groups without replacement, and each group has 9 samples; every time, 4 groups are taken as the training set and 1 group is taken as the validation set, and the cycle is repeated 5 times; the MSE of the training set is minimized as the target, the MSE is calculated by traversing the c-g combination, and the parameters that minimize the average MSE of 5 cross-validations are selected as the optimal parameters.

9. The method of claim 6, wherein, When the relative error between the real content and the predicted content of acrylamide is ≤10%, the model prediction is qualified.

10. A machine learning-based system for predicting acrylamide content in almonds, characterized in that, It comprises: A sample pretreatment module: used for pretreating the baked almond and sealing it for standby; A color index determination module: used for determining the color index of the pretreated almond powder using a color difference meter; A moisture content determination module: used for placing the almond powder in a weighing bottle, heating to constant weight, and calculating the moisture content by the weight difference; The prediction model construction module is used for collecting samples under different baking parameters, determining the color index, the moisture content and the real content of acrylamide of each group of samples, taking the color index and the moisture content as input characteristics, taking the real content of acrylamide as an output variable, proportionally dividing a training set and a test set, adopting a radial basis function to construct an SVR prediction model, and predicting the content of almond acrylamide by optimizing model parameters; The acrylamide content prediction module is used for inputting the color index and the moisture content of an almond sample to be predicted into the constructed SVR prediction model, and outputting a predicted content of acrylamide.