Method and system for rapidly detecting and identifying white spirit

By combining TD-DBDI-MS technology with machine learning algorithms, the problems of cumbersome sample preprocessing and long analysis time in liquor testing have been solved. This has enabled efficient and accurate identification of liquor brands and intelligent early warning of abnormal samples, thus improving testing efficiency and accuracy.

CN121613006APending Publication Date: 2026-03-06XIAMEN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511361673.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-23
Publication Date
2026-03-06

AI Technical Summary

Technical Problem

Existing methods for detecting baijiu (Chinese liquor) suffer from problems such as cumbersome sample pretreatment, long analysis time, and difficulty in real-time analysis. Furthermore, traditional methods are not efficient at identifying baijiu brands and abnormal samples.

Method used

By combining thermal desorption-dielectric barrier discharge ionization-mass spectrometry (TD-DBDI-MS) with machine learning algorithms, and through random forest voting entropy distribution identification and SHAP interpretability analysis, rapid detection and identification of baijiu samples can be achieved.

Benefits of technology

It enables rapid detection of liquor samples without pretreatment, improving detection efficiency and accuracy. It can accurately identify liquor brands and abnormal samples, enhancing the accuracy and robustness of model discrimination.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121613006A_ABST
    Figure CN121613006A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a system for rapidly detecting and identifying white spirit. The method comprises the following steps: constructing a thermal desorption-dielectric barrier discharge ionization-mass spectrum system, optimizing parameters and collecting data to construct a mass spectrum data set with a label; screening out an optimal random forest model for brand classification based on multiple machine learning algorithms; using voting entropy to identify out-of-distribution samples to realize anomaly detection; analyzing a key mass spectrum characteristic peak by combining an SHAP algorithm, and extracting key chemical components; and finally, carrying out qualitative identification through pH value adjustment, three times of extraction and GC-MS database matching, and verifying the chemical rationality of the characteristics. The method integrates rapid detection and accurate analysis, has high accuracy, strong interpretability and engineering practicability, and is suitable for brand identification and authenticity identification of Baijiu. According to the invention, based on the TD-DBDI-MS and machine learning collaborative analysis technology, the problems that brand identification efficiency is low, abnormal samples are difficult to find and results cannot be explained in rapid detection of white spirit are solved, and efficient and verifiable identification is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of liquor testing technology, specifically to a rapid detection and identification method and system for liquor. Background Technology

[0002] Chinese Baijiu is a traditional distilled spirit with a history of over two thousand years, characterized by diverse production techniques and complex aromas. It typically has an alcohol content between 40% and 55%, and the aromas of Baijiu produced by different manufacturers vary significantly due to differences in fermentation processes. The classification system for Baijiu aroma characteristics is primarily based on four basic parameters: production method, raw materials, fermentation agents, and environmental microbial community. Based on current market trends, 12 main aroma types have been defined, including strong aroma, sauce aroma, and light aroma. These three are the three main aroma types dominating Chinese Baijiu production, accounting for approximately 80% of the annual output. Chemical analysis of Baijiu involves a comprehensive characterization of its complex components, including major volatile organic compounds (VOCs), trace additives, and aroma active ingredients.

[0003] Currently, the main methods for detecting and analyzing trace components in baijiu (Chinese liquor) rely on GC-MS, flame ionization, flame photometry, and / or olfactory detection. GC-MS has been widely used for non-targeted analysis of trace components in baijiu, focusing on esters, alcohols, acids, and phenolic compounds. While these methods are useful, they have limitations: (1) cumbersome sample pretreatment procedures (e.g., liquid-liquid extraction, solid-phase microextraction) may lead to analyte loss or degradation; and (2) they are not suitable for real-time analysis due to the time-consuming chromatographic separation and data processing. These limitations highlight the need to develop simplified, high-throughput alternatives to chemical analysis methods, such as those for advancing quality control and aroma engineering in baijiu production.

[0004] Atmospheric pressure ionization mass spectrometry (AIMS) has emerged as a method for directly analyzing complex samples under atmospheric conditions with minimal or no sample preparation requirements. By eliminating time-consuming chromatographic separation steps and vacuum requirements, AIMS significantly simplifies workflows, increases throughput, and enables in-situ real-time monitoring. These characteristics make it particularly valuable in food chemistry, where rapid and accurate component assessment is crucial for quality assurance, authenticity verification, and regulatory compliance. Significant progress has been made in AIMS to enable direct analysis of samples under ambient conditions without extensive pretreatment. Among the many different AIMS techniques available in recent years, DBDI (depleted density discharge) is a low-temperature, non-equilibrium gas discharge method. DBDI efficiently and softly ionizes a wide range of compounds, is easily miniaturized, and is therefore compatible with various ambient sample introduction mass spectrometry systems. Its mild ionization characteristics are particularly suitable for rapid and direct analysis of small molecule organic compounds. Furthermore, when combined with high-speed sampling techniques, DBDI significantly improves analytical efficiency, making it attractive in many different fields. Integrating machine learning (ML) into analytical chemistry also opens new avenues for rapid data interpretation and decision-making. Modern machine learning (ML) methods excel at capturing high-dimensional, nonlinear relationships in complex chemical datasets—capabilities that surpass those of traditional multivariate statistical techniques. By leveraging patterns in mass spectrometry fingerprints, ML can facilitate robust classification, anomaly detection, and evaluation of key variables. Summary of the Invention

[0005] To address the aforementioned issues, this invention proposes a rapid detection and identification method and system for baijiu (Chinese liquor). By integrating TD-DBDI-MS rapid detection, random forest voting entropy distribution external identification, SHAP interpretability analysis, and GC-MS qualitative verification, this method solves the problems of low detection efficiency, difficulty in identifying abnormal samples, and uninterpretable model results in traditional baijiu detection. It achieves efficient, accurate, and reliable baijiu brand identification and component identification.

