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
image
fermented grains
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

本发明提供一种基于高光谱成像技术检测糟醅中总酸含量的方法,所述方法包括:收集糟醅样本,测定糟醅的总酸含量;利用高光谱成像系统采集高光谱图像并校正,获取感兴趣区域的平均光谱信息和颜色信息;对光谱信息进行SNV‑SG预处理;使用RC‑SPA筛选光谱的特征波长,并得到各样本的高光谱特征值;将特征值和颜色信息的融合数据和所述总酸含量构建回归模型;将待测样本的高光谱特征值作为回归模型的输入,得到待测糟醅的总酸含量;对糟醅ROI内总酸含量进行可视化分析。本发明通过高光谱的图谱特征能够精确的检测糟醅中的总酸含量,实现在线检测。

Figure 202210324632

The invention provides a method for detecting the total acid content in grains of grains based on hyperspectral imaging technology. The method includes: collecting grains of grains samples, measuring the total acid content of grains grains; Obtain the average spectral information and color information of the region of interest; perform SNV‑SG preprocessing on the spectral information; use RC‑SPA to filter the characteristic wavelengths of the spectrum, and obtain the hyperspectral eigenvalues of each sample; fuse the eigenvalues and color information The data and the total acid content are used to construct a regression model; the hyperspectral eigenvalues of the sample to be tested are used as the input of the regression model to obtain the total acid content of the grains to be tested; the total acid content in the ROI of the grains is visually analyzed. The present invention can accurately detect the total acid content in the grain grains through the characteristics of the hyperspectral spectrum, and realize online detection.

Figure 202210324632

Description

基于高光谱成像技术的糟醅总酸含量的检测方法Detection method of total acid content in fermented grains based on hyperspectral imaging technology

技术领域technical field

本发明为基于高光谱成像技术的糟醅总酸含量的检测方法,属于固态酿造中固态发酵指标检测技术领域。The invention relates to a method for detecting the total acid content of fermented grains based on hyperspectral imaging technology, and belongs to the technical field of solid-state fermentation index detection in solid-state brewing.

背景技术Background technique

在白酒酿造行业中,糟醅是白酒蒸馏的原料,是风味化合物的直接来源。其中酸是形成浓香型白酒,适宜的酸度有利于白酒糖化发酵和产量的提高,如果酸度不够,将会导致白酒的风味不够浓香且口味单调;但酸度过高,又会抑制有益微生物(主要为酵母菌)的生长繁殖,而影响白酒的出酒率,酒味欠佳。目前在传统白酒的生产工艺中,对糟醅的品质和糟醅发酵的好坏等进行判断时,都是依靠工人师傅的感官评价或者常规理化测定方法,操作繁琐,质检效率低。In the liquor brewing industry, glutinous rice grains are the raw material for liquor distillation and the direct source of flavor compounds. Among them, acid is the formation of strong-flavor liquor, and suitable acidity is conducive to the improvement of liquor saccharification and fermentation and yield. If the acidity is not enough, the flavor of liquor will not be strong enough and the taste is monotonous; but the acidity is too high, which will inhibit beneficial microorganisms ( Mainly for the growth and reproduction of yeast), which affects the liquor yield and the liquor taste is not good. At present, in the production process of traditional liquor, when judging the quality of fermented grains and the quality of fermented grains, they all rely on the sensory evaluation of the workers or the conventional physical and chemical measurement methods, which are cumbersome to operate and have low quality inspection efficiency.

比如中国专利CN104007113B,发明名称为糟醅酸度的检测方法,其记载了糟醅酸度检测方法步骤包括:配制糟醅溶液,加入酚酞,用颜色传感器测出初始红色光强值X,根据X与糟酷溶液红色光强的二次函数曲线Y=-9.67879*10-4*X2+0.70671*X-17.37787计算出Y,根据M=X-Y,从而计算出当达到滴定终点时糟酷溶液的红色光强值M;滴加碱溶液,拌匀,检测溶液的红色光强值N,当N小于M时,停止滴定;通过消耗碱溶液的量,计算出糟醅的酸度值。该专利方法可以准确地检测浓香型、酱香型和清香型等各大香型糟醅酸度值。但专利所述的糟醅酸度含量的检测方法具有破坏性,样本检测过后不能再进行使用,如果样本量较大的话就会造成资源的浪费。另外,专利所述的为了能够使糟醅的酸性物质完全地溶于水中优选浸泡时间为25~40min,检测周期较长。并且专利所述的糟醅酸度含量检测方法不能实现在线监测并对糟醅样本的酸度进行可视化。For example, Chinese patent CN104007113B, the name of the invention is the detection method for the acidity of fermented grains, which records that the steps of the detection method of fermented grains acidity include: preparing a fermented grains solution, adding phenolphthalein, measuring the initial red light intensity value X with a color sensor, The quadratic function curve of the red light intensity of the cool solution Y=-9.67879*10 -4 *X 2 +0.70671*X-17.37787 Calculate Y, according to M=XY, to calculate the red light of the cool solution when the titration end point is reached Intensity value M; add alkaline solution dropwise, mix well, detect the red light intensity value N of the solution, when N is less than M, stop the titration; calculate the acidity value of fermented grains by consuming the amount of alkaline solution. The patented method can accurately detect the acidity value of glutinous rice grains of various flavor types such as strong flavor, Maotai flavor and Qing flavor. However, the method for detecting the acidity content of fermented grains described in the patent is destructive, and the sample cannot be used again after the sample is detected. If the sample size is large, it will cause a waste of resources. In addition, the preferred soaking time is 25-40min, and the detection period is longer, in order to completely dissolve the acid substances of the grains in the water. In addition, the method for detecting the acidity content of the fermented grains described in the patent cannot realize on-line monitoring and visualize the acidity of the fermented grains samples.

另外,专利号CN111539920A,发明名称为一种白酒酿造过程中糟醅质量的自动检测,其也记载了一种涉及白酒酿造领域和图像处理领域的白酒酿造过程中糟醅质量的自动检测方法,该方法包括以下步骤:A、建立基于自适应模糊推理算法的糟醅质量评价模型;B、基于已知质量分级的糟醅样品和对应分级结果对糟醅质量评价模型进行训练;C、采用训练后的糟醅质量评价模型对待测糟醅进行检测。该发明适用于全自动化白酒酿造工艺中的配糟环节对糟醅质量的自动检测和评价。但该专利所述的糟醅质量检测方法仅以图像信息(颜色,纹理等特征)作为输入,而图像信息仅能反映糟醅的表面信息,而不能表达内部结构的变化,因此检测精度会相对较低。并且我认为从纹理角度来监测糟醅质量似乎并不正确,由于糟醅是粘稠的颗粒状,如果在一批样本采集完图像之后,对这批样本进行了翻动,那么这批样本将会得到两个差异很大的纹理信息,就有可能会导致同一批样本的检测结果有很大不同。In addition, the patent number CN111539920A, the title of the invention is an automatic detection of the quality of glutinous rice grains in a liquor brewing process, which also records a kind of automatic detection method for the quality of glutinous rice grains in the liquor brewing process involving the field of liquor brewing and image processing. The method includes the following steps: A. Establishing a bad grain quality evaluation model based on an adaptive fuzzy inference algorithm; B. Training the bad grain quality evaluation model based on bad grain samples with known quality classification and corresponding classification results; C. Using the post-training method The quality evaluation model of glutinous rice grains is used to detect the glutinous rice grains to be tested. The invention is suitable for the automatic detection and evaluation of the quality of the grains in the grain-mixing link in the fully automated liquor brewing process. However, the quality detection method for fermented grains described in this patent only takes image information (color, texture and other features) as input, and the image information can only reflect the surface information of fermented grains, but cannot express changes in the internal structure, so the detection accuracy will be relatively lower. And I don't think it seems correct to monitor grain quality from a texture point of view, since grains are sticky and granular, if you flip a batch of samples after they've been imaged, the batch will be Obtaining two very different texture information may lead to very different detection results of the same batch of samples.

