A method, medium and system for rapid spectral analysis of fresh tobacco leaf baking characteristics

Through spectral technology and neural network model, the problem of detecting the baking characteristics of fresh tobacco leaves in the field is solved, and the rapid and accurate detection of the baking properties and resistance of fresh tobacco leaves is achieved, which improves the quality and economic benefits of tobacco leaves baking.

CN118583790BActive Publication Date: 2024-11-26TOBACCO RESEARCH INSTITUTE OF CHINESE ACADEMY OF AGRICULTURAL SCIENCES (QINGZHOU TOBACCO RESEARCH INSTITUTE OF CHINA NATIONAL TOBACCO COMPANY)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410651805.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2024-03-20
Filing Date
2024-05-24
Publication Date
2024-11-26
Estimated Expiration
2044-05-24

AI Technical Summary

Technical Problem

The prior art is difficult to quickly and accurately detect the baking characteristics of fresh tobacco leaves in the field, which affects the quality changes and product quality during the tobacco leaves baking and processing.

Method used

Spectral technology combined with neural network model is used to obtain representative spectral information of fresh tobacco leaves, establish a mapping relationship between the spectrum and baking characteristics, and train a discriminant model to achieve non-destructive detection of the baking ability and baking resistance of fresh tobacco leaves.

Benefits of technology

It improves the objectivity and accuracy of the detection of tobacco leaf baking characteristics, achieves rapid and efficient rating of large-scale tobacco leaves, reduces production costs, and improves economic benefits.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118583790B_ABST
    Figure CN118583790B_ABST
Patent Text Reader

Abstract

The invention provides a method, a medium and a system for rapid analysis of the spectrum of baking characteristics of fresh tobacco leaves, and belongs to the technical field of tobacco leaf baking. The method comprises the following steps: obtaining representative spectral information of fresh tobacco leaf samples harvested from the field, which is recorded as tobacco leaf spectrum; obtaining baking characteristics of fresh tobacco leaf samples in a dark box experiment, evaluating and grading them to obtain baking characteristic labels; obtaining an average spectrum at the same piece of fresh tobacco leaf, establishing a mapping relationship between the average spectrum of the fresh tobacco leaf and the baking characteristic label, which is recorded as spectral label mapping, thereby obtaining a fresh tobacco leaf spectrum data set with different baking characteristic labels; training a neural network with the fresh tobacco leaf spectrum data set to obtain a fresh tobacco leaf baking characteristic discrimination model; obtaining a test image of the fresh tobacco leaf to be tested; obtaining the test spectrum of the fresh tobacco leaf according to the test image; discriminating the test spectrum by using a discrimination model to obtain a discrimination result; the invention can analyze the baking characteristics of fresh tobacco leaves through spectral detection technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of tobacco leaf baking, and in particular relates to a method, a medium and a system for rapid spectrum analysis of baking characteristics of fresh tobacco leaves. Background Art

[0002] As an important economic crop, the quality assessment and grading of tobacco has always been the focus of the tobacco industry. Traditional tobacco leaf quality assessment mostly relies on experienced graders to manually score according to indicators such as appearance and texture. With the continuous development of intelligent and data-based technologies, it has become possible to use sensory analysis instruments to quickly and accurately evaluate tobacco leaf quality. In recent years, domestic and foreign scholars have carried out a lot of research on rapid and non-destructive detection of tobacco leaf quality based on spectral technology. As a fast and efficient analytical measurement method, spectral technology can extract detailed information on tobacco leaf composition, organizational structure, etc., and realize non-contact detection and intelligent rating of tobacco leaves. At present, research on tobacco leaf quality analysis based on spectral technology mainly focuses on the quality detection and rating of air-dried tobacco leaves and flue-cured tobacco leaves. There are relatively few reports on the prediction and detection of the baking characteristics of fresh leaves in the field. The baking characteristics of fresh tobacco leaves directly affect the quality changes during the baking process, which is an important prerequisite for determining the quality of tobacco leaf processing. Therefore, the development of a non-destructive detection technology that can realize the rapid prediction and evaluation of the baking characteristics of fresh tobacco leaves is of great significance for guiding tobacco leaf baking processing and improving the quality of tobacco products. Summary of the invention

[0003] In view of this, the present invention provides a method, medium and system for rapid spectral analysis of baking characteristics of fresh tobacco leaves, which can analyze the baking characteristics of fresh tobacco leaves through spectral detection technology to improve the objectivity and accuracy of judgment.

[0004] The present invention is achieved in that:

[0005] A first aspect of the present invention provides a method for rapid spectral analysis of fresh tobacco leaf baking characteristics, which comprises the following steps:

[0006] S10, obtaining fresh tobacco leaf samples of different qualities collected from the field and representative spectral information of fresh tobacco leaves collected according to the "8-point method", recorded as tobacco leaf spectra;

[0007] S20, obtaining baking characteristic labels obtained by evaluating and grading the baking characteristics of the fresh tobacco leaf samples in the dark box experiment, including "better", "medium" and "poor" for baking ease, and "better", "medium" and "poor" for baking resistance;

[0008] S30, averaging multiple spectra at the same fresh tobacco leaf to obtain an average spectrum, and establishing a mapping relationship between the average spectrum of each fresh tobacco leaf and a baking characteristic label, recorded as a spectrum label mapping, and obtaining a fresh tobacco leaf spectrum data set with different baking characteristic labels according to the spectrum label mapping;

[0009] S40, training a neural network using the fresh tobacco leaf spectral data set as a training data set to obtain a fresh tobacco leaf baking characteristic discrimination model;

[0010] S50, obtaining a complete image of the fresh tobacco leaf to be tested, recorded as the image to be tested; segmenting the leaf veins according to the image to be tested and locating a plurality of spectral sampling points, obtaining spectra corresponding to the plurality of spectral sampling points, recorded as the spectrum to be tested;

[0011] S60, using the fresh tobacco leaf baking characteristic discrimination model to input the spectrum to be tested, to obtain a baking ease and baking resistance discrimination result of the fresh tobacco leaf to be tested.

[0012] On the basis of the above technical solution, the method for rapid spectral analysis of fresh tobacco leaf baking characteristics of the present invention can also be improved as follows:

