Intelligent identification method for flue-cured tobacco grading and sorting

By using an improved MobileNetV3 network and an entropy weight method-attention fusion module, combined with a dual-modal feature acquisition and domain adaptation module, the problems of low accuracy and low sorting efficiency in the grading of niche flue-cured tobacco are solved, achieving efficient and stable grading and sorting of flue-cured tobacco, which is suitable for embedded devices.

CN121890775APending Publication Date: 2026-04-21YUNNAN TOBACCO CORP QUJING BRANCH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
YUNNAN TOBACCO CORP QUJING BRANCH
Filing Date
2026-02-05
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing intelligent grading technology for flue-cured tobacco suffers from insufficient sample size and overfitting issues for niche and specialty varieties, resulting in low grading accuracy. Furthermore, it lacks efficient linkage with the sorting execution unit and is difficult to adapt to embedded devices, leading to poor grading stability and low efficiency.

Method used

An improved MobileNetV3 network combined with an entropy weight method-attention fusion module is used to construct a general and variety-specific feature library. The ProtoNet meta-learning framework is used to quickly adapt the features of niche flue-cured tobacco. By combining dual-modal feature acquisition and fusion, a contrastive learning loss function and a domain adaptation module are introduced to generate an optimized training dataset, achieving cross-batch grading stability. Grading and sorting are performed through embedded devices.

Benefits of technology

It improves the accuracy of grading and identifying niche flue-cured tobacco to 96.8%, reduces the risk of overfitting, increases sorting efficiency by 3 times, and is compatible with embedded devices to achieve efficient grading and sorting in field curing barns.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121890775A_ABST
    Figure CN121890775A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent identification method for flue-cured tobacco grading and sorting. The intelligent identification method comprises the following steps: step 1) constructing and training a flue-cured tobacco grading identification model; 2) bimodal feature acquisition and fusion processing; 3) optimizing a small sample data set; step 4) grading identification precision calibration; and 5) performing identification and sorting linkage execution. According to the method, the precision and generalization ability are excellent, and the grading recognition precision is improved to 96.8% and is improved by 8.3% compared with that of a traditional method by relying on cross-variety migration, meta-learning double mechanisms, matching domain self-adaption and two-dimensional threshold calibration technologies aiming at the problem of shortage of single-grade samples of small-scale flue-cured tobaccos; meanwhile, the over-fitting risk is effectively controlled, the precision difference between a verification set and a test set is only 1.7%, the flue-cured tobaccos of different planting and baking batches can be stably adapted, and the bottleneck of poor cross-batch generalization in the prior art is thoroughly solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of tobacco processing technology, and in particular to an intelligent identification method for grading and sorting flue-cured tobacco. Background Technology

[0002] Grading and sorting of flue-cured tobacco is a core link in the tobacco processing industry chain, directly determining the accuracy of tobacco leaf quality grading, subsequent processing efficiency, and commercial value. Traditional flue-cured tobacco grading relies on manual labor, and grading standards are heavily influenced by the operator's experience and subjective judgment, resulting in poor grading consistency, low efficiency, and high labor intensity, making it difficult to meet the demands of large-scale, standardized production. With the development of artificial intelligence and automation technologies, intelligent grading and sorting technology for flue-cured tobacco is gradually replacing manual operation, becoming an important direction for industry upgrading.

[0003] Existing intelligent grading technologies for flue-cured tobacco are mostly based on computer vision or single-spectral analysis, combined with deep learning models to achieve grading identification. This technology has been applied to some extent to major flue-cured tobacco varieties, and by collecting massive amounts of samples to train the model, accurate identification of conventional grades can be achieved. However, in actual production, niche and specialty flue-cured tobacco varieties, due to their small planting scale and strong regional specificity, often have fewer than 100 samples per grade, leading to numerous bottlenecks in existing technologies.

[0004] Existing deep learning models rely on massive amounts of samples for training, making them prone to overfitting in small-sample scenarios. Furthermore, traditional transfer learning simply reuses parameters from models of major varieties, failing to accurately adapt to the specific characteristics of niche varieties, leading to a significant decrease in grading accuracy. On the other hand, existing technologies often employ single feature extraction methods. Visual features are easily affected by surface deposits and roasting differences, while spectral features struggle to meet the grading requirements based on external morphology. Additionally, sample expansion often uses general image enhancement algorithms, generating samples that deviate from the characteristics of the flue-cured tobacco process, thus failing to effectively improve the model's generalization ability.

[0005] Meanwhile, existing technologies mostly focus on the grading and identification process, lack efficient linkage with the sorting execution unit, and do not have an adaptation mechanism designed for the cross-batch characteristic fluctuations of niche varieties. This results in poor grading stability of the model on different planting and baking batches of samples, and a high misjudgment rate of critical grades. In addition, some complex models have a large number of parameters and cannot be adapted to embedded devices, which limits their promotion and application in fields, drying rooms and other scenarios.