发明内容SUMMARY OF THE INVENTION

本发明的目的是针对现有技术中存在的技术问题,提供一种基于高光谱成像技术的糟醅总酸含量的检测方法。在该方法中使用了高光谱成像技术,将传统的成像与光谱技术相结合,同时获得样本的空间和光谱信息,利用优选的特征光谱信息融合颜色信息提高模型的检测速度和检测精度,本发明在划分数据集上采用的是SPXY算法,预处理上采用的是SNV结合SG算法,筛选特征波长选用的是RC-SPA算法,将特征值和颜色信息的融合数据和真实总酸含量构建回归模型,将待测样本的高光谱特征值作为回归模型的输入,得到待测糟醅的总酸含量,并对糟醅ROI内总酸含量进行可视化分析,本发明能够精确的检测糟醅中的总酸含量,克服了传统人工鉴别慢,受主观影响等缺点,为白酒酿造产业化的转型升级以及智能化在线监测糟醅发酵状态提供技术保障。The purpose of the present invention is to provide a method for detecting the total acid content of glutinous rice grains based on hyperspectral imaging technology, aiming at the technical problems existing in the prior art. In this method, hyperspectral imaging technology is used, traditional imaging and spectral technology are combined, the spatial and spectral information of the sample is obtained at the same time, and the preferred characteristic spectral information is used to fuse the color information to improve the detection speed and detection accuracy of the model. The SPXY algorithm is used to divide the data set, the SNV combined with the SG algorithm is used for the preprocessing, and the RC-SPA algorithm is used to filter the characteristic wavelengths. , the hyperspectral characteristic value of the sample to be tested is used as the input of the regression model, the total acid content of the fermented grains to be tested is obtained, and the total acid content in the ROI of the fermented grains is visually analyzed, and the present invention can accurately detect the total acid content in the fermented grains The acid content overcomes the shortcomings of traditional manual identification, such as being slow and subject to subjective influence, and provides technical support for the transformation and upgrading of the industrialization of liquor brewing and the intelligent online monitoring of the fermentation state of fermented grains.

为了实现以上发明目的,本发明的具体技术方案为:In order to realize the above purpose of the invention, the specific technical scheme of the present invention is:

基于高光谱成像技术的糟醅总酸含量的检测方法,包括以下步骤:The detection method for the total acid content of glutinous rice grains based on hyperspectral imaging technology includes the following steps:

1)样本高光谱图像的获取和对采集的图像进行校正:采集酒厂里不同窖池不同层的糟醅样本,利用高光谱成像系统采集样本的高光谱图像;1) Acquisition of sample hyperspectral images and correction of the collected images: Collect glutinous grains samples from different pits and different layers in the winery, and use the hyperspectral imaging system to collect the hyperspectral images of the samples;

2)根据GB/T12456-2021测定糟醅的总酸含量;2) According to GB/T12456-2021, measure the total acid content of glutinous rice grains;

3)获取感兴趣区域的平均光谱信息和颜色信息;3) Obtain the average spectral information and color information of the region of interest;

4)数据处理:对原始光谱进行预处理,并筛选出与总酸含量相关的特征波长;4) Data processing: preprocess the original spectrum, and screen out the characteristic wavelengths related to the total acid content;

5)融合特征波长和图像颜色信息与测定的总酸含量建立回归模型,并对所建立的模型进行评价,判定模型的有效性;5) Integrate the characteristic wavelength and image color information with the measured total acid content to establish a regression model, and evaluate the established model to determine the validity of the model;

6)将待测特征光谱变量作为回归模型的输入获得待测糟醅总酸含量的结果。6) Using the characteristic spectral variable to be measured as the input of the regression model to obtain the result of the total acid content of the fermented grains to be measured.

作为本申请中一种较好的实施方式,步骤1)中所述采集酒厂里不同窖池不同层的糟醅样本共128个。采集样本通常分两个不同时期进行采集,例如第一次采集,我们在同一时间(3月28号)分别随机采集了酒厂内13个窖池的上、中、下层的糟醅样品,每层采用旋转式取样器随机选取三个取样点进行采集,其中窖池深度为2m,上层取样点距离窖池平窖处0.6m,中层取样点距离窖池平窖处1.1m,下层取样点距离窖池平窖处2m,共获得117个样本。第二次采集(3月29日)时,在第一次采集的13个窖池中随机选取11个窖池进行采样,每个窖池随机选取一个位置,获得11个样本。最终一共获得128个糟醅样本。As a preferred embodiment of the present application, in step 1), a total of 128 grains of grains samples were collected from different cellars and different layers in the winery. The samples are usually collected in two different periods. For example, for the first time, we randomly collected samples from the upper, middle and lower layers of the 13 cellars in the winery at the same time (March 28). Three sampling points were randomly selected by a rotary sampler for collection, in which the depth of the pit is 2m, the sampling point of the upper layer is 0.6m away from the level pit of the pit, the sampling point of the middle layer is 1.1m away from the flat pit of the pit, and the sampling point of the lower layer is away from the level of the pit. 2m from the cellar, a total of 117 samples were obtained. During the second collection (March 29), 11 pits were randomly selected from the 13 pits collected for the first time for sampling, and each pit was randomly selected to obtain 11 samples. In the end, a total of 128 samples of glutinous rice were obtained.

所述高光谱成像系统主要由高光谱相机,照明系统,高精度电控载物台和一台装有特殊处理软件的计算机组成。采集的光谱范围为940-1730nm,一共有224个波段,光谱分辨率为3.3nm。设置高光谱相机的曝光时间为4.02ms,采集频率为50Hz,载物台的移动速度为16.42mm/s,通过线阵推扫式获得糟醅样本的三维高光谱图像数据块,并将采集的高光谱图像进行标定和感兴趣区域的选取。The hyperspectral imaging system is mainly composed of a hyperspectral camera, an illumination system, a high-precision electronically controlled stage and a computer equipped with special processing software. The collected spectral range is 940-1730 nm, with a total of 224 bands and a spectral resolution of 3.3 nm. The exposure time of the hyperspectral camera was set to 4.02ms, the acquisition frequency was 50Hz, and the moving speed of the stage was 16.42mm/s. The 3D hyperspectral image data blocks of the grain samples were obtained by the linear push-broom method. Calibration of hyperspectral images and selection of regions of interest.