[0013] Among them, the step S10 specifically includes: selecting fresh tobacco leaf samples from different production areas and different varieties, and within each variety in each production area, selecting fresh leaves with large differences in appearance quality for sampling to obtain samples with sufficient quality variation; evaluating the baking characteristics of each batch of sampled tobacco leaves; collecting representative spectral information from different parts of fresh tobacco leaves in the field, and collecting points according to the "eight-point sampling method", with a total of 8 points collecting spectral curves; recording the origin, variety, quality grade, baking characteristic evaluation grade, spectral curve and other information of each tobacco leaf sample, and establishing a sample information library.

[0014] The beneficial effects of adopting the above-mentioned improved scheme are: obtaining fresh tobacco leaf samples of different quality levels, evaluating their baking characteristics, and collecting representative spectral information, laying a data foundation for the subsequent establishment of a correlation model between spectral data and baking characteristics. This step ensures that a sample set with controllable quality, unified evaluation, and complete information is obtained by controlling the quality variation range of the samples, using a standard baking characteristic evaluation method, and a fixed spectral acquisition mode.

[0015] Furthermore, the step S20 specifically includes: moving the fresh tobacco leaf samples obtained in S10 into a sealed, airtight, dark box, observing the yellowing or browning state of the tobacco leaves every 12 hours, and referring to the standard "YC / T 311-2009", calibrating the baking ease and baking resistance level of each sample by recording the time when the tobacco leaves turn completely yellow and the time when they turn 30% brown, entering the origin, variety, agronomic information, and baking characteristic evaluation level of all samples into a database to form a baking characteristic label library, wherein the interior of the box is a constant temperature and humidity environment.

[0016] The beneficial effects of adopting the above-mentioned improvement scheme are: by conducting a baking experiment on tobacco leaves under controlled conditions, evaluating its baking ease and baking resistance indicators, and obtaining the baking characteristic label information of the object. This process adopts the industry's unified evaluation standards to ensure the reliability of the label. Corresponding to S10, it lays the foundation for the baking characteristic data set for subsequent modeling.

[0017] Furthermore, the step S30 specifically includes: for each tobacco leaf sample, taking the average value of the eight spectral curves collected in S10 to obtain the average spectral curve of the sample; forming a correspondence between the average spectral curves of all samples and the baking characteristic labels obtained in S20, and establishing a spectrum-label mapping library; according to the mapping relationship, dividing the spectral curves into spectral data sets corresponding to different baking characteristics; performing sample quantity statistics for each data set, and if the sample size of a certain category is relatively small, obtaining more supplementary samples of the corresponding category; using preprocessing methods such as sample selection, de-anomaly, and normalization to clean the spectral data and construct a training set.

[0018] The beneficial effect of adopting the above improved scheme is: by constructing the correspondence between the spectral curve and the baking characteristic label, the spectral data is divided into multiple data sets representing different baking characteristics. This step realizes the effective comparison and classification of spectral data by constructing the mapping relationship, laying the foundation for the data set to establish a discrimination model for the subsequent use of spectral monitoring of baking characteristics. At the same time, the statistical reliability of each data set is ensured by balancing the number of samples and preprocessing data.

[0019] Furthermore, the step S40 specifically includes: selecting part of the spectral data sets corresponding to different baking characteristics obtained in S30 as a training set and the rest as a test set; preprocessing the spectral data in the training set and the test set; selecting a machine learning algorithm suitable for processing spectral data, and using the training set data to train different monitoring models; evaluating the monitoring performance of different models on the test set, and selecting the optimal model as the final monitoring model.

[0020] The beneficial effect of adopting the above-mentioned improvement scheme is: training and constructing a neural network model that can effectively monitor the ease of baking and baking resistance of tobacco leaves. This step selects a baking characteristic discrimination model with excellent monitoring performance through methods such as sample segmentation, data preprocessing, model training and evaluation, and integrated learning, laying the algorithm foundation for the subsequent spectral rapid monitoring of baking characteristics.

[0021] Furthermore, the step S50 specifically includes: using an image segmentation algorithm to analyze and extract the leaf surface and veins of the tobacco leaf image to be tested; using a key point extraction algorithm to locate the position of the spectral sampling of the leaf surface area obtained by segmentation; marking the main and secondary vein positions on the vein segmentation image, and determining the spectral sampling position of the corresponding vein belly point; obtaining the spectral curve of each sampling point at the corresponding sampling position of the tobacco leaf to be tested; and averaging all the sampled spectral curves to obtain the average spectral curve of the sample to be tested.

[0022] The beneficial effects of adopting the above improved scheme are: intelligently determining the spectral sampling position on the tobacco leaf image to be tested, and obtaining the representative average spectrum of the sample to be tested as the model input. This step extracts key information through image processing and analysis, guides the spectrum collector to effectively and quickly obtain the spectrum to be tested, and prepares for subsequent monitoring.

[0023] A second aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores program instructions, and when the program instructions are executed, they are used to execute the above-mentioned method for rapid spectral analysis of baking characteristics of fresh tobacco leaves.

[0024] The third aspect of the present invention provides a system for rapid spectrum analysis of fresh tobacco leaf baking characteristics, which includes: an image acquisition module, a spectrum adaptive acquisition module, a tobacco leaf conveying module, a computer analysis and control module, a dark box and a rack;

[0025] The image acquisition module includes a camera and a camera illumination light source, which are fixed on the top of the dark box and are used to obtain an overall image of the tobacco leaf facing downward under uniform illumination conditions;

[0026] The spectrum adaptive acquisition module is arranged at the rear end of the dark box and is used to adaptively acquire spectrum information at different positions of the tobacco leaf;

[0027] The tobacco leaf conveying module comprises a slide rail, a telescopic rod and a loading platform, which is arranged at the front end of the dark box and is used to convey tobacco leaves into and out of the dark box;

[0028] The computer analysis control module includes the computer readable storage medium as described above, and the computer analysis control unit is electrically connected to the spectrum adaptive acquisition unit, the image acquisition unit and the tobacco conveying unit, and is used to analyze and process data and transmit control signals;