[0006] On the one hand, a rapid detection and identification method for baijiu (Chinese liquor) includes:

[0007] S1. Build a thermal desorption-dielectric barrier discharge ionization-mass spectrometry (TD-DBDI-MS) data acquisition system for baijiu (Chinese liquor). Set and optimize the injection volume and thermal desorption temperature parameters in the system. Use the injection volume and thermal desorption temperature parameters to collect mass spectrometry data of baijiu samples and anhydrous ethanol. Label the collected mass spectrometry data to obtain a labeled baijiu mass spectrometry dataset.

[0008] S2, based on the labeled baijiu mass spectrometry dataset, uses linear regression (LR), random forest (RF), support vector machine (SVM), extreme gradient boosting (XGBoost), and decision tree (DT) to model brand classification, obtains models for each brand, evaluates the performance of each brand model by classification accuracy, and selects the RF model with the best performance.

[0009] S3. The optimal RF model is used to predict the latest mass spectrometry data of wine varieties. Based on the voting entropy value generated during the model prediction process, the latest mass spectrometry data of wine varieties are identified and detected, and binary classification results of inside and outside distribution are obtained to complete the detection of the latest wine varieties.

[0010] S4. The SHAP algorithm is used to perform interpretability analysis on the detection results of the latest wine varieties, identify the mass spectrometry characteristic peaks that contribute the most to the classification results, and extract the characteristics of key chemical components based on the mass spectrometry characteristic peaks that contribute the most.

[0011] S5. Gas chromatography-mass spectrometry (GC-MS) was used to qualitatively identify the characteristics of key chemical components by matching them to the GC-MS database, verifying the rationality of the key features identified by the model at the chemical level, and completing the identification.

[0012] Furthermore, the thermal desorption-dielectric barrier discharge ionization-mass spectrometry (TD-DBDI-MS) includes a DBDI source, which comprises two concentric copper tubes serving as a high-voltage electrode and a grounding electrode, separated by a ceramic insulator.

[0013] Furthermore, the thermal desorption-dielectric barrier discharge ionization-mass spectrometry TD-DBDI-MS baijiu data acquisition system is specifically used for: injecting baijiu samples into a customized glass injection port via a 0.5μL microsyringe, heating them to a specified temperature via an adjustable temperature-controlled ceramic heating ring for thermal desorption, causing the sample to volatilize, and generating organic compound vapors which enter the dielectric barrier discharge ion source under the vacuum of the mass spectrometer. The dielectric barrier discharge ion source ionizes the generated organic compound vapors, and the ionized products are introduced into the mass spectrometer. The mass spectrometry data is then exported in positive ion mode to construct a dataset.

[0014] Furthermore, based on the voting entropy values ​​generated during the model prediction process, out-of-distribution samples are identified and detected. Specifically, this includes: employing the voting entropy algorithm of Random Forest (RF), where each decision tree generates a class probability distribution for the input sample. By calculating the average of the output probability distributions of all decision trees, the overall prediction probability distribution of the random forest is obtained. A voting entropy function is defined based on the overall prediction probability distribution. This function measures the uncertainty of the model's prediction of the sample. A set of voting entropy values ​​is calculated using a validation set of normal samples within a known distribution, and a detection threshold is determined accordingly. Then, the voting entropy of the sample to be tested is calculated and compared with the detection threshold. If the entropy value is lower than the threshold, it is determined to be a normal sample; if it is higher than the threshold, it is marked as an abnormal data sample, thereby achieving effective identification and detection of out-of-distribution samples.

[0015] Furthermore, gas chromatography-mass spectrometry (GC-MS) was used to qualitatively identify the characteristics of key chemical components by matching them to a GC-MS database, specifically including:

[0016] The pH value of the baijiu sample was adjusted to improve the extraction efficiency of key chemical components. Subsequently, three extractions were performed to enrich the key components and obtain extracts. The obtained extracts were analyzed by gas chromatography-mass spectrometry (GC-MS). Capillary chromatography column was used to achieve effective separation, and mass spectra of each component were obtained by mass spectrometry. Finally, the NIST20 and NIST20s standard databases were matched to complete the qualitative identification and characterization of key chemical components.

[0017] On the other hand, a rapid detection and identification system for baijiu (Chinese liquor) includes:

[0018] The mass spectrometry dataset construction module builds a thermal desorption-dielectric barrier discharge ionization-mass spectrometry TD-DBDI-MS baijiu data acquisition system, sets and optimizes the injection volume and thermal desorption temperature parameters in the system, uses the injection volume and thermal desorption temperature parameters to collect mass spectrometry data of baijiu samples and anhydrous ethanol, and labels the collected mass spectrometry data to obtain a labeled baijiu mass spectrometry dataset.

[0019] The model selection module, based on the labeled baijiu mass spectrometry dataset, uses linear regression (LR), random forest (RF), support vector machine (SVM), extreme gradient boosting (XGBoost), and decision tree (DT) to model brand classification, obtains models for each brand, evaluates the performance of each brand model by classification accuracy, and selects the RF model with the best performance.

[0020] The detection module uses the optimal RF model to predict the latest mass spectrometry data of alcoholic beverages. Based on the voting entropy value generated during the model prediction process, it identifies and detects the latest mass spectrometry data of alcoholic beverages, obtains binary classification results of inside and outside the distribution, and completes the detection of the latest alcoholic beverages.

[0021] The key chemical component extraction module uses the SHAP algorithm to perform interpretability analysis on the detection results of the latest wine varieties, identify the mass spectrometry characteristic peaks that contribute the most to the classification results, and extract the key chemical components based on the mass spectrometry characteristic peaks that contribute the most.