作为本申请中一种较好的实施方式,步骤3)中所述颜色信息的获取主要采用糟醅样本ROI的灰度图像在H、S、V颜色空间的一阶矩、二阶矩和三阶矩作为特征。一个样本有9个特征,128个样本共得到128×9的颜色特征数据。As a preferred embodiment of the present application, the acquisition of the color information in step 3) mainly adopts the first-order moment, second-order moment and third-order moment in the H, S, and V color spaces of the grayscale image of the glutinous rice sample ROI. moments as features. One sample has 9 features, and 128 samples obtain 128×9 color feature data in total.

作为本申请中一种较好的实施方式,步骤4)中所述预处理方法为标准正态变换结合SG卷积平滑(SNV-SG);所述特征波长提取方法为回归系数法结合连续投影算法(RC-SPA)。As a preferred embodiment in this application, the preprocessing method described in step 4) is standard normal transformation combined with SG convolution smoothing (SNV-SG); the feature wavelength extraction method is regression coefficient method combined with continuous projection Algorithm (RC-SPA).

作为本申请中一种较好的实施方式,步骤5)中所述建立的回归模型为级联森林(CF)模型;以R2、RMSE作为评价指标来判定模型的有效性。As a preferred embodiment in this application, the regression model established in step 5) is a cascade forest (CF) model; R 2 and RMSE are used as evaluation indicators to determine the validity of the model.

作为本申请中一种较好的实施方式,步骤6)所述“将待测特征光谱变量作为回归模型的输入获得待测糟醅总酸含量的结果”之后还包括步骤7):将获得的总酸含量进行可视化,得到糟醅的酸度分布图。As a preferred embodiment in the present application, step 6) includes step 7) after "using the characteristic spectral variable to be measured as the input of the regression model to obtain the result of the total acid content of the fermented grains to be measured": the obtained The total acid content was visualized, and the acidity distribution map of the grains was obtained.

进一步地,对采集的图像进行校正的方法为:首先将标准聚四氟乙烯白板放在成像区域,采集标准白板的全白反射标定图像;然后盖上镜头盖,关闭光源,得到全黑的标定图像;最后按照如下公式计算校正后的高光谱图像。Further, the method for calibrating the collected images is as follows: first, place a standard PTFE whiteboard in the imaging area, and collect a calibration image of the standard whiteboard with full white reflection; then cover the lens cover, turn off the light source, and obtain a full black calibration image; finally, the corrected hyperspectral image is calculated according to the following formula.

Figure BDA0003572905900000051
Figure BDA0003572905900000051

式中:R是校正后的图像;I是原始图像;W是标准白板图像;B是关闭镜头的暗电流图像。Where: R is the corrected image; I is the original image; W is the standard whiteboard image; B is the dark current image with the lens turned off.

进一步地,感兴趣区域的选取具体采用形态学处理和二值范数计算,以采集到的糟醅样本图像中心为圆心,100像素为半径划分一块圆形区域作为样本的ROI。Further, the selection of the region of interest specifically adopts morphological processing and binary norm calculation, with the center of the collected glutinous rice sample image as the center of the circle and 100 pixels as the radius to divide a circular area as the ROI of the sample.

以上所述方法用于对糟醅中总酸含量的检测。The above-mentioned method is used for the detection of the total acid content in the grains.

与现有技术相比,本发明具有以下有益效果:Compared with the prior art, the present invention has the following beneficial effects:

(一)本发明公开的基于高光谱成像技术的糟醅总酸含量的检测方法,首次利用优选的特征光谱信息融合颜色信息提高模型的检测精度,本发明提供的检测方法操作简单,不具有破坏性,克服了人工感官评定法检测糟醅品质耗时长、受主观意识影响等缺点,而且所建立的基于高光谱技术和深度学习的糟醅中总酸含量的快速无损检测方法,大大提高了检测效率,为固态酿造智能化发展提供了理论支撑和技术支持。(1) The method for detecting the total acid content of fermented grains based on the hyperspectral imaging technology disclosed in the present invention utilizes the preferred characteristic spectrum information to fuse color information for the first time to improve the detection accuracy of the model. The detection method provided by the present invention is simple to operate and does not have damage It overcomes the shortcomings of artificial sensory evaluation method to detect the quality of glutinous rice grains, which takes a long time and is affected by subjective consciousness. Moreover, the established rapid non-destructive testing method for total acid content in glutinous rice grains based on hyperspectral technology and deep learning has greatly improved the detection performance. Efficiency provides theoretical support and technical support for the intelligent development of solid-state brewing.

(二)在技术领域方面,本发明采用高光谱成像技术进行糟醅总酸含量的检测,并利用了高光谱成像技术的独特优势,将样本ROI中的每个像素作为最优检测模型的输入,结合伪彩色数据处理对所有像素的总酸含量进行分布可视化。以颜色的变化表征各像素点对应含量的变化,直观地反映样本ROI中糟醅总酸含量分布情况。(2) In the technical field, the present invention adopts hyperspectral imaging technology to detect the total acid content of glutinous rice grains, and utilizes the unique advantages of hyperspectral imaging technology, and uses each pixel in the sample ROI as the input of the optimal detection model , combined with pseudocolor data processing to visualize the distribution of total acid content across all pixels. The change of the corresponding content of each pixel is represented by the change of color, and the distribution of the total acid content of glutinous rice grains in the sample ROI is intuitively reflected.

(三)在数据输入方面,本发明利用优选的特征光谱信息融合颜色信息提高模型的检测精度。在所采集的高光谱图像中,图像信息可以反映出糟醅外部特征,由于糟醅在不同的发酵状态下所呈现的颜色有差别,从而图像在HSV空间下的颜色矩有很大不同;光谱信息可以反映出糟醅内部组分和结构特征,会导致不同发酵时期下的糟醅在不同的波长下光谱反射率有较大的差异。融合图像和光谱信息相比于单一数据集来说,更加全面的蕴含了可以明显区分糟醅发酵情况的特征信息,能够达到精确检测的目的。(3) In terms of data input, the present invention utilizes the preferred characteristic spectrum information to fuse color information to improve the detection accuracy of the model. In the collected hyperspectral images, the image information can reflect the external characteristics of the fermented grains. Because the color of the fermented grains in different fermentation states is different, the color moments of the images in the HSV space are very different; The information can reflect the internal components and structural characteristics of grain grains, which will lead to great differences in the spectral reflectance of grain grains in different fermentation periods at different wavelengths. Compared with a single data set, the fusion of image and spectral information contains more comprehensive feature information that can clearly distinguish the fermentation of fermented grains, and can achieve the purpose of accurate detection.

