Baijiu producing area tracing method based on OfficientNet-B4 model

Through the method based on the EfficientNet-B4 model and combined with gas chromatography technology, the high accuracy and low detection technology difficulty of liquor origin traceability were successfully achieved, and the problems of liquor authenticity and source traceability in the existing technology were solved.

CN119989100APending Publication Date: 2025-05-13成都海关技术中心
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510154050.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-12
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

The existing technology is difficult to effectively realize the authenticity of liquor and traceability of origin, resulting in frequent cases of adulteration from the origin, and the existing testing technology is difficult to achieve the expected results.

Method used

Using a method based on the EfficientNet-B4 model, the characteristic map of the liquor sample was obtained through a gas chromatograph, and after pretreatment, the EfficientNet-B4 model was trained to identify the origin of the liquor.

Benefits of technology

It achieves high accuracy and low detection technology difficulty in tracing the origin of liquor. The required sample usage is small and simple to operate. It is suitable for most laboratories and is easy to promote.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119989100A_ABST
    Figure CN119989100A_ABST
Patent Text Reader

Abstract

The invention discloses a Baijiu producing area tracing method based on an OfficientNet-B4 model. The Baijiu producing area tracing method comprises the following steps: acquiring a plurality of Baijiu samples from different producing areas; respectively measuring the plurality of Baijiu samples by using a gas chromatograph to obtain a plurality of corresponding Baijiu spectrums; from each white spirit spectrum, selecting a spectrum image from the time after an ethanol peak to the time when no peak appears, and taking the spectrum image as a characteristic spectrum; each characteristic spectrum is preprocessed; taking each preprocessed atlas image as an input, taking a corresponding production place as a label, and training an OfficientNet-B4 model; and detecting a to-be-detected white spirit sample through the trained OfficientNet-B4 model to obtain the producing area of the to-be-detected white spirit sample. The method has the advantages of small amount of required samples, simple operation, good reproducibility and high accuracy; and the model in the method can be suitable for most laboratories and is easy to popularize.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of traceability and identification, and in particular to a liquor origin tracing method based on an EfficientNet-B4 model. Background Art

[0002] The origin (production area) of liquor has an important impact on the economic value of liquor products. High-quality liquor production areas give liquor products in the production areas higher economic value, and related products can obtain higher market premiums. It can be seen that high-quality liquor production areas are one of the key factors affecting the production of high-quality liquor and an important foundation for the high-quality development of the liquor industry.

[0003] Driven by high economic interests and the influence of information asymmetry, cases of adulteration of liquor authenticity and origin are still common. In this case, it is particularly necessary to achieve liquor authenticity and origin traceability analysis from a technical perspective. Currently, due to the limitations of the development level of detection technology, it is often difficult to achieve the expected results by relying solely on instrumental analysis. Some data analysis methods are needed, and machine learning has an important impact on the application effect of liquor authenticity and origin traceability technology due to its outstanding value in the field of data analysis.

[0004] Therefore, how to reduce the difficulty of tracing the origin of liquor and improve the accuracy of tracing the origin of liquor based on machine learning technology is an urgent problem that technical personnel in this field need to solve. Summary of the invention

[0005] In view of the above problems, the present invention provides a liquor origin tracing method based on the EfficientNet-B4 model to at least solve some of the technical problems mentioned in the above background technology.

[0006] In order to achieve the above object, the present invention adopts the following technical solution:

[0007] The present invention provides a liquor origin tracing method based on the EfficientNet-B4 model, comprising the following steps:

[0008] Obtain liquor samples from multiple different origins;

[0009] Using a gas chromatograph to measure multiple liquor samples respectively, and obtaining multiple corresponding liquor spectra;

[0010] From each liquor spectrum, select the spectrum image starting from the ethanol peak to the end when no peak appears as the characteristic spectrum;

[0011] Preprocess each feature map;

[0012] Take each preprocessed atlas image as input and the corresponding origin as label to train the EfficientNet-B4 model;

[0013] The trained EfficientNet-B4 model is used to detect the liquor samples to obtain the origin of the liquor samples.

[0014] Furthermore, the measurement conditions when using a gas chromatograph for measurement include:

[0015] Injection volume: 1 μL; injection port temperature: 250°C; constant pressure mode; split ratio: 20:1; measurement temperature: 260°C; hydrogen flow rate: 40 mL / min; air flow rate: 400 mL / min; tail blow: 25 mL / min; chromatographic column: Supelco Unkol.

[0016] Furthermore, the atlas image is preprocessed; specifically comprising:

[0017] Use Resize to uniformly adjust the atlas images to a preset size;

[0018] Use ToTensor to convert the atlas image into a tensor format;

[0019] Normalize is used to normalize the atlas image.

[0020] Furthermore, the EfficientNet-B4 model introduces the concept of compound scaling based on the CNN model.

[0021] Furthermore, during the training process, the Adam optimizer was used for gradient update with a learning rate of 0.001.

[0022] Furthermore, after the training is completed, a cross entropy loss function is used to measure the gap between the predicted origin output by the EfficientNet-B4 model and the true label, and the EfficientNet-B4 model is optimized according to the gap.

[0023] Furthermore, after the training is completed, the model performance is evaluated by drawing the loss curve, accuracy curve, and confusion matrix.

[0024] It can be seen from the above technical solution that, compared with the prior art, the present invention discloses a method for tracing the origin of liquor based on the EfficientNet-B4 model, which has the following beneficial effects:

[0025] The present invention combines gas chromatography (GC) with the EfficientNet-B4 model. This is the first time that the EfficientNet-B4 model in deep learning has been used to identify the characteristic spectrum of gas chromatography to obtain the classification results of liquor origin. Compared with the spectrum spectrum, the characteristic spectrum of gas chromatography is conducive to the high performance of the EfficientNet-B4 model in image classification. The combination of the two for liquor samples has a good classification effect.

[0026] The liquor origin tracing method provided by the present invention requires a small amount of sample, is simple to operate, has good reproducibility and high accuracy. The detection technology required by the present invention is relatively low in difficulty, and the established model can be applied to most laboratories and is easy to promote.

[0027] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0029] Figure 1 A schematic flow chart of a liquor origin tracing method provided in an embodiment of the present invention.

[0030] Figure 2 A schematic diagram of a liquor sample spectrum from origin A provided in an embodiment of the present invention.

[0031] Figure 3 A schematic diagram of a liquor sample spectrum from origin B provided in an embodiment of the present invention.

[0032] FIG. 4( a ) is a schematic diagram of training loss and test loss provided in an embodiment of the present invention.

[0033] FIG4( b ) is a schematic diagram of training accuracy and test accuracy provided by an embodiment of the present invention.

[0034] Figure 5 A schematic diagram of a confusion matrix provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0035] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the 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.

[0036] The embodiment of the present invention discloses a liquor origin tracing method based on the EfficientNet-B4 model, see Figure 1 As shown, including:

[0037] S1. Obtain liquor samples from multiple different origins;

[0038] S2. Using a gas chromatograph to measure a plurality of liquor samples respectively to obtain a plurality of corresponding liquor spectra;

[0039] S3, from each liquor spectrum, select the spectrum image starting from the ethanol peak to the end when no peak appears as the characteristic spectrum;

[0040] S4, preprocessing each feature map;

[0041] S5. Take each preprocessed atlas image as input and the corresponding origin as label to train the EfficientNet-B4 model;

[0042] S6. Use the trained EfficientNet-B4 model to test the liquor samples to obtain the origin of the liquor samples.

[0043] Next, each of the above steps will be described respectively.

[0044] In the above step S1, a plurality of liquor samples from different origins are obtained; either base liquor (raw liquor) or finished liquor is acceptable, but the authenticity of the origin of the liquor samples must be guaranteed, that is, they must be determined to be products of the corresponding region, so as to ensure the accuracy of subsequent model training.

[0045] In the above step S2, a gas chromatograph is used to measure a plurality of liquor samples respectively to obtain a plurality of corresponding liquor spectra; the measurement conditions when the gas chromatograph is used for measurement include:

[0046] Injection volume: 1 μL; injection port temperature: 250°C; constant pressure mode; split ratio: 20:1; measurement temperature: 260°C; hydrogen flow rate: 40 mL / min; air flow rate: 400 mL / min; tail blow: 25 mL / min; chromatographic column: Supelco Unkol.

[0047] The reason why gas chromatograph is chosen for measurement in the embodiment of the present invention is that, firstly, gas chromatograph is widely used in various laboratories, which is conducive to later promotion; secondly, its spectrum is very suitable for deep learning models, which helps to improve the accuracy of subsequent model training.

[0048] S3. From each liquor spectrum, select the spectrum image starting from the ethanol peak (excluding the ethanol peak) to the end when no peak appears as the characteristic spectrum; the total detection time of this spectrum is about 32 minutes.

[0049] The main reasons for choosing this feature map are:

[0050] ① This characteristic spectrum includes the main esters and acids in liquor. The types and contents of these trace components can largely reflect the regional differences of liquor from different origins;

[0051] ②The main reason for not including the ethanol peak is that the ethanol peak has a large peak shape and there is no difference in ethanol from different origins. If the ethanol peak is included in the characteristic spectrum, it may have an adverse effect on the training process, so the ethanol peak is not included in the characteristic spectrum;

[0052] ③The total detection time is about 32 minutes. The unified time is mainly for the convenience of application, and this time can include the main esters and acids in the liquor. If the time fluctuates within a certain range of about 32 minutes, it will not affect the result. However, if the fluctuation is large, for example, if one or more peaks are not included in the time of less than 32 minutes, it may affect the training and prediction effects.

[0053] S4. Preprocess each feature map; specifically including:

[0054] Resize is used to uniformly adjust the atlas images to a preset size, such as 256×256;

[0055] Use ToTensor to convert the atlas image into a tensor format for subsequent input into the EfficientNet-B4 model;

[0056] Normalize is used to normalize the atlas image so that the pixel values ​​are within an appropriate range.

[0057] S5. Take each preprocessed atlas image as input and the corresponding origin as label to train the EfficientNet-B4 model;

[0058] Specifically, random_split is used to divide the preprocessed atlas images, for example, 80% of them are used as training sets and 20% as test sets. The custom CustomImageDataset class manages image paths and labels and performs validity checks to prevent loading of damaged or invalid images.

[0059] The above-mentioned EfficientNet-B4 model is an improved and developed model based on CNN. It is a deep learning model suitable for image classification tasks. Compared with the CNN model, EfficientNet introduces the concept of compound scaling and innovatively optimizes the network structure, so that the model can achieve higher accuracy and efficiency with fewer parameters. The high efficiency and high performance of the EfficientNet-B4 model are very suitable for processing the characteristic spectrum of liquor samples obtained by gas chromatography in the present invention (such multi-peak spectrum), and indeed achieve high classification accuracy.

[0060] During the training process, the Adam optimizer is used for gradient updates with a learning rate of 0.001.

[0061] After the training, the test set is used to test the EfficientNet-B4 model, and the cross entropy loss function is used to measure the gap between the predicted origin output by the EfficientNet-B4 model and the actual label, and the EfficientNet-B4 model is optimized according to the gap.

[0062] The present invention combines gas chromatography (GC) with the EfficientNet-B4 model. This is the first time that the EfficientNet-B4 model in deep learning has been used to identify the characteristic spectrum of gas chromatography to obtain the classification results of liquor origin. Compared with the spectrum spectrum, the characteristic spectrum of gas chromatography is conducive to the high performance of the EfficientNet-B4 model in image classification. The combination of the two for liquor samples has a good classification effect.

[0063] And evaluate the model performance by drawing the loss curve, accuracy curve, and confusion matrix.

[0064] S6. Use the trained EfficientNet-B4 model to test the liquor samples to obtain the origin of the liquor samples.

[0065] The liquor origin tracing method provided by the present invention requires a small amount of sample, is simple to operate, has good reproducibility and high accuracy. The detection technology required by the present invention is relatively low in difficulty, and the established model can be applied to most laboratories and is easy to promote.

[0066] Next, the above-mentioned liquor origin tracing method is described through a specific example.

[0067] 1. Materials and Methods

[0068] (1) Experimental samples: 53 liquor samples produced in Origin A; 25 liquor samples produced in Origin B.

[0069] (2) Instruments and reagents. Instruments and equipment: gas chromatograph.

[0070] (3) Instrument conditions. Injection volume: 1 μL; injection port temperature: 250°C; constant pressure mode; split ratio: 20:1; detector temperature: 260°C; hydrogen flow rate: 40 mL / min; air flow rate: 400 mL / min; tail gas flow: 25 mL / min; chromatographic column: supelcounkol (30 m × 250 μm × 0.25 μm), or equivalent; programmed temperature conditions are shown in Table 1.

[0071] Table 1 Program temperature conditions

[0072]

[0073] 2. Select feature map image

[0074] (1) Use gas chromatography to measure liquor samples from different origins according to the above instrument conditions.

[0075] (2) Use the instrument's built-in imaging software to capture the atlas image without relying on special screenshot software.

[0076] (3) The spectra of a liquor sample from origin A and B are as follows: Figure 2 , Figure 3 shown.

[0077] 3. Training and evaluating the model

[0078] 3.1. Main tools

[0079] (1) PyTorch is the main deep learning framework used to build neural networks, define loss functions, optimizers, etc.

[0080] (2)Torchvision is responsible for processing images and loading pre-trained models, providing a pre-trained EfficientNet-B4 model.

[0081] (3) Matplotlib and Seaborn are used to visualize the data and evaluate the model performance by drawing loss and accuracy curves and confusion matrices.

[0082] (4) TQDM is used to display the progress bar to intuitively understand the training and evaluation progress.

[0083] (5) Sklearn is used to generate classification reports, calculate evaluation metrics (such as precision, recall, and F1 score), and plot confusion matrices.

[0084] Data processing

[0085] (1) Load and process the atlas images. Use PIL (Python Imaging Library) to load and process images, including opening, verifying, and converting images.

[0086] (2) From each liquor spectrum, select the spectrum image starting from the ethanol peak to the end when no peak appears as the characteristic spectrum.

[0087] (3) Preprocess each feature map.

[0088] (4) Dataset division. Use random_split to divide the image data into 80% as the training set and 20% as the test set. The custom CustomImageDataset class manages the image path and label and performs validity checks to prevent loading damaged or invalid images.

[0089] 3.3. Model selection and parameter modification

[0090] The embodiment of the present invention takes the binary classification method as an example. Before training the EfficientNet-B4 model, the model classifier is first modified. Based on the pre-trained model, the final classification layer is modified to output two categories to adapt to the binary classification task. The binary classification method is applicable to images of two types of data sets, "Origin A" and "Origin B". When there are more origin data, the model classifier can be modified accordingly.

[0091] 3.4. Model training and evaluation

[0092] The training process includes: in each epoch, the model enters the training and testing phases in turn, as shown in Figure 4, where Figure 4(a) is a diagram of training loss and test loss; Figure 4(b) is a diagram of training accuracy and test accuracy. When the model is trained, forward propagation, loss calculation, back propagation, and optimizer steps are performed; in the test phase, the model is in evaluation mode and the weights are not updated. After each epoch, the loss and accuracy of training and testing are recorded. By comparing the performance of the test set, the model with the highest accuracy is saved.

[0093] Model evaluation: Use the saved best model to evaluate the test set and generate a classification report and draw a confusion matrix (such as Figure 5The classification report shows the precision, recall, F1 score and overall accuracy of each category. The results show that the classifier performs very well in this task (100% accuracy and F1 score). This shows that the classification accuracy of the classifier can reach 100%.

[0094] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0095] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A liquor origin tracing method based on the EfficientNet-B4 model, characterized in that: The steps include: Obtain liquor samples from multiple different origins; Using a gas chromatograph to measure multiple liquor samples respectively, and obtaining multiple corresponding liquor spectra; From each liquor spectrum, select the spectrum image starting from the ethanol peak to the end when no peak appears as the characteristic spectrum; Preprocess each feature map; Take each preprocessed atlas image as input and the corresponding origin as label to train the EfficientNet-B4 model; The trained EfficientNet-B4 model is used to detect the liquor samples to obtain the origin of the liquor samples.

2. According to claim 1, a liquor origin tracing method based on the EfficientNet-B4 model is characterized in that: The measurement conditions when using a gas chromatograph include: Injection volume: 1 μL; injection port temperature: 250°C; constant pressure mode; split ratio: 20:1; measurement temperature: 260°C; hydrogen flow rate: 40 mL / min; air flow rate: 400 mL / min; tail blow: 25 mL / min; chromatographic column: Supelco Unkol.

3. According to claim 1, a liquor origin tracing method based on the EfficientNet-B4 model is characterized in that: The preprocessing of the atlas image specifically includes: Use Resize to uniformly adjust the atlas images to a preset size; Use ToTensor to convert the atlas image into a tensor format; Normalize is used to normalize the atlas image.

4. According to claim 1, a liquor origin tracing method based on the EfficientNet-B4 model is characterized in that: The EfficientNet-B4 model introduces the concept of compound scaling based on the CNN model.

5. According to claim 1, a liquor origin tracing method based on the EfficientNet-B4 model is characterized in that: During the training process, the Adam optimizer is used for gradient updates with a learning rate of 0.

001.

6. According to claim 1, a liquor origin tracing method based on the EfficientNet-B4 model is characterized in that: After the training is completed, the cross entropy loss function is used to measure the gap between the predicted origin output by the EfficientNet-B4 model and the true label, and the EfficientNet-B4 model is optimized according to the gap.

Citation Information

Cited By

  • White spirit knowledge and graph combined question-answering system and test method

    CN121255993A