[0006] Therefore, an intelligent identification method for grading and sorting flue-cured tobacco is proposed. Summary of the Invention

[0007] This application aims to at least partially solve one of the technical problems in the aforementioned technologies.

[0008] To achieve the above objectives, the first aspect of this application proposes an intelligent identification method for grading and sorting flue-cured tobacco, comprising the following steps:

[0009] Step 1) Construct and train the flue-cured tobacco grading identification model: Collect bulk flue-cured tobacco samples, construct a general grading feature library and a variety-specific feature library, use an improved MobileNetV3 as the base network, and connect the entropy weight method-attention fusion module to assign no less than 75% weight to general grading features such as leaf vein density, oil distribution, and chlorophyll residue spectrum and strengthen their extraction, while weakening the interference of bulk flue-cured tobacco-specific features. After training, freeze the network convolutional layer parameters to obtain a general grading feature extractor. Based on the ProtoNet meta-learning framework, split the niche flue-cured tobacco samples into a support set of 60% and a query set of 40%, and construct a training task set based on the flue-cured tobacco sub-grades. By calculating the feature prototype vectors of each grade sample, drive the model to quickly learn the grade-specific features of niche flue-cured tobacco, only fine-tune the model classification head and attention module parameters, and introduce a contrastive learning loss function to widen the gap between the feature prototype vectors of different grades, thus completing the construction and training of the flue-cured tobacco grading identification model.

[0010] Step 2) Dual-modal feature acquisition and fusion processing: RGB images of flue-cured tobacco leaves are acquired at the visual end. After dust filtering submodule to remove interference from surface attachments, leaf vein region segmentation preprocessing is performed to extract external grading features such as color, shape, and surface oil gloss. At the spectral end, a near-infrared spectrometer in the 900-1700nm band is used to acquire sample spectral data. After wavelet transform denoising processing, spectral features reflecting internal oil content, maturity, and fiber density are extracted. Through a gated attention fusion unit, dual-modal feature weights are dynamically allocated according to the sample size of niche flue-cured tobacco. After fusion, redundant information is removed by the t-SNE feature dimensionality reduction module to obtain the core grading feature set.

[0011] Step 3) Small sample dataset optimization: Perform the baking color gradient enhancement and damaged area texture transfer filling operations sequentially on the niche flue-cured tobacco samples. Collect the standard color range of niche flue-cured tobacco and limit the fluctuation boundary of color enhancement. Construct a grade conditional generative adversarial network. Using the features of the same grade of bulk flue-cured tobacco samples and the features of a small number of niche flue-cured tobacco samples as input conditions, generate niche flue-cured tobacco samples of each grade with a consistency of no less than 92% with the real samples. After the discriminator verifies the authenticity of the samples and the grade matching degree, mix the generated samples with the original samples in a 1:1 ratio to obtain the optimized training dataset. Use it to iteratively optimize the flue-cured tobacco grading recognition model constructed in Step 1.

[0012] Step 4) Accuracy calibration of hierarchical identification: Introduce the Domain Adaptive Module (DANN), set the bulk flue-cured tobacco samples as the source domain and the samples from different batches of niche flue-cured tobacco as the target domain. Through adversarial training between the domain discriminator and the feature extractor, the model learns domain-invariant hierarchical features. Construct a two-dimensional threshold adjustment mechanism based on feature similarity and expert rules, calculate the cosine similarity between the predicted sample and the critical level sample, call the level determination rule base labeled by experts to dynamically adjust the hierarchical threshold, and perform dual-modal feature cross-validation on the critical samples.

[0013] Step 5) Identification and sorting linkage execution: The tobacco grade label output in step 4) is converted into a sorting control signal, which triggers the sorting execution unit of the embedded grading and sorting equipment, drives the pushing mechanism to transport the corresponding tobacco leaves to the collection channel of the matching grade, and completes the whole process of flue-cured tobacco grading and sorting.

[0014] In addition, the intelligent identification method for grading and sorting flue-cured tobacco proposed in this application may also have the following additional technical features:

[0015] As a further description of the above technical solution:

[0016] The number of samples collected for the bulk flue-cured tobacco mentioned in step 1) shall not be less than 15,000.

[0017] As a further description of the above technical solution:

[0018] The dynamic allocation of bimodal feature weights in step 2) is as follows: when the sample size of a single grade of niche flue-cured tobacco is ≤80, the weight of spectral features is set to 40% and the weight of visual features is set to 60%; when the sample size of a single grade of niche flue-cured tobacco is ≥100, the weight of visual features is set to 65% and the weight of spectral features is set to 35%.