(四)在数据处理上,本发明采用SNV结合SG对光谱进行预处理,更加去除噪声,增强与成分相关的信息;且本发明开发了一种采用RC结合SPA算法提取特征波长的方法,能够有效的保留与总酸含量相关性最高的波长并消除了波长之间的共线性问题,极大的减少了波长数量,达到快速检测目的。(4) In data processing, the present invention adopts SNV in conjunction with SG to preprocess the spectrum, removes noise more, and enhances the information related to the composition; Effectively retains the wavelength with the highest correlation with the total acid content and eliminates the problem of collinearity between wavelengths, greatly reducing the number of wavelengths and achieving the purpose of rapid detection.

(五)在模型的建立方面,本发明开发了一种深度学习模型—CF来进行糟醅总酸含量的检测。CF模型的超参数设置较少,效率更高,能够执行表征学习,即使只有小规模的训练数据也能表现出优异的性能。该模型能够得到比常规的机器学习算法更加准确和稳定的检测效果。(5) In the aspect of model establishment, the present invention develops a deep learning model-CF to detect the total acid content of fermented grains. The CF model has fewer hyperparameter settings, is more efficient, and is capable of performing representation learning, showing excellent performance even with only small-scale training data. The model can obtain more accurate and stable detection results than conventional machine learning algorithms.

(六)本发明提出了一种无损、快速、准确的检测糟醅总酸含量的方法。该方法有助于监测糟醅的发酵情况,并为白酒酿造过程中工艺参数的及时调整具有指导意义,同时为传统检测手段提供了一种替代方法。(6) The present invention proposes a non-destructive, rapid and accurate method for detecting the total acid content of fermented grains. The method is helpful for monitoring the fermentation of glutinous rice grains, and has guiding significance for the timely adjustment of process parameters in the brewing process of liquor, and provides an alternative method for traditional detection methods.

附图说明Description of drawings

图1为本发明中基于高光谱成像技术的糟醅总酸含量的检测方法的流程示意图;Fig. 1 is the schematic flow sheet of the detection method of the total acid content of glutinous rice grains based on hyperspectral imaging technology in the present invention;

图2为本发明中高光谱ROI的选择流程图;Fig. 2 is the selection flow chart of hyperspectral ROI in the present invention;

图3为本发明中实施例1中的一个样本的HSV图;Fig. 3 is the HSV map of a sample in the embodiment 1 of the present invention;

图4为本发明糟醅样本光谱反射率图像;Fig. 4 is the spectral reflectance image of fermented grains sample of the present invention;

图5为本发明不同总酸含量糟醅样本的可视化云图。Fig. 5 is a visualized cloud image of grains of grains with different total acid contents of the present invention.

具体实施方式Detailed ways

以下通过具体实例说明本发明的实施方式,本领域技术人员可由本说明书所揭露的内容轻易地了解本发明的其他优点与功效。本发明还可以通过另外不同的具体实施方式加以实施或应用,本说明书中的各项细节也可以基于不同观点与应用,在没有背离本发明的精神下进行各种修饰或改变。需说明的是,在不冲突的情况下,以下实施例及实施例中的特征可以相互组合。The embodiments of the present invention are described below through specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments may be combined with each other under the condition of no conflict.

需要说明的是,为使本发明实施例的目的、技术方案和优点更加清楚,下面对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。It should be noted that, in order to make the purposes, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention are described clearly and completely below. Obviously, the described embodiments are part of the embodiments of the present invention. , not all examples.

因此,以下对本发明的实施例的详细描述并非旨在限制要求保护的本发明的范围,而是仅仅表示本发明的选定实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。Thus, the following detailed description of the embodiments of the invention is not intended to limit the scope of the invention as claimed, but rather to represent only selected embodiments of the invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

本发明中所用原料、设备,方法,若无特殊说明,均为本领域的常用原料、设备或方法。The raw materials, equipment and methods used in the present invention, unless otherwise specified, are the common raw materials, equipment or methods in the field.

实施例1:Example 1:

基于高光谱成像技术的糟醅总酸含量的检测方法,包括以下步骤:The detection method for the total acid content of glutinous rice grains based on hyperspectral imaging technology includes the following steps:

1.糟醅样本的采集1. Collection of glutinous rice samples

本实施例采集的糟醅样本取自中国四川宜宾某酒厂。本次采集共分为两次,第一次采集,我们在同一时间(3月28号)分别随机采集了酒厂内13个窖池的上、中、下层的糟醅样品,每层采用旋转式取样器随机选取三个取样点进行采集,其中窖池深度为2m,上层取样点距离窖池平窖处0.6m,中层取样点距离窖池平窖处1.1m,下层取样点距离窖池平窖处2m,共获得117个样本。第二次采集(3月29日)时,在第一次采集的13个窖池中随机选取11个窖池进行采样,每个窖池随机选取一个位置,获得11个样本。最终一共获得128个糟醅样本。The glutinous grains samples collected in this example were taken from a winery in Yibin, Sichuan, China. This collection is divided into two times. For the first collection, we randomly collected the upper, middle and lower glutinous grain samples of 13 cellars in the winery at the same time (March 28). Type sampler randomly selects three sampling points for collection, of which the depth of the pit is 2m, the upper sampling point is 0.6m away from the pit level cellar, the middle level sampling point is 1.1m away from the pit pit level cellar, and the lower layer sampling point is 2m away from the pit pit level cellar. , a total of 117 samples were obtained. During the second collection (March 29), 11 pits were randomly selected from the 13 pits collected for the first time for sampling, and each pit was randomly selected to obtain 11 samples. In the end, a total of 128 samples of glutinous rice were obtained.

2.高光谱图像的获取和校正2. Acquisition and correction of hyperspectral images

采用实验室中推扫式高光谱成像系统获取糟醅的高光谱图像。该系统主要由高光谱相机(芬兰FX17系列)、照明系统(OSRAM,German)、高精度电子控制平台和配备专用处理软件(LUMO-scanner)的计算机组成。采集的光谱范围为940-1720nm,光谱分辨率为3.4nm,一共有224个波段。设置高光谱相机的曝光时间为4.02ms,采集频率为50Hz,载物台的移动速度为16.42mm/s。A push-broom hyperspectral imaging system in the laboratory was used to obtain hyperspectral images of fermented grains. The system is mainly composed of a hyperspectral camera (Finnish FX17 series), an illumination system (OSRAM, German), a high-precision electronic control platform and a computer equipped with special processing software (LUMO-scanner). The collected spectral range is 940-1720 nm with a spectral resolution of 3.4 nm, with a total of 224 bands. The exposure time of the hyperspectral camera was set to 4.02 ms, the acquisition frequency was 50 Hz, and the moving speed of the stage was 16.42 mm/s.

对采集后的光谱图像进行校正,黑白校正的公式如式(1)所示。The collected spectral image is corrected, and the formula for black and white correction is shown in formula (1).

Figure BDA0003572905900000081
Figure BDA0003572905900000081

式中:R是校正后的反射率图像;I是原始高光谱图像;W是标准白板图像;D是关闭镜头的暗电流图像。where R is the corrected reflectance image; I is the original hyperspectral image; W is the standard whiteboard image; D is the dark current image with the lens off.

