Tobacco leaf mold detection method using electronic nose for logistic regression classification

Tobacco leaf odor data is collected through electronic nose sensors, combined with principal component analysis and logistic regression classifiers, automatic discrimination of the degree of mold in tobacco leaves is achieved, solving the problems of strong subjectivity of manual detection and frequent missed detection in the existing technology, and improving detection efficiency and objectivity.

CN115508503BActive Publication Date: 2025-03-25CHINA TOBACCO SHAANXI IND +1

Patent Information

Application Number
CN202110687584.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-21
Publication Date
2025-03-25
Estimated Expiration
2041-06-21

AI Technical Summary

Technical Problem

In the prior art, the detection of tobacco leaves mold mainly relies on manual visual inspection and evaluation, which has strong subjectivity and is prone to lead to missed inspections. Manual inspection consumes a lot of manpower, increasing production costs.

Method used

An electronic nose sensor is used to sample the odor of tobacco leaves, reduce the dimensionality through principal component analysis, extract the principal component information, and comprehensively calculate the principal component using a logistic regression classifier to achieve automated judgment of the degree of mold in tobacco leaves. At the same time, a logistic regression classification weight update method is provided, and the weight is iteratively updated through grouping experiments and gradient descent methods to find the optimal weight and realize automatic classification.

Benefits of technology

It realizes automatic discrimination of the degree of mold in tobacco leaves, reduces labor costs, increases the objectivity of detection, avoids false detection and missed detection, and can more efficiently, safely and objectively determine the degree of mold in tobacco leaves.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115508503B_ABST
    Figure CN115508503B_ABST
Patent Text Reader

Abstract

Provided is a tobacco leaf mildew detection method using an electronic nose for logistic regression classification. The electronic nose sensor is used to sample tobacco leaf odor to generate a group of sensor data. The electronic nose sensor data is reduced in dimension by principal component analysis to extract principal component information. Finally, a logistic regression classifier is used to perform comprehensive calculation on the principal components to give the degree of tobacco leaf mildew, thereby realizing automatic discrimination of the degree of tobacco leaf mildew. Compared with traditional methods, the method not only reduces the labor cost in cigarette production, but also increases the objectivity of tobacco leaf detection, avoids false detection and missed detection of tobacco leaf mildew caused by the subjectivity of detection personnel, and can more efficiently, safely and objectively discriminate the degree of tobacco leaf mildew. At the same time, the invention provides a logistic regression classification weight updating method for tobacco leaf mildew. The method iteratively updates the weights by combining a grouping experiment method with a gradient descent method, thereby finding an optimal group of weights, thereby realizing automatic classification of whether the tobacco leaf is mildewed and the mildew grade.
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 mildew detection, and in particular relates to a tobacco leaf mildew detection method using an electronic nose for logistic regression classification. Background Art

[0002] In the process of making cigarettes, it is generally necessary to ferment the newly harvested tobacco leaves for 2 to 3 years, and then make tobacco after aging. However, tobacco leaves have extremely strong hygroscopicity. If they are not properly stored, they are very easy to become moldy. Once the tobacco leaves become moldy, microorganisms will multiply rapidly with the help of the rich nutrients such as sugar and protein in the tobacco leaves, thereby accelerating the speed of tobacco leaf mold, and further causing the tobacco leaves to completely lose their use value. Therefore, how to quickly detect moldy tobacco leaves at the beginning of tobacco leaf mold has become one of the key technologies for cigarette manufacturers. At present, it is mainly based on manual visual inspection and smoking evaluation, and it is difficult to make an objective evaluation. In recent years, with the development of materials science, electronics, and chemistry, some sensors for detecting volatile odor molecules such as 3-methyl-1-butanol and 2-pentanone emitted from moldy tobacco leaves have reached the level of practical application, so the use of an electronic nose composed of multiple sensors for automatic classification of moldy tobacco leaves has become a development trend.

[0003] At present, tobacco production enterprises mainly rely on manual visual inspection and smoking evaluation to determine whether tobacco is moldy. The visual inspection method is that the inspectors observe with the naked eye. Due to the stacking and storage of tobacco leaves, the moldy tobacco leaves are very hidden, which is easy to cause missed inspections, and then flow into the cigarette production line, affecting the quality of cigarettes; the smoking evaluation method is that the inspectors rely on their noses to smell whether the tobacco leaves are moldy. Since moldy tobacco leaves will emit toxic substances such as aflatoxin, a substance with extremely strong carcinogenic properties, it will cause certain harm to the health of the smokers. In addition, both the visual inspection method and the smoking evaluation method are subjective detection methods, which are easily affected by the inspectors and the environment, and cannot be evaluated more objectively. On the other hand, manual inspection requires a lot of manpower, increases the production costs of enterprises, and is inconsistent with the development trend of automated production of cigarette manufacturers. Therefore, it is necessary to propose improvements. Summary of the invention

[0004] The technical problem solved by the present invention is as follows: a method for detecting tobacco leaf mildew by using an electronic nose for logistic regression classification is provided. The method uses a plurality of electronic nose sensors to sample tobacco leaf odor to generate a group of sensor data, then reduces the dimension of the electronic nose sensor data by principal component analysis, extracts principal component information, and finally uses a logistic regression classifier to perform comprehensive calculation on the principal components to give the degree of tobacco leaf mildew, thereby realizing automatic discrimination of the degree of tobacco leaf mildew. Compared with the traditional manual visual inspection method and smoking evaluation method, the method not only reduces the labor cost in the cigarette production process, but also increases the objectivity of tobacco leaf detection, avoids false detection and missed detection of tobacco leaf mildew caused by the subjectivity of the detection personnel, and can more efficiently, safely and objectively discriminate the degree of tobacco leaf mildew. At the same time, the present invention provides a method for updating weights of logistic regression classification of tobacco leaf mildew. The method can iteratively update weights by combining a grouping experiment method with a gradient descent method, thereby finding an optimal group of weights, thereby realizing automatic classification of whether the tobacco leaf is mildewed and the mildew grade.

[0005] The technical solution adopted by the present invention is a tobacco leaf mildew detection method using an electronic nose for logistic regression classification. The detection method divides tobacco leaves into four levels: non-mildew, mild mildew, moderate mildew, and severe mildew. The method specifically includes the following detection steps:

[0006] Step 1): Weigh 20 g of tobacco leaves to be tested and place them in a sealed measuring cylinder;

[0007] Step 2): After the measuring cylinder is placed at room temperature for 60 minutes to collect gas, the tobacco leaves are tested using an electronic nose sensor to obtain the electronic nose sensor detection data to form an original detection vector X0 ;

[0008] Step 3): Use the principal component analysis algorithm to analyze the original detection vector X0 Extract the first p principal components to form the principal component vector X;

[0009] Step 4): Calculate the score value of the category to which the tobacco leaf belongs through the logistic regression classifier, and select the category with the largest score value as the tobacco leaf detection category.

[0010] In the above step 4), the training and updating process of the model weights of the logistic regression classifier for tobacco leaves is as follows:

[0011] a) Prepare non-moldy tobacco leaves, slightly moldy tobacco leaves, moderately moldy tobacco leaves, and severely moldy tobacco leaves. For each category of prepared tobacco leaves, weigh N groups as training sets, 20 g per group, and put them into 200 ml graduated cylinders, and then seal the mouth of the graduated cylinders with insurance film;

[0012] b) Place the measuring cylinder at room temperature for 60 minutes to collect gas, then perform electronic nose sensor sampling and testing. The electronic nose sensor needs to be calibrated before each test. After calibration, insert the electronic nose sensor sampling tube into the measuring cylinder, sample once every 1s, and sample 300 times in total to generate Mx300 data, where M represents the number of electronic nose sensors;

[0013] c) Group each sensor data of each group of tobacco leaves and take the average value, and take the average value of the first 100 and the last 100 sampling values, respectively, and record them as and k represents the kth group of tobacco leaves, j represents the jth sensor;

[0014] d) normalizing the sampling results, calculating the correlation matrix and the eigenvalues ​​and eigenvectors of the correlation matrix, and selecting the first p eigenvectors with cumulative contribution rates exceeding 85% to form the principal component coefficients;

[0015] Principal component extraction coefficient U Calculation and calculation of principal components of each group of data:

[0016] Calculate the mean for each sensor and variance S0 ,as follows:

[0017]

[0018]

[0019]

[0020]

[0021] Normalize each set of sensor data to obtain as follows:

[0022]

[0023]

[0024] Calculate the covariance matrix R = (r mn ) 20×20 ,in In the formula, r mm =1, r mn =r nm , r mn It represents the correlation coefficient between the mth indicator and the nth indicator;

[0025] Using numerical calculation methods, we can obtain the eigenvalues ​​of the covariance matrix from large to small: λ1,λ2,…,λ 20 and the corresponding eigenvector in Select the first p eigenvalues ​​and eigenvectors and calculate the cumulative contribution rate Satisfy α> 85% ;

[0026] When p is 4, the cumulative contribution rate α = 89%, and the principal component extraction coefficient

[0027] Calculate the first p principal components of each set of data:

[0028]

[0029] e) Gaussian initialization of logistic regression classifier weights

[0030] Calculation of tobacco leaf mildew degree:

[0031] Calculate the score of each group of tobacco leaves in each category as follows:

[0032]

[0033] Where θ = (ω1, ω2, ..., ω4) represents the weight of the logistic regression classifier, and the initial value is generated by a Gaussian random generator, that is, a normal distribution with a mean of 0 and a variance of 1; then the Softmax method is used to normalize the score values ​​to generate the confidence or probability value of the tobacco leaf in each category, as follows:

[0034]

[0035] in

[0036] f) Calculate the probability value of each category of each group of tobacco leaves and the corresponding cross entropy loss function using the Softmax logistic regression classification algorithm, and summarize the loss function

[0037] Loss function calculation:

[0038] For a single training sample, the cross entropy is used to calculate the loss value:

[0039]

[0040] where Y k =(y k1 ,y k2 ,y k3 ,y k4 ) is the one-hot encoding of the training sample category;

[0041] For the overall training sample loss, in addition to the average loss of all samples, L2 regularization is added to prevent the model from overfitting:

[0042]

[0043] in λ represents the L2 regularization control parameter;

[0044] g) Weight update:

[0045] The gradient descent method is used to update the model weights and determine whether the model has converged. If it has converged, the model iteration ends, otherwise it is iterated again. Whether the summarized loss is less than the loss value in the previous iteration is the model convergence standard.

[0046] The advantages of the present invention compared with the prior art are:

[0047] 1. This scheme uses multiple electronic nose sensors to sample tobacco leaf odors to generate a set of sensor data, and then reduces the dimension of the electronic nose sensor data through principal component analysis to extract principal component information, and finally uses a logistic regression classifier to perform comprehensive calculations on the principal components to give the degree of tobacco leaf mildew; at the same time, the present invention provides a logistic regression classification weight update method for tobacco leaf mildew, which can iteratively update the weights through grouping experiments combined with a gradient descent method, thereby finding an optimal set of weights to achieve automatic classification of whether tobacco leaves are mildewed and the degree of mildew;

[0048] 2. For the first time, this scheme extracts the principal components of the signals collected by the electronic nose and then performs Softmax logistic regression classification to realize the automatic identification of the degree of tobacco leaf mildew. Compared with the traditional manual visual inspection and smoking evaluation methods, it not only reduces the labor cost in the cigarette production process, but also increases the objectivity of tobacco leaf detection, avoids false detection and missed detection of tobacco leaf mildew caused by the subjectivity of the inspectors, and can identify the degree of tobacco leaf mildew more efficiently, safely and objectively;

[0049] 3. The present invention uses principal component analysis and logistic regression classification algorithms for the first time to process the multi-dimensional sensor data of tobacco leaves collected by the electronic nose, generate category scores, and then directly use the category with the maximum score as the tobacco leaf discrimination category. This method is simple to calculate and can be directly embedded in the electronic nose processor to output the tobacco leaf discrimination result;

[0050] 4. The present invention proposes to use a group experiment method to perform principal component analysis on the electronic snuff leaf detection data, converting the highly correlated sensor data into principal components that are independent of each other and have lower dimensions, thereby reducing the difficulty of model analysis and the amount of calculation of the model, making it possible to embed the algorithm into the electronic nose processor. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 It is a detection flow chart of the present invention;

[0052] Figure 2is a flow chart of the training process of the model weights of the logistic regression classifier in the present invention;

[0053] Figure 3 It is a detection effect diagram of the present invention. DETAILED DESCRIPTION

[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0055] It should be noted that, in this article, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions. The elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0056] See also Figure 1-3 , details of the embodiments of the present invention.

[0057] A tobacco leaf mold detection method using an electronic nose for logistic regression classification is provided. The method divides tobacco leaves into four levels: non-moldy, slightly moldy, moderately moldy, and severely moldy. The method specifically includes the following detection steps: Figure 1 As shown,

[0058] Step 1): Weigh 20 g of tobacco leaves to be tested and place them in a sealed measuring cylinder;

[0059] Step 2): After the measuring cylinder is placed at room temperature for 60 minutes to collect gas, the tobacco leaves are tested using an electronic nose sensor to obtain the electronic nose sensor detection data to form an original detection vector X0 ;

[0060] Step 3): Use the principal component analysis algorithm to analyze the original detection vector X0 Extract the first p principal components to form the principal component vector X;

[0061] Step 4): Calculate the score value of the category to which the tobacco leaf belongs through the logistic regression classifier, and select the category with the largest score value as the tobacco leaf detection category.

[0062] In the above step 4), the training and updating process of the model weights of the logistic regression classifier for tobacco leaves is as follows: Figure 2 Shown

[0063] a) Prepare non-moldy tobacco leaves, slightly moldy tobacco leaves, moderately moldy tobacco leaves, and severely moldy tobacco leaves. For each category of the prepared tobacco leaves, weigh N groups as training sets, each group of 20 g, and put them into 200 ml measuring cylinders, and then seal the measuring cylinder mouth with a safety film; in this embodiment, N is 40.

[0064] b) Place the measuring cylinder at room temperature for 60 minutes to collect gas, then perform sampling and detection with the electronic nose sensor. Before each detection, the electronic nose sensor needs to be calibrated. After calibration, insert the electronic nose sensor sampling tube into the measuring cylinder, sample once every 1s, and sample 300 times in total to generate Mx300 data, where M represents the number of electronic nose sensors. In the present invention, M=10, which are volatile gas detection sensors such as 2-octen-1-ol, mushroom alcohol, 2-pentanone, and 3-methyl-1-butanol;

[0065] c) Group each sensor data of each group of tobacco leaves and take the average value, and take the average value of the first 100 and the last 100 sampling values, respectively, and record them as and k represents the kth group of tobacco leaves, j represents the jth sensor;

[0066] d) normalizing the sampling results, calculating the correlation matrix and the eigenvalues ​​and eigenvectors of the correlation matrix, and selecting the first p eigenvectors with cumulative contribution rates exceeding 85% to form the principal component coefficients;

[0067] Principal component extraction coefficient U Calculation and calculation of principal components of each group of data:

[0068] Calculate the mean for each sensor and variance S 0 ,as follows:

[0069]

[0070]

[0071]

[0072]

[0073] Normalize each set of sensor data to obtain as follows:

[0074]

[0075]

[0076] Calculate the covariance matrix R = (rmn ) 20×20 ,in In the formula, r mm =1, r mn =r nm , r mn It represents the correlation coefficient between the mth indicator and the nth indicator;

[0077] Using numerical calculation methods, we can obtain the eigenvalues ​​of the covariance matrix from large to small: λ1,λ2,…,λ 20 and the corresponding eigenvector in Select the first p eigenvalues ​​and eigenvectors and calculate the cumulative contribution rate Satisfy α>85%;

[0078] In the experiment of this embodiment, when p is 3, the cumulative contribution rate α=81%, and when p is 4, the cumulative contribution rate α=89%. Therefore, in this embodiment, p is 4, and the principal component extraction coefficient

[0079] Calculate the first p principal components of each set of data:

[0080]

[0081] e) Gaussian initialization of the logistic regression classifier weights;

[0082] Calculation of tobacco leaf mildew degree:

[0083] Calculate the score of each group of tobacco leaves in each category as follows:

[0084]

[0085] Where θ = (ω1, ω2, ..., ω4) represents the weight of the logistic regression classifier, and the initial value is generated by a Gaussian random generator, that is, a normal distribution with a mean of 0 and a variance of 1; then the Softmax method is used to normalize the score values ​​to generate the confidence or probability value of the tobacco leaf in each category, as follows:

[0086]

[0087] in

[0088] f) Calculate the probability value of each category of each group of tobacco leaves and the corresponding cross entropy loss function using the Softmax logistic regression classification algorithm, and summarize the loss function

[0089] Loss function calculation:

[0090] For a single training sample, the cross entropy is used to calculate the loss value:

[0091]

[0092] where Y k =(y k1 ,y k2 ,y k3 ,y k4 ) is the one-hot encoding of the training sample category;

[0093] For the overall training sample loss, in addition to the average loss of all samples, L2 regularization is added to prevent the model from overfitting:

[0094]

[0095] in λ represents the L2 regularization control parameter;

[0096] g) Weight update:

[0097] The gradient descent method is used to update the model weights and determine whether the model has converged. If it has converged, the model iteration ends, otherwise it is iterated again. Whether the summarized loss is less than the loss value in the previous iteration is the model convergence standard.

[0098] The process of distinguishing tobacco leaves by the present invention is as follows:

[0099] a) Take 20g of the tobacco leaves to be tested and place them in a 200ml measuring cylinder, then seal the mouth of the measuring cylinder with a safety film;

[0100] b) placing the measuring cylinder at room temperature for 60 minutes to collect gas and then conducting electronic nose sensor detection. The electronic nose sensor needs to be calibrated before detection. After calibration, the sampling tube of the electronic nose sensor is inserted into the measuring cylinder, and sampling is performed once every 1 second, for a total of 300 times, to generate Mx300 data, where M represents the number of electronic nose sensors, and in this embodiment, M=10;

[0101] c) Group the sensor data and take the average value, taking the average value of the first 100 and the last 100 sample values, respectively, denoted as and j represents the jth sensor, and the original detection vector composed of all sensor data is as follows:

[0102]

[0103] d) Extract the main components:

[0104] The original detection vector X0 Normalize to get X1 , and then calculate the first p principal component variables as follows:

[0105]

[0106] e) Calculate the tobacco leaf category score:

[0107]

[0108] The maximum value is taken as the detection category of the tobacco leaf, without calculating the category probability value, which reduces the amount of calculation. θ is the logistic regression weight.

[0109] The present invention proposes for the first time to use a group experiment method to perform gradient optimization on the weights of the logistic regression classification algorithm based on the moldy electronic snuff leaf, and in the optimization process, taking into account the overfitting of the model, adding L2 regularization, when the model adopts a learning rate α of 0.01 and the number of iterations is 2000, the trained model has the best effect, and its detection accuracy has exceeded that of expert detection personnel, that is, Figure 3 As shown in the figure, when the number of iterations is 1200, the model detection effect is comparable to that of ordinary people, with an accuracy of 0.9. When the number of model iterations is 1800, the model detection effect is comparable to that of expert-level detectors, with an accuracy of 0.94. When the number of model iterations reaches 2000, the model detection effect is optimal, with an accuracy of 0.95.

[0110] The present invention utilizes a plurality of electronic nose sensors to sample tobacco leaf odor, generates a set of sensor data, then reduces the dimension of the electronic nose sensor data through principal component analysis, extracts principal component information, and finally utilizes a logistic regression classifier to comprehensively calculate the principal components, gives the degree of tobacco leaf mildew, and realizes automatic discrimination of the degree of tobacco leaf mildew. Compared with the traditional manual visual inspection method and smoking evaluation method, the present invention not only reduces the labor cost in the cigarette production process, but also increases the objectivity of tobacco leaf detection, avoids false detection and missed detection of tobacco leaf mildew caused by the subjectivity of the detection personnel, and can more efficiently, safely and objectively discriminate the degree of tobacco leaf mildew. At the same time, the present invention provides a logistic regression classification weight updating method for tobacco leaf mildew. The method can iteratively update the weights through a grouping experiment in combination with a gradient descent method, thereby finding an optimal set of weights, and realizing automatic classification of whether the tobacco leaf is mildewed and the mildew grade.

[0111] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.

[0112] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.

Claims

1. A method for detecting tobacco leaf mildew using electronic nose for logistic regression classification, characterized in that: This detection method divides tobacco leaves into four levels: non-moldy, slightly moldy, moderately moldy, and severely moldy. The specific detection steps include the following: Step 1): Weigh 20 g of tobacco leaves to be tested and place them in a sealed measuring cylinder; Step 2): After the measuring cylinder is placed at room temperature for 60 minutes to collect gas, the tobacco leaves are tested using an electronic nose sensor to obtain the electronic nose sensor detection data to form the original detection vector X 0 ; Step 3): Use the principal component analysis algorithm to analyze the original detection vector X 0 Extract the first p principal components to form the principal component vector X; Step 4): Calculate the score value of the category to which the tobacco leaf belongs through the logistic regression classifier, and select the category with the largest score value as the tobacco leaf detection category; In the above step 4), the training and updating process of the model weights of the logistic regression classifier for tobacco leaves is as follows: a) preparing non-moldy tobacco leaves, slightly moldy tobacco leaves, moderately moldy tobacco leaves, and severely moldy tobacco leaves, and weighing N groups of tobacco leaves of each category as training sets, 20 g per group, and placing them in 200 ml graduated cylinders, and then sealing the mouth of the graduated cylinders with insurance film; b) Place the measuring cylinder at room temperature for 60 minutes to collect gas, then perform electronic nose sensor sampling and testing. The electronic nose sensor needs to be calibrated before each test. After calibration, insert the electronic nose sensor sampling tube into the measuring cylinder, sample once every 1s, and sample 300 times in total to generate Mx300 data, where M represents the number of electronic nose sensors; c) Group each sensor data of each group of tobacco leaves and take the average value, and take the average value of the first 100 and the last 100 sampling values, respectively, and record them as and k represents the kth group of tobacco leaves, j represents the jth sensor; d) normalizing the sampling results, calculating the correlation matrix and the eigenvalues ​​and eigenvectors of the correlation matrix, and selecting the first p eigenvectors with cumulative contribution rates exceeding 85% to form the principal component coefficients; Calculation of principal component extraction coefficient U and principal component calculation of each group of data: Calculate the mean value for each electronic nose sensor and variance S 0 ,as follows: Normalize each set of electronic nose sensor data to obtain as follows: Calculate the covariance matrix R = (r mn ) 20×20 ,in In the formula, r mm =1, r mn =r nm , r mn It represents the correlation coefficient between the mth indicator and the nth indicator; Using numerical calculation methods, we can obtain the eigenvalues ​​of the covariance matrix from large to small: λ1,λ2,…,λ 20 and the corresponding eigenvector in Select the first p eigenvalues ​​and eigenvectors and calculate the cumulative contribution rate Satisfy α>85%; When p is 4, the cumulative contribution rate α = 89%, and the principal component extraction coefficient Calculate the first p principal components of each set of data: e) Gaussian initialization of the logistic regression classifier weights; Calculation of tobacco leaf mildew degree: Calculate the score of each group of tobacco leaves in each category as follows: Where θ = [ω1, ω2, ω3, ω4] represents the weight of the logistic regression classifier, and the initial value is generated by a Gaussian random generator, that is, a normal distribution with a mean of 0 and a variance of 1; then the Softmax method is used to normalize the score values ​​to generate the confidence, that is, the probability value, of the tobacco leaf in each category, as follows: in f) using a Softmax logistic regression classification algorithm to calculate the probability value of each category of each group of tobacco leaves and the corresponding cross entropy loss function, and summarizing the loss function; Loss function calculation: For a single training sample, the cross entropy is used to calculate the loss value: where Y k =(y k1 ,y k2 ,y k3 ,y k4 ) is the one-hot encoding of the training sample category; For the overall training sample loss, in addition to the average loss of all samples, L2 regularization is added to prevent the model from overfitting: Where λ represents the L2 regularization control parameter; g) Weight update: The gradient descent method is used to update the model weights and determine whether the model has converged. If it has converged, the model iteration ends, otherwise it is iterated again. Whether the summarized loss is less than the loss value in the previous iteration is the model convergence standard.

Citation Information

Patent Citations

  • Method, device and system for detecting cigarette packet mildew based on rays

    CN109991246A

  • Grain mildew detection method and device based on WiFi equipment

    CN110531039A

Cited By

  • Tobacco producing area distinguishing method and device based on chemical components

    CN120468078A