[0022] The identification module uses gas chromatography-mass spectrometry (GC-MS) to qualitatively identify the characteristics of key chemical components by matching them with the GC-MS database, verifying the rationality of the key features identified by the model at the chemical level, and completing the identification.

[0023] The present invention adopts the above technical solution and has the following beneficial effects:

[0024] (1) This invention uses thermal desorption-dielectric barrier discharge ionization-mass spectrometry (TD-DBDI-MS) technology to achieve pretreatment-free, rapid micro-volume injection and direct ionization detection of liquor samples, overcoming the problems of cumbersome pretreatment and long analysis cycle of traditional GC-MS methods, significantly improving detection efficiency and meeting the needs of high-throughput real-time analysis.

[0025] (2) This invention constructs a brand classification system based on the random forest (RF) model, and combines voting entropy to detect out-of-distribution samples and SHAP algorithm to perform interpretability analysis, thereby achieving high-precision identification of liquor brands and intelligent early warning of abnormal samples, and enhancing the accuracy, robustness and decision transparency of the model.

[0026] (3) This invention achieves qualitative identification of key components by adjusting pH value, three-stage extraction and enrichment, GC-MS analysis combined with NIST20 / NIST20s database matching, effectively improving the accuracy of identification results. Attached Figure Description

[0027] Figure 1 This is a flowchart of the rapid detection and identification method for baijiu (Chinese liquor) according to an embodiment of the present invention;

[0028] Figure 2 This is a schematic diagram of the thermal desorption-dielectric barrier discharge ionization-mass spectrometry (TD-DBDI-MS) structure according to an embodiment of the present invention.

[0029] Figure 3 This is a schematic diagram comparing the multi-class classification indicators of 24 types of baijiu and anhydrous ethanol datasets at different thermal desorption temperatures according to an embodiment of the present invention;

[0030] Figure 4 This is the model classification result of liquor brand types in an embodiment of the present invention at a thermal desorption temperature of 260℃;

[0031] Figure 5 This is the performance of the RF model in this embodiment of the invention when testing 7 OOD samples and 70 randomly selected ID data;

[0032] Figure 6 This is an explanation of the features of the RF model for Luzhou Laojiao classification based on SHAP in this embodiment of the invention;

[0033] Figure 7 This is the model classification result of the aroma types of baijiu under the thermal desorption condition of 260℃ in the embodiments of the present invention;

[0034] Figure 8 This is a schematic diagram of the entire process of rapid detection and identification of baijiu (Chinese liquor) according to an embodiment of the present invention;

[0035] Figure 9 This is a diagram of a rapid detection and identification system for baijiu (Chinese liquor) according to an embodiment of the present invention. Detailed Implementation

[0036] The present invention will be further described in detail below with reference to the embodiments and accompanying drawings, but the embodiments of the present invention are not limited thereto.

[0037] like Figure 1 As shown, the rapid detection and identification method for baijiu (Chinese liquor) of the present invention includes:

[0038] S1. A thermal desorption-dielectric barrier discharge ionization-mass spectrometry (TD-DBDI-MS) system for baijiu (Chinese liquor) data acquisition was built. The injection volume and thermal desorption temperature parameters in the system were set and optimized. Mass spectrometry data of baijiu samples and anhydrous ethanol were acquired using the injection volume and thermal desorption temperature parameters. The acquired mass spectrometry data were labeled to obtain a labeled baijiu mass spectrometry dataset.

[0039] Specifically, the thermal desorption-dielectric barrier discharge ionization-mass spectrometry (TD-DBDI-MS) includes a DBDI source, which comprises two concentric copper tubes serving as a high-voltage electrode and a grounding electrode, separated by a ceramic insulator.

[0040] like Figure 2 The diagram shows the core structure of the thermal desorption-dielectric barrier discharge ionization (TD-DBDI) system, which, from right to left, includes: a syringe, a heating device, a dielectric tube, and a mass spectrometer inlet. The syringe injects a trace amount of baijiu sample (e.g., 0.5 μL) into the system. The heating device is a temperature-controlled ceramic heating ring that heats the sample to a set temperature, achieving thermal desorption and causing the organic components to volatilize into vapor. The inlet consists of two concentric copper tubes, serving as the high-voltage electrode and the ground electrode respectively, separated by a ceramic insulator, forming the dielectric barrier discharge ionization source (DBDI). Here, the organic vapor is ionized by plasma. The ionized products enter the mass spectrometer through the mass spectrometer inlet and are detected in positive ion mode, thus obtaining the sample's mass spectrometry data. This structure achieves efficient sample volatilization, stable ionization, and rapid detection, providing reliable technical support for the real-time analysis of baijiu components.

[0041] Specifically, the thermal desorption-dielectric barrier discharge ionization-mass spectrometry TD-DBDI-MS baijiu data acquisition system is used to: inject baijiu samples into a customized glass injection port via a 0.5μL microsyringe; heat the sample to a specified temperature using an adjustable temperature-controlled ceramic heating ring for thermal desorption, causing the sample to volatilize; and generate organic compound vapors that enter the dielectric barrier discharge ion source under the vacuum of the mass spectrometer. The dielectric barrier discharge ion source ionizes the generated organic compound vapors, and the ionized products are introduced into the mass spectrometer. The mass spectrometry data is then exported in positive ion mode to construct a dataset.