为了提高建模精度,本发明采用形态学处理和二值范数计算对高光谱图像进行背景去除,以采集到的糟醅样本图像中心为圆心,100像素为半径划分一块圆形感兴趣区域(ROI),具体过程如图2所示。In order to improve the modeling accuracy, the present invention adopts morphological processing and binary norm calculation to remove the background of the hyperspectral image, and divides a circular region of interest ( ROI), the specific process is shown in Figure 2.

3.总酸含量的测定3. Determination of total acid content

糟醅的总酸含量测定(GB/T12456-2021)主要是依据酸碱中和原理,利用PH指示终点的电位滴定法来测定。首先用电子天平称取样品,精度精确至0.001g,定容至聚塞量筒中,静置30min并摇动2-3次,过滤之后与蒸馏水混合,用0.1mol/L NaOH标准溶液进行滴定至pH指示读数为8.2,停止滴定并记下读数。试样的总酸含量计算公式如式(2)所示:Determination of total acid content of fermented grains (GB/T12456-2021) is mainly based on the principle of acid-base neutralization, and is determined by potentiometric titration with PH indicating the end point. First, weigh the sample with an electronic balance, the accuracy is accurate to 0.001g, set the volume to a polyplug measuring cylinder, let it stand for 30 minutes and shake it 2-3 times, filter it and mix it with distilled water, and titrate to pH with 0.1mol/L NaOH standard solution A reading of 8.2 is indicated, the titration is stopped and the reading is recorded. The formula for calculating the total acid content of the sample is shown in formula (2):

X=c×V×100×(100/20)×(1/10) (2)X=c×V×100×(100/20)×(1/10) (2)

式中:X为糟醅样本的总酸含量(mmol/10g);c为NaOH标准溶液的浓度(mol/L);V为试样溶液消耗NaOH的体积(mL);20为吸收滤液体积(mL);100为试样稀释体积(mL);10为试样体积(mL)。In the formula: X is the total acid content of the fermented grains sample (mmol/10g); c is the concentration of NaOH standard solution (mol/L); V is the volume of NaOH consumed by the sample solution (mL); 20 is the volume of absorbed filtrate ( mL); 100 is the sample dilution volume (mL); 10 is the sample volume (mL).

3.提取光谱数据和颜色数据3. Extract spectral data and color data

根据式(3)计算每个样本ROI区域内所有像素点的平均光谱值作为该样本的光谱数据,从而128个样本得到128*224(样本数*波长数)的原始光谱数据;糟醅样本的原始光谱曲线如图4所示,图像中的光谱信息主要是糟醅内部化学组分含氢基团(如C-H、O-H和N-H等)合频和倍频吸收的呈现,主要与蛋白质、水分和脂肪等相关,且在不同品质的糟醅中,化学组分含量也有所差异,利用这些差异引起光谱特定波段吸收峰的变化。According to formula (3), the average spectral value of all pixels in the ROI area of each sample is calculated as the spectral data of the sample, so that 128 samples can obtain the original spectral data of 128*224 (number of samples * number of wavelengths); The original spectral curve is shown in Figure 4. The spectral information in the image is mainly the presentation of the combined frequency and frequency doubling absorption of the hydrogen-containing groups (such as C-H, O-H and N-H, etc.) In addition, the content of chemical components in different quality grains of grains is also different, and these differences are used to cause changes in the absorption peaks of specific wavelength bands of the spectrum.

Figure BDA0003572905900000091
Figure BDA0003572905900000091

式中:为所选ROI的平均光谱值;m为所选ROI内部的像素点个数;n为糟醅高光谱数据的波段数;为第j个像素点在第i个波段下的反射率。where: is the average spectral value of the selected ROI; m is the number of pixels inside the selected ROI; n is the number of bands of the hyperspectral data of glutinous rice; .

本实施例采用颜色矩来表示颜色特征,糟醅的颜色主要有浅黄色,浅褐色和红褐色,分别计算糟醅样本ROI的灰度图像在H、S、V颜色空间的一阶矩、二阶矩和三阶矩。其中一阶矩是均值,代表颜色分量的平均强度;二阶矩是颜色方差,代表不均匀性;三阶矩是颜色分量的偏斜度,代表不对称性。图3为其中一个样本的HSV图,它们的计算公式分别如下,一个样本有9个特征,128个样本共得到128×9的颜色特征数据。In this embodiment, color moments are used to represent color features. The colors of glutinous rice grains are mainly light yellow, light brown and reddish brown. first and third order moments. The first moment is the mean, representing the average intensity of the color components; the second moment is the color variance, representing inhomogeneity; the third moment is the skewness of the color components, representing asymmetry. Figure 3 is the HSV diagram of one of the samples, and their calculation formulas are as follows. One sample has 9 features, and 128 samples obtain a total of 128×9 color feature data.

Figure BDA0003572905900000101
Figure BDA0003572905900000101

Figure BDA0003572905900000102
Figure BDA0003572905900000102

Figure BDA0003572905900000103
Figure BDA0003572905900000103

式中,代表一阶矩,N代表像素点个数,代表第j个像素点的第i个颜色分量(H、S、V三个颜色通道的颜色分量),代表二阶矩,代表三阶矩。In the formula, represents the first-order moment, N represents the number of pixels, represents the i-th color component of the j-th pixel (the color components of the three color channels H, S, and V), represents the second-order moment, and represents the third-order moment. moment.

4.构建检测模型4. Build the detection model

步骤一:实验样本划分Step 1: Division of experimental samples

在数据建模之前,通常会将数据集划分为训练集和测试集,训练集数据主要用于模型的建立,测试集数据主要用于检验模型的检测效果,根据检测效果筛选最优模型。通过SPXY算法将样本数据划分为训练集(105个)和测试集(23个)。糟醅样本总酸含量的统计结果如表1所示。Before data modeling, the data set is usually divided into training set and test set. The training set data is mainly used for model establishment, and the test set data is mainly used to test the detection effect of the model, and the optimal model is selected according to the detection effect. The sample data is divided into training set (105) and test set (23) by SPXY algorithm. The statistical results of the total acid content of the fermented grains samples are shown in Table 1.

表1糟醅样本总酸含量的统计结果Table 1 Statistical results of total acid content of glutinous rice grains samples

Figure BDA0003572905900000104
Figure BDA0003572905900000104

步骤二:光谱预处理Step 2: Spectral Preprocessing

在光谱数据采集过程中,光谱经常会受到各种干扰,例如电噪声、背景噪声、基线漂移和无线电散射,这可能导致光谱变化,并影响多变量校准模型的可靠性。因此,为了减少这些信息因素对建模的影响,提高模型的精度,本发明在建立模型之前采用SNV组合SG算法对数据进行预处理。SNV主要是消除糟醅表面散射以及光程变化对漫反射光谱的影响,其原理是假设光谱数据服从正态分布,按照每个波长下的光谱值减去该条光谱曲线的平均值再除以这条曲线的标准差公式计算,具体的公式为:During spectral data acquisition, spectra are often subject to various disturbances, such as electrical noise, background noise, baseline drift, and radio scattering, which can cause spectral changes and affect the reliability of multivariate calibration models. Therefore, in order to reduce the influence of these information factors on the modeling and improve the accuracy of the model, the present invention adopts the SNV combined SG algorithm to preprocess the data before establishing the model. SNV mainly eliminates the influence of surface scattering and optical path variation on the diffuse reflectance spectrum. The principle is to assume that the spectral data obeys a normal distribution, subtract the average value of the spectral curve from the spectral value at each wavelength, and then divide by The standard deviation formula of this curve is calculated, and the specific formula is:

Figure BDA0003572905900000111
Figure BDA0003572905900000111

其中:

Figure BDA0003572905900000112
in:
Figure BDA0003572905900000112

式中Xisnv是i样本的SNV校正光谱,Xi是i样本的原始光谱矩阵,Xi,j是所有样本的光谱矩阵,m是波段数,Xi是i样本的光谱平均值,σi是光谱的标准差。where X isnv is the SNV corrected spectrum of sample i, X i is the original spectral matrix of sample i, X i,j is the spectral matrix of all samples, m is the number of bands, X i is the spectral mean of sample i, σ i is the standard deviation of the spectrum.

SG能够对光谱进行平滑处理,平滑后可减少噪声,S-G卷积平滑与移动窗口平滑类似,不同之处在于它是通过多项式来对移动窗口内的数据进行多项式最小二乘拟合,实质是一种加权平均法,强调中心点的中心作用。但是在使用此方法时需要注意移动窗口宽度的选择,过小会过滤不掉噪声,过大会把有效地信息平滑掉。计算公式如下:SG can smooth the spectrum, which can reduce noise after smoothing. S-G convolution smoothing is similar to moving window smoothing, the difference is that it uses polynomials to perform polynomial least squares fitting on the data in the moving window, which is essentially a A weighted average method, emphasizing the central role of the center point. However, when using this method, you need to pay attention to the selection of the width of the moving window. If it is too small, the noise will not be filtered out, and if it is too large, the effective information will be smoothed out. Calculated as follows:

Figure BDA0003572905900000113
Figure BDA0003572905900000113

式中Xisg是i样本的S-G校正光谱,w是窗口大小,hi是平滑系数。where X isg is the SG-corrected spectrum of sample i , w is the window size, and hi is the smoothing coefficient.

步骤三:数据降维处理Step 3: Data dimensionality reduction processing

采集的高光谱数据存在大量冗杂和共线性的信息,并且数据量过大容易造成模型复杂、计算量大的问题。故本发明采用RC-SPA组合算法对光谱进行特征波长的提取。所述RC-SPA算法包括以下步骤:The collected hyperspectral data has a lot of redundant and collinear information, and the large amount of data can easily lead to the problems of complex model and large amount of calculation. Therefore, the present invention adopts the RC-SPA combination algorithm to extract the characteristic wavelength of the spectrum. The RC-SPA algorithm includes the following steps:

首先通过偏最小二乘回归建立糟醅中总酸含量和平均光谱反射率的回归模型,由于回归表达式中每个波长的回归系数分别表征了各波长的贡献比重,系数的绝对值越大对回归模型的影响越大。本发明选取光谱数据与总酸含量建立的回归方程中绝对值大于1000的回归系数对应的波长作为选择的波长,共得到22个波长组合;然后采用SPA算法对RC算法提取的特征波长进行二次优化,去除共线性波长,SPA是一种前向变量选择方法,在向量空间中执行简单的投影操作即可消除冗余,获得有价值变量的子集并解决共线性问题。得到的新变量是在所有剩余变量中与前面选取的变量在正交子空间上具有最大投影值的变量,SPA算法具体操作步骤如下:Firstly, the regression model of total acid content and average spectral reflectance in fermented grains is established by partial least squares regression. Since the regression coefficient of each wavelength in the regression expression represents the contribution ratio of each wavelength, the greater the absolute value of the coefficient, the greater the The greater the impact of the regression model. The invention selects the wavelength corresponding to the regression coefficient whose absolute value is greater than 1000 in the regression equation established by the spectral data and the total acid content as the selected wavelength, and obtains a total of 22 wavelength combinations; Optimizing, removing collinear wavelengths, SPA is a forward variable selection method that performs a simple projection operation in a vector space to remove redundancy, obtain subsets of valuable variables and solve collinearity problems. The obtained new variable is the variable with the largest projection value on the orthogonal subspace with the previously selected variable among all the remaining variables. The specific operation steps of the SPA algorithm are as follows:

S3-1:记初始迭代向量为xk(0),提取特征波长个数为N,光谱矩阵为J列,随机选取光谱矩阵的一列(第j列),把j列的值赋给xj,记作xk(0)S3-1: Denote the initial iteration vector as x k(0) , the number of extracted characteristic wavelengths as N, and the spectral matrix as column J. Randomly select a column of the spectral matrix (column j), and assign the value of column j to x j , denoted as x k(0) ;

S3-2:将剩余的列向量位置的集合记为s,S3-2: Denote the set of remaining column vector positions as s,

Figure BDA0003572905900000121
Figure BDA0003572905900000121

S3-3:分别计算xj对剩余列向量的投影,S3-3: Calculate the projection of x j to the remaining column vectors, respectively,

Figure BDA0003572905900000122
Figure BDA0003572905900000122

S3-4:选择最大投影值的光谱波长,

Figure BDA0003572905900000123
S3-4: Select the spectral wavelength of the maximum projected value,
Figure BDA0003572905900000123

S3-5:令xj=px,j∈s,n=n+1,如果n<N,则回到S3-2步骤循环计算;S3-5: Let x j =p x , j∈s, n=n+1, if n<N, go back to step S3-2 for cyclic calculation;

S3-6:最后提取出的波长为:{xk(n)=0,…,N-1},根据训练集数据的检测结果,最小的RMSE值对应的k(0)和N就是最优初始变量和变量数。最终得到1538.3nm、1566.8nm、1595.2nm、1659.4nm这四个光谱波长为影响糟醅总酸含量的特征光谱波长,由这四个特征光谱波长得到各样本的高光谱特征值。S3-6: The wavelength finally extracted is: {x k(n) =0,...,N-1}, according to the detection results of the training set data, k(0) and N corresponding to the smallest RMSE value are the optimal Initial variables and number of variables. Finally, four spectral wavelengths of 1538.3nm, 1566.8nm, 1595.2nm and 1659.4nm are obtained as the characteristic spectral wavelengths that affect the total acid content of fermented grains, and the hyperspectral characteristic values of each sample are obtained from these four characteristic spectral wavelengths.

步骤四:构建检测模型Step 4: Build the detection model

