Nondestructive detection method and system for chlorine content of fresh tobacco leaves of Yunyan 87

By constructing a multivariate stepwise regression and BPNN model based on the leaf color swing parameters of RGB color space of tobacco leaf leaves, the problem of cumbersome and high cost of detecting the chlorine content of fresh tobacco leaves in the existing technology is solved, and a fast and accurate non-destructive detection effect is achieved.

CN119600001APending Publication Date: 2025-03-11LONGYAN XINYE AGRICULTURAL MATERIALS CO LTD +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411722309.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

The prior art has problems such as cumbersome operation, time-consuming and labor-intensive, high equipment cost, high operation difficulty, and high configuration hardware support when detecting the chlorine content of fresh tobacco leaves. The traditional methods cannot effectively explain the physiological significance of color parameters and leaf color phenotype changes.

Method used

The tobacco leaf color phenotype parameter system was used as the input factor, and the tobacco leaf color phenotype parameter-chlorine content fitting model was constructed through the multivariate stepwise regression and reverse transmission neural network BPNN to achieve non-destructive detection of the chlorine content in fresh tobacco leaves.

Benefits of technology

It realizes fast and accurate non-destructive testing of the chlorine content of fresh tobacco leaves, reduces the detection cost and operation difficulty, and is lightweight in model construction and can be applied on embedded devices without the need for networking.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119600001A_ABST
    Figure CN119600001A_ABST
Patent Text Reader

Abstract

The invention relates to a nondestructive testing method and system for the chlorine content of fresh tobacco leaves of Yunyan 87, and belongs to the field of nondestructive testing of the chlorine content of the fresh tobacco leaves. According to the method, a tobacco leaf RGB color space leaf color skew parameter system is adopted as an input factor, a tobacco leaf color phenotypic parameter-chlorine content fitting model is constructed by using a multivariate stepwise regression method and a BPNN method, and nondestructive detection of the chlorine content of tobacco leaves is achieved. And based on the process of the method, Matlab software is adopted for curing to form the nondestructive detection system for the chlorine content of the fresh tobacco leaves of the Yunyan 87. According to the invention, image acquisition can be completed by using the digital camera; the leaf color state can be quantitatively described more accurately, and the physiological significance of explaining color parameters and leaf color phenotypic changes can be more accurately achieved; the method realizes quick modeling, light application and no need of networking, and can be applied to embedded equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of nondestructive detection of chlorine content in fresh tobacco leaves, and specifically relates to a method and system for nondestructive detection of chlorine content in Yunyan 87 fresh tobacco leaves. Background Art

[0002] As an essential nutrient, chlorine is of great significance to the growth and development of tobacco and the formation of its quality. Both the lack and excess of chlorine will affect the industrial availability of flue-cured tobacco leaves: if the chlorine content in flue-cured tobacco leaves is too high, the leaves will be thick and brittle, the aroma will be reduced after burning, the combustibility will decrease, and even the flame will be extinguished; if the chlorine content in flue-cured tobacco leaves is too low, the oil content will be reduced, the leaves will be dry and brittle, and the silk yield will be reduced. The chlorine in flue-cured tobacco leaves mainly comes from the accumulation of tobacco during the field growth period. Tobacco in the growth and development period shows an overabundance effect on the absorption of soil chlorine, which may cause the chlorine content in fresh tobacco leaves to exceed the standard, thereby affecting the industrial availability of flue-cured tobacco leaves. Real-time understanding of the chlorine content in tobacco during the field period will help tobacco growers to adjust water and fertilizer management strategies in a timely manner, accurately control the chlorine content in fresh tobacco leaves, and effectively reduce the chlorine content in flue-cured tobacco leaves to meet the quality requirements of cigarette industrial enterprises.

[0003] Traditional determination of chlorine content in plant leaves is mainly based on laboratory chemical analysis, which is complicated, time-consuming and laborious. Although some scholars have proposed methods for non-destructive estimation of the content of plant intrinsic components using multispectral and hyperspectral remote sensing equipment, the required equipment cost is high and the operation is difficult, so it cannot be widely promoted and applied in production. Due to the low acquisition cost, easy use and simple analysis of RGB digital images, it has a basis for wide promotion and application. Researchers have obtained a lot of research results (such as wheat, corn, soybean, etc.) by non-destructive testing of plant phenotypic traits and intrinsic components based on the RGB color space parameters of digital images. However, the method of leaf color analysis using traditional RGB digital images has certain limitations: the traditional method defaults the color scale distribution of the RGB color space extracted from digital images to a normal distribution, but this is only a convenient approximate value method and cannot fully and truly reflect the leaf color distribution. However, the traditional method based on the premise of normal distribution can obtain too little color information from digital images, only the three channels of red (R), green (G), and blue (B) and the color level mean of the grayscale image. Although many researchers have proposed parameter combinations based on these four parameters, they still cannot solve the limitations of these parameters in explaining the physiological significance of leaf color changes. Some researchers have proposed methods of using image fitting values ​​for non-destructive testing (such as fitting using convolutional neural networks), but since these methods do not input relevant parameters representing plant physiological characteristics during the modeling process, they only perform direct convolution operations on the image and lack an explanation of the physiological significance represented by the detection model. At the same time, since such models (such as convolutional neural networks) require high-configuration hardware support for training, the application of such technologies in actual production is limited. Summary of the invention

[0004] The purpose of the present invention is to solve the problems existing in the prior art and to provide a method and system for nondestructive detection of chlorine content in Yunyan 87 fresh tobacco leaves.

[0005] To achieve the above-mentioned purpose, the technical solution of the present invention is: a method for nondestructive detection of chlorine content in Yunyan 87 fresh tobacco leaves, which adopts the leaf color skewness parameter system of tobacco leaf RGB color space as input factors, and uses two methods, multivariate stepwise regression and back transfer neural network BPNN, to construct a tobacco leaf color phenotype parameter-chlorine content fitting model, and through system solidification, realizes nondestructive detection of chlorine content in fresh tobacco leaves.

[0006] In one embodiment of the present invention, the method comprises the following steps:

[0007] S1, standard image acquisition;

[0008] S2, leaf color phenotype information extraction, including: accurate separation of target leaves and background noise, and extraction of RGB color space parameters of tobacco leaf images;

[0009] S3. Fitting model construction, including: multivariate stepwise regression model construction and BPNN model construction.

[0010] In one embodiment of the present invention, step S1 is specifically implemented as follows:

[0011] The collected leaves were cleaned of dirt and water droplets on the surface with absorbent paper and placed in a portable leaf image acquisition box for photographing using a digital camera. The portable leaf image acquisition box light source consisted of two 10W white LED lamp tubes with a color temperature of 5000K and a frequency of 50Hz. The effective light intensity on the acquisition plane was 900lx. The digital camera was a 3-megapixel USB driver-free industrial camera. The obtained image resolution was 2592×1944 and the image format was saved as JPEG.

[0012] In one embodiment of the present invention, in step S2, the process of accurately separating the target blade from the background noise uses MATLAB software to achieve accurate separation of the target blade from the background noise. The specific implementation steps are as follows:

[0013] ① Use rgb2hsv function to convert the JPEG image obtained in step S1 into an HSV image;

[0014] ②Fill the part of the image in ① with a saturation less than 0.2 with black;

[0015] ③Use hsv2rgb function and rgb2gray function to convert the HSV image obtained in ② into a binary image;

[0016] ④Use the strel function and the diamond structure element to smooth the binary image obtained in ③;

[0017] ⑤Use the imerode function to corrode the binary image obtained in ④;

[0018] ⑥Use medfilt2 function to perform median filtering on the binary image obtained in ⑤;

[0019] ⑦Use the bwlabel function to find the connected domains in the binary graph obtained in ⑥ and mark them with numbers;

[0020] ⑧Use the regionprops function to obtain the pixel area of ​​each connected domain obtained in ⑦, and select and retain the connected domain with the largest area;

[0021] ⑨ Using a double loop statement, perform intersection processing on the JPEG image obtained in step S1 and the connected domain obtained in step ⑧, retain the intersection part, and convert the other parts into transparent channels.

[0022] In one embodiment of the present invention, the rgb2hsv function, the hsv2rgb function, the rgb2gray function, the strel function, the imerode function, the medfilt2 function, the bwlabel function, and the regionprops function all call the function library provided by the MATLAB software.

[0023] In one embodiment of the present invention, in step S2, the leaf image RGB color space parameter extraction process is specifically implemented as follows:

[0024] Based on the image obtained by the precise separation process of the target leaf and the background noise, the mean value R of the red R channel color level is extracted by using the mean, median, mode, skewness, and kurtosis functions of MATLAB software. Mean , median R Median , mode R Mode , skewness R Skewness and Kurtosis R Kurtosis , the mean value of the green G channel level G Mean , median G Median , majority G Mode , skewness G Skewness and kurtosis G Kurtosis , the mean value of the blue B channel color level B Mean , median B Median 、Mode B Mode , skewness B Skewness and kurtosis B Kurtosis , the mean value Y of the grayscale Y image level Mean , median Y Median , mode Y Mode , skewness Y Skewness and kurtosis Y Kurtosis , forming the leaf color skewness parameter system of tobacco leaves in RGB color space.

[0025] In one embodiment of the present invention, in step S3, a multivariate stepwise regression model is constructed by using SPSS software, taking the chlorine content of tobacco leaves as the dependent variable and the leaf color skewness parameter system of the tobacco leaf RGB color space as the independent variable, and constructing a multivariate linear fitting model F2 of the tobacco leaf color phenotype parameter-chlorine content according to the stepwise regression method; the specific implementation is as follows:

[0026] ①Select tobacco leaf samples and import the chlorine content of tobacco leaves and its corresponding leaf color deviation parameter system in RGB color space into SPSS software;

[0027] ② Taking tobacco leaf chlorine content as the dependent variable and tobacco leaf RGB color space leaf color skewness parameter system as the independent variable, the least squares stepwise regression method was selected to establish a linear model; at the same time, in the "Options" of SPSS software, it was set that when the regression equation significance test P≤0.05, the independent variable was moved into the regression equation; when the regression equation significance test P≥0.1, the independent variable was moved out of the regression equation;

[0028] ③ Obtain the coefficient of determination of the alternative regression model, the significance test of the regression coefficient, and the collinearity diagnosis results of the independent variables of the regression model;

[0029] ④ According to the coefficient of determination, significance of regression coefficient and collinearity diagnosis results of the alternative regression model, the best regression model was finally determined, that is, the multivariate linear fitting model F2 of tobacco leaf color phenotype parameter-chlorine content, which is expressed as follows:

[0030] F2=0.496·R Kurtosis -2.632 B Skewness -0.048·R Median +12.250.

[0031] In one embodiment of the present invention, in step S3, the BPNN model is constructed by using the Neural Network Toolbox of MATLAB software, taking the chlorine content of tobacco leaves as the output layer factor and the leaf color skewness parameter system of the tobacco leaf RGB color space as the input layer factor, to construct a BPNN model F4 of the tobacco leaf color phenotype parameter-chlorine content, wherein the BPNN model topology structure includes three layers: an input layer, a hidden layer and an output layer; the specific implementation is as follows:

[0032] ① When selecting data in the input layer and output layer: select tobacco leaf samples, and import the chlorine content of tobacco leaves and the corresponding leaf color skewness parameter system in the RGB color space of tobacco leaves into the MATLAB software;

[0033] ② When selecting the optimal topology of the hidden layer: the fitting accuracy of the BPNN model is determined by the number of neurons in the hidden layer. First, different numbers of neurons are determined by the following formula, and then training comparison is performed. The optimal topology is the number of neurons in the hidden layer with the smallest error between the training judgment result and the actual number.

[0034]

[0035] Where Z, m, n are the number of neurons in the hidden layer, input layer, and output layer respectively, and q is a constant between [1, 10];

[0036] ③ Use MATLAB's Neural Network Toolbox to build a BPNN model of tobacco leaf maturity. The operation steps are as follows:

[0037] Data normalization: Before building the BPNN model, the original data is normalized and linearly compressed to the range of [0, 1];

[0038] Backward transfer neural network training: The transfer function of the neurons in the middle layer of the network adopts the Logsig function, the transfer function of the neurons in the output layer adopts the linear function Purelin, and the training function adopts Trainlm; 70% of the normalized data is used for model training, 15% of the data is used for prediction verification, and 15% of the data is used for model testing; the convergence error of the model is set to 0.0001, the learning rate is 0.05, and the maximum number of training rounds is 1000;

[0039] ④ Determination of the optimal BPNN model topology: Taking into account the average accuracy and abnormality rate of the model, the topology with 20 input layer factors, 13 optimal hidden layer factors and 1 output layer factor was selected as the optimal topology of the BPNN model, and the BPNN model F4 of tobacco leaf color phenotype parameter - chlorine content was constructed.

[0040] The present invention also provides a nondestructive detection system for chlorine content in Yunyan 87 fresh tobacco leaves based on the above-mentioned nondestructive detection method for chlorine content in Yunyan 87 fresh tobacco leaves, which is solidified using Matlab software; the system is a stand-alone program, and the configuration resources include: (1) operating system: Window7 and above systems; (2) network status: no need to connect to the Internet; (3) MATLAB dynamic library needs to be installed.

[0041] In one embodiment of the present invention, the system is implemented as follows:

[0042] ① Obtain digital images of fresh tobacco leaves through a portable leaf image acquisition box;

[0043] ② Importing the collected digital images into the system;

[0044] ③ Based on step ②, the system adopts a multi-dimensional composite background noise removal algorithm to obtain the precise contour of the target blade;

[0045] ④ Based on step ③, the system extracts the skewness parameters of the RGB color space of the target leaf digital image as tobacco leaf phenotypic characteristic parameters;

[0046] ⑤ Based on step ④, the system uses the acquired tobacco leaf phenotypic characteristic parameters as input and runs the tobacco leaf color phenotypic parameter-chlorine content fitting model based on multivariate stepwise regression and BPNN that has been solidified in the system;

[0047] ⑥The fitting results are obtained by running the model in step ⑤ and output to the interface, thus completing the non-destructive, rapid and accurate detection of the chlorine content of Yunyan 87 fresh tobacco leaves.

[0048] Compared with the prior art, the present invention has the following beneficial effects:

[0049] (1) Simple acquisition method: image acquisition can be completed using a digital camera;

[0050] (2) More scientific parameter selection: The depth, deflection, and uniformity of leaf color are used to more accurately describe the leaf color state, and the physiological significance of color parameters and leaf color phenotype changes can be explained more accurately. This solves the problem of fewer digital image parameters in traditional research and unclear physiological significance of deep learning parameters.

[0051] (3) Lightweight model construction: Among the many parameter model construction methods, the multivariate stepwise regression method is widely used because of its simple principle and convenient use; BPNN can approximate any continuous function without the need to construct a mathematical equation describing the input-output mapping relationship of things in advance, and has been widely used in plant phenotypic research in recent years. The two modeling methods selected in the present invention solve the problems that large models (such as convolutional neural networks) require high-configuration hardware support during training and require networking during application, and achieve fast modeling, lightweight application, no need for networking, and can be applied on embedded devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 For image acquisition and accurate separation of target leaves and background noise;

[0053] Figure 2 Import examples for SPSS software;

[0054] Figure 3 This is the first example of the linear regression interface of SPSS software;

[0055] Figure 4 This is the second example of the linear regression interface of SPSS software;

[0056] Figure 5 This is a Matlab algorithm code example;

[0057] Figure 6 are the fitting results of ten topological structures;

[0058] Figure 7 Schematic diagram of related training conditions when it is the optimal topology of BPNN;

[0059] Figure 8 It is the main operation interface of the system of the present invention;

[0060] Fig. 9 Enter the graphical interface for the system;

[0061] Fig.10 Separation of background noise of target leaves (shown in the red box in the interface);

[0062] Fig.11 Extraction and visualization of some tobacco leaf phenotypic characteristic parameters (shown in the red box in the interface);

[0063] Fig.12 This is the result of the system's non-destructive testing of the chlorine content of Yunyan 87 fresh tobacco leaves (shown in the red box in the interface);

[0064] Fig.13 This is an application example of the system of the present invention. DETAILED DESCRIPTION

[0065] The technical solution of the present invention is described in detail below in conjunction with the accompanying drawings.

[0066] The present invention provides a method for nondestructive detection of chlorine content in Yunyan 87 fresh tobacco leaves. The method adopts the leaf color skewness parameter system in RGB color space of tobacco leaves as input factors, and respectively uses multiple stepwise regression and back propagation neural network (BPNN) methods to construct a tobacco leaf color phenotype parameter-chlorine content fitting model. Through system solidification, nondestructive detection of chlorine content in fresh tobacco leaves is achieved.

[0067] The present invention also provides a nondestructive detection system for chlorine content in Yunyan 87 fresh tobacco leaves based on the above-mentioned nondestructive detection method for chlorine content in Yunyan 87 fresh tobacco leaves, which is solidified using Matlab software; the system is a stand-alone program, and the configuration resources include: (1) operating system: Window7 and above systems; (2) network status: no need to connect to the Internet; (3) MATLAB dynamic library needs to be installed.

[0068] The following is the specific implementation process of the present invention.

[0069] 1. Method implementation process

[0070] 1.1 Standard Image Acquisition

[0071] Use absorbent paper to wipe off the dirt and water droplets on the surface of the collected leaves and put them into a portable leaf image acquisition box for shooting. The light source of the acquisition box consists of two 10W white LED lamps, with a color temperature of 5000K, a frequency of 50Hz, and an effective light intensity of 900lx on the acquisition plane. The camera is a 3-megapixel USB driver-free industrial camera. The image resolution is 2592×1944, and the image format is saved as JPEG. Samples are shown below. Figure 1 (a) shown.

[0072] 1.2 Leaf color phenotypic information extraction

[0073] 1.2.1 Accurate separation of target leaves and background noise

[0074] Using MATLAB software, the target blades and background noise are accurately separated. Figure 1 (b). The specific operations are as follows:

[0075] ① Use the rgb2hsv function to convert the JPEG image obtained in Section 1.1 into an HSV image.

[0076] ② Fill the part of the image in ① with a saturation less than 0.2 with black.

[0077] ③Use hsv2rgb function and rgb2gray function to convert the HSV image obtained in ② into a binary image.

[0078] ④Use the strel function and the diamond structure element to smooth the binary image obtained in ③.

[0079] ⑤Use the imerode function to corrode the binary image obtained in ④.

[0080] ⑥ Use the medfilt2 function to perform median filtering on the binary image obtained in ⑤.

[0081] ⑦ Use the bwlabel function to find the connected domains in the binary graph obtained in ⑥ and mark them with numbers.

[0082] ⑧Use the regionprops function to obtain the pixel area of ​​each connected domain obtained in ⑦, and filter and retain the connected domain with the largest area.

[0083] ⑨Use the double loop statement to perform intersection processing on the JPEG image obtained in Section 1.1 and the connected domain obtained in Section ⑧, retain the intersection part, and convert the other parts into transparent channels. The effect is as follows Figure 1 (b) as shown.

[0084] The above functions all call the function library that comes with MATLAB software, and achieve the purpose of precise separation through optimized combination.

[0085] 1.2.2 Extraction of RGB color space parameters of leaf images

[0086] The mean, median, mode, skewness, and kurtosis functions of MATLAB software were used to extract the mean value (R) of the red (R) channel color level. Mean ), median (R Median ), mode (R Mode ), skewness (R Skewness ) and kurtosis (R Kurtosis), the mean value of the green (G) channel level (G Mean ), median (G Median ), majority (G Mode ), skewness(G Skewness ) and kurtosis (G Kurtosis ), the mean value of the blue (B) channel color level (B Mean ), median (B Median ), mode (B Mode ), skewness(B Skewness ) and kurtosis (B Kurtosis ), and the mean value of the grayscale (Y) image level (Y Mean ), median (Y Median ), mode(Y Mode ), skewness(Y Skewness ) and kurtosis (Y Kurtosis ) and constitute the leaf color skewness parameter system in leaf RGB color space.

[0087] The above functions all call the function library that comes with MATLAB software.

[0088] 1.3 Fitting model construction

[0089] 1.3.1 Regression model construction

[0090] SPSS software was used to construct the multivariate linear fitting model F2 of tobacco leaf color phenotype parameter - chlorine content, with tobacco leaf chlorine content as the dependent variable and RGB color space skewness parameter system (20) as the independent variable according to the stepwise regression method.

[0091] The implementation process is as follows:

[0092] ① Select tobacco leaf samples (162), import tobacco leaf chlorine content (1) and its corresponding RGB color space skewness parameter system (20) into SPSS software, see Figure 2 .

[0093] ② Taking the chlorine content of tobacco leaves as the dependent variable and the skewness parameter system (20) of RGB color space as the independent variable, the least squares stepwise regression method was selected to establish a linear model. At the same time, in the "Options", it was set that when the significance test of the regression equation is P≤0.05, the independent variable is moved into the regression equation; when the significance test of the regression equation is P≥0.1, the independent variable is moved out of the regression equation, see Figure 3 (a), (b).

[0094] ③ Obtain the coefficient of determination of the alternative regression model, the regression coefficient significance test, and the collinearity diagnosis of the independent variables of the regression model, see Figure 4 .

[0095] ④ Based on the determination coefficient, regression coefficient significance, and collinearity diagnosis results of the alternative regression models, the optimal regression model expression is finally determined.

[0096] a) From the results in Table 1, we can see that R Kurtosis , B Skewness , R Median , G Mean These four parameters are available independent variable parameters for the model.

[0097] Table 1 Variables entered / removed a

[0098]

[0099] a. Strain number: CL

[0100] b) From Table 2 and Table 3, we can see that the significance tests of the four constructed models are all less than 0.05, and the models are significant (the independent variables and the dependent variables have a significant functional relationship). Kurtosis , B Skewness , R Median , G Mean The four parameters of model 4 have a coefficient of determination (R 2 ) is the highest, reaching 0.238.

[0101] Table 2 Model summary e

[0102]

[0103] a. Prediction value: (constant), RK

[0104] b. Prediction value: (constant), RK, BS

[0105] c. Prediction value: (constant), RK, BS, R2

[0106] d. Prediction value: (constant), RK, BS, R2, G1

[0107] e. Strain number: CL

[0108] Table 3 Analysis of variance a

[0109]

[0110] a. Strain number: CL

[0111] b. Prediction value: (constant), RK

[0112] c. Prediction value: (constant), RK, BS

[0113] d. Prediction value: (constant), RK, BS, R2

[0114] e. Prediction value: (constant), RK, BS, R2, G1

[0115] c) From Table 4, we can see that although R Kurtosis , B Skewness , R Median , G Mean The four parameters of model 4 have a coefficient of determination (R 2 ) is the highest, but in its collinearity diagnosis, R Median , G Mean The tolerances of the two independent variables are 0.017 and 0.015, both less than 0.05; the VIF values ​​are 60.524 and 64.984, both greater than 10, indicating that there is a very serious collinearity problem (autocorrelation) between the two coefficients, and one of the independent variables should be eliminated. Therefore, R Kurtosis , B Skewness , R Median Model 3 constructed by these three parameters is the best multivariate linear fitting model F2 of tobacco leaf color phenotype parameter - chlorine content (with the second highest determination coefficient and no abnormality in collinearity diagnosis), and its expression is as follows:

[0116] F2=0.496·R Kurtosis -2.632 B Skewness -0.048·R Median +12.250

[0117] Table 4 Coefficients a

[0118]

[0119] a. Strain number\:CL

[0120] 1.3.2 Backward Transfer Neural Network (BPNN) Model Construction

[0121] The BPNN model F4 of tobacco leaf color phenotype parameter - chlorine content was constructed by using the Neural Network Toolbox of MATLAB software, taking the chlorine content of tobacco leaves as the output layer factor and the skewness parameter system (20) of RGB color space as the input layer factor.

[0122] The implementation process is as follows:

[0123] The topological structure of the BPNN model includes three layers: input layer, hidden layer and output layer.

[0124] ② When selecting the optimal topology of the hidden layer: The fitting accuracy of the BPNN model is mainly determined by the number of neurons in the hidden layer. This study first determines different numbers of neurons by the following formula, and then conducts training comparison. The hidden layer neuron number with the smallest error between the training judgment result and the actual number is taken as the optimal topology.

[0125]

[0126] Where Z, m, n are the number of neurons in the hidden layer, input layer, and output layer respectively, and q is a constant between [1, 10];

[0127] ③ This study uses MATLAB's Neural Network Toolbox to construct a BPNN determination model for tobacco leaf maturity. The operation steps are as follows:

[0128] Normalization of data. Since there are many parameters reflecting the maturity of tobacco leaves and the differences in the original data of each parameter are obvious, this study normalized the original data before constructing the BPNN, linearly compressing the data to the range of [0, 1] to make the network easier to converge during the training stage.

[0129] Backward transfer neural network training. The transfer function of the neurons in the middle layer of the network uses the Logsig function, the transfer function of the neurons in the output layer uses the linear function Purelin, and the training function uses Trainlm. 70% of the data is used for model training, 15% of the data is used for prediction verification, and 15% of the data is used for model testing. The convergence error of the model is set to 0.0001, the learning rate is 0.05, and the maximum number of training rounds is 1000.

[0130] See also Figure 5 , the specific algorithm and modeling results are as follows:

[0131] Matlab algorithm:

[0132] input_train = [R1';R2';R3';RS';RK';G1';G2';G3';GS';GK';B1';B2';B3';BS';BK';Y1';Y2';Y3';YS';YK']; % Input layer 20 factor arrays transposed input

[0133] output_train = [CL']; % Output layer 1 factor matrix transposition

[0134] [inputn,inputps]=mapminmax(input_train); %Data normalization

[0135] [outputn, outputps] = mapminmax (output_train); % data normalization

[0136] inputnum=size(input_train,1);

[0137] outputnum=size(output_train,1);

[0138] p=ceil((inputnum+outputnum).^0.5); %Use the loop body to select the optimal topology structure

[0139] Data = [];

[0140] for i=1:10%

[0141] hiddennum=p+i;

[0142] %BP network training

[0143] net=newff(inputn,outputn,hiddennum,{'tansig','purelin'},'trainlm');

[0144] net.trainParam.show = 100; % Display once in a cycle

[0145] net.trainParam.Lr=0.05;% learning rate

[0146] net.trainParam.epochs = 1000; % Maximum training rounds

[0147] net.trainParam.goal=1e-4;% mean square error

[0148] net.divideParam.trainRatio=70 / 100;%Set the ratio of training set

[0149] net.divideParam.valRatio = 15 / 100; %Set the validation set ratio

[0150] net.divideParam.testRatio=15 / 100;%Set the test set ratio

[0151] net=train(net,inputn,outputn); %Neural network starts training

[0152] %%BP network prediction

[0153] % Data reverse normalization

[0154] inputn_test=mapminmax('apply',input_train,inputps);

[0155] an=sim(net,inputn_test);

[0156] A=mapminmax('reverse',an,outputps);

[0157] Data(:,i)=A(1,:)';%Neural network fitting results

[0158] end

[0159] xlswrite('E:\CL-Fitted BPNN.xls',Data) %Write the fitting results into a spreadsheet to achieve model optimization

[0160] ④ Determination of the optimal BPNN topology: By comparing the fitting results of the ten topological structures, it can be seen that although the average accuracy of the model is the highest when the number of hidden layer factors is 14, reaching 83.40%, the abnormality rate is also high, reaching 2.47%. Therefore, considering the average accuracy and abnormality rate of the model, the topological structure with 20 input layer factors, 13 optimal hidden layer factors, and 1 output layer factor is finally selected as the optimal BPNN topological structure, see Figure 6 .

[0161] For the optimal BPNN topology, see Figure 7 .

[0162] 1.3.3 Best model results, see Table 5 and Table 6. The model of the present invention is not a model architecture that can be obtained through exhaustive or limited attempts.

[0163] Table 5 Construction method of tobacco leaf maturity determination model

[0164]

[0165] Table 6 Expression of fitting model for tobacco leaf color phenotype parameters and chlorine content

[0166]

[0167] 2. Construction of non-destructive measurement system

[0168] 2.1 System Curing

[0169] Based on the content of the method in 1, Matlab software was used to solidify the non-destructive, rapid and accurate detection system for the chlorine content of Yunyan 87 fresh tobacco leaves ( Figure 8 ). This system is a stand-alone program and requires the following configuration resources: (1) Operating system: Window7 and above. (2) Network status: No need to connect to the Internet. (3) MATLAB dynamic library needs to be installed.

[0170] 2.2 Operation Process

[0171] The main function of this system is to realize non-destructive, rapid and accurate detection of the chlorine content of Yunyan 87 fresh tobacco leaves. The implementation process is as follows: ① Obtain digital images of fresh tobacco leaves through a standardized tobacco leaf collection box; ② Import the collected digital images into this system. ③ Based on step ②, this system uses a multi-dimensional composite background noise removal algorithm to obtain the precise contour of the target leaf. ④ Based on step ③, this system extracts the skewness parameters of the RGB color space of the target leaf digital image as the phenotypic characteristic parameters of the tobacco leaf. ⑤ Based on step ④, this system uses the obtained tobacco leaf phenotypic characteristic parameters as input to run the tobacco leaf color phenotypic parameter-chlorine content fitting model based on multivariate stepwise regression and back transfer neural network (BPNN) that has been solidified in this system. ⑥ The fitting results are obtained by running the model in step ⑤ and output to the interface to complete the non-destructive, rapid and accurate detection of the chlorine content of Yunyan 87 fresh tobacco leaves.

[0172] 2.3 Operation Demonstration

[0173] Save this system to any location on your computer and access it by double-clicking the mouse or pressing the Enter key on the keyboard. Figure 7 The overall operation interface is simple and clear, with only three buttons, no operation threshold and technical requirements, and users can complete system operation without any training or instructions.

[0174] (1) Image input

[0175] By clicking the "Input Image" button, the Yunyan 87 digital image to be analyzed is loaded into the system, and the system displays it in the "Input Image" ( Fig. 9 shown).

[0176] (2) Nondestructive testing of leaf chlorine content

[0177] This system automatically reads the imported original image and completely removes the background noise through the following methods:

[0178] ① Noise removal: Use the saturation threshold of the HSV image to achieve preliminary separation of the target leaves from the background.

[0179] ② Edge smoothing: The image after preliminary separation is smoothed, eroded, and median filtered using the image contour of the diamond structure element.

[0180] ③ Area screening: Find all connected domains of the image contour and mark them with numbers, calculate the pixel area of ​​each connected domain, screen and retain the connected domain with the largest area, and display it in the interface "Background Noise Separation" ( Fig.10 ).

[0181] ④ Region determination: Using a double loop statement, the imported original image is subjected to intersection processing with the largest connected domain obtained in step ③ to determine the target object region for analysis.

[0182] This system obtains the target area determined in step ④ and extracts the skewness parameters of the RGB color space of the target leaf digital image ( Fig.11 ), and use these characteristic parameters as input to run the models F2 and F4 that have been solidified in this system to achieve the fitting of the tobacco leaf color phenotype parameter - chlorine content. The model runs to get the fitting results and outputs them to the interface ( Fig.12 ) to complete non-destructive, rapid and accurate detection of the chlorine content in Yunyan 87 fresh tobacco leaves.

[0183] (3) Application examples

[0184] For specific application examples of this system, see Fig.13 .

[0185] The above are preferred embodiments of the present invention. Any changes made according to the technical solution of the present invention, as long as the resulting functions do not exceed the scope of the technical solution of the present invention, belong to the protection scope of the present invention.

Claims

1. A non-destructive detection method for chlorine content in Yunyan 87 fresh tobacco leaves, characterized in that: The leaf color skewness parameter system of tobacco leaf RGB color space was taken as input factor, and the multiple stepwise regression and back propagation neural network (BPNN) methods were used to construct the tobacco leaf color phenotype parameter-chlorine content fitting model. Through system solidification, non-destructive detection of chlorine content in fresh tobacco leaves was achieved.

2. The nondestructive detection method for chlorine content in Yunyan 87 fresh tobacco leaves according to claim 1, characterized in that: The steps include: S1, standard image acquisition; S2, leaf color phenotype information extraction, including: accurate separation of target leaves and background noise, and extraction of RGB color space parameters of tobacco leaf images; S3. Fitting model construction, including: multivariate stepwise regression model construction and BPNN model construction.

3. The nondestructive detection method for chlorine content in Yunyan 87 fresh tobacco leaves according to claim 2, characterized in that: The specific implementation of step S1 is as follows: The collected leaves were cleaned of dirt and water droplets on the surface with absorbent paper and placed in a portable leaf image acquisition box for photographing using a digital camera. The portable leaf image acquisition box light source consisted of two 10W white LED lamp tubes with a color temperature of 5000K and a frequency of 50Hz. The effective light intensity on the acquisition plane was 900lx. The digital camera was a 3-megapixel USB driver-free industrial camera. The obtained image resolution was 2592×1944 and the image format was saved as JPEG.

4. The nondestructive detection method for chlorine content in Yunyan 87 fresh tobacco leaves according to claim 2, characterized in that: In step S2, the target leaf and the background noise are accurately separated. MATLAB software is used to achieve accurate separation of the target leaf and the background noise. The specific implementation steps are as follows: ① Use rgb2hsv function to convert the JPEG image obtained in step S1 into an HSV image; ②Fill the part of the image in ① with a saturation less than 0.2 with black; ③Use hsv2rgb function and rgb2gray function to convert the HSV image obtained in ② into a binary image; ④Use the strel function and the diamond structure element to smooth the binary image obtained in ③; ⑤Use the imerode function to corrode the binary image obtained in ④; ⑥Use medfilt2 function to perform median filtering on the binary image obtained in ⑤; ⑦Use the bwlabel function to find the connected domains in the binary graph obtained in ⑥ and mark them with numbers; ⑧Use the regionprops function to obtain the pixel area of ​​each connected domain obtained in ⑦, and select and retain the connected domain with the largest area; ⑨ Using a double loop statement, perform intersection processing on the JPEG image obtained in step S1 and the connected domain obtained in step ⑧, retain the intersection part, and convert the other parts into transparent channels.

5. The nondestructive detection method for chlorine content in Yunyan 87 fresh tobacco leaves according to claim 4, characterized in that: The rgb2hsv function, hsv2rgb function, rgb2gray function, strel function, imerode function, medfilt2 function, bwlabel function, and regionprops function all call the function library that comes with the MATLAB software.

6. The nondestructive detection method for chlorine content in Yunyan 87 fresh tobacco leaves according to claim 2, characterized in that: In step S2, the leaf image RGB color space parameter extraction process is specifically implemented as follows: Based on the image obtained by the precise separation process of the target leaf and the background noise, the mean value R of the red R channel color level is extracted by using the mean, median, mode, skewness, and kurtosis functions of MATLAB software. Mean , median R Median , mode R Mode , skewness R Skewness and Kurtosis R Kurtosis , the mean value of the green G channel level G Mean , median G Median , majority G Mode , skewness G Skewness and kurtosis G Kurtosis , the mean value of the blue B channel color level B Mean , median B Median 、Mode B Mode , skewness B Skewness and kurtosis B Kurtosis , the mean value Y of the grayscale Y image level Mean , median Y Median , mode Y Mode , skewness Y Skewness and kurtosis Y Kurtosis , forming the leaf color skewness parameter system of tobacco leaves in RGB color space.

7. The nondestructive detection method for chlorine content in Yunyan 87 fresh tobacco leaves according to claim 6, characterized in that: In step S3, a multivariate stepwise regression model is constructed by using SPSS software, taking the tobacco leaf chlorine content as the dependent variable and the tobacco leaf RGB color space leaf color skewness parameter system as the independent variable, and constructing a tobacco leaf color phenotype parameter-chlorine content multivariate linear fitting model F2 according to the stepwise regression method; the specific implementation is as follows: ①Select tobacco leaf samples, and import the chlorine content of tobacco leaves and its corresponding leaf color deviation parameter system in RGB color space into SPSS software; ② Taking the chlorine content of tobacco leaves as the dependent variable and the leaf color skewness parameter system of tobacco leaves in RGB color space as the independent variable, the least squares stepwise regression method was selected to establish a linear model; at the same time, in the "Options" of SPSS software, when the significance test of the regression equation is P≤0.05, the independent variable is moved into the regression equation; When the significance test of the regression equation is P ≥ 0.1, the independent variable is removed from the regression equation; ③ Obtain the coefficient of determination of the alternative regression model, the significance test of the regression coefficient, and the collinearity diagnosis results of the independent variables of the regression model; ④ According to the coefficient of determination, significance of regression coefficient and collinearity diagnosis results of the alternative regression model, the best regression model was finally determined, that is, the multivariate linear fitting model F2 of tobacco leaf color phenotype parameter-chlorine content, which is expressed as follows: F2=0.496·R Kurtosis -2.632·B Skewness -0.048·R Median +12.250。 8. The nondestructive detection method for chlorine content in Yunyan 87 fresh tobacco leaves according to claim 6, characterized in that: In step S3, the BPNN model is constructed by using the Neural Network Toolbox of MATLAB software, taking the chlorine content of tobacco leaves as the output layer factor and the leaf color skewness parameter system of tobacco leaves in RGB color space as the input layer factor, to construct a BPNN model F4 of tobacco leaf color phenotype parameter - chlorine content, wherein the topological structure of the BPNN model includes three layers: input layer, hidden layer and output layer; the specific implementation is as follows: ① When selecting data in the input layer and output layer: select tobacco leaf samples, and import the chlorine content of tobacco leaves and the corresponding leaf color skewness parameter system in the RGB color space of tobacco leaves into the MATLAB software; ② When selecting the optimal topology of the hidden layer: the fitting accuracy of the BPNN model is determined by the number of neurons in the hidden layer. First, different numbers of neurons are determined by the following formula, and then training comparison is performed. The optimal topology is the number of neurons in the hidden layer with the smallest error between the training judgment result and the actual number. Where Z, m, n are the number of neurons in the hidden layer, input layer, and output layer respectively, and q is a constant between [1, 10]; ③ Use MATLAB's neural network toolbox Neural Network Toolbox to build a BPNN model of tobacco leaf maturity. The operation steps are as follows: Data normalization: Before building the BPNN model, the original data is normalized and linearly compressed to the range of [0, 1]; Backward transfer neural network training: The transfer function of the neurons in the middle layer of the network adopts the Logsig function, the transfer function of the neurons in the output layer adopts the linear function Purelin, and the training function adopts Trainlm; 70% of the normalized data is used for model training, 15% of the data is used for prediction verification, and 15% of the data is used for model testing; the convergence error of the model is set to 0.0001, the learning rate is 0.05, and the maximum number of training rounds is 1000; ④ Determination of the optimal BPNN model topology: Taking into account the average accuracy and abnormality rate of the model, the topology with 20 input layer factors, 13 optimal hidden layer factors and 1 output layer factor was selected as the optimal topology of the BPNN model, and the BPNN model F4 of tobacco leaf color phenotype parameter - chlorine content was constructed.

9. A nondestructive detection system for chlorine content in Yunyan 87 fresh tobacco leaves based on a nondestructive detection method for chlorine content in Yunyan 87 fresh tobacco leaves as described in any one of claims 1 to 8, characterized in that: The system is solidified using Matlab software; the system is a stand-alone program, and the configuration resources include: (1) operating system: Window7 and above; (2) network status: no need to connect to the Internet; (3) MATLAB dynamic library needs to be installed.

10. A nondestructive detection system for chlorine content in Yunyan 87 fresh tobacco leaves according to claim 9, characterized in that: The system is implemented as follows: ① Obtain digital images of fresh tobacco leaves through a portable leaf image acquisition box; ② Importing the collected digital images into the system; ③ Based on step ②, the system adopts a multi-dimensional composite background noise removal algorithm to obtain the precise contour of the target blade; ④ Based on step ③, the system extracts the skewness parameters of the RGB color space of the target leaf digital image as tobacco leaf phenotypic characteristic parameters; ⑤ Based on step ④, the system uses the acquired tobacco leaf phenotypic characteristic parameters as input and runs the tobacco leaf color phenotypic parameter-chlorine content fitting model based on multivariate stepwise regression and BPNN that has been solidified in the system; ⑥The fitting results are obtained by running the model in step ⑤ and output to the interface, thus completing the non-destructive, rapid and accurate detection of the chlorine content of Yunyan 87 fresh tobacco leaves.

Citation Information

Cited By

  • Rapid inversion method, device and equipment for walnut leaf chlorine element content based on spectroscopy and medium

    CN121703026A