Tea variety identification device and method
By using eight independent gas chambers and mobile modules in the tea type recognition device to detect volatile gases of tea samples, combined with data processing and feature image training methods, the problem of inaccurate detection results in the existing tea type recognition methods is solved, and higher recognition accuracy is achieved.
Patent Information
- Application Number
- CN202510069419.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-16
- Publication Date
- 2025-05-30
AI Technical Summary
The existing tea type identification method has the problem of inaccurate detection results. It is mainly because multiple gas sensors are located in the same gas chamber and are fixed in locations, which affects the detection results due to different concentrations of volatile gases. Inadequate data preprocessing cannot effectively eliminate interference caused by environmental noise, equipment errors and sample heterogeneity.
A tea type recognition device is designed, using eight independent gas chambers and a moving module. The gas sensor performs synchronous movement detection in the independent gas chamber, collects volatile gases from dry, filtered and tea soup samples, and sends detection data to the controller through the signal acquisition module, performs data processing and converts it into feature images, and trains the YOLOv8n model for identification.
Through the design of independent gas chambers and mobile modules, detection errors caused by uneven concentrations of volatile gases in the gas chambers are eliminated. Data processing and feature image training improve recognition accuracy, reduce interference caused by environmental noise, equipment error and sample heterogeneity, and achieve more accurate tea type recognition.
Smart Images

Figure CN120064563A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of tea detection, and in particular, to a tea variety identification device and method. Background Art
[0002] Currently, the identification of tea varieties still mainly relies on sensory identification, which is easily affected by factors such as the experience of tea tasters, physiological states, and environments, and the evaluation results are somewhat subjective. With the in-depth development of artificial intelligence algorithms and deep learning research, machine olfaction also has a great impact in gas detection and is currently also applied to the field of tea variety identification. A machine olfaction system consists of two parts: a gas sensor array and a pattern recognition method.
[0003] The existing method for identifying tea varieties is to collect the volatile gas of tea and input it into the gas sensor array. The gas sensor array will respond to the volatile gas and emit corresponding electrical signals. Through data preprocessing of these electrical signals and using a neural network algorithm to extract data features from the electrical signal data, a deep learning model is established, and the tea variety is predicted through the model. However, in the existing tea variety identification device, multiple gas sensors for detection are located in the same gas chamber and are fixed in position. Since the concentration of tea volatile gas is different at different positions in the gas chamber, it will affect the accuracy of the detection results. In addition, the existing method for identifying tea varieties only collects the volatile gas of dry tea, and the data preprocessing performed on the electrical signals generated by the gas sensor array is only a simple data cleaning operation, which cannot effectively eliminate the interference caused by environmental noise, equipment errors, and sample heterogeneity, resulting in an easy occurrence of misdetection. Summary of the Invention
[0004] In order to solve the above technical problems, the present invention provides a tea variety identification device and method, which can accurately identify the tea variety and improve the detection accuracy.
[0005] To solve the above problems, the present invention is implemented by adopting the following technical solutions:
[0006] A tea variety identification device of the present invention includes a controller, a sampling mechanism, and a gas detection mechanism. The sampling mechanism includes a sampling probe and an air pump. The gas detection mechanism includes a housing. A signal acquisition chamber and an air chamber are arranged inside the housing. A signal acquisition module is arranged inside the signal acquisition chamber. An intake chamber and eight independent air chambers are arranged inside the air chamber. The intake chamber includes a first air cavity and a second air cavity located above the first air cavity. The first air cavity is cylindrical, and the second air cavity is conical. The first air cavity and the second air cavity are coaxial. The eight independent air chambers are evenly distributed outside the second air cavity and are connected to the second air cavity. An air inlet communicating with the second air cavity is arranged at the connection between the independent air chamber and the second air cavity. A gas sensor and a moving module for driving the gas sensor to approach / leave the air inlet are arranged inside the independent air chamber. The sampling probe is connected to the intake end of the air pump through a connecting pipe. The outlet end of the air pump is connected to the intake end of the first air cavity through a connecting pipe. The gas sensor is electrically connected to the signal acquisition module. The controller is electrically connected to the air pump, the moving module, and the signal acquisition module respectively.
[0007] In this solution, the sampling mechanism respectively collects the volatile gases of three sub-samples of the tea sample to be tested and transports them to the eight independent air chambers of the gas detection mechanism. The three sub-samples are a dry sample, a filtered sample, and a tea soup sample. The gas detection mechanism detects the volatile gases of each sub-sample and sends the detection data to the controller through the signal acquisition module. The controller processes the detection data of each sub-sample to obtain the characteristic image of each sub-sample, and inputs the characteristic images of the three sub-samples as the sample data of the tea sample to be tested into the tea variety identification model. The tea variety identification model outputs the tea variety of the tea sample to be tested.
[0008] The process of the gas detection mechanism detecting the volatile gases of the sub-sample and sending the detection data to the controller through the signal acquisition module is as follows:
[0009] After the volatile gases of the sub-sample are sampled by the sampling probe and transported to the eight independent air chambers through the intake chamber, the moving modules in the eight independent air chambers drive the corresponding gas sensors to synchronously move from the outer edge of the independent air chamber towards the air inlet. During the movement towards the air inlet, the eight gas sensors jointly perform 450 detections and send the detection data to the signal acquisition module. After the eight gas sensors move to the air inlet of the independent air chamber, they then synchronously move towards the outer edge of the independent air chamber. During the movement towards the outer edge, the eight gas sensors jointly perform 450 detections and send the detection data to the signal acquisition module. The signal acquisition module obtains the detection data matrix M of the sub-sample and sends it to the controller.
[0010] Preferably, the gas sensors in the eight independent gas chambers are FECS50-100 sensors, SYS-CC001 sensors, 10152601 sensors, TGS-2620 sensors, SO2 / SF-100-S sensors, FS00303 sensors, TGS-2610 sensors, and GEDH100 sensors respectively.
[0011] The FECS50-100 sensor is used to detect hydrogen sulfide, the SYS-CC001 sensor is used to detect methane, the 10152601 sensor is used to detect ammonia, the TGS-2620 sensor is used to detect ethanol, the SO2 / SF-100-S sensor is used to detect sulfur dioxide, the FS00303 sensor is used to detect carbon dioxide, the TGS-2610 sensor is used to detect propane, and the GEDH100 sensor is used to detect nitrogen dioxide.
[0012] Preferably, the mobile module includes a horizontally arranged guide rail, the extension line of the guide rail intersects the central axis of the second gas chamber, the guide rail is provided with a slider that can slide along the guide rail and a driving mechanism for driving the slider to slide along the guide rail, and the gas sensor is arranged on the slider.
[0013] A method for identifying tea types of the present invention, which is used for the above-mentioned tea type identification device, includes the following steps:
[0014] S1: Prepare multiple parallel tea samples of different tea types;
[0015] S2: The sampling mechanism respectively collects the volatile gases of three sub-samples of each parallel tea sample and transports them to the eight independent gas chambers of the gas detection mechanism. The three sub-samples are dry samples, filtered samples, and tea soup samples. The gas detection mechanism detects the volatile gases of each sub-sample and sends the detection data to the controller through the signal acquisition module. The controller processes the detection data of each sub-sample to obtain the characteristic image of each sub-sample. The characteristic images of the three sub-samples of each parallel tea sample form the sample data of the parallel tea sample;
[0016] S3: The controller constructs a YOLOv8n model, inputs all the sample data into the YOLOv8n model for training, and uses the trained YOLOv8n model as the tea type identification model;
[0017] S4: The sampling mechanism respectively collects the volatile gases of three sub-samples of the tea sample to be measured and transports them to eight independent gas chambers of the gas detection mechanism. The gas detection mechanism detects the volatile gases of each sub-sample and sends the detection data to the controller through the signal acquisition module. The controller processes the detection data of each sub-sample to obtain the characteristic image of each sub-sample, and takes the characteristic images of the three sub-samples as the sample data of the tea sample to be measured and inputs them into the tea variety recognition model. The tea variety recognition model outputs the tea variety of the tea sample to be measured.
[0018] Step S1 includes the following steps: Take 75 grams of each different kind of tea, and divide each kind of tea into 25 parallel tea samples, that is, the weight of each parallel tea sample is 3g.
[0019] Preferably, the method for the sampling mechanism to collect the volatile gases of three sub-samples of the tea sample and transport them to eight independent gas chambers of the gas detection mechanism, and for the gas detection mechanism to detect the volatile gases of each sub-sample and send the detection data to the controller through the signal acquisition module is as follows:
[0020] M1: Put the dry tea sample into the first beaker, seal the first beaker with plastic wrap, place the first beaker in hot water at 90 - 100 degrees and let it stand for 150 - 200 seconds. Insert the sampling probe into the first beaker, and the air pump works to transport the volatile gases of the dry sample in the first beaker to the eight independent gas chambers through the intake chamber. The gas detection mechanism detects the volatile gases of the dry sample and sends the detection data to the controller through the signal acquisition module;
[0021] M2: Brew the dry tea sample in the first beaker with hot water at 90 - 100 degrees and let it stand for 250 - 350 seconds. Filter out the filtered sample and the tea soup sample with a strainer. Put the filtered sample into the second beaker and the tea soup sample into the third beaker. Seal the second beaker and the third beaker with plastic wrap respectively and let them stand for 150 - 200 seconds;
[0022] Expose the sampling probe to the air, and the air pump works to transport fresh air to the eight independent gas chambers through the intake chamber for cleaning. Then insert the sampling probe into the second beaker, and the air pump works to transport the volatile gases of the filtered sample in the second beaker to the eight independent gas chambers through the intake chamber. The gas detection mechanism detects the volatile gases of the filtered sample and sends the detection data to the controller through the signal acquisition module;
[0023] Expose the sampling probe to the air, and the air pump works to transport fresh air to the eight independent gas chambers through the intake chamber for cleaning. Then insert the sampling probe into the third beaker, and the air pump works to transport the volatile gases of the tea soup sample in the third beaker to the eight independent gas chambers through the intake chamber. The gas detection mechanism detects the volatile gases of the tea soup sample and sends the detection data to the controller through the signal acquisition module.
[0024] Preferably, the method for the gas detection mechanism to detect the volatile gas of the sub-sample and send the detection data to the controller through the signal acquisition module is as follows:
[0025] After the volatile gas of the sub-sample is sampled by the sampling probe and transported to eight independent gas chambers through the intake chamber, the moving module in the eight independent gas chambers drives the corresponding gas sensors to move synchronously from the outer edge of the independent gas chamber to the intake port. During the movement towards the intake port, the eight gas sensors jointly perform 450 detections and send the detection data to the signal acquisition module. After the eight gas sensors move to the intake port of the independent gas chamber, they then move synchronously towards the outer edge of the independent gas chamber. During the movement towards the outer edge, the eight gas sensors jointly perform 450 detections and send the detection data to the signal acquisition module. The signal acquisition module obtains the detection data matrix M1 of the sub-sample.
[0026]
[0027] Among them, A i represents the detection data group composed of eight detection data detected by the eight gas sensors at the i-th detection moment, and a ij represents the detection data detected by the j-th gas sensor at the i-th detection moment, 1 ≤ i ≤ 900, 1 ≤ j ≤ 8;
[0028] The signal acquisition module sends the detection data matrix M1 of the sub-sample to the controller.
[0029] Preferably, the method for the controller to process the detection data of the sub-sample and obtain the characteristic image of the sub-sample is as follows:
[0030] N1: The controller optimizes the detection data matrix M1 of the sub-sample sent by the signal acquisition module to obtain the optimized matrix M2.
[0031]
[0032] Among them, B j represents the data of the j-th column of the optimized matrix M2;
[0033] N2: Perform normalization processing on the optimized matrix M2, normalize it to the interval [-1, 1], and then expand it in the order of time series to obtain the matrix M3.
[0034]
[0035] Among them, B' j is the vector obtained after the normalization processing of B j , and b f is the f-th element in the matrix M3, 1 ≤ f ≤ 7200;
[0036] N3: Normalize matrix M3 to the interval [-1, 1] to obtain matrix M4, M4 = [c 1 , c 2 , c 3 …c 7200 , where c f is the f-th element in matrix M4;
[0037] N4: Map the elements in matrix M4 to obtain vector φ,
[0038] φ = [φ 1 , φ 2 …φ 7200 = [arccos(c 1 ), arccos(c 2 ), …, arccos(c 7200 )],
[0039] where φ f is the f-th element in vector φ, and φ f = arccos(c f );
[0040] N5: Generate matrix M5 according to vector φ,
[0041]
[0042] d s,T = cos(φ s + φ t ),
[0043] where 1 ≤ s ≤ 7200, 1 ≤ t ≤ 7200, and d s,t represents the relationship between the s-th element and the t-th element in vector φ;
[0044] N6: Perform a transformation on matrix M5 to obtain matrix M6,
[0045]
[0046]
[0047] where 1 ≤ i′ ≤ 720, 1 ≤ j′ ≤ 720;
[0048] N7: Perform a transformation on matrix M6 to obtain matrix M7,
[0049]
[0050]
[0051] where 1 ≤ i″ ≤ 72 and 1 ≤ j″ ≤ 72;
[0052] N8: Expand matrix M7 by column to obtain a 5184×1 matrix M8;
[0053] N9: Perform binning on the elements in matrix M8 to obtain 64 bins;
[0054] N10: Calculate the bin weights for each bin to obtain a bin weight vector P,
[0055]
[0056] where represents the bin weight of the q-th bin, 1 ≤ q ≤ 64;
[0057] N11: Construct a weight matrix Q based on the bin weight vector P,
[0058]
[0059] N12: Construct a transition probability matrix T based on matrix M8 and the bin corresponding to each element in matrix M8;
[0060] N1 3 : Multiply the transition probability matrix T by the weight matrix Q to obtain a matrix T′, and add a bias equation to matrix T′ to obtain a matrix T″;
[0061] N14: Normalize matrix T″ to the interval [0, 1] to obtain a matrix T″′, and perform a jet color mapping on matrix T″′ to obtain the feature image of the subsample.
[0062] Preferably, the step N9 includes the following steps:
[0063] N91: Construct 64 bins, numbered 1, 2, 3... 64 in sequence, and the bin intervals of the bins numbered 1 to 64 are [h 0 , h 1 ), [h 1 , h 2 ), …, [h 62 , h 63 ), [h 63 , h 64 , 0 ≤ k ≤ 64;
[0064] N92: Assign the elements in matrix M8 to the corresponding bins.
[0065] Preferably, when calculating the bin weight of the q-th bin in the step N10 The method is as follows: Calculate the average value of all elements in the q-th bin, and use this average value as the bin weight of the q-th bin.
[0066] Preferably, the step N12 includes the following steps:
[0067] Construct a 64×64 transition probability matrix T according to the matrix M8 and the bins corresponding to each element in the matrix M8. The element T in the p-th row and q-th column of the transition probability matrix T is pq as follows:
[0068]
[0069]
[0070] where 1 ≤ p ≤ 64, 1 ≤ r ≤ 5183; u r represents the r-th element in the matrix M8; the function K r represents that K r = 1 when the condition is satisfied, and K r = 0 when the condition is not satisfied; F r is the bin number where the r-th element in the matrix M8 is located; the function δ(F r , p) represents that δ(F r , p) = 1 when F r = p, and δ(F r ≠ p, δ(F r , p) = 0.
[0071] Preferably, the element T″ in the p-th row and q-th column of the matrix T″ in the step N13 is p,q as follows:
[0072]
[0073] where T′ p,q is the element in the p-th row and q-th column of the matrix T′.
[0074] The beneficial effects of the present invention are as follows: Eight gas sensors are used to detect the volatile gases generated by the dry samples, filtered samples, and tea soup samples of tea samples at different positions in their respective independent gas chambers to obtain corresponding detection data. After optimizing and enhancing the detection data, it is converted into a feature image to eliminate the interference caused by environmental noise, equipment errors, and sample heterogeneity. The YOLOv8n model is trained with the feature image to obtain a tea variety recognition model, and the tea variety of the tea sample is identified through the tea variety recognition model, improving the detection accuracy. Description of the Drawings
[0075] Figure 1 is a structural schematic diagram of the embodiment;
[0076] Figure 2 It is a cross-sectional view of an independent air chamber.
[0077] In the figure: 1. Sampling probe, 2. Air pump, 3. Housing, 4. Signal acquisition bin, 5. Air chamber bin, 6. Signal acquisition module, 7. Independent air chamber, 8. First air cavity, 9. Second air cavity, 10. Air inlet, 11. Gas sensor, 12. Guide rail, 13. Slide block, 14. Beaker. Specific implementation manner
[0078] The technical solution of the present invention will be further specifically described below through embodiments in conjunction with the accompanying drawings.
[0079] Embodiment: A tea variety identification device according to this embodiment, as Figure 1 , Figure 2 shown, includes a controller, a sampling mechanism and a gas detection mechanism. The sampling mechanism includes a sampling probe 1 and an air pump 2. The gas detection mechanism includes a housing 3. Inside the housing 3, there are a signal acquisition bin 4 and an air chamber bin 5. Inside the signal acquisition bin 4, there is a signal acquisition module 6. Inside the air chamber bin 5, there are an air inlet chamber and eight independent air chambers 7. The air inlet chamber includes a first air cavity 8 and a second air cavity 9 located above the first air cavity 8. The first air cavity 8 is cylindrical, and the second air cavity 9 is conical. The first air cavity 8 and the second air cavity 9 are coaxially connected. The eight independent air chambers 7 are evenly distributed outside the second air cavity 9 and are in contact with the conical surface of the second air cavity 9. At the lower part of the connection between the independent air chamber 7 and the second air cavity 9, there is an air inlet 10 communicating with the second air cavity 9. Inside the independent air chamber 7, there is a gas sensor 11 and a moving module for driving the gas sensor 11 to approach / leave the air inlet 10. The sampling probe 1 is connected to the air inlet end of the air pump 2 through a connecting pipe. The air outlet end of the air pump 2 is connected to the air inlet end at the bottom of the first air cavity 8 through a connecting pipe. The gas sensor 11 is electrically connected to the signal acquisition module 6. The controller is electrically connected to the air pump 2, the moving module, and the signal acquisition module 6 respectively.
[0080] The moving module includes a horizontally arranged guide rail 12. The extension line of the guide rail 12 intersects with the central axis of the second air cavity 9. On the guide rail 12, there is a slide block 13 that can slide along the guide rail 12 and a driving mechanism for driving the slide block 13 to slide along the guide rail 12. The gas sensor 11 is arranged on the slide block 13
[0081] The gas sensors 11 in the eight independent air chambers are respectively FECS50-100 sensors, SYS-CC001 sensors, 10152601 sensors, TGS-2620 sensors, SO2 / SF-100-S sensors, FS00303 sensors, TGS-2610 sensors, and GEDH100 sensors.
[0082] The FECS50-100 sensor is used to detect hydrogen sulfide, the SYS-CC001 sensor is used to detect methane, the 10152601 sensor is used to detect ammonia, the TGS-2620 sensor is used to detect ethanol, the SO2 / SF-100-S sensor is used to detect sulfur dioxide, the FS00303 sensor is used to detect carbon dioxide, the TGS-2610 sensor is used to detect propane, and the GEDH100 sensor is used to detect nitrogen dioxide.
[0083] In this solution, the dry tea sample to be tested is placed in beaker 14, the beaker is sealed with plastic wrap, and the beaker is left standing in hot water at 90 - 100 degrees for 150 - 200 seconds. The beaker is filled with the volatile gas of the dry sample.
[0084] The dry tea sample to be tested in the beaker is brewed with hot water at 90 - 100 degrees and left standing for 250 - 350 seconds. The filtered sample and the tea soup sample are filtered out with a strainer and placed in two other beakers respectively, which are then sealed with plastic wrap and left standing for 150 - 200 seconds. The two other beakers are respectively filled with the volatile gas of the filtered sample and the volatile gas of the tea soup sample.
[0085] The sampling mechanism collects the volatile gases of three sub-samples of the tea sample to be tested and transports them to eight independent gas chambers of the gas detection mechanism. The three sub-samples are the dry sample, the filtered sample, and the tea soup sample. The gas detection mechanism detects the volatile gas of each sub-sample and sends the detection data to the controller through the signal acquisition module. The controller processes the detection data of each sub-sample to obtain the characteristic image of each sub-sample. The characteristic images of the three sub-samples are used as the sample data of the tea sample to be tested and input into the tea type recognition model, and the tea type recognition model outputs the tea type of the tea sample to be tested.
[0086] The process of the gas detection mechanism detecting the volatile gas of the sub-sample and sending the detection data to the controller through the signal acquisition module is as follows:
[0087] After the volatile gas of the sub-sample is sampled by the sampling probe and transported to the eight independent gas chambers through the intake chamber, the moving module in the eight independent gas chambers drives the corresponding gas sensors to move synchronously from the outer edge of the independent gas chamber to the intake port. During the movement towards the intake port, the eight gas sensors perform 450 detections in synchronization and send the detection data to the signal acquisition module. After the eight gas sensors move to the intake port of the independent gas chamber, they then move synchronously towards the outer edge of the independent gas chamber. During the movement towards the outer edge, the eight gas sensors perform 450 detections in synchronization and send the detection data to the signal acquisition module. The signal acquisition module obtains the detection data matrix M1 of the sub-sample and sends it to the controller.
[0088] A method for identifying tea varieties in this embodiment, which is used for the above-mentioned tea variety identification device, includes the following steps:
[0089] S1: Prepare multiple parallel tea samples of different tea varieties;
[0090] S2: The sampling mechanism respectively collects the volatile gases of three sub-samples of each parallel tea sample and transports them to eight independent gas chambers of the gas detection mechanism. The three sub-samples are dry samples, filtered samples, and tea soup samples. The gas detection mechanism detects the volatile gases of each sub-sample and sends the detection data to the controller through the signal acquisition module. The controller processes the detection data of each sub-sample to obtain the characteristic image of each sub-sample. The characteristic images of the three sub-samples of each parallel tea sample form the sample data of this parallel tea sample;
[0091] S3: The controller constructs a YOLOv8n model, inputs all sample data into the YOLOv8n model for training, and uses the trained YOLOv8n model as the tea variety identification model;
[0092] S4: The sampling mechanism respectively collects the volatile gases of three sub-samples of the tea sample to be tested and transports them to eight independent gas chambers of the gas detection mechanism. The gas detection mechanism detects the volatile gases of each sub-sample and sends the detection data to the controller through the signal acquisition module. The controller processes the detection data of each sub-sample to obtain the characteristic image of each sub-sample. The characteristic images of the three sub-samples are used as the sample data of the tea sample to be tested and input into the tea variety identification model. The tea variety identification model outputs the tea variety of the tea sample to be tested.
[0093] Step S1 includes the following steps: Take 75 grams of each different tea variety, and divide each tea variety into 25 parallel tea samples, that is, the weight of each parallel tea sample is 3g.
[0094] The method for the sampling mechanism to collect the volatile gases of three sub-samples of the tea sample and transport them to eight independent gas chambers of the gas detection mechanism, and for the gas detection mechanism to detect the volatile gases of each sub-sample and send the detection data to the controller through the signal acquisition module is as follows:
[0095] M1: Put the dry tea sample into the first beaker, seal the first beaker with plastic wrap, place the first beaker in hot water at 90 - 100 degrees, let it stand for 150 - 200 seconds, insert the sampling probe into the first beaker, and the air pump works to transport the volatile gas of the dry sample in the first beaker to the eight independent gas chambers through the intake chamber. The gas detection mechanism detects the volatile gas of the dry sample and sends the detection data to the controller through the signal acquisition module;
[0096] M2: Pour hot water at 90 - 100 degrees Celsius over the dried tea leaf samples in the first beaker, let it stand for 250 - 350 seconds, filter out the filtered sample and the tea soup sample with a strainer. Put the filtered sample into the second beaker and the tea soup sample into the third beaker. Seal the second beaker and the third beaker with plastic wrap respectively and let it stand for 150 - 200 seconds;
[0097] Expose the sampling probe to the air. The air pump operates to transport fresh air through the intake chamber to eight independent chambers for cleaning. Then insert the sampling probe into the second beaker. The air pump operates to transport the volatile gas of the filtered sample in the second beaker through the intake chamber to eight independent chambers. The gas detection mechanism detects the volatile gas of the filtered sample and sends the detection data to the controller through the signal acquisition module;
[0098] Expose the sampling probe to the air. The air pump operates to transport fresh air through the intake chamber to eight independent chambers for cleaning. Then insert the sampling probe into the third beaker. The air pump operates to transport the volatile gas of the tea soup sample in the third beaker through the intake chamber to eight independent chambers. The gas detection mechanism detects the volatile gas of the tea soup sample and sends the detection data to the controller through the signal acquisition module.
[0099] The method by which the gas detection mechanism detects the volatile gas of the sub - sample and sends the detection data to the controller through the signal acquisition module is as follows:
[0100] After the volatile gas of the sub - sample is sampled by the sampling probe and transported through the intake chamber to eight independent chambers, the moving module in the eight independent chambers drives the corresponding gas sensors to move synchronously from the outer edge of the independent chamber towards the air inlet. During the movement towards the air inlet, the eight gas sensors jointly perform 450 detections and send the detection data to the signal acquisition module. After the eight gas sensors move to the air inlet of the independent chamber, they then move synchronously towards the outer edge of the independent chamber. During the movement towards the outer edge, the eight gas sensors jointly perform 450 detections and send the detection data to the signal acquisition module. The signal acquisition module obtains the detection data matrix M1 of the sub - sample,
[0101]
[0102] where, A i represents the detection data group composed of eight detection data detected by the eight gas sensors at the i - th detection moment, a ij represents the detection data detected by the j - th gas sensor at the i - th detection moment, 1 ≤ i ≤ 900, 1 ≤ j ≤ 8;
[0103] The signal acquisition module sends the detection data matrix M1 of the sub - sample to the controller.
[0104] The method for the controller to process the detection data of the subsample and obtain the feature image of the subsample is as follows:
[0105] N1: The controller optimizes the detection data matrix M1 of the subsample sent by the signal acquisition module to obtain an optimized matrix M2,
[0106]
[0107] where Bj represents the j-th column data of the optimized matrix M2;
[0108] N2: The optimized matrix M2 is normalized to the interval [-1, 1], and then unfolded in the order of the time series to obtain a matrix M3,
[0109]
[0110] where B′ j is the vector obtained after normalizing B j and b f is the f-th element in the matrix M3, 1 ≤ f ≤ 7200;
[0111] N3: The matrix M3 is normalized to the interval [-1, 1] to obtain a matrix M4, M4 = [c 1 , c 2 , c 3 …c 7200 , and c f is the f-th element in the matrix M4;
[0112] N4: Map the elements in the matrix M4 to obtain a vector φ,
[0113] φ = [φ 1 , φ 2 …φ 7200 = [arccos(c 1 ), arccos(c 2 )…arccos(c 7200 )],
[0114] where φ f is the f-th element in the vector φ, and φ f = arccos(c f );
[0115] N5: Generate a matrix M5 according to the vector φ,
[0116]
[0117] d s,t = cos(φ s + φt )
[0118] where \(1\leq s\leq7200\), \(1\leq t\leq7200\), \(d\) s,t represents the relationship between the \(s\)-th element and the \(t\)-th element in the vector \(\varphi\);
[0119] N6: Perform a transformation on matrix \(M5\) to obtain matrix \(M6\),
[0120]
[0121]
[0122] where \(1\leq i'\leq720\), \(1\leq j'\leq720\);
[0123] N7: Perform a transformation on matrix \(M6\) to obtain matrix \(M7\),
[0124]
[0125]
[0126] where \(1\leq i''\leq72\), \(1\leq j''\leq72\);
[0127] N8: Expand matrix \(M7\) by columns to obtain a \(5184\times1\) matrix \(M8\);
[0128] N9: Perform binning on the elements in matrix \(M8\) to obtain 64 bins; N10: Calculate the bin weights for each bin to obtain the bin weight vector \(P\),
[0129] where represents the bin weight of the \(q\)-th bin, \(1\leq q\leq64\); N11: Construct a weight matrix \(Q\) according to the bin weight vector \(P\),
[0130]
[0131] N12: Construct a transition probability matrix \(T\) according to matrix \(M8\) and the bin corresponding to each element in matrix \(M8\);
[0132] N1 3 : Multiply the transition probability matrix \(T\) by the weight matrix Q to obtain matrix \(T'\), and add a bias equation to matrix \(T'\) to obtain matrix \(T''\);
[0133] N14: Normalize matrix \(T''\) to the interval \([0, 1]\) to obtain matrix \(T'''\), and perform a jet color mapping on matrix \(T'''\) (i.e., map the elements in matrix \(T'''\) to a predefined color space of jet) to obtain the feature image of the subsample.
[0134] The gas sensors in eight independent gas chambers first move synchronously from the outer edge of the independent gas chamber towards the air inlet (i.e., from the position with a lower concentration of volatile gas to the position with a higher concentration). During the movement towards the air inlet, 450 detections are carried out synchronously. Then, these 450 detection data need to follow the rule of increasing values after normalization to indicate successful transfer. After the eight gas sensors move to the air inlet of the independent gas chamber, they then move synchronously towards the outer edge of the independent gas chamber (i.e., from the position with a higher concentration of volatile gas to the position with a lower concentration). During the movement towards the outer edge, 450 detections are carried out synchronously. Then, these 450 detection data need to follow the rule of decreasing values after normalization to indicate successful transfer.
[0135] Step N9 includes the following steps:
[0136] N91: Construct 64 bins, numbered 1, 2, 3... 64 in sequence. The bin intervals of the bins numbered from 1 to 64 are [h 0 , h 1 ), [h 1 , h 2 ), …, [h 62 , h 63 ), [h 63 , h 64 ,
[0137] N92: Allocate the elements in matrix M8 to the corresponding bins (i.e., find the bin interval where each element in matrix M8 is located, and allocate each element in matrix M8 to the bin of the bin interval it belongs to).
[0138] In step N10, the method for calculating the bin weight of the q-th bin is as follows: Calculate the average value of all elements in the q-th bin, and take this average value as the bin weight of the q-th bin.
[0139] Step N12 includes the following steps:
[0140] Construct a 64×64 transition probability matrix T according to matrix M8 and the bins corresponding to each element in matrix M8. The element T pq in the p-th row and q-th column of the transition probability matrix T is:
[0141]
[0142]
[0143] where 1 ≤ p ≤ 64, 1 ≤ r ≤ 5183; u r represents the r-th element in matrix M8; the function K r represents that when the condition is satisfied, K r= 1 when the condition is not met, K r = 0; F r is the bin number where the r-th element in matrix M8 is located; the function δ(F r , p) means that when F r = p, δ(F r , p) = 1, and when F r ≠ p, δ(F r , p) = 0.
[0144] The element T″ in the p-th row and q-th column of matrix T″ in step N13 is: p,q as follows:
[0145]
[0146] where T′ p,q is the element in the p-th row and q-th column of matrix T′.
[0147] In this solution, eight gas sensors are used to detect the volatile gases generated by the dry samples, filtered samples, and tea soup samples of tea samples at different positions in their respective independent gas chambers, obtaining corresponding detection data. After optimizing and enhancing the detection data, it is converted into a feature image to eliminate the interference caused by environmental noise, equipment errors, and sample heterogeneity. The YOLOv8n model is trained with the feature image to obtain a tea variety recognition model, and the tea variety of the tea sample is identified through the tea variety recognition model, improving the detection accuracy.
[0148] In step N1, optimizing the detection data matrix M1 is to use the detection data at the initial detection moment as the baseline response, and subtract this baseline response from each detection data to eliminate background noise and possible environmental interference. In step N2, normalizing the optimized matrix M2 is to avoid the dimensional interference of the detection data mismatch between gas sensors. In step N13, adding a bias equation is to enhance the non-zero transition probability in the image. The method of converting the detection data of the volatile gases of the sub-samples into a feature image reduces the interference caused by environmental noise, equipment errors, and sample heterogeneity, improving the quality of the data and the accuracy of the analysis.
[0149] For example: Select 10 kinds of tea such as West Lake Longjing from Hangzhou, Zhejiang Province, Huangshan Maofeng from Huangshan City, Anhui Province, Biluochun from Changzhou City, Jiangsu Province, Enshi Yulu from Enshi City, Hubei Province, Xinyang Maojian from Xinyang City, Henan Province, Qimen Black Tea from Huangshan City, Anhui Province, Jin Junmei from Quanzhou City, Fujian Province, Dianhong Gongfu from Lincang City, Yunnan Province, Yihong Gongfu from Yichang City, Hubei Province, and Ninghong Gong from Jiujiang City, Jiangxi Province. Prepare 25 parallel tea samples for each kind of tea, with each parallel tea sample weighing 3g. Conduct experiments using this method. The experimental results show that the accuracy rate is 99.72%, the precision rate is 0.9972, and the recall rate is 0.9973.
Claims
1. A tea type identification device, characterized in that: The invention comprises a controller, a sampling mechanism and a gas detection mechanism, wherein the sampling mechanism comprises a sampling probe (1) and an air pump (2), and the gas detection mechanism comprises a shell (3), wherein a signal acquisition chamber (4) and an air chamber chamber (5) are arranged in the shell (3), wherein a signal acquisition module (6) is arranged in the signal acquisition chamber (4), and wherein an air inlet chamber and eight independent air chambers (7) are arranged in the air chamber chamber (5), wherein the air inlet chamber comprises a first air cavity (8) and a second air cavity (9) located above the first air cavity (8), wherein the first air cavity (8) is cylindrical, and the second air cavity (9) is conical, wherein the first air cavity (8) is coaxial with the second air cavity (9), and wherein the eight independent air chambers (7) are evenly distributed in the air chamber (8). The independent air chamber (7) is located outside the second air cavity (9) and connected to the second air cavity (9); an air inlet (10) communicating with the second air cavity (9) is provided at the connection between the independent air chamber (7) and the second air cavity (9); a gas sensor (11) and a moving module for driving the gas sensor (11) to approach / move away from the air inlet (10) are provided in the independent air chamber (7); the sampling probe (1) is connected to the air inlet end of the air pump (2) through a connecting pipe; the air outlet end of the air pump (2) is connected to the air inlet end of the first air cavity (8) through a connecting pipe; the gas sensor (11) is electrically connected to the signal acquisition module (6); and the controller is electrically connected to the air pump (2), the moving module, and the signal acquisition module (6) respectively.
2. A tea type identification device according to claim 1, characterized in that: The gas sensors (11) in the eight independent gas chambers (7) are respectively FECS50-100 sensor, SYS-CC001 sensor, 10152601 sensor, TGS-2620 sensor, SO2 / SF-100-S sensor, FS00303 sensor, TGS-2610 sensor, and GEDH100 sensor.
3. A tea type identification device according to claim 1, characterized in that: The mobile module comprises a horizontally arranged guide rail (12), an extension line of the guide rail (12) intersecting with the central axis of the second air cavity (9), a slider (13) capable of sliding along the guide rail (12) and a driving mechanism for driving the slider (13) to slide along the guide rail (12), and the gas sensor (11) is arranged on the slider (13).
4. A method for identifying tea types, used in a tea type identification device according to claim 1, characterized in that: The following steps are involved: S1: Prepare multiple parallel tea samples of different types of tea; S2: The sampling mechanism collects the volatile gas of three subsamples of each parallel tea sample and transmits them to eight independent gas chambers of the gas detection mechanism. The three subsamples are a dry sample, a filtered sample, and a tea soup sample. The gas detection mechanism detects the volatile gas of each subsample and sends the detection data to the controller through the signal acquisition module. The controller processes the detection data of each subsample to obtain a characteristic image of each subsample. The characteristic images of the three subsamples of each parallel tea sample constitute the sample data of the parallel tea sample. S3: The controller builds a YOLOv8n model, inputs all sample data into the YOLOv8n model for training, and uses the trained YOLOv8n model as a tea type recognition model; S4: The sampling mechanism collects the volatile gases of three subsamples of the tea sample to be tested respectively and transmits them to the eight independent gas chambers of the gas detection mechanism. The gas detection mechanism detects the volatile gases of each subsample and sends the detection data to the controller through the signal acquisition module. The controller processes the detection data of each subsample to obtain a characteristic image of each subsample. The characteristic images of the three subsamples are input into the tea type recognition model as the sample data of the tea sample to be tested. The tea type recognition model outputs the tea type of the tea sample to be tested.
5. A method for identifying tea types according to claim 4, characterized in that: The sampling mechanism collects volatile gases of three subsamples of the tea sample and transmits them to eight independent gas chambers of the gas detection mechanism. The gas detection mechanism detects the volatile gases of each subsample and sends the detection data to the controller through the signal acquisition module as follows: M1: Put the dried tea sample into the first beaker, seal the first beaker with plastic wrap, place the first beaker in hot water at 90-100 degrees, place it for 150-200 seconds, insert the sampling probe into the first beaker, and operate the air pump to transport the volatile gas of the dried sample in the first beaker to eight independent air chambers through the air inlet chamber. The gas detection mechanism detects the volatile gas of the dried sample and sends the detection data to the controller through the signal acquisition module; M2: Use hot water at 90-100 degrees to brew the dried tea sample in the first beaker, place it for 250-350 seconds, filter out the filtered sample and tea soup sample with a colander, put the filtered sample into the second beaker, put the tea soup sample into the third beaker, seal the second beaker and the third beaker with plastic wrap respectively, and place them for 150-200 seconds; The sampling probe is exposed to the air, and the air pump works to deliver fresh air to eight independent air chambers through the air inlet chamber for cleaning. Then the sampling probe is inserted into the second beaker, and the air pump works to deliver the volatile gas of the filtered sample in the second beaker through the air inlet chamber to the eight independent air chambers. The gas detection mechanism detects the volatile gas of the filtered sample and sends the detection data to the controller through the signal acquisition module. The sampling probe is exposed to the air, and the air pump works to transport fresh air through the air inlet chamber to eight independent air chambers for cleaning. Then the sampling probe is inserted into the third beaker, and the air pump works to transport the volatile gas of the tea sample in the third beaker through the air inlet chamber to eight independent air chambers. The gas detection mechanism detects the volatile gas of the tea sample and sends the detection data to the controller through the signal acquisition module.
6. A method for identifying tea types according to claim 5, characterized in that: The method in which the gas detection mechanism detects the volatile gas of the sub-sample and sends the detection data to the controller through the signal acquisition module is as follows: After the volatile gas of the sub-sample is sampled by the sampling probe and transported to the eight independent air chambers through the air inlet chamber, the mobile modules in the eight independent air chambers drive the corresponding gas sensors to move synchronously from the outer edge of the independent air chamber to the air inlet. During the movement to the air inlet, the eight gas sensors synchronously perform 450 detections and send the detection data to the signal acquisition module. After the eight gas sensors move to the air inlet of the independent air chamber, they synchronously move to the outer edge of the independent air chamber. During the movement to the outer edge, the eight gas sensors synchronously perform 450 detections and send the detection data to the signal acquisition module. The signal acquisition module obtains the detection data matrix M1 of the sub-sample. Among them, A i represents a detection data group consisting of eight detection data obtained by eight gas sensors at the i-th detection time, a ij represents the detection data obtained by the j-th gas sensor at the i-th detection time, 1≤i≤900, 1≤j≤8; The signal acquisition module sends the detection data matrix M1 of the sub-sample to the controller.
7. A method for identifying tea types according to claim 6, characterized in that: The controller processes the detection data of the sub-sample to obtain the characteristic image of the sub-sample as follows: N1: The controller optimizes the detection data matrix M1 of the sub-samples sent by the signal acquisition module to obtain the optimized matrix M2. Wherein, Bj represents the j-th column data of the optimization matrix M2; N2: Normalize the optimized matrix M2 to the interval [-1, 1], and then expand it in the order of the time series to obtain the matrix M3. <h2 style=";text-align:left;direction:ltr">M3=[B′1<h2 style=";text-align:left;direction:ltr"> T <h2 style=";text-align:left;direction:ltr"> B′2<h2 style=";text-align:left;direction:ltr"> T <h2 style=";text-align:left;direction:ltr"> …B′8<h2 style=";text-align:left;direction:ltr"> T <h2 style=";text-align:left;direction:ltr"> ]<h2 style=";text-align:left;direction:ltr"> T <h2 style=";text-align:left;direction:ltr"> (b1, b2, b3…b)<h2 style=";text-align:left;direction:ltr"> 7200 <h2 style=";text-align:left;direction:ltr"> ], Among them, B′ j For B j The vector obtained after normalization, b f is the fth element in the matrix M3, 1≤f≤7200; N3: Normalize the matrix M3 to the interval [-1, 1] to obtain the matrix M4, M4 = [c1, c2, c3…c 7200 ], c f is the fth element in the matrix M4; N4: maps the elements in the matrix M4 to obtain the vector φ, φ=[φ1,φ2…φ 7200 ]=[arccos(c1),arccos(c2)…arccos(c 7200 )], Among them, φ f is the fth element in the vector φ, φ f =arccos(c f ); N5: Generate matrix M5 based on vector φ, d s,t =cos(φ s +φ t ), Among them, 1≤s≤7200, 1≤t≤7200, d s,t Represents the relationship between the sth element and the tth element in the vector φ; N6: Transform the matrix M5 to obtain the matrix M6. Among them, 1≤i′≤720, 1≤j′≤720; N7: Transform the matrix M6 to obtain the matrix M7. Among them, 1≤i″≤72, 1≤j″≤72; N8: Expand the matrix M7 by columns to obtain a 5184×1 matrix M8; N9: Bin the elements in the matrix M8 to obtain 64 bins; N10: Calculate the bin weight of each bin and get the bin weight vector P. in, Indicates the bin weight of the qth bin, 1≤q≤64; N11: Construct the weight matrix Q based on the bin weight vector P, N12: Construct a transition probability matrix T based on the matrix M8 and the bins corresponding to each element in the matrix M8; N13: Multiply the transfer probability matrix T by the weight matrix Q to obtain the matrix T′, and add the bias equation to the matrix T′ to obtain the matrix T″; N14: Normalize the matrix T″ to the interval [0, 1] to obtain the matrix T″′, perform jet color mapping on the matrix T″′, and obtain the characteristic image of the sub-sample.
8. A method for identifying tea types according to claim 7, characterized in that: The step N9 comprises the following steps: N91: Construct 64 bins, numbered 1, 2, 3, ... 64, and the bin intervals of bins numbered 1 to 64 are [h0, h1), [h1, h2), ..., [h 62 ,h 63 ), [h 63 ,h 64 ], N92: Assign the elements in matrix M8 to the corresponding bins.
9. A method for identifying tea types according to claim 8, characterized in that: In step N10, the bin weight of the qth bin is calculated The method is as follows: calculate the average value of all elements in the qth bin and use the average value as the bin weight of the qth bin.
10. A method for identifying tea types according to claim 9, characterized in that: The step N12 comprises the following steps: According to the matrix M8 and the bins corresponding to each element in the matrix M8, a 64×64 transition probability matrix T is constructed. The element T in the pth row and qth column of the transition probability matrix T is pq for: Among them, 1≤p≤64, 1≤r≤5183; u r Represents the rth element in the matrix M8; function K r Indicates that when the condition is met, K r =1, when the condition is not met, K r =0; F r is the number of the bin where the rth element in the matrix M8 is located; function δ(F r , p) means when F r = p when δ(F r , p)=1, when F r ≠p when δ(F r , p)=0.