CN114813593A - Method for detecting total acid content of fermented grains based on hyperspectral imaging technology - Google Patents

Method for detecting total acid content of fermented grains based on hyperspectral imaging technology Download PDF

Info

Publication number
CN114813593A
CN114813593A CN202210324632.8A CN202210324632A CN114813593A CN 114813593 A CN114813593 A CN 114813593A CN 202210324632 A CN202210324632 A CN 202210324632A CN 114813593 A CN114813593 A CN 114813593A
Authority
CN
China
Prior art keywords
acid content
total acid
hyperspectral
fermented grains
fermented
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210324632.8A
Other languages
Chinese (zh)
Inventor
田建平
姜鑫娜
补友华
黄浩平
胡新军
黄丹
罗惠波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sichuan University of Science and Engineering
Original Assignee
Sichuan University of Science and Engineering
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sichuan University of Science and Engineering filed Critical Sichuan University of Science and Engineering
Priority to CN202210324632.8A priority Critical patent/CN114813593A/en
Publication of CN114813593A publication Critical patent/CN114813593A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/17Systems in which incident light is modified in accordance with the properties of the material investigated
    • G01N21/25Colour; Spectral properties, i.e. comparison of effect of material on the light at two or more different wavelengths or wavelength bands
    • G01N21/31Investigating relative effect of material at wavelengths characteristic of specific elements or molecules, e.g. atomic absorption spectrometry
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • G06N20/20Ensemble learning

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Spectroscopy & Molecular Physics (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Pathology (AREA)
  • Evolutionary Computation (AREA)
  • Biochemistry (AREA)
  • Immunology (AREA)
  • Analytical Chemistry (AREA)
  • Chemical & Material Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Data Mining & Analysis (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Health & Medical Sciences (AREA)
  • Investigating Or Analysing Materials By Optical Means (AREA)

Abstract

The invention provides a method for detecting the total acid content in fermented grains based on a hyperspectral imaging technology, which comprises the following steps: collecting a fermented grain sample, and measuring the total acid content of the fermented grain; collecting and correcting a hyperspectral image by using a hyperspectral imaging system, and acquiring average spectral information and color information of an interested area; carrying out SNV-SG pretreatment on the spectral information; screening characteristic wavelengths of the spectrum by using RC-SPA, and obtaining hyperspectral characteristic values of each sample; constructing a regression model by using fusion data of the characteristic value and the color information and the total acid content; taking the hyperspectral characteristic value of the sample to be detected as the input of a regression model to obtain the total acid content of the fermented grains to be detected; and (4) carrying out visual analysis on the total acid content in the fermented grain ROI. The method can accurately detect the total acid content in the fermented grains by the hyperspectral map characteristics, and realizes online detection.

Description

Method for detecting total acid content of fermented grains based on hyperspectral imaging technology
Technical Field
The invention discloses a method for detecting total acid content of fermented grains based on a hyperspectral imaging technology, and belongs to the technical field of solid-state fermentation index detection in solid-state brewing.
Background
In the white spirit brewing industry, the fermented grains are the raw materials for white spirit distillation and are the direct sources of flavor compounds. The acid forms strong aromatic white spirit, the proper acidity is beneficial to saccharification and fermentation of the white spirit and improvement of yield, and if the acidity is insufficient, the flavor of the white spirit is insufficient, the aroma is not strong and the taste is monotonous; however, if the acidity is too high, the growth and propagation of beneficial microorganisms (mainly yeasts) can be inhibited, so that the liquor yield of the white liquor is influenced, and the liquor taste is not good enough. At present, in the traditional production process of white spirit, the quality of fermented grains, the quality of fermented grain fermentation and the like are judged by means of sensory evaluation of workers or a conventional physicochemical measurement method, so that the operation is complex, and the quality inspection efficiency is low.
For example, chinese patent CN104007113B, entitled method for detecting acidity of fermented grains, describes that the method for detecting acidity of fermented grains comprises the following steps: preparing fermented grain solution, adding phenolphthalein, measuring initial red light intensity value X with color sensor, and obtaining-9.67879 10 according to the quadratic function curve Y of X and red light intensity of fermented grain solution -4 *X 2 + 0.70671X-17.37787, calculating Y, and calculating the red light intensity value M of the vinasse solution when reaching the titration end point according to the value of X-Y; dropwise adding an alkali solution, uniformly stirring, detecting the red light intensity value N of the solution, and stopping titration when N is less than M; and calculating the acidity value of the fermented grains by the consumption of the alkali solution. The method can accurately detect the acidity value of the fermented grains with strong aroma, soy sauce aroma, delicate fragrance and other large aroma. However, the method for detecting the acidity content of the fermented grains disclosed by the patent is destructive, a sample cannot be used after being detected, and if the sample amount is large, resources are wasted. In addition, the soaking time is preferably 25-40 min for completely dissolving the acidic substances in the fermented grains in water, and the detection period is long. And the method for detecting the acidity content of the fermented grains cannot realize on-line monitoring and can not detect the acidity content of the fermented grainsAnd visualizing the acidity of the unstrained spirits sample.
In addition, patent No. CN111539920A, entitled automatic detection of fermented grain quality in liquor brewing process, also describes an automatic detection method of fermented grain quality in liquor brewing process relating to the liquor brewing field and image processing field, the method includes the following steps: A. establishing a fermented grain quality evaluation model based on a self-adaptive fuzzy reasoning algorithm; B. training a fermented grain quality evaluation model based on the known quality graded fermented grain samples and the corresponding grading results; C. and detecting the fermented grains to be detected by adopting the trained fermented grain quality evaluation model. The method is suitable for automatically detecting and evaluating the quality of the fermented grains in the grain preparation link in the full-automatic white spirit brewing process. However, the fermented grain quality detection method disclosed in the patent only takes image information (color, texture, and other characteristics) as input, and the image information can only reflect the surface information of the fermented grain, but cannot express the change of the internal structure, so the detection accuracy is relatively low. And I think that the fermented grain quality monitoring from the texture perspective is not correct, because the fermented grain is sticky granular, if a batch of samples are turned over after the images are collected, the batch of samples can obtain two texture information with large difference, and the detection results of the same batch of samples can be greatly different.
Disclosure of Invention
The invention aims to provide a method for detecting the total acid content of fermented grains based on a hyperspectral imaging technology, aiming at the technical problems in the prior art. In the method, a hyperspectral imaging technology is used, the traditional imaging and the spectroscopic technology are combined, simultaneously obtaining the space and spectrum information of a sample, improving the detection speed and the detection precision of the model by fusing the color information with the optimal characteristic spectrum information, adopting an SPXY algorithm on a divided data set, adopting an SNV combined SG algorithm on pretreatment, selecting an RC-SPA algorithm for screening characteristic wavelength, constructing a regression model by fusing the characteristic value and the color information and the real total acid content, taking the hyperspectral characteristic value of the sample to be detected as the input of the regression model to obtain the total acid content of the fermented grains to be detected, the method can accurately detect the total acid content in the fermented grains, overcomes the defects of slow manual identification, subjective influence and the like in the prior art, and provides technical support for transformation and upgrading of liquor brewing industrialization and intelligent online monitoring of fermented grain fermentation state.
In order to achieve the above purpose, the specific technical scheme of the invention is as follows:
the method for detecting the total acid content of the fermented grains based on the hyperspectral imaging technology comprises the following steps:
1) acquiring a hyperspectral image of a sample and correcting an acquired image: collecting fermented grain samples of different layers of different cellars in a winery, and collecting hyperspectral images of the samples by using a hyperspectral imaging system;
2) measuring the total acid content of the fermented grains according to GB/T12456-2021;
3) acquiring average spectral information and color information of an interested area;
4) data processing: preprocessing an original spectrum, and screening out characteristic wavelengths related to the total acid content;
5) fusing characteristic wavelength and image color information with the measured total acid content to establish a regression model, evaluating the established model, and judging the effectiveness of the model;
6) and taking the characteristic spectrum variable to be detected as the input of the regression model to obtain the result of the total acid content of the fermented grains to be detected.
As a preferred embodiment in the present application, the number of the collected fermented grain samples in different layers of different pits in the distillery in step 1) is 128. The collected samples are generally collected in two different periods, for example, the first collection is carried out, the samples of fermented grains in the upper, middle and lower layers of 13 cellars in a winery are respectively and randomly collected at the same time (No. 3/28), each layer is collected by adopting a rotary sampler to randomly select three sampling points, wherein the depth of the cellars is 2m, the upper sampling point is 0.6m away from the cellars, the middle sampling point is 1.1m away from the cellars, and the lower sampling point is 2m away from the cellars, so that 117 samples are obtained. And during the second collection (29 days in 3 months), randomly selecting 11 cellars from the 13 cellars collected for the first time for sampling, and randomly selecting one position for each cellars to obtain 11 samples. Finally, 128 fermented grain samples are obtained.
The hyperspectral imaging system mainly comprises a hyperspectral camera, an illumination system, a high-precision electronic control objective table and a computer with special processing software. The collected spectral range is 940-1730nm, the total wavelength is 224 wave bands, and the spectral resolution is 3.3 nm. Setting the exposure time of the hyperspectral camera to be 4.02ms, the acquisition frequency to be 50Hz and the moving speed of the objective table to be 16.42mm/s, obtaining a three-dimensional hyperspectral image data block of the fermented grain sample in a linear array push-broom manner, and calibrating the acquired hyperspectral image and selecting an interested area.
As a preferred embodiment in the present application, the obtaining of the color information in step 3) mainly uses the first moment, the second moment and the third moment of the gray image of the fermented grain sample ROI in H, S, V color space as features. There are 9 features in one sample, and 128 samples result in 128 × 9 color feature data.
As a preferred embodiment in the present application, the preprocessing method in step 4) is standard normal transformation combined with SG convolution smoothing (SNV-SG); the characteristic wavelength extraction method is a regression coefficient method combined with a continuous projection algorithm (RC-SPA).
As a better implementation manner in the present application, the regression model established in step 5) is a Cascade Forest (CF) model; with R 2 RMSE is used as an evaluation index to determine the effectiveness of the model.
As a preferred embodiment in the present application, step 6) of obtaining the result of the total acid content of the fermented grains to be measured by using the spectral variable of the characteristic to be measured as the input of the regression model further includes step 7): visualizing the obtained total acid content to obtain the acidity distribution map of the fermented grains.
Further, the method for correcting the acquired image comprises the following steps: firstly, a standard polytetrafluoroethylene white board is placed in an imaging area, and a full white reflection calibration image of the standard white board is collected; then, covering the lens cover, and closing the light source to obtain a completely black calibration image; and finally, calculating the corrected hyperspectral image according to the following formula.
Figure BDA0003572905900000051
In the formula: r is the corrected image; i is the original image; w is a standard whiteboard image; b is a dark current image with the lens turned off.
Further, the region of interest is selected by adopting morphological processing and binary norm calculation, and a circular region is divided by taking the center of the collected fermented grain sample image as a circle center and taking 100 pixels as a radius to serve as the ROI of the sample.
The method is used for detecting the total acid content in the fermented grains.
Compared with the prior art, the invention has the following beneficial effects:
the method for detecting the total acid content of the fermented grains based on the hyperspectral imaging technology has the advantages that the detection precision of the model is improved by fusing the optimized characteristic spectrum information and the color information for the first time, the detection method provided by the invention is simple to operate and free of destructiveness, the defects that the quality of the fermented grains is long in time consumption and influenced by subjective consciousness and the like in a manual sensory evaluation method are overcome, the established method for quickly and nondestructively detecting the total acid content of the fermented grains based on the hyperspectral technology and deep learning greatly improves the detection efficiency, and theoretical support and technical support are provided for intelligent development of solid-state brewing.
In the technical field, the method adopts the hyperspectral imaging technology to detect the total acid content of the fermented grains, utilizes the unique advantages of the hyperspectral imaging technology, takes each pixel in the ROI of the sample as the input of an optimal detection model, and combines the pseudo-color data processing to perform distribution visualization on the total acid content of all the pixels. And representing the content change of each pixel point by using the color change, and intuitively reflecting the total acid content distribution condition of the fermented grains in the sample ROI.
And (III) in the aspect of data input, the invention utilizes the optimized characteristic spectrum information to fuse color information to improve the detection precision of the model. In the collected hyperspectral image, the image information can reflect the external characteristics of the fermented grains, and the color moments of the image in the HSV space are greatly different due to the difference of the colors of the fermented grains in different fermentation states; the spectral information can reflect the internal components and structural characteristics of the fermented grains, which can cause the fermented grains in different fermentation periods to have larger difference of spectral reflectivity under different wavelengths. Compared with a single data set, the fused image and the spectrum information more comprehensively contain characteristic information which can obviously distinguish fermented grains fermentation conditions, and the purpose of accurate detection can be achieved.
In data processing, the SNV is combined with SG to preprocess the spectrum, so that noise is removed, and information related to components is enhanced; the invention develops a method for extracting characteristic wavelengths by combining RC and SPA algorithm, which can effectively reserve the wavelength with the highest correlation with the total acid content, eliminate the problem of collinearity among the wavelengths, greatly reduce the number of the wavelengths and achieve the aim of rapid detection.
And fifthly, in the aspect of establishing the model, the invention develops a deep learning model-CF to detect the total acid content of the fermented grains. The CF model has less hyper-parameter setting and higher efficiency, can perform characterization learning, and can show excellent performance even if only small-scale training data is available. The model can obtain more accurate and stable detection effect than the conventional machine learning algorithm.
The invention provides a nondestructive, rapid and accurate method for detecting the total acid content of the fermented grains. The method is beneficial to monitoring the fermentation condition of the fermented grains, has guiding significance for timely adjusting process parameters in the white spirit brewing process, and provides a substitute method for the traditional detection means.
Drawings
FIG. 1 is a schematic flow chart of a method for detecting total acid content of fermented grains based on a hyperspectral imaging technology in the invention;
FIG. 2 is a flow chart of hyperspectral ROI selection in the present invention;
FIG. 3 is an HSV map of a sample from example 1 of the present invention;
FIG. 4 is a spectrum reflectivity image of a fermented grain sample according to the present invention;
fig. 5 is a visual cloud of the fermented grain samples with different total acid contents.
Detailed Description
The embodiments of the present invention are described below by way of specific examples, and other advantages and effects of the present invention will be readily apparent to those skilled in the art from the disclosure of the present specification. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention. It is to be noted that the features in the following embodiments and examples may be combined with each other without conflict.
It should be noted that, in order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention are clearly and completely described below, and it is obvious that the described embodiments are some embodiments of the present invention, but not all embodiments.
Thus, the following detailed description of the embodiments of the present invention is not intended to limit the scope of the invention as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The raw materials, equipment and methods used in the invention are all the raw materials, equipment and methods which are commonly used in the field if not specified.
Example 1:
the method for detecting the total acid content of the fermented grains based on the hyperspectral imaging technology comprises the following steps:
1. collecting of fermented grain sample
The fermented grain sample collected in this example was obtained from a certain brewery in yibin, sichuan, china. The collection is divided into two times, the first collection is carried out, the fermented grains samples of the upper layer, the middle layer and the lower layer of 13 cellars in a winery are respectively and randomly collected at the same time (No. 3/28), a rotary sampler is adopted for randomly selecting three sampling points for collection in each layer, the depth of each cellars is 2m, the upper layer sampling point is 0.6m away from the cellars in the cellars, the middle layer sampling point is 1.1m away from the cellars in the cellars, and the lower layer sampling point is 2m away from the cellars in the lower layer, so that 117 samples are obtained. And during the second collection (day 29/3), randomly selecting 11 cells from the 13 cells collected for the first collection, and randomly selecting a position for each cell to obtain 11 samples. Finally, 128 fermented grain samples are obtained.
2. Acquisition and correction of hyperspectral images
And acquiring a hyperspectral image of the fermented grains by adopting a push-broom hyperspectral imaging system in a laboratory. The system mainly comprises a hyperspectral camera (Finland FX17 series), an illumination system (OSRAM, German), a high-precision electronic control platform and a computer provided with special processing software (LUMO-scanner). The collected spectral range is 940-1720nm, the spectral resolution is 3.4nm, and a total of 224 wave bands are obtained. The exposure time of the hyperspectral camera is set to be 4.02ms, the acquisition frequency is set to be 50Hz, and the moving speed of the objective table is set to be 16.42 mm/s.
And correcting the acquired spectral image, wherein the formula of black and white correction is shown as formula (1).
Figure BDA0003572905900000081
In the formula: r is the corrected reflectance image; i is an original hyperspectral image; w is a standard whiteboard image; d is a dark current image with the lens turned off.
In order to improve modeling accuracy, the method adopts morphological processing and binary norm calculation to remove the background of a hyperspectral image, divides a circular region of interest (ROI) by taking the center of an acquired fermented grain sample image as a circle center and 100 pixels as a radius, and has the specific process as shown in FIG. 2.
3. Determination of the Total acid content
The total acid content of the fermented grains (GB/T12456-2021) is determined by a potentiometric titration method of indicating an end point by PH according to an acid-base neutralization principle. Firstly, weighing a sample by using an electronic balance, accurately measuring the sample to 0.001g, fixing the volume to a polymer plug measuring cylinder, standing for 30min and shaking for 2-3 times, mixing the sample with distilled water after filtering, titrating the mixture by using 0.1mol/L NaOH standard solution until the pH indication reading is 8.2, stopping titration and recording the reading. The calculation formula of the total acid content of the sample is shown as the formula (2):
X=c×V×100×(100/20)×(1/10) (2)
in the formula: x is the total acid content (mmol/10g) of the fermented grain sample; c is the concentration (mol/L) of the NaOH standard solution; v is the volume (mL) of NaOH consumed by the sample solution; 20 is the absorption filtrate volume (mL); 100 is sample dilution volume (mL); sample volume (mL) is 10.
3. Extracting spectral data and color data
Calculating the average spectrum value of all pixel points in each sample ROI area according to the formula (3) to serve as the spectrum data of the sample, so that 128 samples obtain the original spectrum data of 128 x 224 (sample number wavelength number); the original spectrum curve of the fermented grain sample is shown in fig. 4, the spectrum information in the image is mainly the presentation of the combined frequency and the frequency doubling absorption of hydrogen-containing groups (such as C-H, O-H, N-H and the like) of chemical components in the fermented grain, and is mainly related to protein, moisture, fat and the like, in the fermented grains with different qualities, the chemical component contents are different, and the change of the absorption peak of a specific waveband of the spectrum is caused by the difference.
Figure BDA0003572905900000091
In the formula: average spectral values for the selected ROIs; m is the number of pixel points in the selected ROI; n is the wave band number of the high spectrum data of the fermented grains; the reflectivity of the jth pixel point under the ith wave band is obtained.
In the embodiment, color moments are adopted to express color features, the color of the fermented grains mainly has light yellow, light brown and red brown, and the first moment, the second moment and the third moment of the gray level image of the fermented grain sample ROI in H, S, V color space are respectively calculated. Wherein the first moment is a mean value representing the average intensity of the color components; second moment is the color variance, representing the inhomogeneity; the third moment is the skewness of the color components, representing asymmetry. Fig. 3 is an HSV map of a sample, which has the following calculation formula, wherein 9 features are provided in one sample, and 128 samples obtain 128 × 9 color feature data.
Figure BDA0003572905900000101
Figure BDA0003572905900000102
Figure BDA0003572905900000103
In the formula, the first moment is represented, N represents the number of pixel points, the ith color component (H, S, V color components of three color channels) of the jth pixel point is represented, the second moment is represented, and the third moment is represented.
4. Constructing a detection model
The method comprises the following steps: experimental sample partitioning
Before data modeling, a data set is usually divided into a training set and a test set, the training set data is mainly used for establishing a model, the test set data is mainly used for checking the detection effect of the model, and an optimal model is screened according to the detection effect. The sample data is divided into a training set (105) and a test set (23) by the SPXY algorithm. The statistical results of the total acid content of the fermented grain samples are shown in table 1.
TABLE 1 statistical results of total acid content of fermented grain samples
Figure BDA0003572905900000104
Step two: spectral preprocessing
During the spectral data acquisition process, the spectrum is often subject to various disturbances, such as electrical noise, background noise, baseline drift, and radio scatter, which may cause spectral variations and affect the reliability of the multivariate calibration model. Therefore, in order to reduce the influence of the information factors on the modeling and improve the accuracy of the model, the invention adopts an SNV combined SG algorithm to preprocess data before the model is established. The SNV is mainly used for eliminating the influence of surface scattering of fermented grains and optical path change on diffuse reflection spectrum, the principle is that the spectrum data is assumed to obey normal distribution, the average value of a spectrum curve is subtracted from the spectrum value under each wavelength, and then the average value is divided by a standard deviation formula of the curve, and the specific formula is as follows:
Figure BDA0003572905900000111
wherein:
Figure BDA0003572905900000112
in the formula X isnv Is the SNV corrected spectrum of the i sample, X i Is the original spectral matrix of the i sample, X i,j Is the spectral matrix of all samples, m is the number of bands, X i Is the spectral average, σ, of the i sample i Is the standard deviation of the spectrum.
SG can smooth the spectrum, and noise can be reduced after smoothing, and S-G convolution smoothing is similar to moving window smoothing, except that it carries out polynomial least square fitting on data in a moving window through a polynomial, and is a weighted average method in essence, and emphasizes the central action of a central point. However, when using this method, attention needs to be paid to the selection of the width of the moving window, and too small will not filter out noise, and too large will smooth out effective information. The calculation formula is as follows:
Figure BDA0003572905900000113
in the formula X isg Is the S-G corrected spectrum of the i sample, w is the window size, h i Is a smoothing coefficient.
Step three: data dimension reduction processing
The acquired hyperspectral data has a large amount of information with redundancy and collinearity, and the problems of complex model and large calculated amount are easily caused by overlarge data amount. Therefore, the invention adopts the RC-SPA combined algorithm to extract the characteristic wavelength of the spectrum. The RC-SPA algorithm comprises the following steps:
firstly, establishing a regression model of the total acid content and the average spectral reflectivity in the fermented grains through partial least squares regression, wherein the larger the absolute value of the coefficient is, the larger the influence on the regression model is, because the regression coefficient of each wavelength in the regression expression represents the contribution proportion of each wavelength respectively. Selecting a wavelength corresponding to a regression coefficient with an absolute value larger than 1000 in a regression equation established by spectral data and total acid content as a selected wavelength to obtain 22 wavelength combinations in total; and then, carrying out secondary optimization on the characteristic wavelength extracted by the RC algorithm by adopting an SPA algorithm to remove the collinearity wavelength, wherein the SPA is a forward variable selection method, and the redundancy can be eliminated by executing simple projection operation in a vector space, so that a subset of valuable variables is obtained, and the collinearity problem is solved. The obtained new variable is the variable which has the maximum projection value on the orthogonal subspace with the previously selected variable in all the residual variables, and the SPA algorithm has the following specific operation steps:
s3-1: let the initial iteration vector be x k(0) Extracting N characteristic wavelengths and J spectral matrixes, randomly selecting one column (jth column) of the spectral matrix, and assigning the value of the jth column to x j Is recorded as x k(0)
S3-2: the set of remaining column vector positions is denoted as s,
Figure BDA0003572905900000121
s3-3: separately calculate x j The projection of the remaining column vectors is performed,
Figure BDA0003572905900000122
s3-4: the spectral wavelength of the maximum projection value is selected,
Figure BDA0003572905900000123
s3-5: let x j =p x J ∈ s, n ═ n +1, if n is<N, returning to the step S3-2 for loop calculation;
s3-6: the last extracted wavelength is: { x k(n) 0, …, N-1, and k (0) and N corresponding to the minimum RMSE value are the optimal initial variable and variable number according to the detection result of the training set data. Finally obtaining characteristic spectrum wavelengths which are 1538.3nm, 1566.8nm, 1595.2nm and 1659.4nm and influence the total acid content of the fermented grains, and obtaining hyperspectral eigenvalues of each sample according to the four characteristic spectrum wavelengths.
Step four: constructing a detection model
The Cascade Forest (CF) is an integrated learning method based on a decision tree, processes characteristic information layer by layer, is similar to a neural network, but has less hyper-parameter setting of a CF model and higher efficiency, and can show excellent performance even if only small-scale training data exists. Each cascade in the CF contains 2 random forests and 2 fully random forests, each forest being composed of regression trees. In addition, during the expansion process of the intermediate cascade, the validation set for the newly expanded cascade is evaluated, and if no significant performance gain exists, the process is terminated. Therefore, the model is terminated in advance, so that the overfitting phenomenon of the model can be effectively avoided, and the model can be prevented from being too complex.
The method comprises the steps of respectively establishing a detection model of high spectral data of the fermented grains and total acid content by using Partial Least Squares (PLSR), Support Vector Regression (SVR) and a CF algorithm, wherein the high spectral data is the fusion of characteristic values and image color data. Root mean square error using training set (RMSEC), root mean square error using test set (RMSEP), coefficient of determination using training set (R C 2 ) Determination factor (R) of test set P 2 ) And residual prediction bias (RPD) to evaluate the performance of the model. Furthermore, the robustness of the model is evaluated by the absolute difference (AB _ RMSE) between RMSEC and RMSEP, a smaller value indicating a more stable model is seen. RPD represents the relative detection performance of the model: values of RPD between 1.5 and 2 indicate poor detectability of the model, between 2 and 2.5 indicate effective detection, between 2.5 and 3 or more indicate good detection accuracy of the model, optimalThe model should have a higher R P 2 Value, RPD value and lower RMSEP, AB _ RMSE.
The modeling results under the same pretreatment and the same eigenvalue are shown in table 2. As shown in Table 2, the RPD value of PLSR is 1.4768, the RMSEC and RMSEP values are 0.9824 and 0.8656 respectively, the detection effect is poor, and the method is not suitable for detecting the total acid content of the fermented grains; the RPD value and the AB _ RMSE value of the SVR model are 5.9139 and 0.1520 respectively, the detection effect is better than that of PLSR, next to CF, the RPD value of the CF model is 6.4744, the AB _ RMSE value is 0.0407, the detection precision is highest, and the stability is best. Therefore, the invention selects the CF model to construct the detection model of the total acid content of the fermented grains.
TABLE 2 modeling results of CF, SVR, PLSR
Figure BDA0003572905900000141
Step five: visualization
And substituting the data of each pixel in the ROI into a model for detecting the total acid content of the fermented grains to obtain the total acid content value of each pixel point. And then stretching the content value of each pixel point to a 0-255 gray scale range, and obtaining a visual distribution cloud picture of the total acid content of each fermented grain according to a Jet chromaticity band principle. Fig. 5 is a distribution visualization graph of three different total acid contents, and the distribution condition of the total acid and the difference of each pixel point can be visually seen.
The actual and measured values of the final test set are as follows:
Figure BDA0003572905900000142
Figure BDA0003572905900000151
example 2:
in order to prove the stability and the generalization of the model, the invention adopts the samples of the fermented grains in different fermentation periods of Yibin wine plant to carry out detection and analysis, and the samples are obtained by the methodThe test samples of the batch were collected at four different fermentation stages of day 0, day 8, day 16, day 24, and day 32, respectively, and the total number of the test samples was 120, and according to the test method used in example 1, the evaluation indexes of the final model were R C 2 =0.9982,RMSEC=0.0255,R P 2 =0.9897,RMSEP=0.0446,RPD=6.9853。
In the process of determining the scheme of the invention, the situation of large error occurs, for example:
1. at the beginning, the spectrum is not preprocessed, the original spectrum is adopted for subsequent modeling analysis, poor modeling results are caused due to a large number of noise signals in the spectrum, and the evaluation indexes are R C 2 =0.8764,RMSEC=0.0931,R P 2 =0.7621,RMSEP=0.1278,RPD=1.5445。
2. The spectrum optimization is not carried out by using a feature extraction algorithm, the modeling is carried out by using full wavelength, the modeling speed is slowed down due to a large amount of redundant information in the spectrum, the modeling effect is not ideal, and the specific evaluation indexes are respectively R C 2 =0.8595,RMSEC=0.5809,R P 2 =0.8743,RMSEP=0.6022,RPD=2.0602。
The above description is only exemplary of the present invention and should not be taken as limiting the invention, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. The method for detecting the total acid content of the fermented grains based on the hyperspectral imaging technology is characterized by comprising the following steps of:
1) acquiring a hyperspectral image of a sample and correcting an acquired image: collecting fermented grain samples of different layers of different cellars in a winery, and collecting hyperspectral images of the samples by using a hyperspectral imaging system;
2) measuring the total acid content of the fermented grains according to GB/T12456-2021;
3) acquiring average spectral information and color information of an interested area;
4) data processing: preprocessing an original spectrum, and screening out characteristic wavelengths related to the total acid content;
5) fusing characteristic wavelength and image color information with the measured total acid content to establish a regression model, evaluating the established model, and judging the effectiveness of the model;
6) and taking the characteristic spectrum variable to be detected as the input of the regression model to obtain the result of the total acid content of the fermented grains to be detected.
2. The method for detecting the total acid content of the fermented grains based on the hyperspectral imaging technology as claimed in claim 1, wherein in step 1), the number of the fermented grain samples of different layers of different cellars in a winery is 128, the fermented grain samples are collected in two different periods, the fermented grain samples of the upper, middle and lower layers of 13 cellars in the winery are collected for the first time, a rotary sampler is adopted for each layer to randomly select three sampling points for collection, wherein the depth of each cellar is 2m, the upper sampling point is 0.6m away from the cellars of the cellars, the middle sampling point is 1.1m away from the cellars of the cellars, the lower sampling point is 2m away from the cellars of the cellars, and 117 samples are obtained in total; and in the second collection, 11 cellars are randomly selected from the 13 cellars collected for the first collection for sampling, and each cellar randomly selects one position to obtain 11 samples.
3. The method for detecting the total acid content of the fermented grains based on the hyperspectral imaging technology as claimed in claim 1, wherein the hyperspectral imaging system in the step 1) mainly comprises a hyperspectral camera, an illumination system, a high-precision electronic control objective table and a computer with processing software; the collected spectral range is 940-1730nm, 224 wave bands are totally formed, and the spectral resolution is 3.3 nm; the exposure time of the hyperspectral camera is 4.02ms, the acquisition frequency is 50Hz, the moving speed of the objective table is 16.42mm/s, a three-dimensional hyperspectral image data block of the fermented grain sample is obtained in a linear array push-broom manner, and the acquired hyperspectral image is calibrated and an interested area is selected.
4. The method for detecting the total acid content of the fermented grains based on the hyperspectral imaging technology according to claim 1, wherein the obtaining of the color information in the step 3) mainly adopts a first moment, a second moment and a third moment of a gray image of a fermented grain sample ROI in H, S, V color space as features; there are 9 features in one sample, and 128 samples result in 128 × 9 color feature data.
5. The method for detecting the total acid content of the fermented grains based on the hyperspectral imaging technology according to claim 1, wherein the pretreatment method in the step 4) is standard normal transformation combined with SG convolution smoothing; the characteristic wavelength extraction method is a regression coefficient method combined with a continuous projection algorithm.
6. The method for detecting the total acid content of the fermented grains based on the hyperspectral imaging technology as claimed in claim 1, wherein the regression model established in the step 5) is a cascade forest model; with R 2 RMSE is used as an evaluation index to determine the effectiveness of the model.
7. The method for detecting the total acid content of the fermented grains based on the hyperspectral imaging technology as claimed in claim 1, wherein the method further comprises the following steps of 7): visualizing the obtained total acid content to obtain the acidity distribution map of the fermented grains.
8. The method for detecting the total acid content of the fermented grains based on the hyperspectral imaging technology as claimed in claim 1, wherein the method for correcting the acquired image comprises the following steps: firstly, a standard polytetrafluoroethylene white board is placed in an imaging area, and a full white reflection calibration image of the standard white board is collected; then, covering the lens cover, and closing the light source to obtain a completely black calibration image; finally, calculating the corrected hyperspectral image according to the following formula;
Figure FDA0003572905890000021
in the formula: r is the corrected image; i is the original image; w is a standard whiteboard image; b is a dark current image with the lens turned off.
9. The method for detecting the total acid content of the fermented grains based on the hyperspectral imaging technology as claimed in claim 1, wherein the region of interest is selected by adopting morphological processing and binary norm calculation, and a circular region is divided by taking the center of the collected fermented grain sample image as a circle center and taking 100 pixels as a radius as a ROI of the sample.
10. The method for detecting the total acid content of the fermented grains based on the hyperspectral imaging technology according to any of the claims 1 to 9, which is used for detecting the total acid content of the fermented grains.
CN202210324632.8A 2022-03-30 2022-03-30 Method for detecting total acid content of fermented grains based on hyperspectral imaging technology Pending CN114813593A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210324632.8A CN114813593A (en) 2022-03-30 2022-03-30 Method for detecting total acid content of fermented grains based on hyperspectral imaging technology

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210324632.8A CN114813593A (en) 2022-03-30 2022-03-30 Method for detecting total acid content of fermented grains based on hyperspectral imaging technology

