A method and system for single-leaf tobacco grading based on a dynamically selected convolutional kernel network

By adopting a single-leaf grading method based on dynamically selected convolutional kernel networks, the problem of unstable tobacco leaf grades caused by manual grading is solved, the scientific nature and accuracy of tobacco leaf grading are realized, the grading accuracy is improved, and technical support is provided for intelligent sorting of tobacco leaf grades.

CN116563255BActive Publication Date: 2026-04-17CHINA TOBACCO ZHEJIANG IND CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA TOBACCO ZHEJIANG IND CO LTD
Filing Date
2023-05-12
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

In existing technologies, tobacco leaf grading mainly relies on manual grading, which is easily affected by the physiological and psychological factors of grading workers, resulting in unstable tobacco leaf grades, easy confusion between high-quality and low-quality tobacco leaves, inability to make reasonable use of tobacco leaf resources, and low grading accuracy.

Method used

A single-leaf tobacco leaf grading method based on a dynamically selected convolutional kernel network is adopted. By acquiring multiple single-leaf tobacco leaf images as a training set, local detail enhancement processing is performed to build a dynamically selected convolutional kernel network model. The model is trained using the FocalLoss loss function and the EarlyStopping strategy to automatically grade tobacco leaves.

Benefits of technology

It achieves scientific and accurate tobacco leaf grading, reduces reliance on the experience of grading personnel, improves grading accuracy, and enables better intelligent sorting of tobacco leaf grades.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116563255B_ABST
    Figure CN116563255B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on dynamic selection convolution kernel network's single tobacco leaf grading method and system, the method includes: obtaining multiple single tobacco leaf images as training set;Local detail enhancement processing is carried out to each single tobacco leaf image, and detail enhancement image is obtained;According to detail enhancement image, quality classification is carried out to obtain tobacco quality grade;Tobacco grading model is built based on dynamic selection convolution kernel network;According to the tobacco quality grade corresponding to each single tobacco leaf image in training set, tobacco grading model is trained;According to the tobacco grading model trained and the tobacco sample image to be tested, tobacco grading result is obtained.The single tobacco leaf grading method and system based on dynamic selection convolution kernel network of the application, based on dynamic selection kernel network tobacco grading model, automatically carries out tobacco grading, does not depend on the experience of tobacco grading personnel, prevent the problem that tobacco grading accuracy is low due to insufficient experience of grading personnel, it is more scientific and accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of tobacco leaf grading technology, and in particular to a method and system for grading single tobacco leaves based on a dynamically selected convolutional kernel network. Background Technology

[0002] Tobacco leaf grading is a crucial basis for determining the value of tobacco leaves and has significant implications for tobacco harvesting and curing, processing and aging, and the development direction of tobacco products. Different grades of tobacco leaves have significantly different commercial values.

[0003] However, the current method of grading is mainly based on manual grading, which relies on the sensory feedback of grading workers, such as sight, smell, and touch, as well as their own experience, to determine the grade of tobacco leaves. This grading method is easily affected by the subjective factors of the grading workers' physiology and psychology, which makes the grade of sorted tobacco leaves extremely unstable. High-quality tobacco leaves and low-quality tobacco leaves are easily confused, which is not conducive to the rational use of tobacco leaf resources and cannot maximize the value of tobacco leaves.

[0004] Therefore, there is an urgent need for a method and system for grading single tobacco leaves based on dynamically selected convolutional kernel networks. Summary of the Invention

[0005] The purpose of this invention is to provide a single tobacco leaf grading method and system based on a dynamically selected convolutional kernel network to solve the problems in the prior art. It can automatically grade tobacco leaves based on the tobacco leaf grading model of the dynamically selected kernel network, without relying on the experience of tobacco leaf graders, thus preventing the problem of low accuracy in tobacco leaf grading due to insufficient experience of graders. It is more scientific and accurate.

[0006] This invention provides a method for grading single tobacco leaves based on a dynamically selected convolutional kernel network, comprising:

[0007] Multiple single tobacco leaf images were acquired as a training set;

[0008] Local detail enhancement processing is performed on each of the single tobacco leaf images in the training set to obtain a detail-enhanced image;

[0009] Quality grading is performed based on the enhanced detail images to obtain the tobacco quality grade corresponding to each single tobacco leaf image in the training set;