[0019] As a further description of the above technical solution:

[0020] The discriminator verification in step 3) specifically involves: first, judging the authenticity of the input sample, then verifying the matching degree between the sample features and the corresponding subdivision level grading standard, and retaining only the generated samples that are authentic and match the level.

[0021] As a further description of the above technical solution:

[0022] The domain-invariant grading feature mentioned in step 4) is a core grading feature that is not affected by the flue-cured tobacco variety, planting batch, or curing batch.

[0023] As a further description of the above technical solution:

[0024] The contrastive learning loss function described in step 1) is used to reduce the feature vector spacing of samples at the same level, while increasing the feature vector spacing of samples at different levels, thereby enhancing the distinction of the hierarchical boundary.

[0025] As a further description of the above technical solution:

[0026] The fusion method of external hierarchical features and internal hierarchical features described in step 2) is to output fused features after weighted summation of the dual-modal features through a gated attention fusion unit.

[0027] As a further description of the above technical solution:

[0028] The constraint enhancement operation based on the standard color range described in step 3) is as follows: based on the standard color range of niche flue-cured tobacco, set upper and lower thresholds for color enhancement to prevent the generation of invalid samples that exceed the inherent characteristics of the variety.

[0029] As a further description of the above technical solution:

[0030] The specific steps of the dual-modal feature cross-validation in step 4) are as follows: if the visual feature recognition result is consistent with the spectral feature recognition result, the level label is directly output; if the two recognition results are inconsistent, it is determined to be a critical sample, and the level determination rule base and dynamic threshold are called again for secondary verification.

[0031] As a further description of the above technical solution:

[0032] The total number of parameters of the flue-cured tobacco grading and identification model described in step 1) is controlled within 8M. When adapted to embedded grading and sorting equipment, the inference and sorting speed is not less than 15 frames / second.

[0033] According to the present application, an intelligent identification method for grading and sorting flue-cured tobacco exhibits excellent accuracy and generalization ability. Addressing the problem of insufficient single-grade sample size for niche flue-cured tobacco, the method relies on cross-variety transfer and meta-learning dual mechanisms, combined with domain adaptation and dual-dimensional threshold calibration technology, to improve the grading identification accuracy to 96.8%, which is 8.3% higher than traditional methods.

[0034] At the same time, it effectively controls the risk of overfitting, with an accuracy difference of only 1.7% between the validation set and the test set. It can stably adapt to niche flue-cured tobacco from different planting and curing batches, and completely solve the bottleneck of poor cross-batch generalization of existing technologies.

[0035] The sorting efficiency has been greatly improved. An improved lightweight network architecture is adopted, with an inference sorting speed of 16.2 frames / second. Combined with a pneumatic push mechanism with a response time of 42ms, it realizes efficient linkage between grading and sorting, with a sorting accuracy of 95.6%. The overall efficiency is 3 times higher than that of traditional intelligent grading methods, far exceeding the processing capacity of manual and single-module technologies.

[0036] It is highly practical and the overall parameters of the solution are simplified and adapted to embedded devices. It can be directly deployed in production front-line scenarios such as fields and drying rooms without the need for complex supporting facilities.

[0037] It ensures the comprehensiveness of feature extraction while avoiding interference from invalid samples. Multiple technologies work together to form a complete technology chain, which is both innovative in algorithm and meets the actual production needs of the tobacco industry.

[0038] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description

[0039] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:

[0040] Figure 1 This is a schematic flowchart of an intelligent identification method for grading and sorting flue-cured tobacco according to an embodiment of this application;

[0041] Figure 2 This is a system architecture diagram of an intelligent identification method for grading and sorting flue-cured tobacco according to an embodiment of this application. Detailed Implementation

[0042] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.

[0043] The following describes an intelligent identification method for grading and sorting flue-cured tobacco according to an embodiment of this application, with reference to the accompanying drawings.

[0044] like Figure 1 As shown in Embodiment 1 of this application, an intelligent identification method for grading and sorting flue-cured tobacco may include the following steps:

[0045] Step 1) Construct and train a flue-cured tobacco grading identification model: Collect no less than 15,000 large-volume flue-cured tobacco samples, construct a general grading feature library and a variety-specific feature library, use the MobileNetV3-Small improved network as the base network, and connect the entropy weight method-attention fusion module. Quantify the importance of features through entropy weight calculation and focus on core features through the attention mechanism. Assign no less than 75% weight to general grading features such as leaf vein density, oil distribution, and chlorophyll residue spectrum and strengthen their extraction, while weakening the interference of large-volume flue-cured tobacco-specific features. After training, freeze the convolutional layer parameters to obtain a general grading feature extractor, which can reduce invalid feature learning and improve the targeting of feature extraction. Based on the ProtoNet meta-learning framework, split the niche flue-cured tobacco samples into a support set of 60% and a query set of 40%, construct a training task set based on the flue-cured tobacco sub-grade as the category, and achieve rapid adaptation of small samples by calculating the feature prototype vectors of each grade. Only fine-tune the model classification head and attention module parameters, introduce a contrastive learning loss function to widen the feature prototype spacing of different grades, avoid overfitting of small samples, strengthen the grading boundary discrimination, and complete the model training.

[0046] Step 2) Dual-modal feature acquisition and fusion processing: At the visual end, RGB images of flue-cured tobacco leaves are acquired using an industrial camera (model Basler acA1920-155um). The dust filtering submodule (based on the Otsu threshold segmentation principle) removes interference from surface attachments. Then, the leaf vein region is preprocessed to extract external grading features such as color, shape, and surface oil gloss. At the spectral end, Ocean Optics STS-VIS-NIR near-infrared spectrometer (detection band 900-1700nm) is used to acquire spectral data. After wavelet transform denoising, noise is suppressed by multi-scale decomposition, and effective spectral information is retained to extract internal oil content, maturity, and fiber density features. This can compensate for the deficiency that a single visual feature cannot characterize the internal quality. Through a gated attention fusion unit based on the SENet structure, the dual-modal weights are dynamically allocated to adapt to the sample size difference. After fusion, redundant information is removed by the t-SNE feature dimensionality reduction module to obtain the core grading feature set, which can improve the integrity of feature dimensions and the efficiency of redundant removal.

[0047] Step 3) Small Sample Dataset Optimization: For niche flue-cured tobacco samples, sequentially perform operations such as enhancing the color gradient during baking and filling the texture transfer of damaged areas. Collect the standard color range of niche flue-cured tobacco and limit the enhancement boundary. Constrain the sample generation range according to the characteristics of flue-cured tobacco baking process. Construct a Conditional DCGAN-type grade-based generative adversarial network. Use the characteristics of the same grade of bulk flue-cured tobacco and a small number of samples of niche flue-cured tobacco as input conditions. Use the generator and discriminator to train adversarially to generate highly realistic samples. The discriminator simultaneously verifies the authenticity of the samples and the grade matching degree. Generate samples with a consistency of no less than 92% with real samples. Mix the generated samples and the original samples at a 1:1 ratio to obtain the optimized dataset. Iterative optimization of the model in Step 1) can solve the problem of scarce small sample data, avoid the generation of invalid samples by general enhancement, and improve the quality of model training data.

[0048] Step 4) Graded Identification Accuracy Calibration: Introducing a DANN domain adaptive module, the bulk flue-cured tobacco samples are set as the source domain, and samples from different batches of niche flue-cured tobacco are set as the target domain. Through adversarial training between the domain discriminator and the feature extractor, the model is forced to learn domain-invariant graded features (unaffected by variety or batch), which can improve the stability of cross-batch graded classification. A two-dimensional threshold adjustment mechanism based on feature similarity and expert rules is constructed, which dynamically corrects the threshold by combining cosine similarity calculation and expert annotation rules. Dual-modal feature cross-validation is performed on critical samples, which can reduce the misjudgment rate of critical grades and ensure graded accuracy.

[0049] Step 5) Identification and sorting linkage execution: The grade label is converted into a sorting control signal, which triggers the SMC CDJ2B16-50 pneumatic pushing mechanism of the embedded grading and sorting equipment. The pneumatic drive is used to realize rapid pushing and sorting, and the tobacco leaves are transported to the matching grade collection channel. It can realize the integrated closed loop of identification, grading and sorting, is compatible with embedded equipment, and has a sorting speed of no less than 15 frames / second, which meets the needs of on-site production.

[0050] like Figure 1 As shown:

[0051] In step 1), the number of parameters of the MobileNetV3-Small improved network is controlled within 8M. The parameters are simplified through lightweight network structure design, which can be adapted to embedded devices (such as NVIDIA Jetson Nano) and take into account both inference speed and device deployment compatibility.

[0052] like Figure 1 As shown:

[0053] In step 2), the rule for dynamically allocating the weights of dual-modal features is as follows: when the sample size of a single grade of niche flue-cured tobacco is ≤80, the weight of spectral features is 40% and the weight of visual features is 60%; when the sample size is ≥100, the weight of visual features is 65% and the weight of spectral features is 35%. By adjusting the feature reliability weights based on the sample size, robustness is improved by relying on the stability of spectral features when the sample size is small, and the dominance of visual features is strengthened when the sample size is sufficient, thus adapting to different data volume scenarios.