级联森林(CF)是基于决策树的集成学习方法,逐层处理特征信息,与神经网络类似,但CF模型的超参数设置较少,效率更高,即使只有小规模的训练数据也能表现出优异的性能。CF中每一个级联包含2个随机森林和2个完全随机森林,每一个森林都是由回归树构成。此外,中间级联的扩展过程中,对新扩展的级联用验证集进行评估,如果没有显著的性能增益,则终止。这样提前终止模型既可以有效避免模型出现过拟合现象,又可以避免模型过于复杂。Cascaded Forest (CF) is an ensemble learning method based on decision trees, which processes feature information layer by layer, similar to neural networks, but the CF model has fewer hyperparameter settings and is more efficient, even with small-scale training data. excellent performance. Each cascade in CF contains 2 random forests and 2 full random forests, each of which is composed of regression trees. In addition, during the expansion process of the intermediate cascade, the newly expanded cascade is evaluated on a validation set and terminated if there is no significant performance gain. In this way, terminating the model early can not only effectively avoid the overfitting of the model, but also avoid the model from being too complicated.

本申请人使用偏最小二乘(PLSR)、支持向量回归(SVR)和CF算法分别建立糟醅高光谱数据与总酸含量的检测模型,高光谱数据为特征值与图像颜色数据的融合。采用训练集的均方根误差(RMSEC)、测试集的均方根误差(RMSEP)、训练集的决定系数(RC 2)、测试集的决定系数(RP 2)和剩余预测偏差(RPD)来评估模型的性能。此外,通过RMSEC和RMSEP之间的绝对差值(AB_RMSE)来评估模型的稳健性,其值越小说明所见模型越稳定。RPD表示模型的相对检测性能:RPD的值在1.5到2之间表明模型的检测能力差,在2到2.5之间表明可以实现有效的检测,2.5和3之间或者更大,表明模型具有很好的检测精度,最佳的模型应该具有较高的RP 2值、RPD值和较低的RMSEP、AB_RMSE。The applicant used Partial Least Squares (PLSR), Support Vector Regression (SVR) and CF algorithms to establish detection models of fermented grains hyperspectral data and total acid content, respectively. Hyperspectral data is the fusion of eigenvalues and image color data. The root mean square error (RMSEC) of the training set, the root mean square error of the test set (RMSEP), the coefficient of determination of the training set (R C 2 ), the coefficient of determination of the test set (R P 2 ), and the residual prediction deviation (RPD) were used ) to evaluate the performance of the model. In addition, the robustness of the model is assessed by the absolute difference between RMSEC and RMSEP (AB_RMSE), the smaller the value, the more stable the model seen. RPD represents the relative detection performance of the model: a value of RPD between 1.5 and 2 indicates that the model has poor detection ability, between 2 and 2.5 indicates that effective detection can be achieved, and between 2.5 and 3 or greater indicates that the model has very good detection ability. For good detection accuracy, the best model should have high R P2 value, RPD value and low RMSEP, AB_RMSE .

在相同的预处理和相同的特征值下的建模结果如表2所示。如表2所示,PLSR的RPD的值为1.4768,RMSEC和RMSEP的值分别为0.9824和0.8656,检测效果差,不适用于糟醅总酸含量的检测;SVR模型的RPD和AB_RMSE的值分别为5.9139和0.1520,检测效果优于PLSR,次于CF,CF模型的RPD值为6.4744,AB_RMSE的值为0.0407,检测精度最高,稳定性最好。故本发明选择CF模型构建糟醅总酸含量的检测模型。The modeling results under the same preprocessing and the same eigenvalues are shown in Table 2. As shown in Table 2, the RPD value of PLSR is 1.4768, and the values of RMSEC and RMSEP are 0.9824 and 0.8656, respectively. The detection effect is poor, and it is not suitable for the detection of total acid content of grains. The values of RPD and AB_RMSE of the SVR model are respectively 5.9139 and 0.1520, the detection effect is better than PLSR, second to CF, the RPD value of CF model is 6.4744, the value of AB_RMSE is 0.0407, the detection accuracy is the highest, and the stability is the best. Therefore, the present invention selects the CF model to construct the detection model of the total acid content of fermented grains.

表2 CF、SVR、PLSR的建模结果Table 2 Modeling results of CF, SVR and PLSR

Figure BDA0003572905900000141
Figure BDA0003572905900000141

步骤五:可视化Step 5: Visualization

将ROI内每个像素的数据代入检测糟醅总酸含量的模型中,得出各像素点的总酸含量值。然后将每个像素点的含量值拉伸至0-255灰度范围,依据Jet色度带原理得到每个糟醅总酸含量的可视化分布云图。图5为其中三个不同总酸含量的分布可视化图,能够很直观的看到总酸的分布情况和各像素点的差异。Substitute the data of each pixel in the ROI into the model for detecting the total acid content of glutinous rice grains, and obtain the total acid content value of each pixel point. Then, the content value of each pixel is stretched to the grayscale range of 0-255, and the visual distribution cloud map of the total acid content of each fermented grain is obtained according to the principle of Jet chromaticity band. Figure 5 is a visualization of the distribution of three different total acid contents, which can intuitively see the distribution of total acid and the difference of each pixel point.

最终测试集的真实值与检测值如下表:The real and detected values of the final test set are as follows:

Figure BDA0003572905900000142
Figure BDA0003572905900000142

Figure BDA0003572905900000151
Figure BDA0003572905900000151

实施例2:Example 2:

为了证明该模型的稳定性和泛化性,本发明采用宜宾该酒厂不同发酵时期的糟醅样本进行检测分析,该批的检测样本分别为第0天,第8天,第16天,第24天,第32天的四个不同发酵阶段采集的糟醅,共计120个样本,按照实施例1所使用的检测方法,最终模型的评价指标分别是RC 2=0.9982,RMSEC=0.0255,RP 2=0.9897,RMSEP=0.0446,RPD=6.9853。In order to prove the stability and generalizability of the model, the present invention adopts the samples of glutinous rice grains from different fermentation periods in the Yibin winery for detection and analysis. On the 24th day and on the 32nd day, the fermented grains collected in four different fermentation stages, a total of 120 samples, according to the detection method used in Example 1, the evaluation indicators of the final model are R C 2 =0.9982, RMSEC = 0.0255, R P2 = 0.9897 , RMSEP=0.0446, RPD=6.9853.

在确定这个发明方案的过程中,出现过误差较大的情况,例如:In the process of determining this invention scheme, there have been cases with large errors, such as:

1.在最开始我们并没有对光谱进行预处理,采用了原始光谱进行后续的建模分析,由于光谱中存在大量的噪声信号,导致建模出现较差的结果,此时的评价指标分别是RC 2=0.8764,RMSEC=0.0931,RP 2=0.7621,RMSEP=0.1278,RPD=1.5445。1. At the beginning, we did not preprocess the spectrum, but used the original spectrum for subsequent modeling analysis. Due to the presence of a large number of noise signals in the spectrum, the modeling results were poor. The evaluation indicators at this time are: R C 2 =0.8764, RMSEC=0.0931, R P 2 =0.7621, RMSEP=0.1278, RPD=1.5445.