[0010] A tobacco leaf grading model is built based on a dynamically selected convolutional kernel network, which can adaptively and dynamically select convolutional kernels.

[0011] The tobacco leaf grading model is trained based on the tobacco leaf quality grade corresponding to each single tobacco leaf image in the training set.

[0012] Based on the trained tobacco leaf grading model and the images of the tobacco leaf samples to be tested, the tobacco leaf grading results are obtained.

[0013] The single-leaf grading method based on dynamically selected convolutional kernel networks, as described above, preferably includes the following step: acquiring multiple single-leaf images as a training set.

[0014] Several single tobacco leaves were laid flat on the photography platform in sequence;

[0015] Take a photo after placing the leaf tips with a fixed direction;

[0016] The captured images are categorized and stored according to the tobacco leaf grade.

[0017] The single-leaf grading method based on dynamically selected convolutional kernel networks, as described above, preferably includes the following step: performing local detail enhancement processing on each of the single-leaf images in the training set to obtain a detail-enhanced image.

[0018] The image of the single tobacco leaf was subjected to convolutional noise reduction processing using a Gaussian smoothing filter.

[0019] The Canny operator is used to extract the tobacco leaf edges from the tobacco leaf image to obtain a tobacco leaf image after removing the background.

[0020] The Laplace operator is used to extract tobacco leaf texture features, which are then superimposed on the original tobacco leaf image to enhance local details and obtain a detail-enhanced image.

[0021] The single-leaf grading method based on dynamically selected convolutional kernel networks, as described above, preferably includes the step of using the Canny operator to extract the tobacco leaf edges from the tobacco leaf image to obtain a background-removed tobacco leaf image, specifically comprising:

[0022] For the single tobacco leaf image, the image gradient is calculated using the Canny operator with the following formula:

[0023]

[0024]

[0025]

[0026] Among them, S x S represents the mask template in the horizontal direction. y G represents the mask template in the vertical direction. x G represents the pixel gradient matrix in the horizontal direction of the image. y Let I represent the image pixel gradient matrix in the vertical direction, and G represent the image pixel gradient intensity matrix.

[0027] The step of using the Laplace operator to extract tobacco leaf texture features and then overlaying these features with the original tobacco leaf image to enhance local details and obtain a detail-enhanced image includes:

[0028] The image of the tobacco leaves after removing the background is sharpened using the Laplace operator according to the following formula:

[0029] ▽ 2 f(x,y)=f(x+1,y)+f(x-1,y)+f(x,y+1)+f(x,y-1)-4f(x,y),

[0030]

[0031] Where f(x,y) represents the graph function, ▽ 2 f(x,y) represents the second derivative of the Laplace operation, g(x,y) represents the sharpened image function, and t represents the comparison coefficient of the neighborhood center.

[0032] The single-leaf tobacco leaf grading method based on dynamically selected convolutional kernel networks, as described above, preferably includes the step of performing quality grading based on the enhanced detail images to obtain the tobacco leaf quality grade corresponding to each single-leaf tobacco leaf image in the training set, specifically comprising:

[0033] Perform at least one of the following operations on the detail-enhanced image: random rotation, flipping, and translation, to obtain a data-enhanced image;

[0034] The data-enhanced image is then normalized.

[0035] The data-enhanced image after normalization is then standardized.

[0036] Based on the standardization processing results, the data-enhanced images are assigned grade labels, which are used to classify the quality of tobacco leaf sample images to obtain tobacco leaf quality grades.

[0037] The single-leaf grading method based on dynamically selected convolutional kernel networks, as described above, preferably includes the following: Normalization processing of the data-enhanced image.

[0038] The enhanced image is normalized using the following formula:

[0039]

[0040] Where x represents the value of a pixel in the image, x max x represents the maximum pixel value of a pixel in the same image.min This represents the minimum pixel value of a pixel in the same image.

[0041] The standardization process for the normalized data-enhanced image specifically includes:

[0042] The normalized image is standardized using the following formula:

[0043]

[0044] Where x represents the value of the image pixels, μ represents the mean, and σ represents the standard deviation.

[0045] The single-leaf grading method based on dynamically selected convolutional kernel networks, as described above, preferably includes the following: The method of building a tobacco leaf grading model based on dynamically selected convolutional kernel networks specifically includes:

[0046] Construct a convolutional neural network and add a dual-branch structure to the network structure module, specifically including:

[0047] For the input feature map, the dual-branch structure extracts features using convolutional kernels of different sizes, resulting in two feature maps, F1 and F2, respectively.

[0048] After adding the two feature maps together, global average pooling is used to calculate a feature map of size 1×1×C.

[0049] Use a fully connected layer to transform the feature map into a d×1 dimension vector;

[0050] The vector is increased in dimension using two fully connected layers respectively;

[0051] The two vectors after dimensionality increase are concatenated, and then softmax is used to select the weights. The obtained weights are multiplied by feature maps F1 and F2 respectively, and the calculated results are added together to obtain f(x). Finally, f(x) is added to the input to obtain the final output.

[0052] The single-leaf tobacco leaf grading method based on dynamically selected convolutional kernel networks, as described above, preferably includes the following step: training the tobacco leaf grading model according to the tobacco leaf quality grade corresponding to each single-leaf tobacco leaf image in the training set.

[0053] The image of a single tobacco leaf is input into the tobacco leaf grading model for calculation and analysis to obtain the image grading result.

[0054] The FocalLoss loss function is used to calculate the loss of the nonlinear transformation result of the softmax function and the tobacco quality grade corresponding to the single tobacco leaf image, so as to obtain the loss value of the tobacco grading model.

[0055] Based on the loss value, the weights of the dynamically selected convolutional kernel network are updated using Adam.

[0056] After updating the weights, the EarlyStopping strategy is used to train the tobacco leaf grading model, and the loss value is monitored. If the training termination condition is met, the iterative training of the tobacco leaf grading model is stopped, and the neural network structure and weight values ​​of the dynamically selected convolutional kernel network are output to obtain the tobacco leaf grading model, wherein:

[0057] The loss calculation of the tobacco grading model by using the FocalLoss loss function to perform nonlinear transformation of the softmax function and the tobacco quality grade corresponding to the single tobacco leaf image to obtain the loss value of the tobacco grading model specifically includes:

[0058] The FocalLoss loss function calculates the loss value using the following formula:

[0059]

[0060] Among them, L fl This represents the loss value calculated by the FocalLoss loss function. γ represents the predicted value of the target after calculation by the tobacco leaf grading model, and γ represents the adjustment factor.

[0061] The single-leaf tobacco leaf grading method based on dynamically selected convolutional kernel networks, as described above, preferably includes the following steps: Obtaining the tobacco leaf grading result based on the trained tobacco leaf grading model and the sample image of the tobacco leaf to be tested.

[0062] The tobacco leaf sample image to be tested is input into the trained tobacco leaf grading model to obtain the tobacco leaf grading result.

[0063] This invention also provides a single tobacco leaf grading system based on a dynamically selected convolutional kernel network, comprising:

[0064] The training set acquisition module is used to acquire multiple single tobacco leaf images as the training set;

[0065] The detail enhancement module is used to perform local detail enhancement processing on each of the single tobacco leaf images in the training set to obtain a detail-enhanced image;

[0066] The quality grading module is used to perform quality grading based on the enhanced detail image to obtain the tobacco quality grade corresponding to each of the single tobacco leaf images in the training set.

[0067] The model building module is used to build a tobacco leaf grading model based on a dynamically selected convolutional kernel network, so as to adaptively select the convolutional kernel.

[0068] The model training module is used to train the tobacco grading model based on the tobacco quality grade corresponding to each of the single tobacco leaf images in the training set.

[0069] The tobacco leaf grading module is used to obtain tobacco leaf grading results based on the trained tobacco leaf grading model and the image of the tobacco leaf sample to be tested.

[0070] This invention provides a method and system for grading single tobacco leaves based on a dynamically selected convolutional kernel network. It acquires tobacco leaf images via a camera, establishes a deep learning tobacco leaf grading model, and learns from a large amount of tobacco leaf data to achieve effective grading, providing technical support for intelligent tobacco leaf sorting. A custom network model based on the dynamically selected convolutional kernel network is constructed to obtain a high-performance tobacco leaf grading network model. The tobacco leaf grading model based on the dynamically selected kernel network automatically grades tobacco leaves, independent of the experience of grading personnel, preventing low accuracy due to insufficient experience, and thus offering greater scientific rigor and accuracy. In image processing, the Canny operator is used to extract tobacco leaves, reducing the impact of image background on the grading model. The Lapalce operator enhances the detailed features of the tobacco leaves, facilitating the network model's extraction of tobacco leaf image features. During model training, FocalLoss is used as the loss function to improve the network's recognition performance for difficult-to-distinguish samples. Attached Figure Description