[0054] like Figure 1 As shown:

[0055] In step 3), the generator of Conditional DCGAN adopts a U-Net structure. Through the encoder-decoder architecture, it restores the texture details of flue-cured tobacco leaves. The generated samples have higher consistency with the real samples in terms of leaf veins and oil distribution texture, which further improves the effectiveness of model training.

[0056] like Figure 1 As shown:

[0057] Step 4) Extraction of domain-invariant hierarchical features is achieved through a gradient inversion layer. By inverting the gradient signal of the domain discriminator, the feature extractor is forced to learn the domain-generalized features, which can effectively reduce the feature distribution differences of different batches of samples and improve the model's generalization ability.

[0058] like Figure 1 As shown:

[0059] In step 1), the contrastive learning loss function adopts InfoNCE loss. By comparing sample pairs to bring similar features closer together and dissimilar features further apart, the distinction of the classification boundary can be further strengthened, which helps to improve the classification accuracy in small sample scenarios.

[0060] like Figure 1 As shown:

[0061] In step 2), the wavelet transform denoising uses the db4 wavelet basis. The db4 wavelet basis has the best noise suppression effect on near-infrared spectral signals, which can preserve the intrinsic quality characteristics of the spectrum to the maximum extent and reduce the interference of noise on hierarchical identification.

[0062] like Figure 1 As shown:

[0063] In step 3), the texture migration and filling of the damaged area adopts the Poisson fusion algorithm. By achieving smooth filling based on the consistency of texture features, it can avoid the filling area from being disconnected from the original texture of the leaf, thus ensuring the authenticity of the enhanced sample.

[0064] like Figure 1 As shown:

[0065] In step 4), the dual-modal cross-validation method outputs a label if the visual and spectral feature recognition results are consistent, and if they are inconsistent, it is determined to be a critical sample and a second verification is performed. By eliminating misjudgment of a single feature through dual-modal feature complementary verification, the misjudgment rate of the critical level can be further reduced, so that the classification accuracy is ≥96%.

[0066] like Figure 1 As shown:

[0067] In step 5), the response time of the pneumatic pushing mechanism is ≤50ms. Through the fast response characteristics of pneumatic drive, it can match the inference speed of 15 frames / second, ensuring the collaborative efficiency of grading and sorting, and the sorting accuracy is ≥95%.

[0068] Example 2, as Figure 1-2 As shown, using a niche flue-cured tobacco variety with a local honey aroma as the treatment object, the sample size for this variety was only 65 samples per grade. Grading and sorting were achieved for four sub-grades: Zhongju II, Zhongju III, Zhongning II, and Zhongning III. This was adapted to field-embedded grading and sorting equipment, as detailed below:

[0069] Vision acquisition module: Basler acA1920-155um industrial camera, with a ring LED fill light (CCSLH-100W) to ensure that the blade images are free of shadow interference;

[0070] Spectral acquisition module: Ocean Optics STS-VIS-NIR near-infrared spectrometer;

[0071] Embedded processing unit: NVIDIA Jetson Nano B01 development board, computing power 200 GFLOPS, adapted to MobileNetV3-Small lightweight model, storage capacity expanded to 64GB;

[0072] Sorting execution unit: SMC CDJ2B16-50 pneumatic pushing mechanism (4 units, corresponding to 4 levels), response time ≤50ms, pushing stroke 50mm, equipped with diffuse reflection photoelectric sensor (Keyence PR-FB30N1) for blade positioning;

[0073] Auxiliary equipment: high-precision electronic balance (accuracy 0.001g) and tobacco curing simulation chamber (HR-800) for sample preprocessing and feature calibration.

[0074] The specific processing method is as follows:

[0075] 1) Sample collection and preprocessing:

[0076] 18,000 samples of large-volume flue-cured tobacco were collected (covering K326 and Yunyan 87 varieties, 4,500 samples of each of the four grades), and 260 samples of honey-flavored niche flue-cured tobacco (65 samples of each of the four grades). All samples were treated in a roasting simulation chamber (roasting process: 40℃ constant temperature for 2 hours → 60℃ constant temperature for 3 hours → 70℃ constant temperature for 1 hour), and the petioles were removed, while the complete leaf mesophyll area was retained.

[0077] The data was jointly annotated by three tobacco grading experts. The annotations included grade labels, leaf vein regions, oil distribution regions, and critical samples (10 critical samples for each grade, for a total of 40 samples), forming an annotated dataset.

[0078] 2) Cross-variety feature transfer + meta-learning model training

[0079] Based on the MobileNetV3-Small improved network, an entropy weight method-attention fusion module is added. First, features are extracted and weights are calculated from a large sample of 18,000 samples. The specific formula is as follows:

[0080] Feature standardization: min-max standardization is used to eliminate the influence of dimensions. The formula is:

[0081] ,in, Let j be the feature value of the i-th sample. , Let be the minimum and maximum values ​​of the j-th feature, respectively. These are the standardized eigenvalues;

[0082] Information entropy calculation: characterizes the degree of dispersion of each feature, the formula is as follows. , where n is the total number of samples (18,000). Let be the probability of the j-th feature of the i-th sample. The information entropy of the j-th feature (range 0-1);

[0083] Feature weight calculation: The entropy weight method assigns greater weight to features with lower information entropy (higher discriminative power). The formula is as follows: Where m is the total number of features (12 dimensions, including leaf vein density, oil content, etc.). Assuming the weight of the j-th feature, substituting the data, we calculate: leaf vein density. Oil distribution ratio Chlorophyll Residual Spectrum Blade thickness gradient The total weight of the four general features is 0.75, and the total weight of the other variety-specific features is 0.25. The weights are input into the attention module to enhance the extraction of general features. The module is trained for 50 rounds (batch size 32, initial learning rate 0.001). The parameters of the convolutional layer are frozen to obtain the general feature extractor.

[0084] Based on the ProtoNet framework, 260 minority samples were split into a support set (156 samples) and a query set (104 samples) in a 6:4 ratio. A meta-training task set was constructed (1000 tasks in total, each task containing 4 levels, 5 support samples and 3 query samples per level). The feature prototype vectors for each level were calculated. ,in, Let be the prototype vector of the k-th level. To support the number of samples in the set, For the k-th level support set sample, For the feature vector output by the general feature extractor, the InfoNCE contrastive loss function is introduced, with the following formula:

[0085]

[0086] in, To query the number of samples in the set, For query set, For cosine similarity, The temperature coefficient is set to 0.1, K is the number of levels (4), the classification head and attention module are fine-tuned, and the model is trained for 30 rounds (learning rate 0.0001). The total number of model parameters is 7.8M, and the overfitting risk is controlled at 1.7%.

[0087] 3) Dual-modal feature acquisition and fusion:

[0088] The camera acquired RGB images of the leaves. Dust and other contaminants were removed using Otsu thresholding (threshold calculated to be 128). Canny edge detection (threshold range 50-150) was used to segment the leaf vein region, and 12-dimensional external features were extracted. Spectral data in the 900-1700nm band were acquired using a spectrometer. Noise denoising was performed using a 3-layer wavelet transform based on the db4 wavelet basis. The formula is as follows: Where X is the original spectral data, W is the wavelet decomposition coefficient, low-frequency coefficients are retained to reconstruct the spectral signal, and 8-dimensional intrinsic features (oil content, maturity, etc.) are extracted.

[0089] Based on the SENet gated attention unit, and considering the small sample size (65 samples per level, ≤80 samples), a weight of 0.4 for spectral features and 0.6 for visual features are set. The fusion formula adopts a standard weighted summation form, specifically as follows: ,in, It is a visual feature vector (12-dimensional, such as standardized values ​​like leaf vein density 0.32 and surface gloss 0.68). It is a spectral feature vector (8-dimensional, such as standardized values ​​for oil content feature 0.56, maturity feature 0.72, etc.). The fused core feature set (20 dimensions) is reduced to 10 dimensions by t-SNE and then input into the hierarchical recognition model.

[0090] 4) Optimization of small sample datasets:

[0091] Based on the standard color range of honey-scented flue-cured tobacco (RGB values: R[220-255], G[180-220], B[80-120]), gradient samples are generated through linear interpolation, using the standard interpolation formula:

[0092] ;

[0093] in, The original sample RGB values ​​(example: R=230, G=190, B=90). To determine the maximum value of the corresponding channel color range, k is the interpolation coefficient (0.2, 0.4, 0.6, 0.8). Substituting k=0.2, the RGB values ​​of the gradient sample are calculated as R=233, G=196, B=92, generating a color gradient sample four times larger than the original sample, all within the standard color range of the variety. Damaged areas are filled using the standard Poisson blending formula, specifically... ,in, The image after filling. For healthy leaf texture images, For the Laplace operator, To ensure consistent pixel values ​​at the boundary of the damaged area, the filled area was smoothly integrated with the original leaf texture. A total of 15 damaged samples were processed, and the texture consistency of the filled samples reached 94.1%.

[0094] A Conditional DCGAN (generator is a U-Net structure, discriminator is a CNN structure) was constructed and trained for 500 epochs (batch size 16, learning rate 0.0002) using features of both large and small samples. This generated 260 small samples (1:1 with the original samples). The discriminator's verification accuracy was 93.2%, and the consistency between the generated samples and the real samples was 92.5%. After mixing, 520 optimized datasets were obtained, and the model was iteratively optimized.

[0095] 5) Grading accuracy calibration and sorting linkage:

[0096] The DANN module is introduced to achieve domain-invariant feature extraction through a gradient reversal layer (with the gradient reversal coefficient set to 1.0), using the standard loss function expression, the specific formula of which is as follows: ,in The loss is hierarchical (using cross-entropy loss).

[0097] The domain classification loss is calculated using binary cross-entropy loss. As the loss balance coefficient (set to 0.5), after training with the input data, the feature distribution distance between the source domain (major samples) and the target domain (minority samples) decreased from the initial 0.82 to 0.48, the feature distribution difference across batches of samples decreased by 42%, and the model's generalization ability was significantly improved.

[0098] The feature similarity between the predicted sample and the critical sample is calculated using the standard cosine similarity formula, which is as follows: ,in, The fusion feature vector for the predicted sample (10-dimensional, example: [0.28, 0.35, 0.42, 0.51, 0.39, 0.47, 0.53, 0.32, 0.41, 0.37]). The average feature vector of the critical samples of Zhongju II and Zhongju III (10-dimensional, example: [0.29, 0.36, 0.43, 0.52, 0.40, 0.48, 0.54, 0.33, 0.42, 0.38]). Using the L2 norm, we can calculate the similarity. (Setting a threshold) triggers expert rule base calibration, calls the oil content determination rule (oil content of Zhongju II ≥ 30%, oil content of Zhongju III 25%-30%), detects that the oil content of the predicted sample is 29.2%, dynamically lowers the Zhongju II / Zhongju III grading threshold by 0.02, and finally determines that the sample is Zhongju III. The above calibration process is performed on 40 critical samples (10 of each grade), and the critical sample identification accuracy is improved from the initial 92.3% to 97.5%, effectively reducing the false judgment rate;

[0099] After the model outputs the level label, the embedded unit generates a control signal (high level 24V) to trigger the corresponding level SMC pneumatic pushing mechanism. The photoelectric sensor locates the blade position (positioning error ≤2mm), and the pushing mechanism responds and sends the blade into the corresponding collection channel to achieve an integrated closed loop.

[0100] In summary, the intelligent identification method for grading and sorting flue-cured tobacco according to Embodiment 2 of this application achieves a grading and identification accuracy of 96.8% for niche flue-cured tobacco, an overfitting risk (accuracy difference between validation and test sets) of 1.7%, an inference sorting speed of 16.2 frames / second, a sorting accuracy of 95.6%, a pneumatic push mechanism response time of 42ms, and is compatible with embedded devices, making it applicable to field curing barn scenarios. Compared with existing technologies, it solves the problems of overfitting on small samples of niche flue-cured tobacco, poor generalization across batches, and disconnect between grading and sorting, improving grading accuracy by 8.3% and sorting efficiency by 3 times, significantly outperforming traditional intelligent grading methods.

[0101] In the description of this specification, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0102] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0103] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.

Claims