[0029] The dark box is fixed on the frame and is used for shielding interference from the external environment.

[0030] On the basis of the above technical solution, the fresh tobacco leaf baking characteristic spectral rapid analysis system of the present invention can also be improved as follows:

[0031] Furthermore, the spectral adaptive acquisition module includes a spectrometer and a fiber optic probe, an excitation light source, a distance sensor and a three-axis translation stage. The spectrometer is fixed on a frame, and the fiber optic probe is fixed on the bottom of the slide seat of the three-axis translation stage for collecting spectral information of tobacco leaves. The distance sensor is fixedly connected to the fiber optic probe for detecting the distance between the fiber optic probe and the surface of the tobacco leaves.

[0032] Furthermore, the distance between the optical fiber probe and the tobacco leaf is 2.9 to 3.1 cm.

[0033] Compared with the prior art, the method for rapid prediction and evaluation of fresh tobacco leaf baking characteristics based on spectral technology proposed in the present invention has the following significant technical effects and progress:

[0034] 1. It realizes non-destructive testing of the baking characteristics of fresh tobacco leaves in the field, and can pre-evaluate the raw material characteristics of tobacco leaves to guide subsequent production;

[0035] 2. Using spectral information as the detection feature and combining it with a machine learning model, we can achieve quantitative intelligent identification of baking characteristics and improve the accuracy and objectivity of detection;

[0036] 3. The detection is fast and efficient, and can grade and classify the baking characteristics of large quantities of tobacco leaves to meet production needs;

[0037] 4. The test prediction results are intuitive and visible, and the baking characteristics classification results can be directly used for production quality control, reducing the number of baking tests and reducing resource waste;

[0038] 5. The method is non-destructive and rapid, and the overall detection efficiency can be increased by more than 60%, reducing production costs and improving economic benefits;

[0039] 6. Use standard and unified sample preparation, spectrum acquisition and data processing methods to ensure accurate and reliable test results and easy promotion and application of the method. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0041] Figure 1 A flowchart of a method for rapid spectral analysis of baking characteristics of fresh tobacco leaves;

[0042] Figure 2 A schematic diagram of a rapid spectral analysis system for fresh tobacco leaf baking characteristics;

[0043] Figure 3 This is a diagram of the internal structure of a system for rapid spectrum analysis of fresh tobacco leaf baking characteristics;

[0044] Figure 4 for Figure 3 A magnified view of middle;

[0045] Figure 5 It is a process for fresh cigarette image stem and leaf segmentation and spectral sampling point positioning;

[0046] Figure 6 Pseudocode of support vector machine model optimized for sparrow search algorithm;

[0047] In the accompanying drawings, the components represented by the reference numerals are listed as follows:

[0048] 1. Image acquisition module; 11. Camera lighting source; 12. Camera; 2. Spectral adaptive acquisition module; 21. Spectrometer; 22. Excitation light source; 23. Fiber optic probe; 24. Distance sensor; 25. Three-axis translation stage; 3. Tobacco leaf conveying module; 31. Telescopic rod; 32. Slide rail; 33. Loading table; 4. Computer analysis and control module; 5. Dark box; 6. Rack. DETAILED DESCRIPTION

[0049] In order to make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0050] like Figure 1 , Figure 5 FIG. 1 is a flowchart of a first embodiment of a method for rapid spectral analysis of fresh tobacco leaf baking characteristics according to the first aspect of the present invention. In this embodiment, the following steps are included:

[0051] S10, obtaining fresh tobacco leaf samples of different qualities collected from the field and representative spectral information of fresh tobacco leaves collected according to the "8-point method", recorded as tobacco leaf spectra;

[0052] S20. Obtain baking characteristic labels obtained by evaluating and grading the baking characteristics of fresh tobacco leaf samples in the dark box experiment, including "better", "medium" and "poor" for baking ease, and "better", "medium" and "poor" for baking resistance;

[0053] S30, averaging multiple spectra at the same fresh tobacco leaf to obtain an average spectrum, and establishing a mapping relationship between the average spectrum of each fresh tobacco leaf and a baking characteristic label, recorded as spectral label mapping, and obtaining a fresh tobacco leaf spectral data set with different baking characteristic labels according to the spectral label mapping;

[0054] S40, training a neural network using the fresh tobacco leaf spectrum data set as a training data set to obtain a fresh tobacco leaf baking characteristic discrimination model;

[0055] S50, obtaining a complete image of the fresh tobacco leaf to be tested, recorded as the image to be tested; segmenting the leaf veins according to the image to be tested and locating a plurality of spectral sampling points, obtaining spectra corresponding to the plurality of spectral sampling points, recorded as the spectrum to be tested;

[0056] S60, using the fresh tobacco leaf baking characteristic discrimination model to input the spectrum to be tested, and obtaining the baking ease and baking resistance discrimination results of the fresh tobacco leaf to be tested.

[0057] The specific implementation of step S10 is as follows:

[0058] 1. Select fresh tobacco leaf samples from different production areas and varieties. The production areas should be selected from major tobacco producing areas, such as different prefecture-level cities in Yunnan, Guizhou and other provinces. The varieties should be selected from major flue-cured tobacco varieties, such as Huangyan 87, Burley 97, etc.;

[0059] 2. In each production area and each variety, select fresh leaves with large differences in appearance quality for sampling to obtain samples with sufficient quality variation. Appearance quality evaluation can be based on indicators such as leaf length, color, and the presence of pests and diseases;

[0060] 3. Evaluate the baking characteristics of each batch of sampled tobacco leaves, with the evaluation indicators including ease of baking and baking resistance;

[0061] 4. Collect representative spectral information from different parts of fresh tobacco leaves in the field. According to the "eight-point sampling method", select the left, middle, and right sides of the tobacco leaf surface, the left, middle, and right sides of the back of the tobacco leaf, and the midribs on both sides, a total of 8 points to collect spectral curves;

[0062] 5. Record the origin, variety, quality grade, baking characteristic evaluation grade, spectral curve and other information of each tobacco leaf sample, and establish a sample information database.

[0063] The purpose of step S10 is to obtain fresh tobacco leaf samples of different quality levels, evaluate their baking characteristics, and collect representative spectral information to lay a data foundation for the subsequent establishment of a correlation model between spectral data and baking characteristics. This step controls the quality variation range of the samples, adopts a standard baking characteristic evaluation method, and a fixed spectral acquisition mode to ensure that a sample set with controllable quality, unified evaluation, and complete information is obtained.

[0064] The specific implementation of step S20 is as follows:

[0065] 1. Move the fresh tobacco leaf samples obtained in S10 into a closed, airtight dark box and place them in a woven tobacco hanging manner. The temperature of the dark box can be maintained at room temperature;

[0066] 2. Take the tobacco leaves out of the dark box every 12 hours, flatten them and take photos to observe the yellowing and browning of the leaves. The duration is about 10 to 15 days.

[0067] 3. Record the time period from the initial state of tobacco leaves to complete yellowing, which is used to assess the baking ease of tobacco leaf samples. Record the time period from complete yellowing to 30% browning, which is used to assess the baking resistance of tobacco leaf samples. The classification of baking ease and baking resistance is based on the tobacco industry standard "YC / T311-2009";

[0068] 4. Evaluate the ease of baking and resistance to baking of each sample according to three levels: "better", "medium" and "poor". The evaluation results serve as the baking characteristic labels of the samples and are associated with the spectral data obtained in S10;

[0069] 5. Enter the origin, variety, agronomy and other information of all samples, as well as the baking characteristic evaluation level into the database to form a baking characteristic label library.

[0070] The purpose of S20 is to evaluate the ease of baking and baking resistance of tobacco leaves by conducting baking experiments under controlled conditions, and obtain the baking characteristic label information of the object. This process adopts the industry's unified evaluation standards to ensure the reliability of the label. Corresponding to S10, it lays the foundation for the baking characteristic data set for subsequent modeling.

[0071] The specific implementation of step S30 is as follows:

[0072] 1. For each tobacco leaf sample, the eight spectral curves collected in S10 are averaged to obtain the average spectral curve of the sample;

[0073] 2. The average spectral curves of all samples are corresponding to the baking characteristic labels obtained in S20, and a spectrum-label mapping library is established;

[0074] 3. According to the mapping relationship, the spectral curve can be divided into spectral data sets corresponding to different baking characteristics:

[0075] The good bakeability corresponds to the spectral data set;

[0076] The medium-bakeability corresponds to the spectral data set;

[0077] The poor bakeability corresponds to the spectral data set;

[0078] The better baking resistance corresponds to the spectral data set;

[0079] The medium baking resistance corresponds to the spectral data set;

[0080] Poor baking resistance corresponds to the spectral data set;

[0081] 4. Perform sample counts for each data set. If the sample size of a certain category is too small, return to step S10 to obtain more supplementary samples of the corresponding category to ensure a balanced sample size in each data set.

[0082] 5. Use preprocessing methods such as sample selection, anomaly removal, and normalization to clean the spectral data and construct a training data set for the baking characteristics monitoring model.

[0083] Specifically, the specific implementation of step S30 is as follows:

[0084] Suppose there are N tobacco leaf samples, and the spectral data of the i-th sample is represents the spectral signal intensity value of the i-th sample at the j-th wavelength; where M is the number of wavelengths of each spectrum. Then the 8 spectral curves of each sample i can be expressed as:

[0085]

[0086] The average spectrum of the sample is obtained by averaging the eight spectral curves:

[0087]

[0088] in, represents the jth original spectrum curve of the i-th sample, and the value of j is [1, 8], which means 8 sampling points. At the same time, each sample has two baking characteristic labels, which indicate the baking ease. and baking resistance

[0089]

[0090] The label value is an integer from 1 to 5, 1 means the baking characteristic is "poor" and 5 means "good".

[0091] Then the average spectrum of all N samples and the label constitute a spectrum-label mapping relationship:

[0092]

[0093] According to this mapping relationship, the spectral data can be divided into 6 data sets:

[0094] D1: label y 1 =1, indicating poor baking performance;

[0095] D2: label y 1 =2 or 3, indicating medium bakeability;

[0096] D3: label y 1=4 or 5, indicating good baking properties;

[0097] D4: label y 2 =1, indicating poor baking resistance;

[0098] D5: label y 2 =2 or 3, indicating medium baking resistance;

[0099] D6: Label y 2 =4 or 5, indicating good baking resistance;

[0100] Calculate the number of samples n for each data set k k , if n k If it is too small, it is necessary to return to step S10 to obtain more supplementary samples of the corresponding category to ensure a balanced sample size.

[0101] Finally, the spectral data is preprocessed, including sliding average, polynomial fitting, standard normalization, etc., to remove noise and obtain a spectral dataset that can be used for model training.

[0102] The above achieves data classification by constructing a mapping association between spectra and labels, providing a standardized training sample set for the subsequent establishment of a spectral discrimination model.

[0103] The purpose of S30 is to divide the spectral data into multiple data sets representing different baking characteristics by constructing the corresponding relationship between the spectral curve and the baking characteristic label. This step realizes the effective comparison and classification of the spectral data by constructing the mapping relationship, laying the foundation for the data set to establish a discrimination model for the subsequent use of spectral monitoring of baking characteristics. At the same time, the statistical reliability of each data set is ensured by balancing the number of samples and preprocessing data.

[0104] The specific implementation of step S40 is as follows:

[0105] 1. From the spectral data sets corresponding to different baking characteristics obtained in S30, 70% are selected as the training set and 30% as the test set;

[0106] 2. Preprocess the spectral data in the training set and test set, including smoothing, standardization, wavelength selection, etc., to remove signal errors and improve the signal-to-noise ratio;

[0107] 3. Select machine learning algorithms suitable for processing spectral data, such as support vector machine (SVM), random forest (RF), multi-layer perceptron (MLP) neural network, etc.;

[0108] 4. Use the training set data to train different monitoring models. Use the spectral data as feature input and the baking characteristic label as the expected output. By adjusting the parameters and optimizing the model, multiple sets of easy-to-bake monitoring models and baking resistance monitoring models are obtained;

[0109] 5. Evaluate the monitoring performance of different models on the test set, and select the model with the highest cross-validation score as the final monitoring model for bakeability and bakeability;

[0110] 6. Use model fusion methods, such as voting and stacking, to integrate the outputs of multiple single models and build an integrated monitoring model for baking ease and baking resistance to improve monitoring stability;

[0111] 7. Compress, crop, quantize, and optimize the final model size to facilitate deployment on mobile terminals.

[0112] The purpose of S40 is to train and build a neural network model that can effectively monitor the ease of baking and baking resistance of tobacco leaves. This step selects a baking characteristic discrimination model with excellent monitoring performance through methods such as sample segmentation, data preprocessing, model training and evaluation, and integrated learning, laying the algorithm foundation for the subsequent spectral rapid monitoring of baking characteristics.

[0113] The specific implementation of step S50 is as follows:

[0114] Step 1: Use image segmentation algorithms, such as color-based segmentation, edge-based segmentation, etc., to analyze and extract the leaf surface and veins of the tobacco leaf image to be tested;

[0115] Step 2: In the segmented leaf area, use the key point extraction algorithm to locate the location of the leaf surface spectrum sampling. The sampling points are distributed according to the "eight-point sampling method";

[0116] Step 3: On the leaf vein segmentation image, mark the positions of the main and secondary leaf veins and determine the spectral sampling positions corresponding to the vein belly points;

[0117] Step 4: At the sampling position corresponding to the tobacco leaf to be tested, use the same spectrum acquisition instrument as in S10 to obtain the spectrum curve of each sampling point;

[0118] Step 5: Take the average value of all sampled spectral curves to obtain the average spectral curve of the tobacco leaf sample to be tested as the spectrum to be tested;

[0119] Step 6: Apply steps 1 to 5 to all tobacco leaf samples to be tested to obtain average spectral data of all samples to be tested.

[0120] The purpose of S50 is to intelligently determine the spectral sampling position on the tobacco leaf image to be tested and obtain the representative average spectrum of the sample to be tested as the model input. This step extracts key information through image processing and analysis, guides the spectrum collector to effectively and quickly obtain the spectrum to be tested, and prepares for subsequent monitoring.

[0121] The specific implementation of step S60 is as follows:

[0122] 1. The average spectrum of the sample to be tested obtained in S50 is sequentially input into the easy-to-bake and resistance-to-bake monitoring models trained in S40;

[0123] 2. The monitoring model extracts features and performs pattern recognition on the input spectrum to obtain the prediction results of the baking ease and baking resistance of each sample to be tested;

[0124] 3. The prediction result is in the form of the category probability distribution corresponding to each baking characteristic. For example, if the prediction result of the baking ease of a sample is [0.7, 0.2, 0.1], it means that the probability that the sample is judged to be good baking ease is 0.7, medium baking ease is 0.2, and poor baking ease is 0.1;

[0125] 4. According to the maximum value of the category probability, determine the monitoring results of the ease of baking and baking resistance of each sample. The monitoring results are one of the three qualitative results of "good", "medium" and "poor";

[0126] 5. Collect the prediction results of the baking ease and baking resistance of all samples to be tested, and form a discrimination report as the basis for evaluating the baking characteristics of the batch of tobacco leaves to be tested;

[0127] 6. Conduct verification test drying of key samples as needed to evaluate the accuracy of monitoring. Continue to optimize the model and improve monitoring performance.

[0128] The purpose of S60 is to use the trained model to intelligently evaluate and identify the bakeability and bake resistance of the samples to be tested. This step realizes rapid non-destructive monitoring based on spectroscopy, providing important decision support for the baking process and reducing production losses.

[0129] like Figure 1 , Figure 5 FIG. 1 is a flow chart of a second embodiment of a method for rapid spectrum analysis of fresh tobacco leaf baking characteristics provided by the first aspect of the present invention. In this embodiment, the following steps are included:

[0130] S10, obtaining fresh tobacco leaf samples of different qualities collected from the field and representative spectral information of fresh tobacco leaves collected according to the "8-point method", recorded as tobacco leaf spectra;

[0131] S20. Obtain baking characteristic labels obtained by evaluating and grading the baking characteristics of fresh tobacco leaf samples in the dark box experiment, including "better", "medium" and "poor" for baking ease, and "better", "medium" and "poor" for baking resistance;

[0132] S30, averaging multiple spectra at the same fresh tobacco leaf to obtain an average spectrum, and establishing a mapping relationship between the average spectrum of each fresh tobacco leaf and a baking characteristic label, recorded as spectral label mapping, and obtaining a fresh tobacco leaf spectral data set with different baking characteristic labels according to the spectral label mapping;

[0133] S40, training a neural network using the fresh tobacco leaf spectrum data set as a training data set to obtain a fresh tobacco leaf baking characteristic discrimination model;

[0134] S50, obtaining a complete image of the fresh tobacco leaf to be tested, recorded as the image to be tested; segmenting the leaf veins according to the image to be tested and locating a plurality of spectral sampling points, obtaining spectra corresponding to the plurality of spectral sampling points, recorded as the spectrum to be tested;

[0135] S60, using the fresh tobacco leaf baking characteristic discrimination model to input the spectrum to be tested, and obtaining the baking ease and baking resistance discrimination results of the fresh tobacco leaf to be tested.

[0136] A vision-guided rapid analysis method for the spectrum of fresh tobacco leaf baking characteristics: spectral information of fresh tobacco leaf samples of different qualities is collected, and the fresh tobacco leaves are evaluated and graded for baking ease and baking resistance, a spectral data set of fresh tobacco leaves of different baking characteristic grades is constructed, and then a fresh tobacco leaf baking characteristic discrimination model is established, and then the baking characteristic of fresh tobacco leaves of unknown quality is quickly discriminated by using the model, comprising the following steps:

[0137] Step 1: Collect fresh tobacco leaf samples of different qualities from the field, and collect representative spectral information of fresh tobacco leaves according to the "8-point method";

[0138] Step 2: Evaluate and grade the baking characteristics of fresh tobacco leaves of different qualities through a dark box experiment, and obtain baking characteristic labels corresponding to the tobacco leaf spectra, including "better", "medium" and "poor" for baking ease, and "better", "medium" and "poor" for baking resistance;

