Method and device for discriminating authenticity of white spirit
Through HS-SPME-GC×GC-TOFMS technology and deep learning model, the authenticity of liquor samples is automatically determined, and the defects of relying on manual experience and traditional means in the existing technology are solved, and the accuracy and automation of the judgment are improved.
Patent Information
- Application Number
- CN202411925558.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-04-18
AI Technical Summary
The existing methods of authenticity of liquor rely on manual experience and traditional means, and it is difficult to meet the needs of rapid testing, random inspection and supervision in large-scale markets, and lacks automated and intelligent analysis systems.
The HS-SPME-GC×GC-TOFMS technology is used to collect liquor sample data, and a liquor authenticity discrimination database is established through pre-processing. The convolutional neural network and multi-layer perceptron model are constructed based on deep learning technology, and the authenticity categories of the liquor samples to be identified are automatically output.
It improves the accuracy and automation of the authenticity judgment of liquor, reduces the dependence on manual experience, improves the detection efficiency and consistency, and saves labor costs.
Smart Images

Figure CN119848666A_ABST
Abstract
Description
Technical Field
[0001] The invention mainly relates to the technical field of liquor identification, and in particular to a method and device for distinguishing the authenticity of liquor. Background Art
[0002] As a traditional fermented wine, baijiu has a wide range of consumers at home and abroad. However, with the growth of market demand, the problem of counterfeit and inferior baijiu has become increasingly serious, which not only damages the rights and interests of consumers, but also has a serious impact on the brand image and market order of regular wine companies. At present, the authenticity identification of baijiu mainly relies on traditional methods such as sensory evaluation and chemical composition testing. These methods have problems such as reliance on manual experience, complex testing methods, and high identification costs. In dealing with the increasingly complex means of counterfeiting baijiu, they face challenges and are difficult to meet the rapid detection, sampling and supervision needs of the large-scale market.
[0003] In recent years, comprehensive two-dimensional gas chromatography time-of-flight mass spectrometry has become an important tool for complex chemical composition analysis due to its high resolution and high sensitivity. However, existing research mainly focuses on the classification of liquor flavors or ingredients, and its application in counterfeit liquor detection is relatively rare. In addition, data processing and analysis generally rely on expert experience and lack automated and intelligent analysis systems. Summary of the invention
[0004] Technical Problems to be Solved by the Invention
[0005] A method and device for distinguishing the authenticity of liquor are provided, aiming to improve the accuracy and automation of distinguishing the authenticity of liquor.
[0006] The technical solution adopted by the present invention to solve the above technical problems
[0007] In one aspect, the present invention provides a method for determining the authenticity of liquor, the method comprising:
[0008] The HS-SPME-GC×GC-TOFMS data of genuine and fake liquor samples were collected and preprocessed, and the preprocessed HS-SPME-GC×GC-TOFMS data of liquor samples were matched with the genuine and fake categories of liquor to establish a liquor authenticity discrimination database;
[0009] Establishing a liquor authenticity discrimination model, and training the established liquor authenticity discrimination model based on the established liquor authenticity discrimination database;
[0010] The HS-SPME-GC×GC-TOFMS data of the liquor sample to be identified are obtained and input into the trained liquor authenticity identification model. The liquor authenticity identification model automatically outputs the authenticity category of the liquor sample to be identified.
[0011] Furthermore, the HS-SPME-GC×GC-TOFMS data of the authentic and fake liquor samples are HS-SPME-GC×GC-TOFMS total ion current chromatogram images of the authentic and fake liquor samples, which are rectangular HS-SPME-GC×GC-TOFMS images represented by pixels; the HS-SPME-GC×GC-TOFMS images of the authentic and fake liquor samples include a coordinate axis part and a chromatogram part, wherein the horizontal and vertical axes of the coordinate axis part are one-dimensional time and two-dimensional time, respectively.
[0012] Further, the HS-SPME-GC×GC-TOFMS data are preprocessed including:
[0013] Based on the RGB color range or HSV color range of the background color of the chromatogram part in the HS-SPME-GC×GC-TOFMS image, the rectangular area corresponding to the chromatogram part in the HS-SPME-GC×GC-TOFMS image of the liquor sample is identified;
[0014] According to the one-dimensional time and two-dimensional time range in the coordinate axis part of the HS-SPME-GC×GC-TOFMS image of the liquor sample, and the one-dimensional time and two-dimensional time range of the region of interest (the rectangular area corresponding to the chromatogram part in the HS-SPME-GC×GC-TOFMS image of the liquor sample), the range ratio corresponding to the region of interest in the chromatogram part is calculated, and the chromatogram image of the region of interest in the HS-SPME-GC×GC-TOFMS image of the liquor sample is intercepted;
[0015] All chromatographic images with the focus area cut out were reconstructed into square images with the same resolution as the HS-SPME-GC×GC-TOFMS data of liquor samples for establishing the liquor authenticity discrimination dataset.
[0016] Furthermore, the liquor authenticity discrimination model includes a neural network module, a multi-layer perceptron module and a classification output module;
[0017] The convolutional neural network module is any one of CNN, LeNet, AlexNet, ZFNet, VGG, GoogLeNet, ResNet, and DenseNet. Other convolutional neural networks can also be constructed to extract image features from HS-SPME-GC×GC-TOFMS data.
[0018] The multi-layer perceptron module is an MLP network, the input features of the multi-layer perceptron module are the output features of the one-dimensional convolutional neural network module, the output features of the multi-layer perceptron module are true or false category prediction features; the output feature dimension of the multi-layer perceptron module is 2;
[0019] The classification output module uses a Softmax function to convert the output of the multi-layer perceptron module into the predicted probability of real wine and fake wine.
[0020] Furthermore, the training of the liquor authenticity identification module includes:
[0021] The established liquor authenticity identification database is divided into a training set and a test set according to the proportion;
[0022] The HS-SPME-GC×GC-TOFMS data in the training set are used as the input parameters of the liquor authenticity discrimination model, and the corresponding liquor authenticity type is used as the true output label of the liquor authenticity discrimination model to train the liquor authenticity discrimination model; during the training process, the liquor authenticity category prediction value output by the liquor authenticity discrimination model is compared with the corresponding true output label, the loss function is calculated, and the parameters of the liquor authenticity discrimination model are optimized based on the back propagation of the loss function;
[0023] The accuracy of the liquor authenticity discrimination model is verified based on the test set. When the loss function is less than the set loss function threshold, the training of the liquor authenticity discrimination model is completed.
[0024] Furthermore, the loss function is: In the formula, y i is the true or false category label of the i-th liquor sample; is the predicted probability of the model for the i-th liquor sample; N is the total number of liquor samples.
[0025] Furthermore, the fake liquor samples include: fake liquor with illegal additives, fake liquor with poor quality and dilution, fake liquor with counterfeit brands, fake liquor with imitation technology, and fake liquor with recycled and processed products.
[0026] On the other hand, the present invention also provides a liquor authenticity determination device, the liquor authenticity determination device comprising:
[0027] Liquor authenticity model training module; used to establish a liquor authenticity discrimination database and a liquor authenticity discrimination model, and correspond the HS-SPME-GC×GC-TOFMS data of genuine and fake liquor samples to the genuine and fake categories of liquor; based on the established liquor authenticity discrimination database, the established liquor authenticity discrimination model is trained;
[0028] Data acquisition module for liquor samples to be identified: used to obtain HS-SPME-GC×GC-TOFMS data of liquor samples to be identified;
[0029] Liquor authenticity identification module: The liquor authenticity identification module stores a trained liquor authenticity identification model, which is used to output the authenticity category of the liquor sample to be identified based on the HS-SPME-GC×GC-TOFMS data of the liquor sample obtained by the liquor sample data acquisition module.
[0030] Beneficial effects of the present invention
[0031] The present invention collects HS-SPME-GC×GC-TOFMS data of authentic and fake liquor samples and performs preprocessing, matches the preprocessed HS-SPME-GC×GC-TOFMS data of the liquor samples with the authenticity categories of the liquor, establishes a liquor authenticity discrimination database as training data of an established liquor authenticity discrimination model, obtains HS-SPME-GC×GC-TOFMS data of liquor samples to be discriminated and inputs them into the trained liquor authenticity discrimination model, the liquor authenticity discrimination model automatically outputs the authenticity type of the liquor samples to be discriminated, combines deep learning technology with HS-SPME-GC×GC-TOFMS data analysis, automatically realizes authenticity discrimination of liquor samples, can improve efficiency and accuracy of liquor authenticity discrimination and consistency of discrimination results, and also improves the degree of automation of liquor authenticity discrimination, reduces dependence on manual experience, and can save labor costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 It is a flow chart of a method for distinguishing the authenticity of liquor;
[0033] Figure 2 The loss function changes during the training process of the liquor authenticity discrimination model;
[0034] Figure 3 Schematic diagram of the confusion matrix of the prediction results of the training and test sets of the liquor authenticity discrimination model;
[0035] Figure 4 It is a schematic diagram of a liquor authenticity identification device. DETAILED DESCRIPTION
[0036] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present application more clear, the present application is further described in detail below in combination with the implementation methods. Unless otherwise defined, all scientific and technological terms used herein have the same meanings as understood by ordinary technicians in the field.
[0037] Obviously, the described embodiments are only some embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0038] The present invention provides a method for distinguishing the authenticity of liquor. Figure 1 As shown, including:
[0039] S1. Collect HS-SPME-GC×GC-TOFMS data of genuine and fake liquor samples and perform preprocessing. Match the preprocessed HS-SPME-GC×GC-TOFMS data of liquor with the genuine and fake categories of liquor to establish a liquor authenticity discrimination database.
[0040] S2. Establishing a liquor authenticity discrimination model, and training the established liquor authenticity discrimination model based on the established liquor authenticity discrimination database;
[0041] S3, obtaining HS-SPME-GC×GC-TOFMS data of the liquor sample to be identified;
[0042] S4. Input the HS-SPME-GC×GC-TOFMS data of the liquor sample to be identified into the trained liquor authenticity discrimination model. The liquor authenticity discrimination model outputs the authenticity category of the liquor sample to be identified based on the HS-SPME-GC×GC-TOFMS data of the liquor sample.
[0043] Specifically, the authenticity of liquor includes real liquor and fake liquor, among which fake liquor includes but is not limited to liquor produced by the following counterfeiting methods.
[0044] (1) Counterfeit liquor with illegal additives: containing non-food grade ingredients, industrial chemicals or prohibited additives;
[0045] (2) Low-quality diluted counterfeit liquor: using authentic or low-quality liquor as the base liquor and diluting it by adding water, ethanol or other solvents;
[0046] (3) Brand-counterfeiting counterfeit liquor: products with counterfeit brand packaging or using the names of well-known brands;
[0047] (4) Imitation craft-type counterfeit liquor: impersonating authentic liquor by means of non-traditional fermentation processes or artificially adding flavoring agents;
[0048] (5) Recycled and processed counterfeit liquor: counterfeit products that are refilled with recycled bottles, packaging or residual liquor and sold.
[0049] The HS-SPME-GC×GC-TOFMS data of liquor samples are rectangular pixel images, that is, the HS-SPME-GC×GC-TOFMS total ion current chromatogram images of authentic and fake liquors; the HS-SPME-GC×GC-TOFMS total ion current chromatogram images of liquor samples include a coordinate axis part and a chromatogram part, wherein the horizontal and vertical axes of the coordinate axis part are one-dimensional time and two-dimensional time, respectively.
[0050] Therefore, the preprocessing of the collected HS-SPME-GC×GC-TOFMS data of the real and fake liquor samples specifically includes: first, based on the RGB color range or HSV color range of the main background color of the chromatogram part in the HS-SPME-GC×GC-TOFMS total ion current chromatogram image, the rectangular area corresponding to the chromatogram part in the HS-SPME-GC×GC-TOFMS total ion current chromatogram image of the real and fake liquor is identified; then, according to the one-dimensional time and two-dimensional time ranges in the coordinate axis part of the HS-SPME-GC×GC-TOFMS image of the real and fake liquor, as well as the one-dimensional time and two-dimensional time ranges of the focus area Time range, calculate the range ratio corresponding to the focus area in the chromatogram part, and cut out the chromatographic image of the focus area in the HS-SPME-GC×GC-TOFMS image of the authentic and fake liquor by image cropping; reconstruct all the cut-out chromatographic images into square images with the same resolution as the HS-SPME-GC×GC-TOFMS data of the authentic and fake liquor samples, correspond the HS-SPME-GC×GC-TOFMS data of the authentic and fake liquor samples to the authenticity category of the liquor, and establish a liquor authenticity discrimination database; wherein, the authenticity category of the liquor is represented by digital format coding, 1 for true and 0 for false.
[0051] In this embodiment, in the collected HS-SPME-GC×GC-TOFMS image, the background color of the coordinate axis part is black, and the background color of the chromatogram part is blue. Therefore, the RGB color range is used to judge the blue range. The specific judgment method is: R<50 and G<50 and B>100;
[0052] After the blue area is identified, the rectangular area corresponding to the chromatogram part in the HS-SPME-GC×GC-TOFMS image is obtained by calculating the maximum and minimum values of the pixel values in the blue area in two directions;
[0053] In this embodiment, the main chromatogram values do not cover the entire chromatogram area, so this embodiment selects a chromatogram image with a resolution of 15% to 80% in two directions of the pixel image as the focus area;
[0054] Afterwards, the chromatographic image of the area of interest was reconstructed into a square image with the same resolution using the Python language and the resize function in the PIL library. The resolution of the reconstructed square image was 256×256.
[0055] The liquor authenticity discrimination model is constructed based on a convolutional neural network and a multi-layer perceptron network. Specifically:
[0056] The liquor authenticity discrimination model includes a convolutional neural network module, a multi-layer perceptron module and a classification output module;
[0057] The convolutional neural network module is any one of CNN, LeNet, AlexNet, ZFNet, VGG, GoogLeNet, ResNet, and DenseNet networks, and is used to extract image features in HS-SPME-GC×GC-TOFMS images;
[0058] The multi-layer perceptron module is an MLP network, the input features of the multi-layer perceptron module are the output features of the one-dimensional convolutional neural network module, and the output features of the multi-layer perceptron module are true or false category prediction features;
[0059] The output feature dimension of the multi-layer perceptron module is 2;
[0060] The classification output module uses a Softmax function to convert the output of the multi-layer perceptron module into the predicted probability of real wine and fake wine.
[0061] The HS-SPME-GC×GC-TOFMS database of authentic and fake liquors is divided into a training set and a test set according to a ratio of 7:3, 8:2, or 9:1;
[0062] The liquor authenticity discrimination model is trained using the training set, and the liquor authenticity discrimination model is tested using the test set.
[0063] The process of training the liquor authenticity discrimination model includes:
[0064] The authenticity discrimination database is divided into a training set and a test set according to a ratio, the HS-SPME-GC×GC-TOFMS data of liquor samples in the authenticity discrimination database is used as the input of the liquor authenticity discrimination model, and the true and false category prediction features are used as the output of the liquor authenticity discrimination model; the difference between the prediction result of the liquor authenticity discrimination model and the true and false category label is calculated by the loss function; the loss function is: In the formula, y i is the true or false category label (0 or 1) of the i-th liquor sample; is the predicted probability of the model for the i-th liquor sample; N is the total number of liquor samples.
[0065] The model parameters are optimized through the back propagation algorithm until the loss function value of the test set is lower than the preset loss function threshold, or the classification accuracy of the test set is higher than the preset accuracy threshold, so as to obtain a trained liquor authenticity discrimination model.
[0066] In this embodiment, the PyTorch library is used to construct a liquor authenticity discrimination model, the torch.nn.Conv2d function is used to construct a convolutional neural network module, the torch.nn.Linear function is used to construct a multi-layer perceptron module, and the torch.softmax function is used to construct a classification output module; the loss function is constructed using the torch.nn.CrossEntropyLoss function; the optimizer uses the Adam optimizer, and the learning rate is 0.001;
[0067] In the training process of the neural network, since the torch.nn.CrossEntropyLoss function has embedded the softmax process, the liquor authenticity discrimination model is only composed of the convolutional neural network module and the multi-layer perceptron module. In the use of the neural network, the classification output module is added to facilitate the output probability.
[0068] Specifically, the liquor authenticity discrimination model constructed in this embodiment is:
[0069]
[0070] Figure 2 The changes in the loss functions of the training set and test set during the training process of the liquor authenticity discrimination model are shown.
[0071] In the process of applying the liquor authenticity discrimination model, when obtaining the HS-SPME-GC×GC-TOFMS data of the liquor sample to be identified, the acquired HS-SPME-GC×GC-TOFMS data also needs to be preprocessed. The preprocessing method is consistent with the HS-SPME-GC×GC-TOFMS data preprocessing method of the liquor samples in the liquor authenticity discrimination database. The HS-SPME-GC×GC-TOFMS data of the liquor sample to be identified is processed into a 256×256 square image.
[0072] In this embodiment, 8 data are used as the test set, of which 4 are real wines and 4 are fake wines. The present invention can achieve 100% accuracy prediction. The corresponding confusion matrix is as follows: Figure 3 shown.
[0073] The probabilities of the 8 test sets being predicted as real wine and fake wine are:
[0074]
[0075] In this embodiment, the preset accuracy threshold is 90%. Since this embodiment can achieve 100% correct identification of genuine and fake liquors in the test set, the model can be directly used as a trained liquor authenticity discrimination model.
[0076] Figure 4 The structure diagram of the liquor authenticity identification device of the present invention is as follows. The liquor authenticity identification device comprises:
[0077] Liquor authenticity model training module; used to establish a liquor authenticity discrimination database and a liquor authenticity discrimination model, and correspond the HS-SPME-GC×GC-TOFMS data of genuine and fake liquor samples to the authenticity and fake categories of liquor; based on the established liquor authenticity discrimination database, the established liquor authenticity discrimination model is trained;
[0078] Data acquisition module for liquor samples to be identified: used to acquire HS-SPME-GC×GC-TOFMS data of liquor samples to be identified, and to pre-process the acquired HS-SPME-GC×GC-TOFMS data of liquor samples;
[0079] Liquor authenticity identification module: The liquor authenticity identification module stores a trained liquor authenticity identification model, which is used to output the authenticity category of the liquor sample to be identified based on the HS-SPME-GC×GC-TOFMS data of the liquor sample preprocessed by the liquor sample data acquisition module.
Claims
1. A method for determining the authenticity of liquor, characterized in that: include: The HS-SPME-GC×GC-TOFMS data of authentic and fake liquor samples were collected and preprocessed, and the HS-SPME-GC×GC-TOFMS data of the preprocessed liquor samples were matched with the authenticity and fake categories of liquor to establish a liquor authenticity discrimination database; Establishing a liquor authenticity discrimination model, and training the established liquor authenticity discrimination model based on the established liquor authenticity discrimination database; The HS-SPME-GC×GC-TOFMS data of the liquor sample to be identified is obtained and input into the trained liquor authenticity identification model, and the liquor authenticity identification model automatically outputs the authenticity category of the liquor sample to be identified.
2. A method for determining the authenticity of liquor according to claim 1, characterized in that: The HS-SPME-GC×GC-TOFMS data of the authentic and fake liquor samples are HS-SPME-GC×GC-TOFMS total ion current chromatogram images of the authentic and fake liquor samples, which are rectangular HS-SPME-GC×GC-TOFMS images represented by pixels; the HS-SPME-GC×GC-TOFMS images of the authentic and fake liquor samples include a coordinate axis part and a chromatogram part, wherein the horizontal and vertical axes of the coordinate axis part are one-dimensional time and two-dimensional time, respectively.
3. A method for determining the authenticity of liquor according to claim 2, characterized in that: Preprocessing of HS-SPME-GC×GC-TOFMS data includes: Based on the RGB color range or HSV color range of the background color of the chromatogram part in the HS-SPME-GC×GC-TOFMS image, the rectangular area corresponding to the chromatogram part in the HS-SPME-GC×GC-TOFMS image of the liquor sample is identified; According to the one-dimensional time and two-dimensional time ranges in the coordinate axis part of the HS-SPME-GC×GC-TOFMS images of the genuine and fake liquors, and the one-dimensional time and two-dimensional time ranges of the focus area, the range ratio corresponding to the focus area in the chromatogram part is calculated, and the chromatographic image of the focus area in the HS-SPME-GC×GC-TOFMS images of the genuine and fake liquors is intercepted; All chromatographic images of the intercepted area of interest were reconstructed into square images with the same resolution and used as the HS-SPME-GC×GC-TOFMS data of authentic and fake liquor samples to establish a dataset for liquor authenticity discrimination.
4. A method for determining the authenticity of liquor according to claim 1, characterized in that: The liquor authenticity discrimination model includes a neural network module, a multi-layer perceptron module and a classification output module; The convolutional neural network module is any one of CNN, LeNet, AlexNet, ZFNet, VGG, GoogLeNet, ResNet, and DenseNet, and is used to extract image features from HS-SPME-GC×GC-TOFMS data; The multi-layer perceptron module is an MLP network, the input features of the multi-layer perceptron module are the output features of the one-dimensional convolutional neural network module, the output features of the multi-layer perceptron module are true or false category prediction features; the output feature dimension of the multi-layer perceptron module is 2; The classification output module uses a Softmax function to convert the output of the multi-layer perceptron module into the predicted probability of real wine and fake wine.
5. A method for determining the authenticity of liquor according to claim 1, characterized in that: The training of the liquor authenticity discrimination module includes: The established liquor authenticity identification database is divided into a training set and a test set according to the proportion; The HS-SPME-GC×GC-TOFMS data in the training set are used as the input parameters of the liquor authenticity discrimination model, and the corresponding liquor authenticity type is used as the true output label of the liquor authenticity discrimination model to train the liquor authenticity discrimination model; during the training process, the liquor authenticity category prediction value output by the liquor authenticity discrimination model is compared with the corresponding true output label, the loss function is calculated, and the parameters of the liquor authenticity discrimination model are optimized based on the back propagation of the loss function; The accuracy of the liquor authenticity discrimination model is verified based on the test set. When the loss function is less than the set loss function threshold, the training of the liquor authenticity discrimination model is completed.
6. A method for determining the authenticity of liquor according to claim 5, characterized in that: The loss function is: In the formula, y i is the true or false category label of the i-th liquor sample; is the predicted probability of the model for the i-th liquor sample; N is the total number of liquor samples.
7. A method for determining the authenticity of liquor according to any one of claims 1 to 6, characterized in that: The fake liquor samples include: fake liquor with illegal additives, fake liquor with inferior dilution, fake liquor with counterfeit brand, fake liquor with imitation technology, and fake liquor with recycled and processed technology.
8. A liquor authenticity determination device, used to implement a liquor authenticity determination method as claimed in any one of claims 1 to 7, characterized in that: include: Liquor authenticity model training module; It is used to establish a liquor authenticity discrimination database and a liquor authenticity discrimination model, and to correspond the HS-SPME-GC×GC-TOFMS data of genuine and fake liquor samples with the authenticity and fake categories of liquor; and to train the established liquor authenticity discrimination model based on the established liquor authenticity discrimination database; The data acquisition module of liquor samples to be identified is used to acquire the HS-SPME-GC×GC-TOFMS data of the liquor samples to be identified, and to pre-process the acquired HS-SPME-GC×GC-TOFMS data of the liquor samples; Liquor authenticity identification module: The liquor authenticity identification module stores a trained liquor authenticity identification model, which is used to output the authenticity category of the liquor sample to be identified based on the HS-SPME-GC×GC-TOFMS data of the liquor sample preprocessed by the liquor sample data acquisition module.
Citation Information
Cited By
Identification system and method for intrinsic semantic difference learning
CN121476550A