Tobacco shred identification correction and component proportion prediction method based on vision
By combining the deep semantic segmentation model SegFormer and the DahNet network, the problem of insufficient accuracy in the determination of tobacco components in traditional methods is solved, and efficient and accurate detection and proportion prediction of tobacco components are achieved.
Patent Information
- Application Number
- CN202511788356.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-01
- Publication Date
- 2026-01-27
AI Technical Summary
Traditional methods for determining tobacco components are limited by low efficiency and insufficient accuracy due to manual operation, while traditional computer vision technology has poor adaptability, resulting in inaccurate component ratio determination results.
The SegFormer deep semantic segmentation model is used for initial segmentation, and DahNet network is used for secondary recognition and correction. Morphological processing is used to extract tobacco shred boundary features, automatically correcting category confusion and boundary errors. Training data is constructed and the model is fine-tuned to improve the detection accuracy of tobacco shred components.
It significantly improves the accuracy and reliability of tobacco component detection, achieves pixel-level precise segmentation and category identification, reduces errors, and has good scalability and intelligent detection capabilities.
Smart Images

Figure CN121409964A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of tobacco production quality inspection. Specifically, it is a vision-based method for identifying and correcting tobacco shreds and predicting the proportion of components. Background Technology
[0002] In the production of finished cigarettes in the tobacco industry, the accurate determination of tobacco component composition is a crucial step in assessing whether it meets production standards. Traditional manual screening and classification methods are not only time-consuming and labor-intensive, but also limited by sample size and subjective judgment, making it difficult to guarantee the accuracy and reliability of the test results. Therefore, exploring an efficient and accurate method for determining tobacco component composition is of great significance for improving tobacco quality, optimizing production processes, and reducing production costs.
[0003] Traditional methods for determining tobacco component composition are limited by manual operation, resulting in small sample sizes, low detection efficiency, and difficulty in obtaining the true proportions of tobacco components in real time. In contrast, online tobacco structure measurement technology can dynamically analyze tobacco components during the production process, providing real-time data support for production control and quality assessment. This represents a significant technological advancement in quality testing within the modern tobacco industry.
[0004] In the quality control stage of tobacco production, accurately determining the proportions and corresponding mass percentages of different components in tobacco is a crucial prerequisite for ensuring the stability of tobacco product quality. Currently, the industry mainly relies on manual sorting and weighing or traditional computer vision technology for component detection. Manual sorting and weighing is limited by the efficiency bottleneck of manual operation, making it difficult to meet the rapid detection needs of large-scale industrial production. It is also prone to insufficient accuracy in component proportion determination due to subjective judgment differences of operators and material loss during the sorting process. Traditional computer vision technology, on the other hand, has weak adaptability to complex mixed tobacco scenarios, failing to achieve pixel-level accurate segmentation and category recognition of different components. This often results in component misclassification and missed detection due to blurred boundaries, thus affecting the accuracy of component proportion determination results. Therefore, this project introduces a deep semantic segmentation model and a secondary segmentation method to apply computer vision technology to tobacco detection, enabling pixel-level accurate segmentation and category recognition of mixed tobacco. Summary of the Invention
[0005] The purpose of this invention is to provide a vision-based method for identifying and correcting tobacco shreds and predicting their component proportions.
[0006] The technical solution to achieve the objective of this invention is: a vision-based method for identifying and correcting tobacco shreds and predicting component proportions, comprising the following steps:
[0007] The steps for generating the tobacco sample image in step 1 are as follows:
[0008] Step 11: Generation of Real Training Samples for Pure Tobacco Shreds and Generation of Simulated Samples for Mixed Tobacco Shreds; The steps for generating real training samples for pure tobacco shreds are as follows: Various types of tobacco shreds and stems of fixed quality are individually placed on a background stage, and images of pure tobacco shreds with a background are captured; the images are segmented using a tobacco shred segmentation algorithm to generate a mask image with the same size as the original image; based on the segmentation results, pixels of different categories of tobacco shreds are labeled as labels 1-4, and the background area is labeled as label 0, thus obtaining real training samples for pure tobacco shreds; Simulated samples for mixed tobacco shreds are generated in two ways: instance-level and image-level. In the image-level generation, based on the tobacco shred segmentation results, several images are randomly selected from various pure tobacco shred samples. The segmented tobacco shreds are superimposed onto the empty background image according to the set rules to form a mixed tobacco shred image, and the corresponding ground truth mask label is generated simultaneously. The sample diversity can be enriched by adjusting the adhesion and coverage methods, such as no coverage, slight adhesion, and complete coverage. In the image-level generation, one image is randomly selected from each of the four types of pure tobacco shred images. Based on the characteristic that the background brightness is higher than that of the tobacco shreds and their shadows, the minimum brightness value of the corresponding position of each pixel in the four images is taken to achieve natural fusion.
[0009] Step 2, which involves segmenting the tobacco region based on a semantic segmentation model, consists of the following steps:
[0010] Step 21: Based on the data images collected in Step 1, perform data augmentation on the original images by horizontal / vertical flipping, Gaussian blurring, image scaling, and aspect ratio distortion; divide the processed image set into training and validation sets in an 8:2 ratio for training the SegFormer model, and select appropriate parameters to complete the model training during the training process;
[0011] Step 22: Use the SegFormer model to predict the tobacco shred image to achieve tobacco shred region segmentation and obtain tobacco shred segmentation result image;
[0012] Step 23: Using morphological methods, extract the boundary pixels of the tobacco shreds from the prediction results of the SegFormer model and analyze the distribution of pixels of different categories within each connected region. When the value of a pixel of a certain category in the boundary region exceeds a set threshold, the category is considered an oversegmented category, and its pixel label is uniformly corrected to the main category with the most pixels in that region.
[0013] Step 3 involves constructing training data and training the tobacco recognition model. The steps are as follows:
[0014] Step 31: Based on the tobacco region segmentation map implemented in Step 2, segment the connected regions according to the category to obtain images of a single type of tobacco as the training set for training the recognition model;
[0015] Step 32: Based on the generated single-class tobacco images, the DahNet network is used to train a recognition model to perform detailed classification of the tobacco region segmentation map implemented in Step 2;
[0016] Step 4 involves using a four-grid sample to calibrate the surface density of various tobacco shreds.
[0017] Step 41: Take tobacco shreds with different mass percentages, weigh them, and use a vibrating table to break up the tobacco shreds of each percentage. Then, sort the four types of tobacco shreds and pile them in the four corners of the background to obtain images of the tobacco shreds of each component and their corresponding mass.
[0018] Step 42: Based on the tobacco sample images generated in Step 1, statistically analyze the true pixel values of each type of tobacco in each image, calculate the quality-to-area ratio of each image, and obtain the standard average areal density ratio for subsequent calculation of quality proportion.
[0019] The steps for predicting the percentage of tobacco weight in step 5 are as follows:
[0020] Step 51: Predict the tobacco image based on the SegFormer model to obtain a semantic segmentation result image of the tobacco.
[0021] Step 52: Separate connected regions based on the semantic segmentation result graph to obtain monofilament images of various types.
[0022] Step 53: Use DahNet to further identify various monofilament images and correct the original results to obtain more accurate results.
[0023] Step 54: Count the number of pixels for each type of tobacco based on the final result image. Then, combine the standard average areal density ratio of each type of tobacco as determined in Step 4, multiply the total number of pixels for each type of tobacco by its corresponding areal density ratio to obtain the final quality of each type, and calculate the final quality percentage.
[0024] Compared with existing technologies, the present invention has the following significant advantages: (1) By fine-tuning the pre-trained model in the domain, the method significantly improves the model's ability to represent the features of tobacco images and its classification accuracy. While reducing the dependence on manual annotation, it achieves efficient learning and generalization performance under conditions of few samples. (2) In view of the problem that traditional semantic segmentation models are not accurate enough in complex backgrounds, the present invention uses SegFormer to perform preliminary segmentation of tobacco. On this basis, a secondary correction algorithm based on connected component analysis is proposed to solve the problem of over-segmentation and misclassification caused by tobacco entanglement or similar features in the segmentation results. (3) The method extracts the boundary features of tobacco through morphological processing, judges the spatial distribution features of different categories of pixels in connected regions, and automatically corrects abnormal categories according to the proportion threshold, effectively reducing category confusion and boundary error.
[0025] Verification has shown that the model and method proposed in this invention exhibit significantly lower relative errors in tobacco structure determination compared to traditional methods, enabling more accurate detection and proportion prediction of tobacco components. Furthermore, this method possesses good scalability, allowing for incremental learning of the model by introducing new sample categories, thus providing reliable technical support for intelligent detection systems for multi-component tobacco identification. Attached Figure Description
[0026] Figure 1 This is a flowchart for determining the composition and structural proportions of tobacco shreds.
[0027] Figure 2 This is a schematic diagram of the data acquisition system.
[0028] Figure 3 The various tobacco shreds used to build model training samples are (colored as red for leaf shreds, blue for expanded leaf shreds, green for thin sheets, and gray for stems).
[0029] Figure 4 This is a single tobacco shred image used to build the recognition model.
[0030] Figure 5 This is a diagram of the DahNet model architecture.
[0031] Figure 6 The model identifies the corrected results. Detailed Implementation
[0032] The present invention will now be further described with reference to the accompanying drawings.
[0033] Figure 1This paper demonstrates the complete workflow of an algorithm for tobacco identification and component proportion prediction. The specific steps are as follows: First, the program converts the color image to grayscale for brightness distribution analysis and reduces the image size through downsampling to speed up subsequent calculations. Next, it calculates the average grayscale value of the entire image and performs a point-by-point subtraction of the mean for each pixel, setting pixels with brightness below the average to 0 (black background) to highlight the bright areas in the image. Subsequently, the OTSU method is used to perform global adaptive threshold segmentation on the bright areas, generating a binary image to effectively distinguish the shaking table from the background area. In the obtained binary result, the white area represents the possible range of the shaking table. Then, Hough transform is used to detect straight lines, retaining only lines close to the horizontal and vertical directions to eliminate noise and tilt interference. By enumerating all combinations of horizontal and vertical lines, the set of rectangles formed by them is calculated, and the rectangle containing the largest proportion of binary white area is considered the region of interest for the shaking table. After locating the shaking table rectangle, the corresponding region is extracted from the original high-resolution image based on its vertex coordinates. Affine or perspective transformations are used for geometric correction to eliminate tilt or perspective distortion caused by the shooting angle, ensuring the shaking table area maintains a standard rectangular proportion and a normal viewing angle. In the corrected image, OTSU thresholding is applied again to obtain an accurate binary mask of the tobacco distribution area. Finally, the tobacco distribution image is extracted from this region and input into the model for initial prediction to obtain the mask image. Subsequently, connected regions of the mask image are extracted, and individual tobacco images are extracted based on the same positional information. The extracted individual tobacco images are then fed into DahNet for secondary recognition. The results correct the initial prediction, and the final mass percentage of the tobacco in the image is obtained based on the areal density ratio.
[0034] The specific steps are as follows:
[0035] Step 1: Generation of tobacco samples;
[0036] (1) Generating real training samples of pure tobacco shreds.
[0037] A fixed weight of various types of tobacco shreds and stems were individually fed into a feeding device, and images of pure tobacco shreds were captured. The images were then segmented using a tobacco shred segmentation algorithm to generate a mask image of the same size as the original image. Based on the segmentation results, pixels of different types of tobacco shreds were labeled as labels 1-4, and the background area was labeled as label 0, thus obtaining real pure tobacco shred training samples.
[0038] (2) Generation of simulated samples of mixed tobacco shreds.
[0039] The simulated tobacco samples are generated in two ways: instance-level and image-level. The instance-level generation method is based on tobacco segmentation. Then, the independently segmented tobacco shreds are superimposed onto a blank background image according to certain rules, generating corresponding ground truth mask images. Specifically, the process involves: capturing a blank background image; randomly selecting one blank background image; and selecting N images from each type of pure tobacco sample. The tobacco shreds in all images are segmented. A certain type of tobacco shred is randomly selected according to a certain proportion and pasted onto a blank belt. Different tobacco coverage methods are set: no coverage and no adhesion; adhesion only; and coverage, while simultaneously generating several ground truth images. Figure 3 The first line gives the results of a set of instance-level image generation.
[0040] The image-level generation method randomly selects one image from each pure class of tobacco images. Taking advantage of the white background and the lower brightness of the tobacco and shadows compared to the background, a minimization operation can be used for synthesis. Specifically, one image is randomly selected from each of the four categories, and each pixel is calculated using the minimum value of its corresponding pixel in each of these four images. Simultaneously, the category corresponding to the minimum pixel value is recorded. This is because when multiple tobacco strands overlap, the darkest tobacco pixel is always preserved in the final image.
[0041] Unlike instance-level generation methods, image-level generation methods can better preserve the shadows around the tobacco shreds, closely resembling realistically captured images, thus complementing instance-level generation methods. However, its diversity in the distribution and coverage of different types of tobacco shreds is not as good as that of instance-level generation methods. Figure 3 The second line presents a set of image-level image generation results. Compared to the original image generated at the instance level in the first line, the shadows are largely preserved, making it closer to the actual captured image.
[0042] Step 2: Segmenting tobacco regions based on semantic segmentation model
[0043] The training set generated in step 1 is augmented by flipping it horizontally / vertically, applying Gaussian blur, scaling the image, and distorting its length and width to enhance the model's robustness.
[0044] The trained model makes preliminary predictions on the image and obtains a preliminary result mask. Subsequent extraction of single filaments and correction of the results are all based on the preliminary result mask.
[0045] To better extract the single-filament image for subsequent single-filament recognition, the mask image of the model's initial prediction result is corrected. Morphological methods are used to extract the boundary pixels of the tobacco filaments, and the proportion of pixels of each type of tobacco filament in each connected region is analyzed. If more than 80% of the pixels of a certain type of tobacco filament are located in the boundary region, this case is considered oversegmentation. To avoid the impact of oversegmentation on subsequent single-filament recognition, the connected regions in this case are uniformly corrected, and the remaining predicted categories are corrected to the category with the most pixel values, which is regarded as a single type of tobacco filament.
[0046] Step 3: Construct training data and train the tobacco shred recognition model;
[0047] (1) Constructing training data
[0048] Firstly, considering the significant contrast between the white conveyor belt background and the tobacco color, to accurately extract the tobacco region while avoiding shadow interference, the blue channel (B channel) of the image is extracted. The image is then binarized using the OTSU adaptive thresholding algorithm, and regions with grayscale values less than the threshold are selected as candidate tobacco regions. This maximizes the separation of the mixed areas between the white conveyor belt background and the tobacco and its shadows. The original image is then converted from RGB space to a color space (e.g., HSV or Lab). The formula for extracting the color channels is as follows:
[0049]
[0050] The shadow pixel region is then determined by the OTSU threshold, enabling the identification and exclusion of tobacco shadows. A grayscale histogram of the mixed tobacco and shadow region is then constructed based on the blue channel, gradually decreasing from high to low grayscale. The iteration stops when the average pixel value at a certain grayscale level falls below a set threshold, and the pixels with grayscale values less than that threshold at this point are taken as the final tobacco pixels.
[0051] Because other tobacco shred areas are inevitably cut during the segmentation process, and these areas can sometimes affect the recognition of tobacco shreds, the regions in the original image corresponding to the non-maximum connected regions (other tobacco shreds within the bounding rectangle) in the segmentation mask are filled. The fill pixel values use pure white or the background pixel color value, such as... Figure 4 As shown.
[0052] (2) DahNet's semantic segmentation model
[0053] The DahNet network structure diagram is as follows: Figure 5 As shown.
[0054] DahNet employs a hierarchical attention enhancement and cross-level feature fusion strategy, combining a ResNet backbone network, attention mechanism, feature enhancement module, and multi-level feature fusion technology. This network uses ResNet-50 as its backbone to extract multi-scale basic features and achieves fine-grained visual representation learning through a three-level optimization architecture.
[0055] The Feature Enhancement and Suppression Module (FESM) is designed to construct a spatial attention-guided feature optimization mechanism. FESM is a feature enhancement and suppression module based on spatial attention. It dynamically segments the feature map along the width and height directions and generates bidirectional attention weights. Combining local convolutional responses and global pooling, it uses Softmax normalization to generate a spatial attention mask, enhancing salient region features and suppressing non-critical region responses in the form of residuals. This improves the model's sensitivity to critical regions while preserving the original features. Subsequently, a TransLayer maps the 1024-dimensional mid-level features to a 2048-dimensional high-level semantic space, and an MCM layer is introduced: the cosine similarity of features from adjacent layers is calculated as the fusion weight, and the fusion is achieved by adding the residuals. Two-way feature interaction. Multi-scale feature aggregation is finally achieved through a global-local dual-path refinement module: the global path uses the standard ResNet50 fourth stage to extract overall features, while the local path embeds a CFM module consisting of CoordAtt and a convolutional MLP. CoordAtt captures spatial-channel dependencies through horizontal / vertical pooling, while ConvMlp refines local features through 1×1 convolutional channel expansion, 3×3 depthwise convolutional spatial mixing, and 1×1 compression. In the classification stage, global features and third-level local features are combined and multi-semantic fusion classification is achieved through an 8192-dimensional fully connected layer. This network, through a FESM-MCM-Refine three-level optimization architecture, significantly improves the discriminative feature learning ability for fine-grained visual tasks.
[0056] During the model training phase, the DAHNet network structure based on the PyTorch framework was adopted. Input images were uniformly adjusted to a resolution of 224×224, the batch size was set to 32, and the training epochs were 30. The weight decay coefficient was set to 0 to avoid over-constraining weight updates during small sample training. An improved GHM loss function was used to dynamically balance the gradient distribution between easy and difficult samples, thereby improving the model's ability to distinguish tobacco samples with similar gray levels. Training and validation data were partitioned using five-fold hierarchical cross-validation to ensure a consistent proportion of each compromise class, thus improving the model's generalization performance.
[0057] Step 4: Use a four-grid sample to calibrate the surface density of various tobacco shreds.
[0058] Based on the model's prediction results, the pixel values, or areas, of various types of tobacco can be statistically analyzed. The ultimate goal of this invention is to calculate the mass percentage of each type of tobacco, thus requiring the calculation of a surface density ratio to convert area into mass. First, the tobacco is broken up and separated using a vibrating table. Then, the four types of tobacco are sorted and piled in four areas at the four corners of the background stage. Figure 3 As shown, data on various tobacco components were generated for statistical pixel value analysis.
[0059] The results of four-grid samples of various tobacco components were labeled and the pixel values of each type of tobacco were statistically analyzed. Before conducting the statistical analysis, the quality of various types of tobacco shreds in each of the four-square grid samples was pre-calculated. (Unit: grams), further calculate the ratio of mass to area of each type of tobacco in each image. The final areal density percentage is obtained by averaging the values.
[0060] Step 5: Prediction of the proportion of tobacco shreds in quality
[0061] A semantic segmentation model is used to predict tobacco shred images, resulting in a predicted mask image. Connected regions are separated from the mask, with each region representing a single tobacco shred. Individual shreds are extracted from the original image based on their location information to obtain single-class tobacco shred images. These single-shred images are further identified using DahNet, and the original images are corrected to obtain more accurate results. The number of pixels for each class of tobacco shreds is counted based on the final results, and then multiplied by the areal density ratio to obtain the final quality for each class. The final quality percentage is then calculated. The predicted pixel values for each class of tobacco shreds are known. The formula for calculating the weight percentage is:
[0062]
[0063] To verify the prediction accuracy of this method, two different tobacco distribution scenarios were selected for testing. The prediction error data for the proportion of various components are shown in Table 1:
[0064] Table 1. Prediction error of component proportion under different tobacco shred distributions.
[0065]
[0066] This invention aims to integrate tobacco component determination and identification technology, semantic segmentation model technology, and mobile internet technology to promote the intelligent and refined quality inspection of the tobacco industry. By leveraging edge devices such as mobile terminals, it enables rapid image acquisition of tobacco shreds for testing, allowing for intelligent analysis and determination of tobacco quality. This provides tobacco industry professionals with a simple, fast, and accurate dynamic cigarette quality inspection solution. This invention not only improves the efficiency and accuracy of tobacco shred testing but also provides a scientific basis and technical support for tobacco quality improvement, offering tobacco industry professionals a simple, fast, and accurate cigarette quality inspection solution, thereby effectively contributing to tobacco quality improvement.
[0067] This invention employs semantic segmentation model prediction and secondary recognition, performing secondary recognition based on initial prediction. This results in an accurate and efficient method for determining the composition and structural proportions of tobacco shreds. This fusion strategy not only significantly improves the overall accuracy of tobacco shred category prediction but also achieves breakthroughs in detailed segmentation and category consistency in complex regions, providing a reliable and efficient solution for automated quality inspection of tobacco shred structures.
Claims
1. A vision-based method for identifying, correcting, and predicting the proportion of tobacco components, characterized in that, Includes the following steps: Step 1: For the tobacco sample, use an image acquisition device to acquire images under preset lighting and shooting angle conditions to generate a sample image set containing different types and shapes of tobacco and a four-grid tobacco sample data, which will serve as the raw image data for subsequent processing. Step 2: Train the SegFormer model. Use the model to perform pixel-level segmentation of the tobacco region and background region in the image to be detected, and obtain a tobacco segmentation image with the tobacco region accurately segmented, which provides a basis for subsequent secondary recognition. Step 3: Based on the tobacco shred segmentation image obtained in Step 2, segment individual tobacco shred images according to connected regions, which are used to train the DahNet-based tobacco shred recognition model to form a refined classification model that can be used for secondary recognition. Step 4: Based on the four-grid tobacco calibration sample collected in Step 1, calculate the standard average areal density ratio by statistically analyzing the real pixel values and corresponding quality of various types of tobacco, and complete the areal density calibration of various types of tobacco. Step 5: Based on the tobacco shred segmentation image from Step 2, use the DahNet model trained in Step 3 to perform secondary recognition, obtain a refined secondary recognition result, and then use the areal density ratio measured in Step 4 to convert the pixels into mass percentages, and obtain the final tobacco shred mass percentage prediction.
2. The vision-based method for tobacco identification correction and component proportion prediction according to claim 1, characterized in that, The method for generating the tobacco sample image in step 1 is as follows: The method for generating real training samples of pure tobacco shreds is as follows: various types of tobacco shreds and stems of fixed quality are placed separately on a background stage, and images of pure tobacco shreds with background are taken; the images are segmented using a tobacco shred segmentation algorithm to generate a mask image with the same size as the original image; based on the segmentation results, the pixels of different types of tobacco shreds are labeled as labels 1 to 4, and the background area is labeled as label 0, thereby obtaining real training samples of pure tobacco shreds. The hybrid tobacco simulation samples are generated in two ways: instance-level and image-level. In instance-level generation, based on the tobacco segmentation results, several images are randomly selected from various pure tobacco samples. The segmented tobacco is then superimposed onto an empty background image according to a set rule to form a hybrid tobacco image, and a corresponding ground truth mask label is generated simultaneously. In image-level generation, one image is randomly selected from each of the four types of pure tobacco images. Based on the characteristic that the background brightness is higher than that of the tobacco and its shadow, the minimum brightness value of each pixel at the corresponding position in the four images is taken to achieve natural fusion.
3. The vision-based method for tobacco identification correction and component proportion prediction according to claim 1, characterized in that, The specific implementation of step 2 is as follows: Step 21: Based on the data images collected in Step 1, perform data augmentation on these original data images by horizontal / vertical flipping, Gaussian blurring, scaling the images, and distorting the length and width. Divide the processed image set into a training set and a validation set in an 8:2 ratio to train the SegFormer model and select appropriate parameters for training. Step 22: Use the SegFormer model to predict the tobacco shred image to achieve tobacco shred region segmentation and obtain tobacco shred segmentation result image; Step 23: Use morphological methods to extract the boundary pixels of the tobacco shreds based on the prediction results of the SegFormer model, and analyze the distribution of different categories of pixels in each connected region. When the value of a certain category of pixel in the boundary region exceeds the set threshold, the category is regarded as an oversegmented category, and its pixel label is uniformly corrected to the main category with the most pixels in the region.
4. The vision-based method for tobacco identification correction and component proportion prediction according to claim 1, characterized in that, The specific implementation of step 3 is as follows: Step 31: The tobacco shred segmentation result image obtained in Step 2 is segmented into connected regions according to the category, and the images of a single type of tobacco shred are used as the training set for training the recognition model; Step 32: Based on the generated single-class tobacco images, a recognition model is trained using the DahNet network to perform detailed classification of the tobacco region segmentation map implemented in Step 2.
5. The vision-based method for tobacco identification correction and component proportion prediction according to claim 1, characterized in that, Step 4 involves using a four-grid sample to calibrate the surface density of various tobacco shreds. Step 51: Take tobacco shreds with different mass percentages, weigh them, break up the tobacco shreds of each percentage using the vibration table, and sort and pile the four types of tobacco shreds in the four corners of the background to obtain images of the tobacco shreds of each component and their corresponding mass. Step 52: Based on the tobacco sample images generated in Step 1, annotate and statistically analyze the true pixel values of each type of tobacco in each image, calculate the quality-to-area ratio of each image, and obtain the standard average areal density ratio, which is used for subsequent calculation of quality proportion.
6. The vision-based method for tobacco identification correction and component proportion prediction according to claim 1, characterized in that, The specific implementation of the tobacco shred quality ratio prediction in step 5 is as follows: Step 61: Use the SegFormer semantic segmentation model from Step 2 to predict the tobacco image and obtain a segmentation result image of the tobacco. Step 62: Separate the connected regions from the segmented tobacco shreds image to obtain images of various individual shreds; Step 63: Use the DahNet trained in Step 3 to further identify various monofilament images, and correct the original results to obtain more accurate results. Step 64: Count the number of pixels for each type of tobacco based on the final result image. Then, combine the standard average areal density ratio of each type of tobacco as determined in Step 4, multiply the total number of pixels for each type of tobacco by its corresponding areal density ratio to obtain the final quality of each type, and calculate the final quality percentage.