Rapid determination of pit mud moisture content using hyperspectral imaging

Abstract Lack of moisture can lead to the aging of pit mud, excessive moisture will make it difficult to maintain its shape or even collapse. Therefore, a rapid and nondestructive detection technology for moisture in pit mud using hyperspectral imaging was firstly investigated. Modeling efficiency of various processing was compared in visible (400–1,000 nm) and near‐infrared (900–1,700 nm) regions, and the optimal model was SNV‐SPA‐SVM in near‐infrared spectroscopy; the Rpre2 and RMSEP of model were .9953 and 0.0029, respectively. Furthermore, the distribution map showed that the moisture in the new cellar was generally lower than that of old, and the moisture distribution of the old pit mud was more even. Moreover, the moisture content of different layers in the same cellar increased from top to bottom. This work provides strong technical support for liquor brewing enterprises to effectively implement online monitoring of pit mud changes and open a new era for the application of hyperspectral imaging technology in the field of liquor solid‐state fermentation.


| INTRODUC TI ON
As one of the six distilled liquor in the world, Chinese baijiu is an invention that full of creative wisdom and cultural charm in China.
The production and market share of Luzhou-flavor liquor account for about 70% of the entire liquor industry (Hu, 2015). As the foundation for the brewing of Luzhou-flavor liquor, pit mud determines the quality of product to a large extent. The water in pit mud dissolves various organic matter and mineral nutrients and acts as a transporting substance. A series of biochemical reactions in the microbial organism is also inseparable from water (Zhang et al., 2013). Therefore, the lack of water will lead to mud hardening, the precipitation of salt, and the death of some microbes in pit mud, which will eventually cause the degradation of pit mud, thus seriously affect the production (Jing, Tang, Ren, & Yao, 2010). However, the excessive moisture will result in that it is hard to maintain shape even the collapse of the pit. Therefore, the moisture of the mud is regarded as a crucial detection indicator in the evaluation standard of the Luzhouflavor liquor.
At present, there have been many reports on the moisture determination in pit mud. For example, Xie et al. (2018) compared the difference between moisture content in different regions and quality levels and studied its distribution features. Zhang et al. (2014) found that moisture, pH, and humus had a great influence on the quality of the mud based on the analytic hierarchy process. Liu et al. (2018) found that moisture, total nitrogen, and ammonium nitrogen increased with the improvement of the quality of the mud via correlation analysis, the pH value was close to 7. However, all the above method for the determination of the mud moisture is natural drying method, which is destructive, time-consuming, labor-intensive, etc., and the results often lag behind the actual production, which cannot meet the relevant staff to the rapid and nondestructive online assessment of mud.
Therefore, hyperspectral imaging emerged as a rapid, nondestructive, advanced optical technology. Hyperspectral imaging is an image data technology based on a very large number of narrowband. It combines imaging with spectroscopy technology and simultaneously detects the spectral and spatial information, which is closer to the real properties of the object. It has attracted countless researchers as a powerful new tool for lossless online testing a variety of products (Li, Rao, & Ying, 2011). At present, hyperspectral technology has been widely implemented in nondestructive testing of agriculture products, such as apple (Baranowski, Mazurek, & Pastuszka-Woźniak, 2013), cucumber (Cen, Lu, Zhu, & Mendoza, 2016), orange (Li et al., 2011), peach (Pan et al., 2016), potatoes (Cho et al., 2013), cocoa beans (Caporaso, Whitworth, Fowler, & Fisk, 2018), fish (Sivertsen, Heia, Hindberg, & Godtliebsen, 2012), beef (ElMasry, , pork (Barbin, ElMasry, Sun, & Allen, 2012, and cereal crops Orina, Manley, & Williams, 2017;Vigneau, Ecarnot, Rabatel, & Roumet, 2011). Sun et al. (2017) established a quantitative prediction model of chlorophyll content in peaches using hyperspectral imaging and quickly distinguished the degree of decay of peaches. Zou et al. (2011) rapidly detected the chlorophyll content of cucumber leaves, and a visual distribution map was drawn using hyperspectral technology. ElMasry, Sun, and Allen (2013) used hyperspectral imaging to quickly detect fat and protein content in beef and visualize their distribution to compare the differences between various beef samples. Moreover, this technology can also be used to evaluate indicator changes in solid-state fermentation. Zhu et al. (2016) used hyperspectral to investigate the moisture and total acid content of vinegar, and the results showed that it was feasible to determine changes in the main indicators during solid-state fermentation using hyperspectral imaging. However, there has been no report on the application of hyperspectral technology to the solid-state brewing of liquor, and research in this field has been blank.

Due to preliminary experiments and literature review showed
that O-H of moisture has characteristic absorption from visible to near-infrared region even interfere with signals from other compounds. Consequently, the objective of this work is to establish rapid prediction models of pit mud moisture based on near-infrared (900-1,700 nm) and visible spectroscopy (400-1,000 nm), untreated and standard normal variate (SNV) pretreated, full and characteristic spectrum, and three modeling methods including partial least squares regression (PLSR), least squares support vector machine (LS-SVM), and back-propagation network (BP). A total of twenty-four models were acquired. The optimal model was selected through the determination coefficients (R 2 cal and R 2 pre ) and root mean square error (RMSEC and RMSEP) of calibration and prediction set, and the moisture distribution difference of various pit mud samples was visualized based on the obtained optimal model (Figure 1a). This work provides strong technical support for the transformation and upgrading of liquor brewing industrialization and intelligent real-time online monitoring.

| Pit mud samples
The original pit mud samples were collected in June 2019 and provided by Yibin Jinxilai Liquor Co., Ltd, located in the south-central of Sichuan Province (26°03′-34°19′ northern latitude, 97°21′-108°31′ east longitude). The production process flowchart of Luzhou-flavor liquor is shown in Figure 1b. After fermentation, the fermented grains were removed in the cellar; the pit mud around the same layer was collected and fully mixed to form a sample. The sampling sites of the same pit include three layers of upper, middle, and lower, that is, cellar cap, huangshui line, and cellar bottom, so three samples were obtained from the same pit. Finally, a total of 108 pit mud samples were obtained from 36 pits with 12 years (6, 8, 9, 12, 15, 18, 21, 23, 24, 27, 29, and 30), in which each pit age corresponds to No. 1, 2, and 3 pits. The specific sampling method is shown in Figure 2. Collected samples were placed in ice box and transported back to the laboratory for rapid experiments.
The 108 samples were assigned to the calibration set and prediction set with the method of Kennard-Stone (K-S) algorithm according to a proportion of 2:1. Therefore, 72 samples were selected as calibration set for developing the calibration model, whereas the remaining 36 samples were used as prediction set to verify the prediction performance of the calibration model.

| Hyperspectral imaging system and data acquisition
Hyperspectral images of samples were obtained using a hyperspectral imaging system in reflection mode. The system

| Hyperspectral imaging processing
The hyperspectral data collected by the camera are a threedimensional data cube; each pixel contains a full-band spectral curve. Apart from sample information, there are also interference signals, such as dark current, high-frequency random noise in the process of spectral data acquisition. The region of interest (ROI) with 100 × 100 pixels was manually selected from the raw spectra, which should be fairly flat and representative. The average spectral values of each pixel in the ROI were calculated to obtain the data before correction. Because of the nonuniformity of fermentation F I G U R E 2 A diagram of the sampling method status, the growth and metabolism of microbes in pit mud vary greatly, and the spectral values of each pixel will be different under different illumination intensity. To eliminate the systematic error caused by nonuniform illumination, the spectral values were converted into spectral reflectivity via black-and-white correction processing, removing the influence of illumination intensity changes.

TA B L E 1 Parameter setting in near-infrared region
Calibration board should be used for black-and-white correction, considering that the color difference between the samples and board was too large; it was easy to interfere with the collection of spectral data. Therefore, calibration boards which were similar to a specific sample and slightly better in spectral reflectance performance were chosen. Moreover, due to the difference between near-infrared and visible region, a gray Teflon board in the visible region and a beige Teflon board in the near-infrared region were chosen. The dark reflection image was obtained via covering the camera lens with an opaque cap, and a white reflection image was obtained using a Teflon gray and beige board. The corrected relative reflectivity (R) was calculated according to the following equation: where I is the original hyperspectral image, D is the dark image, and W is the white reflectance image. The corrected spectral reflectivity was used for further analysis.

| Determination of moisture content in pit mud
The specific steps of moisture determination in pit mud were as follows: Took clean weighing bottle and placed it in the drying box at 101-105°C. The cap was obliquely supported on the edge of the bottle, heated for 1.0 hr, removed and cooled for 0.5 hr in the dryer.
Weighed and dried it repeatedly until the quality difference between the two times was no more than 2 mg, that is, constant weight.
Weighing 2-10 g sample (accurate to 0.0001 g), put into weighing bottle, the height of the sample was not more than 5 mm, capped after precise weighing, placed in a 101-105°C drying box, the cap was slanted to the edge of the bottle, after 2-4 hr of drying, capped and removed bottle, weighed after cooled in the dryer for 0.5 hr. Then, put it in 101-105°C drying box for about 1 hr, continue to take it out, cooled in the dryer for 0.5 hr, and weighed them again. Repeated the above operation until the quality difference between the two times was no more than 2 mg, that is, constant weight. Moisture content (X) in samples was calculated according to the following equation: where m 1 is the quality of weighing bottles and samples, m 2 is the quality of weighing bottles and samples after drying, m 3 is the quality of weighing bottle, 100 is the conversion factor. Moisture in pit mud was used for further analysis.

| Data processing and analysis
Considering that noise, baseline variation and others may affect the accuracy of the model in the data acquisition process; SNV can effectively remove high-frequency noise (Munera et al., 2017;Yan et al., 2017), prevent baseline drift, and optimize spectral signals.
Thus, original spectral information was preprocessed by SNV, which means that spectra were corrected mainly using mean and variance of samples to eliminate the influence of spectral linear translation, which was shown in Figure 4a,b,c,d. Spectral reflectivity (X i(SNV) ) in samples was calculated according to the following equation: where X i is the spectral mean value of samples, σ i is the spectral standard deviation of samples.
O-H was selective for spectral absorption, whereas the spectral signals produced by the sample were the overlap of various substances in pit mud. To improve the robustness and prediction capability of the Partial least squares regression, LS-SVM, and BP three models were established based on the spectral data of near-infrared, visible, untreated and pretreated, full spectrum, and characteristic spectrum, respectively, combined with the measured values of pit mud moisture, a total of 24 models. The optimal model was obtained by comparing the R 2 and RMSE of the calibration set and prediction set of the models.
Region of interest (100 × 100) was selected in the image, and each pixel in the region was regarded as a sample. The characteristic spectral data corresponding to each sample were brought into the optimal prediction model to calculate the moisture prediction value of all the pixels in the region and then mapped the predicted value to 0-255 for graying; the gray value of each pixel was obtained. Finally, the pseudocolor processing was carried out to acquire the visual images of moisture content in pit mud.

| Moisture content analysis
The statistics of the moisture content measured by the conventional analysis method is listed in Table 3. It can be seen that wide variations in moisture contents ranging from 30% to 40% were obtained, which was the basic data for the establishment of calibration model.

| Spectral analysis of moisture in pit mud
In the whole process of liquor brewing, pit-entry fermentation is a very important process, in which pit mud plays a key role. After decades or even hundreds of years of fermentation, the pit mud contains abundant microbes and metabolites. Hyperspectral imaging technology can quickly detect the main variables of pit mud, explore the fermentation status of microbes via spectral information, and find out the essential differences of the cellar at various layers and ages.
For the convenience of observation, taking pit mud of two ages as an example, the spectral reflectance curves of pit mud of different layers and ages in near-infrared and visible spectroscopy were described. There were six curves including near-infrared full spectrum (224 wavelengths) and visible full spectrum (448 wavelengths), respectively, as shown in Figure 4e,f; one was a new cellar for 6 years, and the other was an old cellar for 30 years. The spectral reflectance of pit mud in 30 years was generally higher than that in 6 years, and the spectral reflectance curves of pit mud at different layers were also different, which indicates that hyperspectral imaging can identify pit mud at different layers and years.

| Feature-related wavelengths selection
To compare and analyze the performance of full spectrum and characteristic spectrum modeling, it was essential to select wavelengths closely related to moisture in pit mud and to eliminate the influence of irrelevant wavelengths. To determine the optimal number of variables, the effects of compounds other than moisture and the  and 125 bands were obtained in the near-infrared region, including untreated and pretreated. Thus, we can know that the numbers of characteristic wavelengths after SPA screening were still large. To clearly show the absorption range correlated with pit mud moisture, we selected four groups of wavelengths with higher frequency to display, respectively, as shown in the Figure 5. The result shows that the characteristic peak of moisture was mostly concentrated below 1,500 nm, both strong absorption in visible and near-infrared spectroscopy, which had similar to that of some study (Workman, 2007).

| Prediction of moisture in pit mud
Pre-experiment with different gradients was carried out to find the characteristic absorption peak of moisture in pit mud; the result showed that feature-related wave bands were within 1,500 nm, which was verified by literature (Workman, 2007). Therefore, in this paper, the spectral information corresponding to the front 180 wavelengths was selected for the modeling of near-infrared spectroscopy. Different quantitative prediction models (PLSR, SVM, BP) were established for calibration set samples based on various mathematical algorithms, totaling 24 models. The optimal prediction model was evaluated and screened through the R 2 and RMSE of the calibration set and prediction set. The SVM model was generally superior to the other two models in calibration and prediction set, regardless of the robustness or predictive performance of the model; thus, it was considered as a relatively good model (Table 4).
Next, on the basis of SVM model, the modeling effects of untreated and SNV pretreated spectral data were compared. From Table 3, we can see that in near-infrared region, the modeling effect of SNV pretreatment was always better than that of untreated spectral data in both full and characteristic bands. Moreover, in the visible range, the pretreated data were significantly better than the untreated on the basis of the full spectrum. In the characteristic spectrum, the untreated model had better generalization performance, but the error was larger. Therefore, the SNV pretreatment was chosen to get rid of noises and prevent the baseline drift.
Further compared and analyzed the performance of the SVM model in near-infrared and visible regions, from Table 3, it can be Finally, compared the model performance of full spectrum and characteristic spectrum, the SVM model based on characteristic spectrum had higher accuracy, smaller error, and better prediction effect than that of characteristic (Table 3). Furthermore, taking a large amount of data in full spectrum modeling and the difficulty in processing into account, large-scale servers were needed. Consequently, under the condition of guaranteeing the accuracy of the model, modeling with characteristic variables was preferred to reduce the computational load and improve the work efficiency. Therefore, the optimal model for quantitative prediction of pit mud moisture was SNV-SPA-SVM model based on near-infrared spectroscopy (Figure 6), The R 2 cal of calibration set was .9995, the RMSEC was 0.0008, the R 2 pre of prediction set was .9953, and the RMSEP was 0.0029.

| Visualization of moisture content
The spectral data of each pixel in the ROI were brought into the optimal model to calculate the predicted value of pit mud moisture content, and then, pseudocolor processing was carried out to obtain the visual distribution map (Figure 7). The result shows that the moisture in the cellar of 6 years was generally lower than that of 30 years, the new cellar was about 36%-38% and the old was about 37%-40%, and the moisture distribution of the old pit mud was more even compared with the new pit. This may be due to the longterm succession of microbial communities, which resulted in the accumulation of a large number of nutrients in pit and increased water holding capacity of pit mud. Moreover, the moisture content of the same cellar increased from top to bottom in turn.

| CON CLUS ION
Pit mud, as the foundation of Luzhou-flavor liquor brewing, plays a decisive role in quality and liquor yield. Moisture content was a crucial factor for the normal metabolism of beneficial microbes in pit mud. In this work, a rapid and nondestructive detection method for moisture in pit mud using hyperspectral imaging was investigated. Raw spectral data of 108 pit mud samples in near-infrared and visible range were collected. SNV was used to remove noise and prevent baseline variation, which may reduce the accuracy of were developed for calibration samples based on full spectrum and specified spectrum; according to the R 2 and RMSE of the calibration and prediction set, SNV-SPA-SVM in near-infrared region was considered as the optimal prediction model. Based on this model, the visual distribution map of pit mud moisture was obtained. The result shows that the moisture content in the new cellar was generally lower than that of old, and the moisture of the same cellar increased from top to bottom in turn. The cloud image can visually display the moisture distribution of pit mud and help to judge the complex fermentation state, thus providing a reference for the online monitoring of pit fermentation.
Consequently, a rapid prediction method for pit mud moisture content was firstly established, which opens the door for the application of hyperspectral imaging technology in liquor solid-state field, and also injects new vigor into the transformation and upgrading of industrialization of Chinese baijiu.

ACK N OWLED G M ENT
This work was supported by Sichuan Science and Technology Program (2018GZ0112); Zigong Science and Technology Program (2018CXJD06).

CO N FLI C T O F I NTE R E S T
The authors declare that they do not have any conflict of interest.

E TH I C A L S TATEM ENT
This study does not involve any human or animal testing.