[0042] In this embodiment, a certain amount of liquor sample is injected into a custom-designed glass injection port using a microsyringe. The sample is heated by a ceramic heating ring (adjustable between 20 and 400°C) to cause volatilization. The evaporated organic compounds are then drawn into the DBDI source via vacuum through the mass spectrometer. The DBDI source consists of concentric copper tubes, serving as both the high-voltage electrode and the ground electrode, separated by a ceramic insulator. Figure 2 (As shown). The plasma-ionized compound was then introduced into a quadrupole time-of-flight mass spectrometer (Q-TOF; model-API-TOF, TOFWERKAG, Switzerland) for analysis. The mass spectrometer was operated in positive ion mode with a mass range of m / z = 6.8–566.8. The capillary injection voltage and temperature were maintained at 0 V and 200 °C, respectively. The acquired data were used for subsequent calculations and visualization using Python 3.7. The optimized injection volume was 0.5 μL and the thermal desorption temperature was 260 °C, as shown. Figure 3 The diagram shows a comparison of multiple classification indices of 24 types of baijiu and anhydrous ethanol datasets at different thermal desorption temperatures. Part (A) is a radar chart illustrating the classification performance of five machine learning models, and part (B) is a bar chart comparing the classification performance of the RF model.

[0043] Specifically, in this embodiment, to ensure the reliability of the analysis results and minimize differences caused by manual sampling and environmental fluctuations, each type of baijiu sample underwent at least 40 replicate analyses. Anhydrous ethanol, as a control, was also analyzed 40 times under the same conditions. These 25 samples constituted the ID dataset used for training a multi-class classification model for 25 labels (anhydrous ethanol, Fenjiu, Baofeng Daqu, Jiangxiaobai, Kinmen, Moutai, fake Moutai, Lai Zhengheng, Qinghualang, Xijiu, Luzhou Laojiao, Shede, Wuliangye, Yanghe Daqu, Baiyunbian, Haizhilan, Yubingshao, Laobaigan, Dongjiu, Jiuguijiu, Jingzhijiu, and Sitejiu). The other seven types of alcohol not included in the training set (coconut wine, gin, milk wine, pear wine, tequila, rum, and vodka) were considered OOD samples and used only for model testing; each OOD sample underwent 10 analyses. For MS data preprocessing, the MS data was first truncated to the range of m / z = 6.8-350, retaining only data in the lower quality range. This decision was based on the fact that key volatile compounds in baijiu are mainly below m / z = 350, while signals above m / z are usually impurities such as plasticizers, which may reduce the accuracy of the model. To standardize signal intensity and improve training efficiency, the min-max normalization method was applied to each spectrum.

[0044] S2, based on a labeled baijiu mass spectrometry dataset, uses linear regression (LR), random forest (RF), support vector machine (SVM), extreme gradient boosting (XGBoost), and decision tree (DT) to model brand classification, obtaining models for each brand. The performance of each brand model is evaluated by the classification accuracy index, and the RF model with the best performance is selected.

[0045] S3 uses the optimal RF model to predict the latest mass spectrometry data of wine varieties. Based on the voting entropy value generated during the model prediction process, it identifies the latest mass spectrometry data of wine varieties (out-of-distribution sample data), obtains the binary classification results of in-distribution and out-of-distribution, and completes the detection of the latest wine varieties.

[0046] Specifically, based on the voting entropy values ​​generated during the model prediction process, out-of-distribution samples are identified and detected. This includes: employing the voting entropy algorithm of Random Forest (RF), where each decision tree generates a class probability distribution for the input sample. By calculating the average of the output probability distributions of all decision trees, the overall prediction probability distribution of the random forest is obtained. A voting entropy function is defined based on the overall prediction probability distribution, which measures the uncertainty of the model's prediction of the sample. A set of voting entropy values ​​is calculated using a validation set of normal samples within a known distribution, and a detection threshold is determined accordingly. Then, the voting entropy of the sample to be tested is calculated and compared with the detection threshold. If the entropy value is lower than the threshold, it is determined to be a normal sample; if it is higher than the threshold, it is marked as an abnormal data sample, thereby achieving effective identification and detection of out-of-distribution samples.

[0047] S4 uses the SHAP algorithm to perform interpretability analysis on the detection results of the latest wine varieties, identifies the mass spectrometry characteristic peaks that contribute the most to the classification results, and extracts the characteristics of key chemical components based on the mass spectrometry characteristic peaks that contribute the most.

[0048] S5. Gas chromatography-mass spectrometry (GC-MS) was used to qualitatively identify the characteristics of key chemical components by matching them to the GC-MS database, verifying the rationality of the key features identified by the model at the chemical level, and completing the identification.

[0049] Specifically, in S5, gas chromatography-mass spectrometry (GC-MS) is used to qualitatively identify the characteristics of key chemical components by matching them to a GC-MS database. This includes:

[0050] The pH value of the baijiu sample was adjusted to improve the extraction efficiency of key chemical components. Subsequently, three extractions were performed to enrich the key components and obtain extracts. The obtained extracts were analyzed by gas chromatography-mass spectrometry (GC-MS). Capillary chromatography column was used to achieve effective separation, and mass spectra of each component were obtained by mass spectrometry. Finally, the NIST20 and NIST20s standard databases were matched to complete the qualitative identification and characterization of key chemical components.

[0051] Specifically, in this embodiment, the classification performance of various models is compared on the liquor dataset.

[0052] Model training and testing were performed using Python 3.7. Five machine learning models were employed to classify the MS dataset: LR, RF, SVM, XGBoost, and DT. The MS dataset was divided into training and testing sets in an 8:2 ratio (per ID sample). To ensure model robustness and reliability, 5-fold cross-validation was applied during training, where the training data was divided into five parts, and the model was trained and validated five times using different data combinations. Model performance was evaluated using six key metrics: recall (sensitivity), reflecting the ability to correctly identify positive samples; precision, representing the proportion of predicted positive samples that are actually positive; F1 score, the harmonic mean of precision and recall; CA, the overall percentage of correctly predicted samples; AUC, measuring the model's ability to distinguish between different classes; and MCC, a balance metric suitable for imbalanced datasets.