Publications (1)

Publication Number Publication Date
CN114813593A true CN114813593A (en) 2022-07-29

Family

ID=82532773

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210324632.8A Pending CN114813593A (en) 2022-03-30 2022-03-30 Method for detecting total acid content of fermented grains based on hyperspectral imaging technology

Country Status (1)

Country Link
CN (1) CN114813593A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117288692A (en) * 2023-11-23 2023-12-26 四川轻化工大学 Method for detecting tannin content in brewing grains

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117288692A (en) * 2023-11-23 2023-12-26 四川轻化工大学 Method for detecting tannin content in brewing grains
CN117288692B (en) * 2023-11-23 2024-04-02 四川轻化工大学 Method for detecting tannin content in brewing grains

Similar Documents

Publication Publication Date Title
Zhang et al. Nondestructive measurement of soluble solids content in apple using near infrared hyperspectral imaging coupled with wavelength selection algorithm
CN108663339B (en) On-line detection method for mildewed corn based on spectrum and image information fusion
Zhao et al. Identification of egg’s freshness using NIR and support vector data description
Zhang et al. Fast prediction of sugar content in dangshan pear (Pyrus spp.) using hyperspectral imagery data
CN113049530B (en) Single-seed corn seed moisture content detection method based on near-infrared hyperspectrum
CN111968080B (en) Method for detecting quality of inside and outside of Feicheng peaches based on hyperspectral and deep learning
Moscetti et al. Detection of mold-damaged chestnuts by near-infrared spectroscopy
Wang et al. Monitoring the withering condition of leaves during black tea processing via the fusion of electronic eye (E-eye), colorimetric sensing array (CSA), and micro-near-infrared spectroscopy (NIRS)
CN106596416A (en) Chilled fresh meat quality non-destructive testing method based on hyperspectral imaging technology
Yue et al. A smart data-driven rapid method to recognize the strawberry maturity
Gao et al. Improvement of chlorophyll content estimation on maize leaf by vein removal in hyperspectral image
Wang et al. Study on starch content detection and visualization of potato based on hyperspectral imaging
CN109324000A (en) Kuerle delicious pear soluble solids content prediction technique based on CARS-MIV-SVR
Wang et al. Nondestructive prediction and visualization of total flavonoids content in Cerasus Humilis fruit during storage periods based on hyperspectral imaging technique
Sun et al. Detection of moisture content in peanut kernels using hyperspectral imaging technology coupled with chemometrics
Yu et al. Rapid and visual measurement of fat content in peanuts by using the hyperspectral imaging technique with chemometrics
Lin et al. Identification of rice storage time based on colorimetric sensor array combined hyperspectral imaging technology
CN114813593A (en) Method for detecting total acid content of fermented grains based on hyperspectral imaging technology
Wang et al. pH indicator-based sensor array in combination with hyperspectral imaging for intelligent evaluation of withering degree during processing of black tea
Jiang et al. Rapid nondestructive detecting of wheat varieties and mixing ratio by combining hyperspectral imaging and ensemble learning
CN111445469A (en) Hyperspectrum-based apple damage parameter lossless prediction method after impact
Tian et al. Detection of soluble solid content in apples based on hyperspectral technology combined with deep learning algorithm
Jiang et al. Detecting total acid content quickly and accurately by combining hyperspectral imaging and an optimized algorithm method
Shao et al. Soluble solids content monitoring and shelf life analysis of winter jujube at different maturity stages by Vis-NIR hyperspectral imaging
CN107643255A (en) A kind of method of Non-Destructive Testing hatching egg middle and later periods addled egg

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination