A rapid determination method of SO2 concentration in wine based on electronic nose
By building a test device and using the gas sensor array and neural network model of electronic nose, the accuracy and rapidity of SO2 concentration determination in wine are solved, and quantitative analysis of SO2 concentration in wine is achieved, providing the treatment of medium and low concentrations of complex components The ideas of key ingredients have been expanded to other food safety testing.
Patent Information
- Application Number
- CN201911259322.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-10
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2039-12-10
AI Technical Summary
The prior art is difficult to achieve accurate, fast and online monitoring of SO2 concentrations in wines. Electronic noses have cross-sensitivity and repetition problems in quantitative analysis, and it is difficult to quantify SO2 concentrations in wines alone.
Build a test device, including a clean air source, mass flow controller, single-port valve, headspace bottle, gas sensor array and control analysis module, and perform pre-processing, principal component analysis and neural network model training by collecting information from wine samples. , a regression model was constructed to determine the concentration of SO2 in wine.
It realizes simple and rapid determination of wine SO2 concentration, provides methods to deal with key components in low concentrations of complex ingredients, and expands to other food safety testing applications.
Smart Images

Figure CN110823966B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of trace gas detection, and in particular to a method for quickly determining the SO2 concentration of wine based on an electronic nose. Background Art
[0002] Sulfur dioxide (SO2) is a food additive with antiseptic, sterilizing and antioxidant effects. Especially in the wine industry, important indicators such as wine quality, flavor and maturity are closely related to the concentration of added SO2. In the winemaking process, if the amount of SO2 added is too low, the expected effect will not be achieved. At the same time, excessive SO2 causes significant damage to human health. China's GB2760-2014 "National Food Safety Standard for the Use of Food Additives" clearly stipulates that the maximum amount of SO2 used in wine should not exceed 0.25g / L.
[0003] Therefore, it is an important issue to realize accurate, rapid and online monitoring of SO2 content in wine. At present, there are two main methods for determining SO2 content in wine. One is instrumental analysis method, among which ion chromatography and high performance liquid chromatography are representative. These methods have high measurement accuracy and simple operation, but the high price has become a key factor preventing their promotion. The other is chemical analysis method. In addition to the distillation method of my country's national food safety standard GB5009.34-2016 "Determination of sulfur dioxide in food", there are also oxidation method and direct iodine method. This type of method has low cost, but the configuration and calibration of drugs require high time cost, and the direct iodine method also has the problem of small scope of application. Despite the various determination methods, it is still difficult to realize and promote real-time monitoring of SO2 in the wine production process.
[0004] In recent years, electronic noses have become a research hotspot in the field of odor / gas detection due to their advantages such as low cost, rapid response, and simple operation. They have also attracted widespread attention from researchers in other fields, including food safety, quality inspection, disease detection, and environmental monitoring. However, due to problems such as cross-sensitivity and repeatability, gas sensors, the core components of electronic noses, have been used in wine-related applications for qualitative analysis such as traceability, anti-counterfeiting, quality grading, and odor detection, and rarely perform quantitative analysis tasks, such as the above-mentioned determination of SO2 content in wine.
[0005] In addition, the gas composition of wine is very complex, and the content of SO2 in wine may be tens to hundreds of ppm (1 ppm is one part per million). It is impossible to quantify the concentration of SO2 in wine by relying on a single gas sensor. Therefore, quantitative analysis of the concentration of SO2 in wine by electronic nose is an important research in this field at this stage. Summary of the invention
[0006] The technical problem to be solved by the present invention is to provide a method for quickly determining the SO2 concentration of wine based on an electronic nose.
[0007] In order to solve the above technical problems, a test device is firstly built, including a clean air source, a first mass flow controller, a second mass flow controller, a first one-way valve, a second one-way valve, a headspace bottle, a test chamber, a gas sensor array, and a control and analysis module; the headspace bottle stores a wine sample to be tested, and the headspace bottle is provided with an air inlet pipe and an air outlet pipe, one end of the air inlet pipe in the headspace bottle is arranged below the liquid level of the wine sample, and one end of the air outlet pipe in the headspace bottle is arranged above the liquid level of the wine to be tested, wherein,
[0008] The clean air source is connected to the air inlets of the first mass flow controller and the second mass flow controller respectively through an air pipe, the air outlet of the first mass flow controller is connected to the air inlet of the first one-way valve through an air pipe, the air outlet of the second mass flow controller is connected to the air inlet pipe of the head space bottle, the air outlet pipe of the head space bottle is connected to the air inlet of the second one-way valve, the air outlet of the second one-way valve is connected to the air inlet of the first one-way valve, the air outlet of the first one-way valve is connected to the air inlet of the test chamber through an air pipe, and the air outlet of the test chamber discharges tail gas through the air pipe;
[0009] A gas sensor array is provided in the test chamber, and the gas sensor array is connected to the control and analysis module;
[0010] The control and analysis module is used to process and analyze the data collected by the gas sensor array.
[0011] The present invention is based on the above-mentioned testing device. The method for rapidly determining the SO2 concentration of wine based on an electronic nose of the present invention comprises the following steps:
[0012] S1. Take wine samples with different concentrations of SO2;
[0013] S2, collecting information of each wine sample separately through the electronic nose;
[0014] S3, preprocessing all sample information to extract multiple characteristic parameters of each gas sensor;
[0015] S4, construct a regression model of training data through principal component analysis and neural network;
[0016] S5. Obtain the concentration of the wine sample to be tested by using the regression model obtained in step S4.
[0017] Compared with the prior art, the present invention has the following technical effects: it can simply and quickly measure the SO2 concentration of wine, and provides a way of using an electronic nose to deal with the problem of low-concentration key components in complex components.
[0018] Based on the above technical solution, the present invention can also be improved as follows.
[0019] Preferably, the volume of the wine sample is 10%-40% of the headspace bottle capacity, and all samples maintain the same amount.
[0020] Preferably, the specific steps of step S2 are as follows:
[0021] S21, cleaning the test chamber with clean air until the sensor response stabilizes or returns to the baseline;
[0022] S22, pumping clean air into the headspace bottle at a set flow rate, and collecting information of the wine sample using an electronic nose;
[0023] S23, cleaning the test chamber with clean air at a set flow rate;
[0024] S24, replace the sample and repeat steps S21-S23 until all samples are tested.
[0025] Preferably, the preprocessing of all sample information in step S3 refers to performing 5-point average filtering on the information of all samples to reduce noise interference, and the specific method is to use the following formula for processing:
[0026]
[0027] Where s is the gas sensor signal before filtering, and s is the gas sensor information after filtering.
[0028] Preferably, in step S3, a plurality of characteristic parameters are extracted, specifically including a steady-state maximum value, a steady-state differential value, a first-order differential maximum value, a first-order integral maximum value, a steady-state response time, and a recovery time, so as to select an optimal or approximately optimal combination.
[0029] Preferably, the specific steps of step S4 are as follows:
[0030] S41, performing standardization processing on all characteristic parameters obtained in step S3;
[0031] S42, using the principal component analysis method to compress the sample space and extract the principal component;
[0032] S43, using a neural network to model the SO2 concentration regression of the first n principal components whose contribution rates are greater than a threshold value γ;
[0033] S44. Verify the effect of the model until the accuracy meets the index requirements;
[0034] S45. Output model parameters.
[0035] Preferably, in step S41, if the units and magnitudes of the characteristic parameters are different, the z-score method is used for standardization, and the calculation formula is as follows:
[0036] x′= (x-μ) / σ (2)
[0037] In the above formula, x and x are the original data and the standardized data of the feature parameter, respectively, and μ and σ are the mean and standard deviation of the original data of the feature parameter, respectively.
[0038] All the standardized feature parameters constitute a new sample set X
[0039] Preferably, in step S42, the principal component analysis method comprises the following specific steps:
[0040] S42-1. Calculate the covariance matrix C of the standardized sample set X. The calculation method is as follows:
[0041]
[0042] In the formula, N is the sample size,
[0043] S42-2. Find the eigenvalues and corresponding eigenvectors of the covariance matrix C, and extract the eigenvectors corresponding to the first k eigenvalues in descending order and arrange them into a matrix P. Calculate and obtain a new data set Z. The calculation method is as follows:
[0044] Z=PX (4)
[0045] Preferably, the neural network mentioned in step S43 is a computing model, generally composed of an input layer, a hidden layer and an output layer, and the layers are connected to each other through neurons. Each neuron is composed of a linear combination and a nonlinear activation function, and their expressions can be expressed as:
[0046] c=ω T a+b (5)
[0047] d=g(c) (6)
[0048] Specifically, in the above formula, a is the input, d is the output, and is also the input to the next layer of neurons, ω is the weight, and b is the intercept. For example, the principal component extracted in step S42 is used as the input of the input layer, and through the calculation of the hidden layer, the final output layer outputs the concentration of SO2. Different activation functions have different operation methods. The ReLU function is used in this patent, and its calculation method is as follows:
[0049] f(c)=max(0,c) (7)
[0050] Preferably, in step S44, the determination coefficient R is used 2 , mean square error MSE and mean absolute error MAE are used as the criteria for judging the regression effect, and their expressions are:
[0051]
[0052]
[0053]
[0054] In the above formula, y i and are the true value and predicted value of the i-th sample, respectively. is the arithmetic mean of all samples.
[0055] Compared with the prior art, the present invention has the following technical effects:
[0056] The method for rapid determination of SO2 concentration in wine based on electronic nose adopted in the present invention can simply and quickly realize the determination of SO2 concentration in wine, and provides an idea of using electronic nose to deal with the problem of low-concentration key components in complex components. Combined with the specific conditions of other foods, it can be expanded to other food safety detection applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 It is a flow chart of the method of the present invention
[0058] Figure 2 This is the typical response curve of the gas sensor in the example
[0059] Figure 3 is the average signal comparison of the steady-state maximum values of the 16 sensors in the example (polar coordinates)
[0060] Figure 4 is the average signal comparison of the steady-state differential values of the 16 sensors in the example (polar coordinates)
[0061] Figure 5 is the average signal comparison of the maximum value of the first-order differential of the 16 sensors in the example (polar coordinates)
[0062] Figure 6 This is a comparison of the total contribution rates of the first 20 principal components for four different combinations of characteristic parameters in the example.
[0063] Figure 7 This is a schematic diagram of the principle of a feedforward neural network (taking a single hidden layer as an example)
[0064] Figure 8 is the prediction result of the optimal feature parameter combination in the instance
[0065] Fig. 9 This is a schematic diagram of the structure of the test device based on the embodiment of the present invention. DETAILED DESCRIPTION
[0066] The principles and features of the present invention are described below in conjunction with the accompanying drawings. The examples given are only used to explain the present invention and are not used to limit the scope of the present invention.
[0067] Please refer to Figure 1 As shown, it is a schematic diagram of the structure of the method for rapid determination of SO2 concentration in wine based on electronic nose of the present invention. The method for rapid determination of SO2 concentration in wine based on electronic nose comprises:
[0068] Step 1: Sample the wine to be tested containing different concentrations of SO2 and inject them into the headspace bottle;
[0069] In this example, rosé wine is taken as an example, the added SO2 concentrations are 0, 40, 80, 120, 160, 200 ppm, the sample volume is 20 ml, and the headspace bottle volume is 50 ml.
[0070] Step 2: Collecting information of the wine sample through the gas sensor array of the electronic nose;
[0071] The electronic nose contains a total of 16 gas sensors, including 15 metal oxide semiconductor (MOX) gas sensors and 1 electrochemical gas sensor. The detailed information of these sensors is shown in Table 1.
[0072] Table 1 Gas sensor details
[0073] serial number model quantity Manufacturer S1, S2 TGS2602 2 Figaro S3, S4 TGS2600 2 Figaro S5 4SO2-20 1 Honeywell S6 TGS2603 1 Figaro S7, S8 TGS2610 2 Figaro S9, S10 TGS2611 2 Figaro S11 TGS2612 1 Figaro S12 TGS2620 1 Figaro S13, S14 TGS2630 2 Figaro S15, S16 WSP7110 2 Weisheng
[0074] In addition, all MOX gas sensors were heated for 1 week with a 5V voltage before the test. The test was carried out in a dry laboratory environment at room temperature, and the upper computer program written in LabVIEW was used to control the gas circuit and circuit. Before each wine sample test, the gas cavity where the gas sensor is located was cleaned with air to restore the sensor to the standard state. The entire cleaning process was divided into two stages, with a time and flow rate of 20 minutes, 300 sccm and 5 minutes, 100 sccm respectively; when testing the sample, the sample was collected by pumping air into the headspace bottle, with a time and flow rate of 3 minutes and 100 sccm. Repeat the above process until all sample tests are completed.
[0075] Data description: There are 6 wines with different SO2 concentrations in this example. 8 samples of each concentration are prepared. Each sample is tested 3 times, and a total of 6×8×3=144 data can be obtained. Figure 2 The typical response curve of the gas sensor is given in .
[0076] Step 3: pre-process all sample information and extract multiple characteristic parameters of each gas sensor;
[0077] According to formula (1), all data are filtered by 5-point average, and then the steady-state maximum value V of each sensor is extracted. max , Steady-state differential value V dif and the maximum value of the first-order differential D max The three characteristic parameters extracted by all gas sensors are as follows: Figure 3 , 4 , 5, specifically, Figure 3 In the figure, S10 represents the 10th sensor, and the corresponding value of the wine with a SO2 content of 0ppm is about 0.4, the corresponding value of the wine with a SO2 content of 40ppm is about 1.5, the corresponding value of the wine with a SO2 content of 80ppm is about -0.7, the corresponding value of the wine with a SO2 content of 120ppm is about -0.8, the corresponding value of the wine with a SO2 content of 160ppm is about -1.2, and the corresponding value of the wine with a SO2 content of 200ppm is about -1.4. From the numerical value of the feature, there is no obvious relationship between the concentration of SO2 in the wine and the numerical value of the feature. This is because the SO2 content in the wine is low and the gas sensor is cross-sensitive, which is also the difficulty in solving this problem.
[0078] Step 4: Construct a regression model for the training data through principal component analysis and neural network, and use the test data to evaluate the regression model.
[0079] Among the three characteristic parameters extracted in the example, the maximum value of the first-order differential D max The units and magnitudes of the two features are different, so z-score standardization is used. After standardization, the mean of all features in the new data is 0 and the variance is 1.
[0080] Next, we test the impact of different feature parameter combinations on the regression results. The three feature parameters can be divided into four cases: full feature combination (V max +V dif +D max ) and the pairwise combination of characteristic parameters (V max +V dif 、V max +D max and Vdif +D max ). By means of step 42 in the invention content, the main components of the four feature combinations are extracted respectively, Figure 6 The total contribution rates of the first 20 principal components of the four feature combinations are shown in Figure .
[0081] The threshold γ is recommended to be greater than 85%. The larger the γ, the more information the principal component will contain. In this example, the threshold γ is set to 97.5%. Figure 6 The result in V max +V dif +D max 、V max +V dif 、V max +D max and V dif +D max The first 14, 12, 13 and 10 principal components were selected in turn for the four cases, and the mapping relationships between these principal components and SO2 concentrations were established using neural networks.
[0082] The feedforward neural network used in this example is also called a multilayer perceptron. The network structure diagram is as follows Figure 7 As shown. The parameters of the neural network in this example are set as follows: the number of hidden layers is 2, the number of neurons in the hidden layer is twice the input dimension, the maximum number of iterations is 500, the weight update method is the L-BFGS algorithm, the regularization term parameter is 0.00001, the selected principal component is used as the input data of the neural network, and the actual concentration of SO2 in the wine sample is used as the label (output layer output).
[0083] In the regression later in this example, because there are 48 groups of samples in total, 47 groups are used as training sets each time, and the remaining group is used as a test set, so a total of 48 training times are performed to ensure that the measurement results from the same sample will not appear in both the training set and the test set, otherwise it may cause more serious overfitting.
[0084] Table 2 summarizes the prediction results of four different feature parameter combinations. 2 The larger the value, the smaller the MSE and MAE, indicating that the regression model is more effective. In Table 2, the effect of the combination of the steady-state maximum value and the steady-state difference value is in terms of MSE, MAE and R 2 All aspects are optimal, so the example finally selects two characteristic parameters: steady-state maximum value and steady-state difference value.
[0085] Table 2 Comparison of results of different characteristic parameter combinations
[0086] Feature parameter combination MSE MAE <![CDATA[R 2 ]]> <![CDATA[V max +V dif +D max ]]> 191.17 8.61 0.959 <![CDATA[V max +V dif ]]> 69.33 5.60 0.985 <![CDATA[V max +D max ]]> 304.35 11.94 0.934 <![CDATA[V dif +D max ]]> 369.55 12.53 0.920
[0087] Detailed test results are as follows Figure 8 As shown, the concentration of SO2 in wine was measured more accurately.
[0088] The above examples are only preferred implementations of the present invention. Those skilled in the art will appreciate that various changes, modifications, substitutions and variations to these embodiments without departing from the principles and purpose of the present invention are all within the protection scope of the present invention.
Claims
1. A wine SO based on electronic nose 2 A rapid method for determining the concentration of It is characterized in that include: S1, taking different concentrations of SO 2 wine samples; S2, collecting information of each wine sample separately through the electronic nose; S3, preprocessing all sample information to extract multiple characteristic parameters of each gas sensor; S4, construct a regression model of training data through principal component analysis and neural network; S5, obtaining the concentration of the wine sample to be tested through the regression model obtained in step S4; In step S3, multiple characteristic parameters are extracted, including the steady-state maximum value V max , Steady-state differential value V dif , the maximum value of the first-order differential D max ; The specific steps of step S4 are as follows: S41, performing standardization processing on all characteristic parameters obtained in step S3; S42, the three feature parameters can be divided into four cases: full feature combination (V max +V dif +D max ) and the pairwise combination of characteristic parameters (V max +V dif 、V max +D max and V dif +D max ) ; Use the principal component analysis method to compress the sample space and extract the principal components under each feature combination; S43, using neural network as the front end when the sum of contribution rate is greater than the threshold γ n Principal component pairs 2 Regression modeling of concentrations; S44. Test the impact of different feature parameter combinations on regression results, verify the effect of the model under each feature combination, until the accuracy meets the index requirements; determine the best feature combination method; S45. Output model parameters.
2. Wine SO based on electronic nose according to claim 1 2 A rapid method for determining the concentration of It is characterized in that The volume of the wine sample was 10%-40% of the headspace bottle capacity, and all samples maintained the same amount.
3. Wine SO based on electronic nose according to claim 1 or 2 2 A rapid method for determining the concentration of It is characterized in that The specific steps of step S2 are as follows: S21, cleaning the test chamber with clean air until the sensor response stabilizes or returns to the baseline; S22, pumping clean air into the headspace bottle at a set flow rate, and collecting information of the wine sample using an electronic nose; S23, cleaning the test chamber with clean air at a set flow rate; S24, replace the sample and repeat steps S21-S23 until all samples are tested.
4. Wine SO based on electronic nose according to claim 1 or 2 2 A rapid method for determining the concentration of It is characterized in that The preprocessing of all sample information in step S3 refers to performing 5-point average filtering on the information of all samples to reduce noise interference. The specific method is to use the following formula for processing: (1) Where s is the gas sensor signal before filtering, is the filtered gas sensor signal.
5. Wine SO based on electronic nose according to claim 1 or 2 2 A rapid method for determining the concentration of It is characterized in that In step S3, a plurality of characteristic parameters are extracted, including first-order integral maximum value, steady-state response time, and recovery time.
6. Wine SO based on electronic nose according to claim 1 or 2 2 A rapid method for determining the concentration of It is characterized in that In step S41, if the units and magnitudes of the characteristic parameters are different, the z-score method is used for standardization, and the calculation formula is as follows: (2) In the above formula, x and are the original data and standardized data of the characteristic parameters, μ and They are the mean and standard deviation of the original data of the feature parameter, and all the standardized feature parameters constitute a new sample set X .
7. Wine SO based on electronic nose according to claim 1 or 2 2 A rapid method for determining the concentration of It is characterized in that In step S42, the principal component analysis method comprises the following specific steps: S42-1. Calculate the standardized sample set X The covariance matrix of C , calculated as follows: (3) In the formula, N The sample size S42-2. Find the covariance matrix C The eigenvalues and corresponding eigenvectors of are extracted in descending order. k The eigenvectors corresponding to the eigenvalues are arranged into a matrix , calculate to obtain a new data set , calculated as follows: Z=PX(4).
8. Wine SO based on electronic nose according to claim 1 or 2 2 A rapid method for determining the concentration of It is characterized in that In step S44, the determination coefficient R is used 2 , mean square error MSE and mean absolute error MAE are used as the criteria for judging the regression effect, and their expressions are: (8) (9) (10) In the above formula and are the true value and predicted value of the i-th sample, respectively. is the arithmetic mean of all samples.