[0053] First, T-SNE technology was used to visualize the clustering of mass spectrometry data from 24 types of baijiu and anhydrous ethanol. For example... Figure 4The following table shows the classification results of the baijiu brand type model proposed in this invention at a thermal desorption temperature of 260℃: (A) T-SNE clustering analysis of 24 baijiu samples and anhydrous ethanol; (B) the confusion matrix of the RF model's classification results on the training and testing datasets. The 25 samples form clear and separate clusters, indicating that each sample has unique volatile compound characteristics. This demonstrates that the TD-DBDI-MS technology can capture the chemically significant differences between samples, making it suitable for classification tasks. Next, five common machine learning models were used to classify samples collected at a thermal desorption temperature of 260℃ with an injection volume of 0.5 μL. The confusion matrix of the best-performing model—the RF model—was analyzed to gain a deeper understanding of its classification accuracy. On the training set, this model achieved 100% accuracy for all 25 baijiu categories. Notably, it can also correctly distinguish between genuine and counterfeit Moutai samples, demonstrating its strong discriminative ability, even under complex conditions. Next, we identified out-of-order (OOD) samples. Seven types of out-of-order data were selected, totaling 70 spectra (10 replicates per type), to evaluate the model's ability to identify samples outside the known distribution. This identification was performed using an entropy algorithm based on voting results, derived from the voting results of a Random Fields (RF) classifier. In an RF model, each decision tree casts a vote for the predicted category. For out-of-order samples, these votes tend to be highly consistent across different trees, resulting in low entropy (i.e., low uncertainty). Conversely, when encountering out-of-order data samples, the disagreement between trees tends to be greater due to unfamiliarity with the data distribution, leading to higher entropy. By setting an appropriate entropy threshold, out-of-order data samples can be distinguished from known normal categories: samples with low entropy are classified as normal, while samples exceeding the threshold are marked as out-of-order. This approach, based on the inherent uncertainty in ensemble predictions, provides a non-parametric and interpretable method for out-of-order data detection.

[0054] Specifically, such as Figure 5 The figure shows the performance of the RF model in the embodiment of the present invention when testing 7 OOD samples and 70 randomly selected ID data. Among them, (A) voting entropy distribution of ID and OOD samples, (B) confusion matrix when the optimal entropy threshold is 1.77, (CD) the trend of classification accuracy and F1 score with the increase of entropy value, and (E) the relationship between entropy threshold and corresponding voting agreement percentage.

[0055] Specifically, the main steps in this embodiment, summarized by specific formulas, are as follows:

[0056] Step 1: Training phase, using the training sample set

[0057]

[0058] Train the random forest classifier to obtain a model set consisting of T decision trees:

[0059] F = {f1, f2, ..., f F}

[0060] Step 2: Tree-level probability output. For any input sample 𝑥, each decision tree outputs a class probability distribution:

[0061]

[0062] Step 3: Average voting probabilities. Average the probability distributions of all decision trees to obtain the overall prediction probability distribution of the random forest.

[0063]

[0064] Step 4: Calculate voting entropy

[0065] Define a voting entropy function to measure the uncertainty of the model's prediction of sample X:

[0066]

[0067] Step 5: Threshold setting, validation set of samples within a known distribution. The set of entropy values ​​is calculated. And take τ as the detection threshold:

[0068]

[0069] Step 6: Out-of-distribution detection rules

[0070] OOD detection is performed on the input samples based on a comparison of voting entropy and a threshold.

[0071]

[0072] Step 7: Model Visualization and GC-MS Validation

[0073] SHAP values ​​were used to understand how the model makes decisions. SHAP values ​​originate from game theory and are based on the idea that each feature (such as a specific m / z value) acts as a "participant" that influences the model's final outcome.

[0074] Specifically, such as Figure 6The diagram illustrates the feature interpretation of the RF model for Luzhou Laojiao classification based on SHAP in this embodiment of the invention. (A) shows the relationship between m / z values ​​and their impact on the model output based on SHAP values ​​(left) and a SHAP summary plot (right), ranking the importance of the 20 m / z values ​​that contribute most to the model's classification. (B) shows the annotated DBDI-MS spectrum of Luzhou Laojiao at 260℃, highlighting the positions of these positively correlated key m / z features. This embodiment uses a SHAP interpreter to visualize the classification weights of the RF model to distinguish Luzhou Laojiao from the other 24 samples and identify the 20 most important features. The SHAP feature ranking plot shows the importance hierarchy of the m / z ratio, while the SHAP value-impact relationship plot visually explains the specific impact of these 20 features. Each point represents a sample, and vertical stacking indicates sample density. Red indicates features positively correlated with the classification of Laojiao (improving prediction scores), blue indicates negative correlation, and purple indicates values ​​close to the average. The width of the colored area reflects the magnitude of the feature's influence. The results showed that the peak at m / z = 157.17 in the mass spectrometry of Luzhou Laojiao had the highest classification importance. Its broad distribution pattern and predominantly red SHAP values ​​(indicating a positive contribution) indicate that the stronger peak intensity at this m / z ratio significantly enhanced the model's ability to identify Luzhou Laojiao samples. Similarly, m / z ratios of 188.27, 159.11, 131.14, 161.21, 85.22, 191.27, 143.18, 132.17, 102.15, 158.20, 232.32, 121.19, and 118.27 made positive contributions to Luzhou Laojiao classification. Conversely, m / z ratios of 201.29, 255.34, 317.44, 127.16, 253.32, and 327.97 showed a negative correlation, meaning that increasing peak intensity reduced the likelihood of classifying Luzhou Laojiao.

[0075] The baijiu liquid (50 mL) was diluted with distilled ultrapure water to a total volume of 10% ethanol solution, then saturated with sodium chloride and extracted with diethyl ether (3 × 20 mL). The mixed extract was further separated into acidic / water-soluble, neutral, and basic fractions using a mixture of pentane / ultrapure water (1:1 v / v) as the extraction solvent. Each fraction was then dried overnight with anhydrous sodium sulfate and concentrated to a final volume of 200 μL under a gentle nitrogen flow. These concentrated fractions were stored at -20 °C for gas chromatography-mass spectrometry (GC-MS) analysis. 1 μL of the concentrated fraction was injected. Volatile matter was analyzed using a GC-MS instrument (Shimadzu TQ8040, Japan) equipped with a DB-5 column (30 m × 0.25 mm × 0.25 μm, Agilent Technologies, USA). Helium (99.999%) was used as the carrier gas at a constant flow rate of 2.0 mL / min. The thermostat was initially maintained at 40 °C, increased to 250 °C at a rate of 5 °C / min, and then held for 15 min. Mass spectra were recorded in the range of 35–550 m / z using electron ionization (70 eV). The ion source temperature was set to 250 °C. For identification, the mass spectra of the analytes were compared with reference spectra from the NIST-20 and NIST20s databases. Compounds with a similarity score ≥85% were matched.

[0076] To verify the reliability of the model's classification weights, it was necessary to identify the chemical substances corresponding to the key mass spectrometry ratios (SMRs) and determine their correlation with the classification of Luzhou Laojiao. For this purpose, GC-MS was used to analyze Luzhou Laojiao. Extracts from the liquor, after three pH adjustments, were sequentially injected into a gas chromatography system, separated by capillary chromatography, and detected by mass spectrometry. Compound identification was achieved through database matching. By projecting the SMR features obtained from SHAP onto the DBDI-MS spectrum of Luzhou Laojiao, significantly higher peak intensities were observed for 14 positively correlated SMRs, while the six negatively correlated SMRs showed extremely low or almost undetectable signals in the DBDI-MS spectrum of Luzhou Laojiao.

[0077] Based on the GC-MS results, characteristic peaks were matched using the [M+H]+ (protonated ions formed by DBDI ionization) and M+ strategies, successfully identifying 12 peaks. By comparing the spectra with a reference database, 36 compounds were matched—including 10 alcohols, 3 acids, 11 esters, 1 ketone, 4 aldehydes, 6 benzene derivatives, and 1 alkane derivative—all of which showed a positive correlation with Luzhou Laojiao in the model-based classification (Table 1). Among them, the following substances have been reported in the literature about Luzhou Laojiao: (Z)-2-nonen-1-ol, (E)-2-nonen-1-ol, 2,7-dimethyl-1-octanol, dihydrocitronellol, 2-propyl-1-heptanol, 2-isopropyl-5-methyl-1-hexanol, (E)-2-decen-1-ol, 1-hexanol, 3-methylbutyric acid (isovaleric acid), valeric acid, heptanoic acid, ethyl lactate, ethyl valerate, ethyl isovalerate, n-propyl lactate, ethyl 5-methylhexanoate, ethyl heptanoate, ethylene glycol monododecyl ether, 2-methylbenzaldehyde (o-methylbenzaldehyde), p-methylbenzaldehyde, m-methylbenzaldehyde, nonanal, 1,3-di-tert-butylbenzene, and 1,1-diethoxy-3-methylbutane.

[0078] The content of unique aroma compounds in Luzhou Laojiao samples was significantly higher than that of 24 other types of liquor. This is attributed to its brewing process, in which the unique microbial ecosystem of the century-old fermentation pits plays a crucial role. During the approximately 60-day solid-state fermentation process, the fermented grains not only serve as a nutrient substrate for microorganisms but also undergo biotransformation into a major source of key aroma-active substances, including esters, alcohols, fatty acids, aldehydes, and ketones. Functional microorganisms in the brewing system (such as Bacillus and Streptococcus, as well as Aspergillus, Aspergillus oryzae, and Rhizopus) drive the saccharification process by secreting extracellular enzyme systems (amylase, glucosylamylase, and cellulase). Genome-wide analysis revealed significant correlations: Burkholderia showed a positive correlation with the synthesis of 1-hexanol; yeast strains played a key regulatory role in the formation of higher alcohols ((E)-2-decen-1-ol and 2,7-dimethyl-1-octanol) and medium- and long-chain fatty acid esters. The formation of benzaldehyde is closely associated with a core bacterial community, including Clostridium, Klebsiella, Coxsackia, Enterobacter, Wesella, Lactobacillus, and Burkholderia. Of particular note is a significant positive correlation between yeast and characteristic medium-chain fatty acid esters such as ethyl-3-methylbutyrate.

[0079] As shown in Table 1 below, this table displays the specific substances whose molecular weights, obtained using this method, are identified by GC-MS. These substances, as confirmed by literature, also correspond to the key flavor compounds of Luzhou Laojiao.

[0080] Table 1. Matching of the top 20 features extracted by SHAP with GC-MS experimental results and database;

[0081]

[0082] To further evaluate the generalization ability of the TD-DBDI-MS platform combined with machine learning algorithms, the classification task was extended to the three main aroma types of Chinese Baijiu. For example... Figure 7 The figures show the model classification results of baijiu aroma types under thermal desorption conditions at 260℃ in this embodiment of the invention. (A) T-SNE clustering analysis of the three baijiu aroma types (light, strong, and sauce aroma), (B) radar chart illustrating the classification performance of the five machine learning models, (C) ROC curves of the five machine learning models on the training and test datasets, and (D) confusion matrix showing the classification results of the RF model on the training and test sets. For example, in T-SNE clustering, the samples mainly formed different clusters according to their respective aroma categories, indicating that the volatile compound features obtained by TD-DBDI-MS effectively captured the unique chemical characteristics of the aroma. To quantitatively evaluate the classification performance, the five machine learning models were trained and validated using the collected dataset. Comparison of radar charts for six standard classification metrics shows that RF and SVM achieved the most consistent and outstanding performance on all metrics, highlighting their effectiveness in capturing and utilizing the chemical differences between different baijiu aroma types. XGBoost also performed relatively well, while LR and DT had lower classification accuracy and poor stability across different metrics. This may be due to their limited ability to capture the inherent nonlinear and high-dimensional interactions in mass spectrometry data. Other models (such as RF and SVM) achieved an AUC of 1.0 on the test set, indicating excellent discriminative power and extremely low overfitting. The steep convergence of their ROC curves also supports their robustness and stability. To analyze the classification accuracy at the category level, a confusion matrix was generated for the RF model. On the test set, the model performed exceptionally well, achieving 100% accuracy for light aromas, 97% for soy sauce aromas, and 100% for strong aromas. The average classification accuracy for different aroma types was 99%, confirming the model's reliability.