[0139] Step 3: Average multiple spectra from the same tobacco leaf, and correspond the average spectrum of each tobacco leaf to the baking characteristic label one by one, so as to obtain the spectral data set of fresh tobacco leaves with different baking characteristic levels, and perform data quality diagnosis;

[0140] Step 4: Using the spectral data sets of fresh tobacco leaves with different baking characteristic levels, establish a fresh tobacco leaf baking characteristic discrimination model, select the model with the best discrimination performance, and determine the model structure and parameters;

[0141] Step 5: If the effect of the constructed model meets the preset requirements, it means that the model is feasible, and the best model is transplanted to the computer analysis and control module. Otherwise, repeat steps 1 to 4 by expanding the sample set and optimizing the model until the requirements are met;

[0142] Step 6: Place the fresh tobacco leaves of unknown characteristics on the tobacco leaf conveying platform, and send them into the dark box under the traction of the telescopic rod to collect the complete image of the fresh tobacco leaves;

[0143] Step 7: segment the leaf veins based on the tobacco leaf image and locate the spectral sampling points, and guide the optical fiber probe to automatically collect spectra at different positions of the fresh tobacco leaves;

[0144] Step 8: The trained fresh tobacco leaf baking characteristic discrimination model is called through the computer analysis control module, and the averaged spectrum is input to quickly discriminate the baking characteristics of the fresh tobacco leaves, and the baking ease and baking resistance discrimination results are output.

[0145] Further, according to a visually guided spectrum rapid analysis system for fresh tobacco leaf baking characteristics, the spectrum adaptive acquisition module includes a spectrometer and a fiber optic probe, an excitation light source, a distance sensor and a three-axis displacement stage. The spectrometer is fixed on the frame, and the fiber optic probe is fixed on the bottom of the slide seat of the three-axis displacement stage to collect tobacco leaf spectrum information, and the collection distance is 3±0.1cm. The distance sensor is fixedly connected to the fiber optic probe and is used to measure the distance between the fiber optic probe and the tobacco leaf surface to adjust the detection height in real time. The beneficial effect of adopting a further technical solution is that the distance sensor can detect the collection distance of the fiber optic probe from the tobacco leaf surface in real time, and the control end outputs a corresponding pulse drive signal to the motor of the three-axis displacement stage according to the feedback distance information and the coordinates of the spectrum sampling point, and adjusts the collection height in real time while adjusting the position of the fiber optic probe, so as to avoid the influence of the wrinkled or uneven placement of the tobacco leaves on the spectrum collection, thereby ensuring the accuracy and consistency of the spectrum collection data.

[0146] Furthermore, a fresh tobacco leaf baking characteristic discrimination model is established in step 4 according to a visually guided method for rapid spectral analysis of fresh tobacco leaf baking characteristics, including preprocessing of spectral data, comparison and optimization of basic models and optimization of model parameters. The preprocessing methods involved include moving smoothing, first-order derivatives, and second-order derivatives. The basic models for comparison include support vector machines, random forests, and convolutional neural networks. The model parameter optimization methods include sparrow search algorithms, genetic algorithms, and particle swarm optimization algorithms. Finally, moving smoothing is determined as the preprocessing method, and the support vector machine optimized by the sparrow search algorithm is used as the best model to discriminate tobacco leaf baking characteristics.

[0147] The mathematical formula of the motion smoothing preprocessing algorithm is:

[0148]

[0149] Where n is the moving window size, here n = 3, X i represents the i-th spectral data point.

[0150] like Figure 6 Shown is the pseudo code of the support vector machine model optimized by the sparrow search algorithm.

[0151] Results of the fresh tobacco leaf baking characteristics discrimination model based on the support vector machine optimized by the sparrow search algorithm:

[0152] Model category indicators Dataset Accuracy F-score Easy to bake Validation set 86.67% 85.37% Baking resistance Validation set 88.89% 88.00%

[0153] The beneficial effect of adopting further technical solutions is to improve the spectral quality through preprocessing, and use the sparrow optimization algorithm to automatically optimize the support vector machine parameters, thereby avoiding the shortcomings of time-consuming and labor-intensive manual parameter adjustment and easy to fall into local optimality, and improving the accuracy of the fresh tobacco leaf baking characteristics discrimination model.

[0154] According to step 7 of a visually guided method for rapid spectral analysis of fresh tobacco leaf baking characteristics, the specific method for segmenting abnormal areas such as stems and leaves, mature spots, etc. and determining spectral sampling points in the normal tobacco leaf image area is as follows:

[0155] Step 1: Convert the collected tobacco leaf RGB image into a grayscale image and use median filtering to remove noise;

[0156] Gray=0.299×R+0.587×G+0.114×B;

[0157]

[0158] Among them, R, G, and B represent the pixel values ​​of the three channels of the tobacco leaf color image, respectively, and Z x,y Represents the grayscale value at the coordinate (x, y) in the grayscale image, Med is Z x,y The median grayscale value within the adjacent rectangular area.

[0159] Step 2: Segment the complete leaf area using iterative thresholding. The complete steps for segmenting tobacco leaves using iterative thresholding are:

[0160] A. Set the initial threshold a0 as the mean value of the grayscale image and set the conditional threshold a1;

[0161] B. The pixels in the grayscale image whose grayscale value is greater than a0 are classified into set E1, otherwise they are classified into set E2;

[0162] C. Calculate the average value Z of the pixels in set E1 and set E2 mean1 and Z mean2 ;

[0163] D. Judgment | Z mean1 -Z mean2 |≤a1 is satisfied, if not, iterate Repeat operations A to C until the conditions are met.

[0164] Step 3: Use the binary image after iterative threshold segmentation as a mask and construct an external rectangular window to extract the tobacco leaf body from the original RGB image and obtain the relative position and length and width values ​​of the external matrix window.

[0165] Step 4: According to the total length of the rectangular window * 0.15, cut off the ear leaf part of the tobacco leaf petiole. Because the ear leaf part of the fresh tobacco leaf is easy to wear and has little actual value, it is not involved in the spectrum collection.

[0166] Step 5: Taking the "8-point method" as an example, the remaining tobacco leaf image is divided into 4 parts along the length direction, the R channel and B channel pixels of the tobacco leaf image in each area are extracted, and the difference is performed to obtain 4 RB difference maps.

[0167] Step 6: Use the maximum inter-class variance method (Otsu) and the grid method to find the vein segmentation threshold in the RB difference map. The optimization goal is the weighted sum of the maximum connected area value and the inter-class variance after segmentation. The specific process is as follows:

[0168] A. Set the initial segmentation threshold j to the mean of the RB difference map, and assign the pixel points with values ​​greater than j to set v1, otherwise to set v2;

[0169] B. Calculate the between-class variance of set v1 and set v2 as follows:

[0170]

[0171]

[0172] Where w1 and w2 are the proportions of the number of pixels in set v1 and set v2, respectively, v1i and v2i are the mean values ​​of the pixels in set v1 and set v2, respectively, and n1 and n2 are the number of pixels in set v1 and set v2.

[0173] C. Use the grid method to optimize the segmentation threshold j so that the inter-class variance g tends to the maximum.

[0174] Step 7: The largest connected area Q segmented from the RB difference map max Leaf veins, the vein extraction effect is further improved through morphological dilation and corrosion operations.

[0175] Step 8: After removing the leaf veins, use threshold segmentation to further remove abnormal areas such as mature spots and holes, and the remaining area is the normal leaf area.

[0176] Step 9: Exclude the leaf interconnection areas with an area less than 300, calculate the center position of each leaf interconnection area with an area greater than 300, and use the 8-point sampling method to select the leaf interconnection area closest to the ideal position point in the figure as the spectral sampling point.

[0177] A second aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores program instructions, and when the program instructions are executed, they are used to execute the above-mentioned method for rapid spectral analysis of baking characteristics of fresh tobacco leaves.

[0178] like Figure 2 , Figure 3 , Figure 4 As shown, the third aspect of the present invention provides a first embodiment of a system for rapid spectrum analysis of fresh tobacco leaf baking characteristics. In this embodiment, it includes an image acquisition module, a spectrum adaptive acquisition module, a tobacco leaf conveying module, a computer analysis control module, a dark box and a rack;

[0179] The image acquisition module includes a camera and a camera illumination light source, which is fixed on the top of the dark box and is used to obtain an overall image of the tobacco leaf facing downward under uniform lighting conditions;

[0180] The spectral adaptive acquisition module is arranged at the rear end of the dark box and is used to adaptively acquire spectral information at different positions of the tobacco leaves;

[0181] The tobacco leaf conveying module includes a slide rail, a telescopic rod and a loading platform, which is arranged at the front end of the dark box and is used to convey tobacco leaves into and out of the dark box;

[0182] The computer analysis control module includes the computer readable storage medium as described above, and the computer analysis control unit is electrically connected to the spectrum adaptive acquisition unit, the image acquisition unit and the tobacco leaf conveying unit for analyzing and processing data and transmitting control signals;

[0183] The dark box is fixed on the frame to shield interference from the external environment.

[0184] Furthermore, in the above technical scheme, the spectral adaptive acquisition module includes a spectrometer and a fiber optic probe, an excitation light source, a distance sensor and a three-axis translation table. The spectrometer is fixed on a frame, and the fiber optic probe is fixed on the bottom of the slide of the three-axis translation table for collecting spectral information of tobacco leaves. The distance sensor is fixedly connected to the fiber optic probe for measuring the distance between the fiber optic probe and the surface of the tobacco leaves.

[0185] Furthermore, in the above technical solution, the distance between the optical fiber probe and the tobacco leaf is 2.9 to 3.1 cm.

[0186] The present invention is based on the idea that there is a quantitative correspondence between the spectral information of tobacco leaves and their baking characteristics. The spectral curve can reflect the composition and structural information of the sample as a comprehensive characteristic description of the sample. There are differences in the tissue structure and biochemical composition formed during the growth and development period of tobacco leaves with different baking characteristics, and these differences can be reflected through the characteristics of the spectral signal. Therefore, by analyzing the spectral characteristics of tobacco leaf samples with different baking characteristics, a model between the spectral signal and the baking characteristics is established to achieve the prediction and evaluation of the baking characteristics of tobacco leaves. The specific principles are as follows:

[0187] 1. Through the controlled baking test of fresh tobacco leaves of different production areas, varieties and quality levels, and the evaluation of baking characteristics, a quantitative mapping relationship between sample spectral data and baking characteristic labels is established;

[0188] 2. According to the spectrum-label mapping relationship, the spectral data is divided into multiple data sets representing different baking characteristics;

[0189] 3. Use machine learning algorithms and the data set as the training set to train the baking characteristics monitoring model;

[0190] 4. Obtain spectral data of the sample to be tested and input it into the trained monitoring model to realize intelligent judgment of baking characteristics.

[0191] This technical solution realizes non-destructive testing and intelligent rating by constructing a quantitative correspondence model between the spectrum and baking characteristics, which can effectively solve the technical problem of predicting the baking characteristics of fresh tobacco leaves.

Claims

1. A rapid spectral analysis method for fresh tobacco leaf baking characteristics, characterized in that: The following steps are involved: S10, obtaining fresh tobacco leaf samples of different qualities collected from the field and representative spectral information of fresh tobacco leaves collected according to the "8-point method", recorded as tobacco leaf spectra; S20, obtaining baking characteristic labels obtained by evaluating and grading the baking characteristics of the fresh tobacco leaf samples in the dark box experiment, including "better", "medium" and "poor" for easy baking, and "better", "medium" and "poor" for baking resistance, wherein each sample corresponds to two baking labels of "easy baking" and "baking resistance" respectively; S30, averaging multiple spectra at the same fresh tobacco leaf to obtain an average spectrum, and establishing a mapping relationship between the average spectrum of each fresh tobacco leaf and a baking characteristic label, recorded as a spectrum label mapping, and obtaining a fresh tobacco leaf spectrum data set with different baking characteristic labels according to the spectrum label mapping; S40, training a neural network using the fresh tobacco leaf spectral data set as a training data set to obtain a fresh tobacco leaf baking characteristic discrimination model; S50, obtaining a complete image of the fresh tobacco leaf to be tested, recorded as the image to be tested; segmenting the leaf veins according to the image to be tested and locating a plurality of spectral sampling points, obtaining spectra corresponding to the plurality of spectral sampling points, recorded as the spectrum to be tested; S60, using the fresh tobacco leaf baking characteristic discrimination model to input the spectrum to be tested, and obtaining the baking ease and baking resistance discrimination results of the fresh tobacco leaf to be tested; Wherein, obtaining the determination results of the ease of baking and baking resistance of the fresh tobacco leaves to be tested comprises the following steps: Get the prediction results of "easy baking" and "resistant baking" for each sample. The prediction results are in the form of the category probability distribution corresponding to each baking characteristic. According to the maximum value of the category probability, the monitoring results of the ease of baking and the resistance to baking of each sample are determined; The prediction results of baking ease and baking resistance of all samples to be tested are statistically compiled to form a judgment report, which serves as the basis for evaluating the baking characteristics of the tobacco leaf batches to be tested.

2. The method for rapid spectrum analysis of fresh tobacco leaf baking characteristics according to claim 1, characterized in that: The step S10 specifically includes: selecting fresh tobacco leaf samples from different production areas and different varieties, and selecting fresh leaves with large differences in appearance quality for sampling in each variety of each production area to obtain samples with sufficient quality variation; evaluating the baking characteristics of each batch of sampled tobacco leaves; collecting representative spectral information from different parts of fresh tobacco leaves in the field, and collecting spectral curves at a total of 8 points according to the "eight-point sampling method"; recording the origin, variety, quality grade, baking characteristic evaluation grade, and spectral curve information of each tobacco leaf sample, and establishing a sample information library.

3. A method for rapid spectrum analysis of fresh tobacco leaf baking characteristics according to claim 2, characterized in that: The step S20 specifically includes: moving the fresh tobacco leaf samples obtained in S10 into a sealed, airtight, dark box, observing the yellowing or browning state of the tobacco leaves every 12 hours, calibrating the baking ease and baking resistance level of each sample by recording the time when the tobacco leaves turn completely yellow and the time when they turn 30% brown, entering the origin, variety, agronomic information, and baking characteristic evaluation level of all samples into a database to form a baking characteristic label library, wherein the interior of the box is a constant temperature and humidity environment.

4. The method for rapid spectrum analysis of fresh tobacco leaf baking characteristics according to claim 3, characterized in that: The step S30 specifically includes: for each tobacco leaf sample, taking the average value of the eight spectral curves collected in S10 to obtain the average spectral curve of the sample; forming a correspondence between the average spectral curves of all samples and the baking characteristic labels obtained in S20, and establishing a spectrum-label mapping library; according to the mapping relationship, dividing the spectral curves into spectral data sets corresponding to different baking characteristics; counting the number of samples for each data set, if the sample size of a certain category is relatively small, obtaining more supplementary samples of the corresponding category; using sample selection, de-anomaly, and normalization preprocessing methods to clean the spectral data and construct a training set.

5. The method for rapid spectrum analysis of fresh tobacco leaf baking characteristics according to claim 4, characterized in that: The step S40 specifically includes: selecting part of the spectral data sets corresponding to different baking characteristics obtained in S30 as a training set and the rest as a test set; preprocessing the spectral data in the training set and the test set; selecting a machine learning algorithm suitable for processing spectral data, and using the training set data to train different monitoring models; evaluating the monitoring performance of different models on the test set, and selecting the optimal model as the final monitoring model.

6. The method for rapid spectrum analysis of fresh tobacco leaf baking characteristics according to claim 5, characterized in that: The step S50 specifically includes: using an image segmentation algorithm to analyze and extract the leaf surface and veins of the tobacco leaf image to be tested; using a key point extraction algorithm to locate the position of the spectral sampling of the leaf surface area obtained by segmentation; marking the main and secondary vein positions on the vein segmentation image, and determining the spectral sampling position of the corresponding vein belly point; obtaining the spectral curve of each sampling point at the corresponding sampling position of the tobacco leaf to be tested; and averaging all the sampled spectral curves to obtain the average spectral curve of the sample to be tested.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program instructions, and when the program instructions are executed, the method for rapid spectral analysis of baking characteristics of fresh tobacco leaves according to any one of claims 1 to 6 is executed.

8. A rapid spectrum analysis system for fresh tobacco leaf baking characteristics, characterized by: It includes an image acquisition module, a spectrum adaptive acquisition module, a tobacco leaf conveying module, a computer analysis and control module, a dark box and a rack; The image acquisition module includes a camera and a camera illumination light source, which are fixed on the top of the dark box and are used to obtain an overall image of the tobacco leaf facing downward under uniform illumination conditions; The spectrum adaptive acquisition module is arranged at the rear end of the dark box and is used to adaptively acquire spectrum information at different positions of the tobacco leaf; The tobacco leaf conveying module comprises a slide rail, a telescopic rod and a loading platform, which is arranged at the front end of the dark box and is used to convey tobacco leaves into and out of the dark box; The computer analysis control module includes a computer-readable storage medium as claimed in claim 7, and the computer analysis control unit is electrically connected to the spectrum adaptive acquisition unit, the image acquisition unit and the tobacco conveying unit for analyzing and processing data and transmitting control signals; The dark box is fixed on the frame and is used for shielding interference from the external environment.

9. A fresh tobacco leaf baking characteristic spectrum rapid analysis system according to claim 8, characterized in that: The spectral adaptive acquisition module includes a spectrometer and a fiber optic probe, an excitation light source, a distance sensor and a three-axis translation stage. The spectrometer is fixed on a frame, the fiber optic probe is fixed on the bottom of the slide seat of the three-axis translation stage, and is used to collect spectral information of tobacco leaves. The distance sensor is fixedly connected to the fiber optic probe and is used to detect the distance between the fiber optic probe and the surface of the tobacco leaves.

10. A fresh tobacco leaf baking characteristic spectrum rapid analysis system according to claim 9, characterized in that: The distance between the optical fiber probe and the tobacco leaf is 2.9-3.1 cm.