1. An intelligent identification method for grading and sorting flue-cured tobacco, characterized in that, Includes the following steps: Step 1) Construct and train the flue-cured tobacco grading identification model: Collect bulk flue-cured tobacco samples, construct a general grading feature library and a variety-specific feature library, use an improved MobileNetV3 as the base network, and connect the entropy weight method-attention fusion module to assign no less than 75% weight to general grading features such as leaf vein density, oil distribution, and chlorophyll residue spectrum and strengthen their extraction, while weakening the interference of bulk flue-cured tobacco-specific features. After training, freeze the network convolutional layer parameters to obtain a general grading feature extractor. Based on the ProtoNet meta-learning framework, split the niche flue-cured tobacco samples into a support set of 60% and a query set of 40%, and construct a training task set based on the flue-cured tobacco sub-grades. By calculating the feature prototype vectors of each grade sample, drive the model to quickly learn the grade-specific features of niche flue-cured tobacco, only fine-tune the model classification head and attention module parameters, and introduce a contrastive learning loss function to widen the gap between the feature prototype vectors of different grades, thus completing the construction and training of the flue-cured tobacco grading identification model. Step 2) Dual-modal feature acquisition and fusion processing: RGB images of flue-cured tobacco leaves are acquired at the visual end. After dust filtering submodule to remove interference from surface attachments, leaf vein region segmentation preprocessing is performed to extract external grading features such as color, shape, and surface oil gloss. At the spectral end, a near-infrared spectrometer in the 900-1700nm band is used to acquire sample spectral data. After wavelet transform denoising processing, spectral features reflecting internal oil content, maturity, and fiber density are extracted. Through a gated attention fusion unit, dual-modal feature weights are dynamically allocated according to the sample size of niche flue-cured tobacco. After fusion, redundant information is removed by the t-SNE feature dimensionality reduction module to obtain the core grading feature set. Step 3) Small sample dataset optimization: Perform the baking color gradient enhancement and damaged area texture transfer filling operations sequentially on the niche flue-cured tobacco samples. Collect the standard color range of niche flue-cured tobacco and limit the fluctuation boundary of color enhancement. Construct a grade conditional generative adversarial network. Using the features of the same grade of bulk flue-cured tobacco samples and the features of a small number of niche flue-cured tobacco samples as input conditions, generate niche flue-cured tobacco samples of each grade with a consistency of no less than 92% with the real samples. After the discriminator verifies the authenticity of the samples and the grade matching degree, mix the generated samples with the original samples in a 1:1 ratio to obtain the optimized training dataset. Use it to iteratively optimize the flue-cured tobacco grading recognition model constructed in Step 1. Step 4) Accuracy calibration of hierarchical identification: Introduce the Domain Adaptive Module (DANN), set the bulk flue-cured tobacco samples as the source domain and the samples from different batches of niche flue-cured tobacco as the target domain. Through adversarial training between the domain discriminator and the feature extractor, the model learns domain-invariant hierarchical features. Construct a two-dimensional threshold adjustment mechanism based on feature similarity and expert rules, calculate the cosine similarity between the predicted sample and the critical level sample, call the level determination rule base labeled by experts to dynamically adjust the hierarchical threshold, and perform dual-modal feature cross-validation on the critical samples. Step 5) Identification and sorting linkage execution: The tobacco grade label output in step 4) is converted into a sorting control signal, which triggers the sorting execution unit of the embedded grading and sorting equipment, drives the pushing mechanism to transport the corresponding tobacco leaves to the collection channel of the matching grade, and completes the whole process of flue-cured tobacco grading and sorting.

2. The intelligent identification method for grading and sorting flue-cured tobacco according to claim 1, characterized in that, The number of samples collected for the bulk flue-cured tobacco mentioned in step 1) shall not be less than 15,000.

3. The intelligent identification method for grading and sorting flue-cured tobacco according to claim 1, characterized in that, The dynamic allocation of bimodal feature weights in step 2) is as follows: when the sample size of a single grade of niche flue-cured tobacco is ≤80, the weight of spectral features is set to 40% and the weight of visual features is set to 60%; when the sample size of a single grade of niche flue-cured tobacco is ≥100, the weight of visual features is set to 65% and the weight of spectral features is set to 35%.

4. The intelligent identification method for grading and sorting flue-cured tobacco according to claim 1, characterized in that, The discriminator verification in step 3) specifically involves: first, judging the authenticity of the input sample, then verifying the matching degree between the sample features and the corresponding subdivision level grading standard, and retaining only the generated samples that are authentic and match the level.

5. The intelligent identification method for grading and sorting flue-cured tobacco according to claim 1, characterized in that, The domain-invariant grading feature mentioned in step 4) is a core grading feature that is not affected by the flue-cured tobacco variety, planting batch, or curing batch.

6. The intelligent identification method for grading and sorting flue-cured tobacco according to claim 1, characterized in that, The contrastive learning loss function described in step 1) is used to reduce the feature vector spacing of samples at the same level, while increasing the feature vector spacing of samples at different levels, thereby enhancing the distinction of the hierarchical boundary.

7. The intelligent identification method for grading and sorting flue-cured tobacco according to claim 1, characterized in that, The fusion method of external hierarchical features and internal hierarchical features described in step 2) is to output fused features after weighted summation of the dual-modal features through a gated attention fusion unit.

8. The intelligent identification method for grading and sorting flue-cured tobacco according to claim 1, characterized in that, The constraint enhancement operation based on the standard color range described in step 3) is as follows: based on the standard color range of niche flue-cured tobacco, set upper and lower thresholds for color enhancement to prevent the generation of invalid samples that exceed the inherent characteristics of the variety.

9. The intelligent identification method for grading and sorting flue-cured tobacco according to claim 1, characterized in that, The specific steps of the dual-modal feature cross-validation in step 4) are as follows: if the visual feature recognition result is consistent with the spectral feature recognition result, the level label is directly output; if the two recognition results are inconsistent, it is determined to be a critical sample, and the level determination rule base and dynamic threshold are called again for secondary verification.

10. The intelligent identification method for grading and sorting flue-cured tobacco according to claim 1, characterized in that, The total number of parameters of the flue-cured tobacco grading and identification model described in step 1) is controlled within 8M. When adapted to embedded grading and sorting equipment, the inference and sorting speed is not less than 15 frames / second.