[0083] Furthermore, this invention achieves rapid and accurate detection of baijiu (Chinese liquor) by combining TD-DBDI-MS technology with machine learning algorithms, verifying its advantages in detection speed, accuracy, and real-time performance. It provides an efficient solution for food safety testing and has broad application prospects. In the future, this technology can be extended to the detection of various types of food, such as identifying harmful substances like heavy metals and pesticide residues, and screening for food adulteration and spoilage. In market supervision, portable devices developed based on this technology can perform real-time on-site detection, improving regulatory efficiency, reducing costs, and providing immediate feedback to all links in the food supply chain. Further optimization of the detection range and sensitivity, along with the integration of big data and IoT technologies, suggests that this method is expected to become a core support for intelligent food safety monitoring systems, helping regulators transform towards "pre-emptive warning and real-time control." A machine learning model suitable for baijiu mass spectrometry datasets was also designed and constructed. Two algorithms of the same model were trained and tested using ID and OOD samples respectively. The results of this invention demonstrate that the model has excellent detection performance across different baijiu brands. The classification accuracy for 24 types of baijiu and the control (anhydrous ethanol) reached 95%. This invention can distinguish genuine from counterfeit Moutai samples with 100% accuracy and identify OOD (Out of Detail) samples with 87% accuracy, providing a preliminary screening step for multi-classification tasks. The research of this invention shows that TD-DBDI-MS combined with machine learning provides an accurate, simple, and economical method for baijiu (Chinese liquor) detection, with broader application prospects in food quality control. Key spectral features were extracted using SHAP, and 12 characteristic peaks were successfully matched using the [M+H]+ (protonated ions formed by DBDI ionization) and M+ strategies. GC-MS was used to identify 36 diagnostic compounds. Matching these 36 compounds—including 10 alcohols, 3 acids, 11 esters, 1 ketone, 4 aldehydes, 6 benzene derivatives, and 1 alkane derivative—showed high consistency with previously reported brand-specific markers. This indicates that the method has good interpretability and reliability.

[0084] Specifically, such as Figure 8 The diagram illustrates the entire process of rapid detection and identification of baijiu (Chinese liquor): First, data is collected from baijiu samples using thermal desorption (TD), dielectric barrier discharge ionization (DBDI), and mass spectrometry (MS). Next, the collected dataset is input into a classification model to generate results such as brand classification, genuine / counterfeit Moutai classification, out-of-distribution sample classification, and aroma type classification. Finally, gas chromatography-mass spectrometry (GC-MS) is used for qualitative identification of key chemical components, ensuring the accuracy and reliability of the classification results. This entire process achieves a systematic operation from sample processing to data analysis and final identification, improving the efficiency and accuracy of baijiu detection.

[0085] like Figure 9 As shown, this embodiment also discloses a rapid detection and identification system for baijiu (Chinese liquor), including:

[0086] The mass spectrometry dataset construction module 91 builds a thermal desorption-dielectric barrier discharge ionization-mass spectrometry TD-DBDI-MS baijiu data acquisition system, sets and optimizes the injection volume and thermal desorption temperature parameters in the system, uses the injection volume and thermal desorption temperature parameters to collect mass spectrometry data of baijiu samples and anhydrous ethanol, labels the collected mass spectrometry data, and obtains a labeled baijiu mass spectrometry dataset.

[0087] Model selection module 92, based on the labeled baijiu mass spectrometry dataset, uses linear regression (LR), random forest (RF), support vector machine (SVM), extreme gradient boosting (XGBoost), and decision tree (DT) to model brand classification, obtains models for each brand, evaluates the performance of each brand model by classification accuracy index, and selects the RF model with the best performance.

[0088] The detection module 93 uses the optimal RF model to predict the latest mass spectrometry data of alcoholic beverages. Based on the voting entropy value generated during the model prediction process, it identifies and detects the latest mass spectrometry data of alcoholic beverages, obtains binary classification results of inside and outside the distribution, and completes the detection of the latest alcoholic beverages.

[0089] The key chemical component extraction module 94 uses the SHAP algorithm to perform interpretability analysis on the detection results of the latest wine varieties, identifies the mass spectrometry characteristic peaks that contribute the most to the classification results, and extracts the key chemical components based on the mass spectrometry characteristic peaks that contribute the most.

[0090] The identification module 95 uses gas chromatography-mass spectrometry (GC-MS) to perform qualitative identification of key chemical components by matching the characteristics with the GC-MS database, verifying the rationality of the key features identified by the model at the chemical level, and completing the identification.

[0091] The specific implementation of a rapid detection and identification system for baijiu (Chinese liquor) is described in this embodiment, and the same rapid detection and identification method for baijiu will not be repeated here.

[0092] Although the invention has been specifically shown and described in conjunction with preferred embodiments, those skilled in the art should understand that various changes in form and detail may be made to the invention without departing from the spirit and scope of the invention as defined in the appended claims, all of which shall be within the scope of protection of the invention.

Claims

1. A method for rapid detection and identification of Baijiu, characterized in that, The method comprises the following steps: S1, a thermal desorption-medium barrier discharge ionization-mass spectrometry (TD-DBDI-MS) liquor data acquisition system is built, the sample injection amount and the thermal desorption temperature parameters in the system are set and optimized, the mass spectrometry data of liquor samples and anhydrous ethanol are acquired by using the sample injection amount and the thermal desorption temperature parameters, the acquired mass spectrometry data are labeled, and a labeled liquor mass spectrometry data set is obtained; S2, based on the labeled liquor mass spectrometry data set, linear regression (LR), random forest (RF), support vector machine (SVM), extreme gradient boosting (XGBoost) and decision tree (DT) are used for brand classification modeling, each brand model is obtained, the performance of each brand model is evaluated through a classification accuracy index, and an optimal RF model is screened out; S3, the optimal RF model is used to predict the latest liquor variety mass spectrometry data, the latest liquor variety mass spectrometry data is identified and detected according to the voting entropy value generated in the model prediction process, a two-class result of distribution inside and outside is obtained, and detection of the latest liquor variety is completed; S4, a SHAP algorithm is used for explainability analysis of the detection result of the latest liquor variety, the mass spectrometry feature peaks with the largest contribution to the classification result are identified, and feature extraction of key chemical components is realized based on the mass spectrometry feature peaks with the largest contribution; S5, gas chromatography-mass spectrometry (GC-MS) technology is used for GC-MS database matching and qualitative identification of the characteristics of the key chemical components, the rationality of the key features identified by the model in the chemical level is verified, and identification is completed.

2. The method for rapid detection and identification of Baijiu according to claim 1, characterized in that, In S1, the thermal desorption-medium barrier discharge ionization-mass spectrometry (TD-DBDI-MS) comprises a DBDI source, the DBDI source comprises two concentric copper tubes inside and outside, which are used as high-voltage electrodes and ground electrodes, and are separated by a ceramic insulator.

3. The method for rapid detection and identification of Baijiu according to claim 1, characterized in that, In S1, the thermal desorption-medium barrier discharge ionization-mass spectrometry (TD-DBDI-MS) liquor data acquisition system is specifically used for: injecting a liquor sample into a customized glass sample inlet through a 0.5 mu L microsyringe, heating the sample to a specified temperature through a temperature-controllable ceramic heating ring for thermal desorption, making the sample volatilize, making organic compound vapor generated under the action of a mass spectrometer vacuum enter a medium barrier discharge ion source, realizing plasma ionization of the generated organic compound vapor through the medium barrier discharge ion source, introducing the ionized products into the mass spectrometer, and detecting mass spectrometry data in a positive ion mode to construct a data set after the mass spectrometry data are exported.

4. The method for rapid detection and identification of Baijiu according to claim 1, characterized in that, In S3, the voting entropy value generated in the model prediction process is used to identify and detect out-of-distribution samples. Specifically, the voting entropy algorithm of random forest RF is used, where each decision tree generates a class probability distribution for the input sample. The overall prediction probability distribution of the random forest is obtained by calculating the average of the probability distributions output by all decision trees. The voting entropy function is defined based on the overall prediction probability distribution, which measures the uncertainty of the model's prediction for the sample. The voting entropy value set is calculated using the known in-distribution normal sample validation set, and the detection threshold is determined accordingly. Then, the voting entropy of the sample to be tested is calculated and compared with the detection threshold. If the entropy value is lower than the threshold, it is determined to be a normal sample. If it is higher than the threshold, it is marked as an abnormal data sample. Thus, the effective identification and detection of out-of-distribution samples are achieved.

5. The method for rapid detection and identification of Baijiu according to claim 1, characterized in that, In S5, the GC-MS database matching qualitative identification of the characteristics of the key chemical components is performed using GC-MS technology. Specifically, the pH value of the liquor sample is adjusted to improve the extraction efficiency of the key chemical components. Then, three extractions are performed to enrich the key components, and the extract is obtained. The obtained extract is analyzed by GC-MS, and the capillary chromatographic column is used for effective separation. The mass spectrum of each component is obtained by mass spectrometry detection. Finally, the NIST20 and NIST20s standard databases are matched to complete the qualitative identification and characteristic confirmation of the key chemical components. It includes:

6. A system for rapid detection and identification of Baijiu, characterized in that, A mass spectrum data set construction module is built to build a thermal desorption-medium resistance discharge ionization-mass spectrometry TD-DBDI-MS liquor data acquisition system. The sample size and thermal desorption temperature parameters in the system are set and optimized. The mass spectrum data of the liquor sample and anhydrous ethanol are collected using the sample size and thermal desorption temperature parameters. The collected mass spectrum data is labeled to obtain a labeled liquor mass spectrum data set. A model screening module is used to build a brand classification model based on the labeled liquor mass spectrum data set using linear regression LR, random forest RF, support vector machine SVM, extreme gradient boosting XGBoost, and decision tree DT. The performance of each brand model is evaluated by the classification accuracy rate index, and the optimal RF model is selected. A detection module uses the optimal RF model to predict the latest liquor variety mass spectrum data. According to the voting entropy value generated in the model prediction process, the latest liquor variety mass spectrum data is identified and detected to obtain the in-distribution and out-of-distribution binary classification results, and the detection of the latest liquor variety is completed. A key chemical component extraction module uses the SHAP algorithm to perform interpretability analysis on the detection results of the latest liquor variety, identifies the most contributed mass spectrum feature peaks, and extracts the characteristics of the key chemical components based on the most contributed mass spectrum feature peaks. An identification module uses GC-MS technology to perform GC-MS database matching qualitative identification of the characteristics of the key chemical components, verifies the rationality of the key features identified by the model in the chemical aspect, and completes the identification. ​