Chinese yam beverage quality inspection method and system
By collecting and analyzing multi-source data on yam beverages, and using the YOLOv5 network architecture and a full-dimensional dynamic convolution combined with an attention module appearance detection model, the data traceability problem in the quality inspection of yam beverages was solved. This enabled rapid and accurate traceability of non-conforming items and batch analysis, improving the accuracy and reliability of the system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2026-04-03
AI Technical Summary
During the quality inspection of yam beverages, users find it difficult to trace abnormal data from multi-source heterogeneous data, making it difficult to analyze the cause of the problem.
A quality inspection method for yam beverages is designed. By collecting data on the appearance, physical properties, ingredients, microorganisms, and chemical substances of yam beverages, an appearance detection model using the YOLOv5 network architecture and full-dimensional dynamic convolution combined with attention modules is used to generate unique identification information, establish data association relationships, and quickly and accurately trace non-compliant items.
It improves the accuracy and reliability of the yam beverage quality inspection system, enabling it to quickly and accurately obtain data on non-compliant indicators and batches, thus helping the system to quickly analyze problems.
Smart Images

Figure CN121787943A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of beverage quality inspection technology, specifically to a method and system for quality inspection of yam beverages. Background Technology
[0002] With the advancement of science and technology and the development of testing techniques, modern testing technologies have enabled the rapid and accurate detection of multiple components in beverages. For example, the introduction of advanced instruments and equipment such as chromatography, spectroscopy, and mass spectrometry has greatly improved the accuracy and efficiency of testing. The application of computer technology and artificial intelligence has also brought new possibilities to beverage quality inspection. Therefore, developing intelligent testing systems and methods to achieve the automation and intelligence of beverage quality inspection has become a key to enhancing the competitiveness of enterprises.
[0003] Chinese invention patent CN108709966A discloses a beverage quality inspection method and system. This invention detects the quality and temperature of the beverage in a cup in real time, adjusts the shelf life of the beverage according to the temperature, and monitors the beverage based on its quality and shelf life, thereby improving the management of beverage safety and ensuring that users can drink beverages safely.
[0004] However, in actual production and daily life, the yam beverage samples tested during the quality inspection process are numerous. When the final evaluation of the sampled product is unqualified, users find it difficult to trace the abnormal data from the large amount of multi-source heterogeneous data, and thus find it difficult to analyze the cause of the problem. Summary of the Invention
[0005] The purpose of this invention is to address the problems existing in the background art by proposing a quality inspection method and system for yam beverages.
[0006] The technical solution of this invention: a quality inspection method for yam beverages, comprising the following specific implementation steps:
[0007] S1. Collect data on the appearance, physical properties, composition, microbiology and chemical substances of the sampled yam beverages.
[0008] S2. Inspect the appearance of the yam beverage sample for defects, and compare the collected data on physical properties, components, microorganisms, and chemical substances with the set standard values. Analyze whether the data on physical properties, components, microorganisms, and chemical substances are qualified, output the analysis results, and generate an analysis record set and an analysis report set. The analysis record set includes: appearance analysis record set, physical property analysis record set, component analysis record set, microbiological analysis record set, and chemical substance analysis record set. The analysis report set includes: appearance analysis report, physical property analysis report, component analysis report, microbiological analysis report, and chemical substance analysis report.
[0009] Regenerate unique identifier information and establish the relationship between <unique identifier information, analysis report, and analysis record table>.
[0010] S3. Summarize and automatically analyze the appearance analysis record sheet, physical property analysis record sheet, component analysis record sheet, microbial analysis record sheet and chemical substance analysis record sheet. If the analysis result recorded in any of the above analysis record sheets is found to be unqualified, the sampled yam beverage will be rated as unqualified.
[0011] S4. If the sampled yam beverage fails the quality inspection, extract the unique identification information from the analysis record table of the non-compliant analysis results, trace the corresponding analysis report based on the correlation <unique identification information, analysis report, analysis record table>, and automatically obtain the corresponding non-compliant data.
[0012] Preferably, the process of generating unique identifier information is as follows:
[0013] S21. Select a random number ε∈Z p * k∈Z p * Calculate the auxiliary information generation parameter r = g k modp;
[0014] Where g is Z p * The generator, Z p * = {1, 2, ..., p-1}, where p is a randomly selected large prime number;
[0015] S22. Calculate the following identification parameter: PI i =H(r||m i ), PI i '=PI Ⅰ ×ε+k mod q;
[0016] Where || represents string concatenation, H is a hash function, and mi For data on appearance, physical properties, composition, microorganisms or chemical substances, q and p are randomly selected large prime numbers that satisfy q|(p-1);
[0017] S23. Generate unique identification information I i =(PI) i PI i ').
[0018] The technical solution of the present invention: a yam beverage quality inspection system, which is used to perform the above-mentioned yam beverage quality inspection method, comprising:
[0019] The data acquisition subsystem is used to collect data on the appearance, physical properties, composition, microorganisms, and chemical substances of yam drinks;
[0020] The data analysis subsystem is used to analyze and evaluate data on the appearance, physical properties, composition, microorganisms, and chemical substances of yam beverages.
[0021] The quality assessment module is used to summarize various indicators of yam beverages and automatically judge whether the sampled yam beverages are qualified.
[0022] The system database is used to store and manage data generated by the various components within the system.
[0023] Preferably, the data acquisition subsystem includes:
[0024] The image acquisition module is used to acquire images of the appearance of yam drinks;
[0025] The physical property acquisition module is used to collect viscosity and density data of yam beverages;
[0026] The component acquisition module is used to collect spectral data from yam beverage samples;
[0027] The microbial detection module is used to detect the types and quantities of microorganisms in yam beverage samples.
[0028] Chemical substance detection module, used to detect harmful chemicals in samples.
[0029] Preferably, the data analysis subsystem includes:
[0030] The appearance inspection module is used to build an appearance inspection model for yam drinks and to inspect the appearance of yam drinks, outputting the inspection results.
[0031] The physical property analysis module is used to compare the viscosity and density data acquired by the physical property acquisition module with the set viscosity and density standard values and output the comparison results.
[0032] The component analysis module is used to identify the sugar, starch, and protein components and their contents in the spectral data of yam beverage samples, and compares the identified sugar, starch, and protein contents in the spectral data of the yam beverage samples with the predetermined standard values of each component, and outputs the comparison results.
[0033] The microbial analysis module is used to determine whether yam beverage samples meet hygiene standards.
[0034] The chemical substance analysis module is used to compare the chemical substance detection results output by the chemical substance detection module with the safety limit standards to determine whether the chemical substances in the sample exceed the limits.
[0035] Preferably, the yam beverage appearance detection model adopts the YOLOv5 network architecture, introduces full-dimensional dynamic convolution in the Neck part of YOLOv5, and adds the CBAM attention module between each detection head and the C3 module in the Neck part.
[0036] The preferred method for constructing the appearance inspection model for yam beverages is as follows:
[0037] S71. Collect yam beverage appearance image data from historical quality inspection data for training and validation. Preprocess the collected yam beverage appearance image data, including image scaling, normalization and data augmentation operations, and label the category and bounding box coordinate information of the target in the image to generate a yam beverage appearance image dataset.
[0038] S72. Divide the dataset of yam beverage appearance images into a training dataset and a test dataset in a 3:1 ratio.
[0039] S73. Set the learning rate, batch size, training epochs and optimizer during the training process, load the pre-trained weights, and train the model using the training dataset.
[0040] S74. Use the test dataset to evaluate the trained model. Input the test image into the model and observe the detection effect of the model.
[0041] Compared with the prior art, the above-mentioned technical solution of the present invention has the following beneficial technical effects:
[0042] This invention designs a method and system for quality inspection of yam beverages. The method collects multi-source data on five aspects of yam beverages: appearance, physical properties, composition, microorganisms, and chemical substances. Using a constructed yam beverage appearance detection model, combined with a YOLOv5 network architecture, full-dimensional dynamic convolution, and attention modules, it significantly improves the system's ability to detect minor appearance defects in yam beverages. Furthermore, by generating identification information for the detection results across the five aspects of appearance, physical properties, composition, microorganisms, and chemical substances, it establishes a correlation between <identification information, analysis record table, and analysis report>. When a sampled yam beverage fails quality inspection, the system quickly and accurately extracts the analysis report of the non-compliant items from the system database through the aforementioned correlation, obtains the non-compliant index data detected in the sampled yam beverage, and identifies the batch to which the sample belongs. This greatly enhances the system's traceability capability for non-compliant yam beverages, thereby helping the system quickly analyze problems and improving the accuracy and reliability of the yam beverage quality inspection. Attached Figure Description
[0043] Figure 1 This is an architecture diagram of a yam beverage quality inspection system proposed in this invention;
[0044] Figure 2 This is a network architecture diagram of the yam beverage appearance detection model proposed in this invention;
[0045] Figure 3 The network structure diagram of module C3 in the network architecture of the yam beverage appearance detection model;
[0046] Figure 4 This is a diagram of the network structure for full-dimensional dynamic convolution. Detailed Implementation
[0047] Example 1, as Figure 1 As shown, the present invention proposes a yam beverage quality inspection system, which includes: a data acquisition subsystem, a data analysis subsystem, a quality assessment module, and a system database.
[0048] The data acquisition subsystem is used to collect data on the appearance, physical properties, composition, microorganisms, and chemical substances of yam beverages. The data acquisition subsystem includes an image acquisition module, a physical property acquisition module, a composition acquisition module, a microbial detection module, and a chemical substance detection module.
[0049] The image acquisition module uses a high-definition camera to capture real-time images of the yam beverage, obtaining images of its appearance.
[0050] The physical property acquisition module is equipped with a viscometer and a densitometer to collect viscosity and density data of beverages;
[0051] The component acquisition module is equipped with an NIR spectrometer to collect spectral data of yam beverage samples;
[0052] The microbial detection module is equipped with a PCR instrument to detect the types and quantities of microorganisms in yam beverage samples.
[0053] The chemical substance detection module uses high-performance liquid chromatography (HPLC) to detect whether samples contain pesticide residues and harmful heavy metals.
[0054] The data analysis subsystem is used to analyze and evaluate data on the appearance, physical properties, composition, microorganisms, and chemical substances of yam beverages. The data analysis subsystem includes an appearance detection module, a physical property analysis module, a composition analysis module, a microbial analysis module, and a chemical substance analysis module.
[0055] The appearance inspection module constructs an appearance inspection model for yam drinks, uses machine vision and image processing technology to inspect the appearance of yam drinks, and outputs the inspection results;
[0056] The physical property analysis module compares the viscosity and density data acquired by the physical property acquisition module with the set viscosity and density standard values and outputs the comparison results.
[0057] The component analysis module identifies the sugar, starch, and protein components and their contents in the spectral data of yam beverage samples, and compares the identified sugar, starch, and protein contents of the yam beverage samples with the predetermined standard values of each component, and outputs the comparison results.
[0058] The microbial analysis module determines whether a sample meets hygiene standards based on the PCR test results output by the microbial detection module.
[0059] The chemical substance analysis module compares the chemical substance detection results output by the chemical substance detection module with the safety limit standards to determine whether the chemical substances in the sample exceed the limits.
[0060] The quality assessment module automatically analyzes various indicators of yam beverages to determine whether the sampled yam beverages are qualified.
[0061] The system database is used to store and manage data generated by the various components within the system.
[0062] Example 2: The present invention proposes a quality inspection method for yam beverages, which is applicable to the yam beverage quality inspection system proposed in Example 1. The specific implementation steps are as follows:
[0063] Initialization phase:
[0064] S101. Determine testing standards: Based on the production requirements of yam beverages, formulate standard values for various testing indicators, including but not limited to color, transparency, particle distribution, nutritional components, viscosity, density, microbial limits, and chemical residues.
[0065] S102. Periodically, in accordance with statistical principles, randomly select a portion of samples from the same batch of yam beverages and record the beverage sample number and batch number of the yam beverage samples.
[0066] Yam beverage quality inspection stage:
[0067] S201. The image acquisition module uses a high-definition camera to take real-time pictures of the yam beverage sample, acquire the appearance image of the yam beverage, and transmit it to the appearance inspection module.
[0068] The physical property acquisition module uses a viscometer to detect the viscosity of yam beverages, collects viscosity data of yam beverage samples, and transmits it to the physical property analysis module.
[0069] The physical property acquisition module uses a densitometer to detect the density of yam beverages, collects density data of yam beverage samples, and transmits it to the physical property analysis module.
[0070] The component acquisition module uses an NIR spectrometer to acquire spectral data of yam beverage samples in real time and transmits it to the component analysis module;
[0071] The microbial detection module uses a PCR instrument to detect the types and quantities of microorganisms in yam beverage samples, including but not limited to one or more of bacteria, molds, yeasts, Escherichia coli, or Staphylococcus aureus, and transmits the output PCR detection results to the microbial analysis module.
[0072] The chemical substance detection module uses a high-performance liquid chromatography (HPLC) instrument to detect whether the sample contains harmful chemical substances, including but not limited to one or more of pesticide residues or potentially harmful heavy metals, and transmits the detection results to the chemical substance analysis module.
[0073] S202. The appearance inspection module uses the appearance image of the yam beverage as the input parameter of the yam beverage appearance inspection model. It uses the constructed yam beverage appearance inspection model to detect whether there are defects in the appearance of the yam beverage sample, generates an appearance analysis record table (as shown in Table 1), and generates an appearance analysis report Ra. i And establish <Appearance Data Specific Identification Information I> Ⅰi Appearance Analysis Record Sheet, Appearance Inspection Report Ra i After determining the correlation, the appearance analysis record sheet is transferred to the quality assessment module, and the appearance analysis report Ra is sent. i Save to system database;
[0074] Among them, the appearance analysis report Ra i ={Appearance data exclusive identification information I Ⅰi The types of defects in the appearance of yam beverage samples, the location of the defects, and the results of appearance analysis.
[0075] Table 1 Appearance Analysis Record Sheet
[0076]
[0077] It should be noted that the appearance inspection module generates unique identification information (I) for the appearance data of yam beverage samples. Ⅰi The process is as follows:
[0078] S21. Select a random number ε1∈Z p * k1∈Z p * Calculate auxiliary information generation parameters
[0079] Where g is Z p * The generator, Z p * ={1, 2, ..., p-1};
[0080] S22. Calculate the following identification parameter: PI Ⅰ =H(r1||m Ⅰi ), PI Ⅰ '=PI Ⅰ ×ε1+k1 mod q;
[0081] Where || represents string concatenation, H is a hash function, and m Ⅰi For the appearance test data of yam beverage samples, ε1 and k1 are random numbers required to generate unique identification information for appearance data, and q and p are randomly selected as large prime numbers that satisfy q|(p-1).
[0082] S23. Generate unique identification information for appearance data. Ⅰi =(PI) Ⅰ PI Ⅰ ').
[0083] S203. The physical property analysis module calculates the deviation between the measured actual values of viscosity and density and the standard values of viscosity and density. The deviation calculation method is shown in equations (1) and (2):
[0084] △μ=μ test -μ standard (1)
[0085] △ρ=ρtest -ρ standard (2)
[0086] Where, μ test This represents the actual value of the viscosity of the detected yam beverage sample, in μ. standard ρ represents the standard value of the viscosity of the detected yam beverage sample. test ρ represents the actual density of the detected yam beverage sample. standard This indicates the standard value representing the viscosity of the detected yam beverage sample;
[0087] It should be noted that if the detected value exceeds the tolerance range (the tolerance range is ±5%), the physical property analysis module will automatically mark the viscosity or density of the yam beverage sample as unqualified; otherwise, it will be judged as qualified.
[0088] Then, a physical property analysis record table (as shown in Table 2) is generated, and a physical property analysis report Rp is generated. i And establish <Physical property data exclusive identification information I> Ⅱi Physical property analysis record sheet, physical property analysis report Rp i The physical property analysis module then transfers the physical property analysis record sheet to the quality assessment module, and sends the physical property analysis report Rp to the module. i Save to system database;
[0089] Among them, the physical property analysis report Rp i ={Physical property data exclusive identification information I Ⅱi The actual viscosity / density values of the yam beverage samples, the standard viscosity / density values of the yam beverage, and the results of physical property analysis.
[0090] Table 2 Physical Property Analysis Record Sheet
[0091]
[0092] It should be noted that the physical property analysis module generates unique identifier information (I) for the physical property data of yam beverage samples. Ⅱi The process is as follows:
[0093] S31. Select a random number ε2∈Z p * k2∈Z p * Calculate auxiliary information generation parameters
[0094] S32. Calculate the following identification parameter: PI Ⅱ =H(r2||m) Ⅱi ), PI Ⅱ '=PI Ⅱ×ε² + k² mod q;
[0095] Where, m Ⅱi The physical property data of the yam beverage sample are specifically the concatenated values of the actual viscosity and density of the yam beverage sample. ε2 and k2 are random numbers required to generate the unique identifier information of the physical property data. q and p are large prime numbers that satisfy q|(p-1).
[0096] S33, Generate unique identifier information for physical property data I Ⅱi =(PI) Ⅱ PI Ⅱ ').
[0097] S204. The component analysis module compares the actual content of each component in the test results with its corresponding standard range, generates a component analysis record table (as shown in Table 3), and generates a component analysis report Rc. i And establish <Ingredient Data Specific Identification Information I> Ⅲi Composition analysis record sheet, composition analysis report Rc i The correlation between > is then established, followed by the transfer of the component analysis record sheet to the quality assessment module, and the component analysis report Rc is sent. i Save to system database;
[0098] Among them, the component analysis report Rc i = {Ingredient data exclusive identification information I} Ⅲi The actual content of each component, the standard range corresponding to each component, and the component analysis results;
[0099] Table 3. Composition Analysis Record Sheet
[0100]
[0101] It should be noted that the component analysis module generates unique identifier information (I) for the component data of yam beverage samples. Ⅲi The process is as follows:
[0102] S41. Select a random number ε3∈Z p * k3∈Z p * Calculate auxiliary information generation parameters
[0103] S42. Calculate the following identification parameter: PI Ⅲ =H(r3||m Ⅲi ), PI Ⅲ '=PI Ⅲ ×ε3+k3 mod q;
[0104] Where, mⅢi The component data for the yam beverage sample is the cascaded value of the content of each detected component. ε3 and k3 are the random numbers required to generate the unique identifier information for the component data. q and p are large prime numbers that satisfy q|(p-1).
[0105] S43, Generated component data exclusive identification information I Ⅲi =(PI) Ⅲ PI Ⅲ ').
[0106] S205. The microbial analysis module compares the detected microbial content with the permissible microbial limits for yam beverages stipulated by national food safety regulations, industry standards, and the company's internal regulations, generating a microbial analysis record table (as shown in Table 4) and a microbial analysis report Rm. i And establish <Microbial Data Specific Identification Information I> Ⅳi Microbial analysis record form, microbial analysis report (RM) i The correlation is then established, and the microbial analysis record sheet is transferred to the quality assessment module. The microbial analysis report Rm... i Save to system database;
[0107] Among them, the microbial analysis report Rm i ={Microbial Data Specific Identification Information I Ⅳi Identification information Ⅳi Microbial content, microbial limits, and microbial analysis results of yam beverage samples;
[0108] Table 4 Microbiological Analysis Record Sheet
[0109]
[0110] It should be noted that the microbial analysis module generates unique identifier information (I) for microbial data of yam beverage samples. Ⅳi The process is as follows:
[0111] S51. Select a random number ε4∈Z p * k4∈Z p * Calculate auxiliary information generation parameters
[0112] S52. Calculate the following identification parameter: PI Ⅳ =H(r4||m Ⅳi ), PI Ⅳ '=PI Ⅳ ×ε4+k4 mod q;
[0113] Where, m ⅣiThe microbial data for the yam beverage sample is the cascaded value of the detected microbial content. ε4 and k4 are the random numbers required to generate the unique identifier information for the microbial data. q and p are large prime numbers that satisfy q|(p-1).
[0114] S53, Generate microbial data-specific identification information I Ⅳi =(PI) Ⅳ PI Ⅳ ').
[0115] S206. The chemical substance analysis module compares the HPLC detection results with the standard limit values to determine whether they are qualified, generates a chemical substance analysis record table (as shown in Table 5), and generates a chemical substance analysis report Rh. i And establish <Chemical Substance Data Specific Identification Information I> Ⅴi Chemical substance analysis record sheet, chemical substance analysis report Rh i The correlation is then established, and the chemical substance analysis record sheet is transferred to the quality assessment module, along with the chemical substance analysis report Rh. i Save to system database;
[0116] Among them, the chemical substance analysis report Rh i ={Chemical substance data-specific identification information I Ⅴi The chemical types, content of each chemical substance, standard limit values of each chemical substance, and chemical substance analysis results in yam beverage samples;
[0117] Table 5 Chemical Substance Analysis Record Sheet
[0118]
[0119] It should be noted that the chemical substance analysis module generates unique identifier information (I) for chemical substance data of yam beverage samples. Ⅴi The process is as follows:
[0120] S61. Select a random number ε5∈Z p * k5∈Z p * Calculate auxiliary information generation parameters
[0121] S62. Calculate the following identification parameter: PI Ⅴ =H(r5||m Ⅴi ), PI Ⅴ '=PI Ⅴ ×ε5+k5 mod q;
[0122] Where, m ⅤiThe chemical data for yam beverage samples are the cascaded values of chemical content in the sampled yam beverages. ε5 and k5 are the random numbers required to generate the unique identifier information for the chemical data. q and p are large prime numbers that satisfy q|(p-1).
[0123] S63, Generates specific identification information for chemical substance data I Ⅴi =(PI) Ⅴ PI Ⅴ ').
[0124] S207. The quality assessment module summarizes and automatically analyzes the appearance analysis record sheet, physical property analysis record sheet, component analysis record sheet, microbial analysis record sheet and chemical substance analysis record sheet. If any one or more of the above record sheets are found to be unqualified, the sampled yam beverage is considered unqualified.
[0125] If the sampled yam beverage fails the quality inspection, the quality assessment module extracts the unique identifier information from the non-compliance record table. Based on the relationship <unique identifier information, analysis record table, analysis report>, it traces the corresponding analysis report from the system database and automatically obtains the corresponding non-compliance indicators. Then, the quality assessment module executes S208.
[0126] For example: when a sample of yam fails to meet the chemical substance standards, the quality assessment module extracts the unique identifier information of the chemical substance data from the chemical substance analysis record table. Ⅴi Then, based on the association <Chemical Substance Data Specific Identification Information I> Ⅴi Chemical substance analysis record sheet, chemical substance analysis report Rh i >Extract chemical substance analysis report Rh from the system database i And from the chemical analysis report Rh i The process involves obtaining the types and contents of each chemical substance, the standard limits for each chemical substance, and the chemical substance analysis results. Then, the batch number to which the yam samples belong is obtained. i .
[0127] S208. The quality assessment module immediately generates an alarm message and takes the following measures:
[0128] S81. Suspend production line: After a non-conforming product is detected, the quality assessment module automatically triggers the suspension of the production line to avoid continuing to produce products that may have quality problems.
[0129] S82. Lock the problematic batch: Mark the current batch as a problematic batch and stop all subsequent processing, packaging and shipping operations for this batch of products;
[0130] S83. Product isolation: Isolate substandard yam beverages from the production line and warehouse to avoid confusion with qualified products;
[0131] S84. Sealing and Marking: Non-conforming products shall be sealed and clearly marked on the outer packaging, indicating the reason for the product's non-conformity and the testing date;
[0132] S85. Production process inspection: Inspect the raw materials, formulas, production equipment, and operating procedures during the production process to identify the specific links that lead to quality problems.
[0133] Example 3: This invention proposes an appearance inspection model for yam beverages. The structure of this yam beverage appearance inspection model is as follows:
[0134] like Figure 2 As shown, the yam beverage appearance detection model adopts the YOLOv5 network architecture. Omnidimensional Dynamic Convolution (ODConv) is introduced into the Neck part of YOLOv5, and a Convolutional Block Attention Module (CBAM) is added to each detection head and the C3 module (e.g., ...). Figure 3 As shown, the C3 module mainly consists of three Conv modules and several BottleNeck modules.
[0135] Figure 2 In this diagram, Imput represents the input to the yam beverage appearance detection model. The Conv module consists of convolutional layers, normalization layers, and activation function layers, and is a commonly used module in convolutional neural networks. The SPPF (Spatial Pyramid Pooling-Fast) module fuses high-level features through pooling. Upsample represents the upsampling operation. Concat is used to stitch together feature maps of different scales. Detect represents the detection head. The C3 module transforms the input feature map into a higher-level feature representation through convolutional operations.
[0136] Figure 3 In this context, BottleNeck×n represents n BottleNeck modules, which are used to reduce the number of channels in the input feature map.
[0137] like Figure 4As shown, full-dimensional dynamic convolution (ODConv) is composed of multiple convolution kernels linearly combined through a weighted attention mechanism. First, the input features are compressed, and the compressed feature vector is mapped to a certain proportion of low-dimensional space. The attention scalar of each dimension is calculated through the four dimensions of the kernel space and multiplied with the convolution kernel. Finally, the convolution operation is performed with the input features to obtain the output of dynamic convolution.
[0138] The formula for dynamic convolution is shown in equation (3):
[0139] y=(α w1 ⊙α f1 ⊙α c1 ⊙α s1 ⊙W1+...+α wn ⊙α fn ⊙α cn ⊙α sn ⊙W n )*x (3)
[0140] Where x represents the input feature, y represents the output feature, GAP represents global average pooling, FC represents a fully connected layer, ReLU, Sigmoid, and Softmax represent activation functions, and α represents the input feature. s1 ..., α sn α represents the attention scalar assigned to the convolution parameters at each location. c1 ..., α cn α represents the scalar of interest assigned to the input channel by the corresponding convolutional filter. f1 ..., α fn α represents the scalar of interest assigned to the output channel. w1 ..., α wn The attention scalars W1, ..., W represent the total attention allocation of the convolution kernel. n This represents the weights corresponding to each convolutional filter;
[0141] Full-dimensional dynamic convolution uses attention weighting in four dimensions of the kernel space, making full use of the convolution kernel space, input channel information, and output channel information, ensuring comprehensive information processing during the convolution process, and using a parallel strategy for the attention mechanism to reduce the model's running time.
[0142] The process of constructing the appearance detection model for the above-mentioned yam beverage is as follows:
[0143] S301. Collect yam beverage appearance image data from historical quality inspection data for training and validation. Preprocess the collected yam beverage appearance image data, including image scaling, normalization and data augmentation operations, and label the category and bounding box coordinate information of the target in the image to generate a yam beverage appearance image dataset.
[0144] S302. Divide the dataset of yam beverage appearance images into a training dataset and a test dataset in a 3:1 ratio.
[0145] S303. Set various parameters during the training process, such as learning rate, batch size, training epochs and optimizer, load pre-trained weights, and train the model using the training dataset.
[0146] It should be noted that during the training process, the model will continuously learn and optimize its parameters to better identify targets in the image;
[0147] S304. Use the test dataset to evaluate the trained model. Evaluation metrics include, but are not limited to, accuracy, recall, F1 score, and mAP (mean precision). Then, input the test images into the model and observe the model's detection performance.
[0148] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited thereto. Various changes can be made within the scope of knowledge possessed by those skilled in the art without departing from the spirit of the present invention.
Claims
1. A quality inspection method for yam beverages, characterized in that, The specific implementation steps include the following: S1. Collect data on the appearance, physical properties, composition, microbiology and chemical substances of the sampled yam beverages. S2. Inspect the appearance of the yam beverage sample for defects, and compare the collected data on physical properties, components, microorganisms, and chemical substances with the set standard values. Analyze whether the data on physical properties, components, microorganisms, and chemical substances are qualified, output the analysis results, and generate an analysis record set and an analysis report set. The analysis record set includes: appearance analysis record set, physical property analysis record set, component analysis record set, microbiological analysis record set, and chemical substance analysis record set. The analysis report set includes: appearance analysis report, physical property analysis report, component analysis report, microbiological analysis report, and chemical substance analysis report. Regenerate unique identifier information and establish the relationship between <unique identifier information, analysis report, and analysis record table>. S3. Summarize and automatically analyze the appearance analysis record sheet, physical property analysis record sheet, component analysis record sheet, microbial analysis record sheet and chemical substance analysis record sheet. If the analysis result recorded in any of the above analysis record sheets is found to be unqualified, the sampled yam beverage will be rated as unqualified. S4. If the sampled yam beverage fails the quality inspection, extract the unique identification information from the analysis record table of the non-compliant analysis results, trace the corresponding analysis report based on the correlation <unique identification information, analysis report, analysis record table>, and automatically obtain the corresponding non-compliant data.
2. The method for quality inspection of yam beverages according to claim 1, characterized in that, The process of generating unique identifier information is as follows: S21. Select a random number ε∈Z p * k∈Z p * Calculate the auxiliary information generation parameter r = g k modp; Where g is Z p * The generator, Z p * = {1, 2, ..., p-1}, where p is a randomly selected large prime number; S22. Calculate the following identification parameter: PI i =H(r||m i ), PI i '=PI Ⅰ ×ε+k mod q; Where || represents string concatenation, H is a hash function, and m i For data on appearance, physical properties, composition, microorganisms or chemical substances, q and p are randomly selected large prime numbers that satisfy q|(p-1); S23. Generate unique identification information I i =(PI) i PI i ').
3. A quality inspection system for yam beverages, used to execute the quality inspection method for yam beverages according to claim 1 or 2, characterized in that, include: The data acquisition subsystem is used to collect data on the appearance, physical properties, composition, microorganisms, and chemical substances of yam drinks; The data analysis subsystem is used to analyze and evaluate data on the appearance, physical properties, composition, microorganisms, and chemical substances of yam beverages. The quality assessment module is used to summarize various indicators of yam beverages and automatically judge whether the sampled yam beverages are qualified. The system database is used to store and manage data generated by various components within the system.
4. The yam beverage quality inspection system according to claim 3, characterized in that, The data acquisition subsystem includes: The image acquisition module is used to acquire images of the appearance of yam drinks; The physical property acquisition module is used to collect viscosity and density data of yam beverages; The component acquisition module is used to collect spectral data from yam beverage samples; The microbial detection module is used to detect the types and quantities of microorganisms in yam beverage samples. Chemical substance detection module, used to detect harmful chemicals in samples.
5. The yam beverage quality inspection system according to claim 3, characterized in that, The data analysis subsystem includes: The appearance inspection module is used to build an appearance inspection model for yam drinks and to inspect the appearance of yam drinks, outputting the inspection results. The physical property analysis module is used to compare the viscosity and density data acquired by the physical property acquisition module with the set viscosity and density standard values and output the comparison results. The component analysis module is used to identify the sugar, starch, and protein components and their contents in the spectral data of yam beverage samples, and compares the identified sugar, starch, and protein contents in the spectral data of the yam beverage samples with the predetermined standard values of each component, and outputs the comparison results. The microbial analysis module is used to determine whether yam beverage samples meet hygiene standards. The chemical substance analysis module is used to compare the chemical substance detection results output by the chemical substance detection module with the safety limit standards to determine whether the chemical substances in the sample exceed the limits.
6. The yam beverage quality inspection system according to claim 5, characterized in that, The yam beverage appearance detection model adopts the YOLOv5 network architecture. Full-dimensional dynamic convolution is introduced in the Neck part of YOLOv5, and the CBAM attention module is added between each detection head and the C3 module in the Neck part.
7. The yam beverage quality inspection system according to claim 5, characterized in that, The process of constructing the appearance inspection model for yam beverages is as follows: S71. Collect yam beverage appearance image data from historical quality inspection data for training and validation. Preprocess the collected yam beverage appearance image data, including image scaling, normalization and data augmentation operations, and label the category and bounding box coordinate information of the target in the image to generate a yam beverage appearance image dataset. S72. Divide the dataset of yam beverage appearance images into a training dataset and a test dataset in a 3:1 ratio. S73. Set the learning rate, batch size, training epochs and optimizer during the training process, load the pre-trained weights, and train the model using the training dataset. S74. Use the test dataset to evaluate the trained model. Input the test image into the model and observe the detection effect of the model.
Citation Information
Patent Citations
Beverage quality inspection method and system
CN108709966A