2.未使用特征提取算法进行光谱优化,使用了全波长进行建模,由于光谱中存在大量冗余信息,导致建模速度变慢,且建模效果并不理想,具体的评价指标分别为RC 2=0.8595,RMSEC=0.5809,RP 2=0.8743,RMSEP=0.6022,RPD=2.0602。2. Spectral optimization is not performed using feature extraction algorithm, but full wavelength is used for modeling. Due to the large amount of redundant information in the spectrum, the modeling speed is slow, and the modeling effect is not ideal. The specific evaluation indicators are R C2 =0.8595, RMSEC= 0.5809 , Rp2 =0.8743, RMSEP= 0.6022 , RPD=2.0602.

以上所述仅为本发明的典型实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。The above are only typical embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present invention shall be included in the protection scope of the present invention. within.

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 (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115586159A (en) * 2022-11-04 2023-01-10 四川轻化工大学 Method for evaluating aging association degree of white spirit based on mid-infrared spectrum detection technology
CN117288692A (en) * 2023-11-23 2023-12-26 四川轻化工大学 Method for detecting tannin content in brewing grains

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106872370A (en) * 2017-02-23 2017-06-20 浙江大学 Anthocyanin content method for measuring in a kind of red bayberry based on EO-1 hyperion
CN109883967A (en) * 2019-02-26 2019-06-14 江苏大学 A method for quality classification of Chinese mitten crab based on information fusion
CN110441249A (en) * 2019-09-10 2019-11-12 四川轻化工大学 Method for building pit mud total acid prediction model based on hyperspectral image technology
CN111539920A (en) * 2020-04-16 2020-08-14 泸州老窖酿酒有限责任公司 Automatic detection method for fermented grain quality in white spirit brewing process

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106872370A (en) * 2017-02-23 2017-06-20 浙江大学 Anthocyanin content method for measuring in a kind of red bayberry based on EO-1 hyperion
CN109883967A (en) * 2019-02-26 2019-06-14 江苏大学 A method for quality classification of Chinese mitten crab based on information fusion
CN110441249A (en) * 2019-09-10 2019-11-12 四川轻化工大学 Method for building pit mud total acid prediction model based on hyperspectral image technology
CN111539920A (en) * 2020-04-16 2020-08-14 泸州老窖酿酒有限责任公司 Automatic detection method for fermented grain quality in white spirit brewing process

Non-Patent Citations (12)

* Cited by examiner, † Cited by third party
Title
刘昱微, 微波加热牛肉品质的高光谱成像无损检测研究, 30 April 2018 (2018-04-30), pages 6 - 7 *
刘昱微: "微波加热牛肉品质的高光谱成像无损检测研究", 中国优秀硕士学位论文全文数据库工程科技I辑, no. 2019, 15 January 2019 (2019-01-15), pages 35 *
唐凯, 基于高光谱图像技术的茶叶霉菌菌落总数检测研究, 30 April 2018 (2018-04-30), pages 8 - 10 *
唐凯: "基于高光谱图像技术的茶叶霉菌菌落总数检测研究", 中国优秀硕士学位论文全文数据库工程科技I辑, no. 2019, 15 May 2019 (2019-05-15), pages 34 - 12 *
孙海霞: "多源因素影响下鲜枣品质的光谱和成像检测研究", 中国博士学位论文全文数据库农业科技辑, no. 2020, 15 July 2020 (2020-07-15), pages 77 *
安霆: "基于光谱与图像的红茶萎凋水分感知模型研究", 中国优秀硕士学位论文全文数据库工程科技I辑, no. 2020, 15 August 2020 (2020-08-15), pages 42 *
李金敏, 基于高光谱的水稻叶片氮含量估计的深度森林模型研究, 31 January 2021 (2021-01-31), pages 1345 *
李金敏: "基于高光谱的水稻叶片氮含量估计的深度森林模型研究", 作物学报, vol. 47, no. 7, 15 January 2021 (2021-01-15), pages 1342 - 1350 *
李金敏: "基于高光谱的水稻叶片氮含量估计的深度森林模型研究", 作物学报, vol. 47, no. 7, 31 January 2021 (2021-01-31), pages 1342 - 1350 *
王庆庆: "金银花贮藏过程中绿原酸含量的高光谱检测方法研究", 中国优秀硕士学位论文全文数据库工程科技I辑, no. 2021, 15 June 2021 (2021-06-15), pages 33 *
闻萍, 基于高光谱与数字图像信息融合的注水羊肉检测研究, 30 June 2019 (2019-06-30), pages 9 *
闻萍: "基于高光谱与数字图像信息融合的注水羊肉检测研究", 中国优秀硕士学位论文全文数据库工程科技I辑, no. 2020, 15 January 2020 (2020-01-15), pages 9 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115586159A (en) * 2022-11-04 2023-01-10 四川轻化工大学 Method for evaluating aging association degree of white spirit based on mid-infrared spectrum detection technology
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
CN111968080B (en) A detection method for internal and external quality of Feicheng peach based on hyperspectral and deep learning
CN113049530B (en) Single-seed corn seed moisture content detection method based on near-infrared hyperspectrum
CN103063585B (en) Melon and fruit degree of ripeness Rapid non-destructive testing device and detection system method for building up
CN1995987A (en) Non-destructive detection method and device for agricultural and animal products based on hyperspectral image technology
CN114663821B (en) Real-time nondestructive detection method for product quality based on video hyperspectral imaging technology
CN114813593A (en) Method for detecting total acid content of fermented grains based on hyperspectral imaging technology
CN105241821A (en) Slightly decayed fruit quick identification method based on smell spectral imaging technology
CN104280349A (en) Method for identifying hollowness of white radishes based on hyperspectral image
CN105628708A (en) Quick nondestructive testing method for multi-parameter quality of south Xinjiang red dates
CN115661813A (en) Rapid classification and detection method of multi-grain mixed broken particles based on hyperspectral imaging technology
CN111398211A (en) Information distinguishing and processing method of rhizoma atractylodis granules
CN114324215A (en) A kind of lemon leaf chlorophyll content and its two-dimensional distribution detection method
CN115424006A (en) Multi-source multi-level data fusion method applied to crop phenotypic parameter inversion
CN111192260A (en) Melon quality detection method based on hyperspectral image depth feature fusion
CN116559111A (en) A method for identifying sorghum varieties based on hyperspectral imaging technology
Yu et al. Nondestructive testing of external defects on Nanguo pear
Zhang et al. Development of a hyperspectral imaging system for the early detection of apple rottenness caused by P enicillium
CN115546141A (en) A small sample Mini LED defect detection method and system based on multi-dimensional measurement
CN115545383A (en) Binocular stereoscopic vision detection method for crisp appearance quality of strawberries
CN117288692B (en) Method for detecting tannin content in brewing grains
Gomes et al. Towards robust machine learning models for grape ripeness assessment
CN105954205A (en) Spectral imaging-based green plum sugar content and acidity fast non-destructive detection device
Song et al. Rapid detection of imperfect maize kernels based on spectral and image features fusion
CN116429724A (en) Detection method of pollution degree of composite insulator materials based on infrared hyperspectral analysis
CN105115909B (en) The method that fat content profiles in peanut are detected based on high light spectrum image-forming technology

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