[0071] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described below with reference to the accompanying drawings, wherein:

[0072] Figure 1 A flowchart illustrating an embodiment of the single-leaf grading method based on dynamically selected convolutional kernel networks provided by the present invention;

[0073] Figure 2 The dual-branch network structure in the dynamic selection convolutional kernel network in the embodiment of the single tobacco leaf grading method based on dynamic selection convolutional kernel network provided by the present invention;

[0074] Figure 3 Test results for dynamically selecting convolutional kernel network models;

[0075] Figure 4 This is a structural block diagram of an embodiment of the single tobacco leaf grading system based on dynamically selected convolutional kernel networks provided by the present invention. Detailed Implementation

[0076] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. The descriptions of the exemplary embodiments are merely illustrative and are in no way intended to limit the present disclosure or its application or use. The present disclosure may be implemented in many different forms and is not limited to the embodiments described herein. These embodiments are provided so that the present disclosure will be thorough and complete, and will fully express the scope of the disclosure to those skilled in the art. It should be noted that, unless specifically stated otherwise, the relative arrangement of components and steps, the composition of materials, numerical expressions, and values ​​set forth in these embodiments should be interpreted as exemplary only and not as limiting.

[0077] The terms “first,” “second,” and similar terms used in this disclosure do not indicate any order, quantity, or importance, but are merely used to distinguish different parts. Terms such as “including” or “contains” mean that the element preceding the term encompasses the element listed after it, and do not exclude the possibility of encompassing other elements as well. Terms such as “above” and “below” are used only to indicate relative positional relationships; when the absolute position of the described object changes, this relative positional relationship may also change accordingly.

[0078] In this disclosure, when a specific component is described as being located between a first component and a second component, an intermediary component may or may not be present between the specific component and the first or second component. When a specific component is described as connecting to other components, the specific component may be directly connected to the other components without having an intermediary component, or it may not be directly connected to the other components but may have an intermediary component.

[0079] All terms used in this disclosure (including technical or scientific terms) have the same meaning as understood by one of ordinary skill in the art to which this disclosure pertains, unless otherwise specifically defined. It should also be understood that terms defined in a general dictionary, such as a dictionary, should be interpreted as having a meaning consistent with their meaning in the context of the relevant art, and not as having an idealized or highly formalized meaning, unless expressly defined herein.

[0080] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, they should be considered part of the specification.

[0081] like Figure 1 As shown, the single-leaf grading method based on dynamically selected convolutional kernel networks provided in this embodiment includes the following steps in actual implementation:

[0082] Step S1: Obtain multiple single tobacco leaf images as a training set.

[0083] In one embodiment of the single-leaf grading method based on dynamically selected convolutional kernel network of the present invention, step S1 may specifically include:

[0084] Step S11: Lay multiple single tobacco leaves flat on the photography platform in sequence.

[0085] Step S12: Place the leaf tips in a fixed direction and take a photo.

[0086] Step S13: Classify and store the captured images according to the tobacco leaf grade.

[0087] In some embodiments of the present invention, a total of 20 images of tobacco leaves of different grades are collected.

[0088] Step S2: Perform local detail enhancement processing on each of the single tobacco leaf images in the training set to obtain a detail-enhanced image.

[0089] In one embodiment of the single tobacco leaf grading method based on dynamically selected convolutional kernel network of the present invention, step S2 may specifically include:

[0090] Step S21: Perform convolution noise reduction processing on the single tobacco leaf image using a Gaussian smoothing filter.

[0091] Step S22: Use the Canny operator to extract the tobacco leaf edges in the tobacco leaf image to obtain a tobacco leaf image after removing the background.

[0092] The Canny operator is used to extract tobacco leaves, reducing the impact of image background on the tobacco leaf grading model. Specifically, for the single tobacco leaf image, the image gradient is calculated using the Canny operator with the following formula:

[0093]

[0094]

[0095]

[0096] Among them, S x S represents the mask template in the horizontal direction. y G represents the mask template in the vertical direction. x G represents the pixel gradient matrix in the horizontal direction of the image. y Let I represent the image pixel gradient matrix in the vertical direction, and let G represent the image pixel gradient intensity matrix.

[0097] Step S23: Use the Laplace operator to extract tobacco leaf texture features, and overlay the tobacco leaf texture features with the original tobacco leaf image to enhance the local detail features of the tobacco leaf and obtain a detail-enhanced image.

[0098] The Laplace operator enhances the detailed features of tobacco leaves, which is beneficial for the network model to extract features from tobacco leaf images. Specifically, the Laplace operator is used to sharpen the image of the tobacco leaves after removing the background using the following formula:

[0099] ▽ 2 f(x,y)=f(x+1,y)+f(x-1,y)+f(x,y+1)+f(x,y-1)-4f(x,y),

[0100]

[0101] Where f(x,y) represents the graph function, ▽ 2 f(x,y) represents the second derivative of the Laplace operation, g(x,y) represents the sharpened image function, and t represents the comparison coefficient of the neighborhood center. The Laplace operator sharpening operation determines the corresponding transformation method by comparing the average gray level of the center pixel of the neighborhood with the average gray level of other pixels in its neighborhood.

[0102] Step S3: Perform quality grading based on the enhanced detail images to obtain the tobacco quality grade corresponding to each single tobacco leaf image in the training set.

[0103] In one embodiment of the single tobacco leaf grading method based on dynamically selected convolutional kernel network of the present invention, step S3 may specifically include:

[0104] Step S31: Perform at least one of the following operations on the detail-enhanced image: random rotation, flipping, and translation, to obtain a data-enhanced image.

[0105] Data augmentation can increase the amount of data and improve the generalization ability of the model.

[0106] Step S32: Normalize the data-enhanced image.

[0107] Specifically, the enhanced image is normalized using the following formula:

[0108]

[0109] Where x represents the value of a pixel in the image, x max x represents the maximum pixel value of a pixel in the same image. min This represents the minimum pixel value of a pixel in the same image.

[0110] Step S33: Standardize the data-enhanced image after normalization.

[0111] Specifically, the normalized image is standardized using the following formula:

[0112]

[0113] Where x represents the value of the image pixels, μ represents the mean, with a value of [0.485, 0.456, 0.406], and σ represents the standard deviation, with a value of [0.229, 0.224, 0.225].

[0114] Step S34: Based on the standardization processing results, assign a grade label to the data-enhanced image. The grade label is used to classify the quality of the tobacco sample image to obtain the tobacco quality grade.

[0115] Step S4: Build a tobacco leaf grading model based on a dynamically selected convolutional kernel network, wherein the dynamically selected convolutional kernel network can adaptively and dynamically select convolutional kernels.

[0116] like Figure 2 As shown, in step S4, a convolutional neural network is constructed, and a dual-branch structure is added to the network structure module. In one embodiment of the single-leaf tobacco leaf grading method based on dynamically selected convolutional kernel network of the present invention, step S4 may specifically include:

[0117] Step S41: For the input feature map, the dual-branch structure extracts features using convolution kernels of different sizes to obtain feature maps of two branches, namely F1 and F2.

[0118] Step S42: After adding the two feature maps together, use global average pooling to calculate a feature map of size 1×1×C.

[0119] Step S43: Use a fully connected layer to convert the feature map into a d×1 dimension vector.

[0120] Step S44: Use two fully connected layers to increase the dimension of the vector.

[0121] Step S45: Concatenate the two vectors after dimensionality increase, then use softmax to select weights, and multiply the obtained weights by feature map F1 and feature map F2 respectively. Add the calculated results to obtain f(x), and finally add it to the input to obtain the final output.

[0122] Since the sum of the values ​​obtained after using the softmax function equals 1, it is possible to assign weights to the feature maps in the branches. Because the convolutional kernel sizes are different in different branches, the network calculates different weights for different branches. The branch with the larger weight indicates that the convolutional kernel of that branch extracts better features, that is, the network can adaptively and dynamically select the appropriate convolutional kernel.

[0123] Step S5: Train the tobacco grading model according to the tobacco quality grade corresponding to each single tobacco leaf image in the training set.

[0124] In one embodiment of the single tobacco leaf grading method based on dynamically selected convolutional kernel network of the present invention, step S5 may specifically include:

[0125] Step S51: Input the single tobacco leaf image into the tobacco leaf grading model for calculation and analysis to obtain the image grading result.

[0126] Specifically, images of individual tobacco leaves with assigned grade labels are input into a convolutional neural network for calculation and analysis to obtain image grading results.

[0127] Step S52: Use the FocalLoss loss function to calculate the loss between the nonlinear transformation result of the softmax function and the tobacco quality grade corresponding to the single tobacco leaf image, and obtain the loss value of the tobacco grading model.

[0128] Using FocalLoss as the loss function improves the network's ability to identify difficult-to-distinguish samples. Specifically, the FocalLoss loss function calculates the loss value using the following formula:

[0129]

[0130] Among them, L fl This represents the loss value calculated by the FocalLoss loss function. This represents the predicted value of the target after calculation by the tobacco grading model. It is generally the result of softmax calculation. γ represents the adjustment factor. The larger the value, the more the model focuses on easy and difficult samples.

[0131] Step S53: Based on the loss value, update the weights of the dynamically selected convolutional kernel network using Adam.

[0132] Step S54: After updating the weights, the EarlyStopping strategy is used to train the tobacco grading model and monitor the loss value. If the training termination condition is met, the iterative training of the tobacco grading model is stopped, and the neural network structure and weight values ​​of the dynamically selected convolutional kernel network are output to obtain the tobacco grading model.

[0133] Step S6: Obtain the tobacco grading result based on the trained tobacco grading model and the image of the tobacco sample to be tested.

[0134] Specifically, the image of the tobacco leaf sample to be tested is input into the trained tobacco leaf grading model to obtain the tobacco leaf grading result. In a specific implementation, the trained tobacco leaf grading model is loaded, and the image of the tobacco leaf sample to be tested is input into the tobacco leaf grading model to obtain the grading result.

[0135] Furthermore, in some embodiments of the present invention, the single-leaf grading method based on dynamically selected convolutional kernel networks further includes:

[0136] Step S7: Verify the accuracy of the tobacco grading model based on the tobacco grading results obtained through the tobacco grading model and the actual grade of the tobacco leaves.

[0137] Specifically, a total of 140 images were tested, and the accuracy rate of tobacco leaf grading was 82.14%. See the detailed test results below. Figure 3 As shown.

[0138] The single-leaf tobacco leaf grading method based on dynamically selected convolutional kernel networks provided in this invention acquires tobacco leaf images through a camera, establishes a deep learning tobacco leaf grading model, and learns from a large amount of tobacco leaf data to achieve better grading of tobacco leaves, providing technical support for intelligent tobacco leaf sorting. A custom network model based on dynamically selected convolutional kernel networks can be constructed to obtain a high-performance tobacco leaf grading network model. The tobacco leaf grading model based on dynamically selected kernel networks automatically grades tobacco leaves, without relying on the experience of tobacco leaf graders, preventing the problem of low accuracy due to insufficient experience of graders, making it more scientific and accurate. In image processing, the Canny operator is used to extract tobacco leaves, reducing the influence of image background on the tobacco leaf grading model; the Lapalce operator is used to enhance the detailed features of tobacco leaves, which is beneficial for the network model to extract tobacco leaf image features; during model training, FocalLoss is used as the loss function to improve the network's recognition effect on difficult-to-distinguish samples.

[0139] Accordingly, such as Figure 4 As shown, the present invention also provides a single tobacco leaf grading system based on a dynamically selected convolutional kernel network, comprising:

[0140] Training set acquisition module 1 is used to acquire multiple single tobacco leaf images as a training set;

[0141] Detail enhancement module 2 is used to perform local detail enhancement processing on each of the single tobacco leaf images in the training set to obtain a detail-enhanced image;

[0142] Quality grading module 3 is used to perform quality grading based on the enhanced detail image to obtain the tobacco quality grade corresponding to each single tobacco leaf image in the training set.

[0143] Model building module 4 is used to build a tobacco leaf grading model based on a dynamically selected convolutional kernel network, so as to adaptively select the convolutional kernel.

[0144] Model training module 5 is used to train the tobacco grading model based on the tobacco quality grade corresponding to each of the single tobacco leaf images in the training set.

[0145] The tobacco leaf grading module 6 is used to obtain the tobacco leaf grading result based on the trained tobacco leaf grading model and the image of the tobacco leaf sample to be tested.

[0146] The single-leaf tobacco leaf grading system based on dynamically selected convolutional kernel networks provided in this invention acquires tobacco leaf images through a camera, establishes a deep learning tobacco leaf grading model, and learns from a large amount of tobacco leaf data to effectively grade tobacco leaves, providing technical support for intelligent tobacco leaf sorting. A high-performance tobacco leaf grading network model can be obtained by custom-constructing a network model based on dynamically selected convolutional kernel networks. The system automatically grades tobacco leaves without relying on the experience of grading personnel, preventing low accuracy due to insufficient experience, and is more scientific and accurate.

[0147] The embodiments of this disclosure have now been described in detail. To avoid obscuring the concept of this disclosure, some details known in the art have not been described. Those skilled in the art can fully understand how to implement the technical solutions disclosed herein based on the above description.

[0148] While specific embodiments of this disclosure have been described in detail by way of examples, those skilled in the art should understand that the examples are for illustrative purposes only and not intended to limit the scope of this disclosure. Those skilled in the art should understand that modifications can be made to the above embodiments or equivalent substitutions can be made to some technical features without departing from the scope and spirit of this disclosure. The scope of this disclosure is defined by the appended claims.

Claims

1. A single-leaf tobacco grading method based on a dynamically selected convolutional kernel network, characterized in that, include: Multiple single tobacco leaf images were acquired as a training set; Local detail enhancement processing is performed on each of the single tobacco leaf images in the training set to obtain a detail-enhanced image; Quality grading is performed based on the enhanced detail images to obtain the tobacco quality grade corresponding to each single tobacco leaf image in the training set; A tobacco leaf grading model is built based on a dynamically selected convolutional kernel network, which can adaptively and dynamically select convolutional kernels. The tobacco leaf grading model is trained based on the tobacco leaf quality grade corresponding to each single tobacco leaf image in the training set. Based on the trained tobacco leaf grading model and the images of the tobacco leaf samples to be tested, the tobacco leaf grading results are obtained. The step of performing local detail enhancement processing on each of the single tobacco leaf images in the training set to obtain a detail-enhanced image specifically includes: The image of the single tobacco leaf was subjected to convolutional noise reduction processing using a Gaussian smoothing filter. The Canny operator is used to extract the tobacco leaf edges from the tobacco leaf image to obtain a tobacco leaf image after removing the background. The Laplace operator is used to extract tobacco leaf texture features, which are then superimposed on the original tobacco leaf image to enhance local details and obtain a detail-enhanced image.

2. The single tobacco leaf grading method based on the dynamic selection convolution kernel network according to claim 1, wherein, The acquisition of multiple single tobacco leaf images as a training set specifically includes: Several single tobacco leaves were laid flat on the photography platform in sequence; Take a photo after placing the leaf tips with a fixed direction; The captured images are categorized and stored according to the tobacco leaf grade.

3. The single leaf tobacco grading method based on dynamic selection kernel network according to claim 1, wherein, The step of using the Canny operator to extract the tobacco leaf edges from the tobacco leaf image to obtain a tobacco leaf image after removing the background specifically includes: For the single tobacco leaf image, the image gradient is calculated using the Canny operator with the following formula: , , , in, This represents a mask template in the horizontal direction. This represents the mask template in the vertical direction. This represents the pixel gradient matrix of the image in the horizontal direction. This represents the pixel gradient matrix of the image in the vertical direction. Represents an image matrix. Represents the gradient intensity matrix of image pixels. The step of using the Laplace operator to extract tobacco leaf texture features and then overlaying these features with the original tobacco leaf image to enhance local details and obtain a detail-enhanced image includes: The image of the tobacco leaves after removing the background is sharpened using the Laplace operator according to the following formula: , , in, Represents the image function. This represents the second derivative of the Laplace operation. The function representing the sharpened image. The comparison coefficient represents the neighborhood center.

4. The single-leaf grading method based on dynamically selected convolutional kernel network according to claim 1, characterized in that, The step of performing quality grading based on the enhanced detail images to obtain the tobacco leaf quality grade corresponding to each of the individual tobacco leaf images in the training set specifically includes: Perform at least one of the following operations on the detail-enhanced image: random rotation, flipping, and translation, to obtain a data-enhanced image; The data-enhanced image is then normalized. The data-enhanced image after normalization is then standardized. Based on the standardization processing results, the data-enhanced images are assigned grade labels, which are used to classify the quality of tobacco leaf sample images to obtain tobacco leaf quality grades.

5. The single-leaf grading method based on dynamically selected convolutional kernel network according to claim 4, characterized in that, The normalization process for the data-enhanced image specifically includes: The enhanced image is normalized using the following formula: , in, This represents the numerical value of an image pixel. This represents the maximum pixel value of a pixel in the same image. This represents the minimum pixel value of a pixel in the same image. The standardization process for the normalized data-enhanced image specifically includes: The normalized image is standardized using the following formula: , in, This represents the numerical value of an image pixel. This represents the mean. It represents the standard deviation.

6. The single-leaf grading method based on dynamically selected convolutional kernel network according to claim 1, characterized in that, The tobacco leaf grading model built based on dynamically selected convolutional kernel networks specifically includes: Construct a convolutional neural network and add a dual-branch structure to the network structure module, specifically including: For the input feature map, the dual-branch structure extracts features using convolutional kernels of different sizes, resulting in two feature maps, F1 and F2, respectively. After adding the two feature maps, global average pooling is used to calculate the result. Size feature map; This feature map is transformed using a fully connected layer. A vector of dimension; The vector is increased in dimension using two fully connected layers respectively; The two vectors after dimensionality increase are concatenated, then softmax is used to select weights, and the resulting weights are multiplied by feature maps F1 and F2 respectively. The results are then summed to obtain the final value. Finally, the result is added to the input to obtain the final output.

7. The single-leaf grading method based on dynamically selected convolutional kernel network according to claim 1, characterized in that, The step of training the tobacco leaf grading model based on the tobacco leaf quality grade corresponding to each of the individual tobacco leaf images in the training set specifically includes: The image of a single tobacco leaf is input into the tobacco leaf grading model for calculation and analysis to obtain the image grading result. The FocalLoss loss function is used to calculate the loss of the nonlinear transformation result of the softmax function and the tobacco quality grade corresponding to the single tobacco leaf image, so as to obtain the loss value of the tobacco grading model. Based on the loss value, the weights of the dynamically selected convolutional kernel network are updated using Adam. After updating the weights, the EarlyStopping strategy is used to train the tobacco leaf grading model, and the loss value is monitored. If the training termination condition is met, the iterative training of the tobacco leaf grading model is stopped, and the neural network structure and weight values ​​of the dynamically selected convolutional kernel network are output to obtain the tobacco leaf grading model, wherein: The loss calculation of the tobacco grading model by using the FocalLoss loss function to perform nonlinear transformation of the softmax function and the tobacco quality grade corresponding to the single tobacco leaf image to obtain the loss value of the tobacco grading model specifically includes: The FocalLoss loss function calculates the loss value using the following formula: , in, This represents the loss value calculated by the FocalLoss loss function. This represents the predicted value of the target after calculation by the tobacco leaf grading model. This indicates a regulatory factor.

8. The method for grading single tobacco leaves based on dynamically selected convolutional kernel networks according to claim 1, characterized in that, The step of obtaining tobacco leaf grading results based on the trained tobacco leaf grading model and the images of the tobacco leaf samples to be tested specifically includes: The tobacco leaf sample image to be tested is input into the trained tobacco leaf grading model to obtain the tobacco leaf grading result.

9. A single tobacco leaf grading system based on a dynamically selected convolutional kernel network, employing the method described in any one of claims 1-8, characterized in that, include: The training set acquisition module is used to acquire multiple single tobacco leaf images as the training set; The detail enhancement module is used to perform local detail enhancement processing on each of the single tobacco leaf images in the training set to obtain a detail-enhanced image; The quality grading module is used to perform quality grading based on the enhanced detail image to obtain the tobacco quality grade corresponding to each of the single tobacco leaf images in the training set. The model building module is used to build a tobacco leaf grading model based on a dynamically selected convolutional kernel network, so as to adaptively select the convolutional kernel. The model training module is used to train the tobacco grading model based on the tobacco quality grade corresponding to each of the single tobacco leaf images in the training set. The tobacco leaf grading module is used to obtain tobacco leaf grading results based on the trained tobacco leaf grading model and the image of the tobacco leaf sample to be tested.

Citation Information

Patent Citations

  • Tobacco leaf grading method and system, terminal equipment and storage medium

    CN111915580A

  • Tobacco leaf grading method based on Faster R-CNN network

    CN113159083A