Methods, apparatus, computer equipment and storage media for analyzing the uniformity of tobacco blending

By analyzing the blending state of tobacco shreds using hyperspectral imaging technology and a convolutional neural network-long short-term memory network regression model, the problem of low accuracy in RGB image analysis was solved, and the accuracy and reliability of tobacco shred blending uniformity analysis were improved.

CN120071260BActive Publication Date: 2025-10-28CHINA TOBACCO SICHUAN IND CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510527114.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-25
Publication Date
2025-10-28
Estimated Expiration
2045-04-25

AI Technical Summary

Technical Problem

Existing methods for analyzing tobacco blending using RGB images are not very accurate, which affects the quality consistency of cigarette products and the smoking experience.

Method used

Hyperspectral images of tobacco shreds were acquired using hyperspectral imaging technology. Spectral, color, and texture features were extracted to generate a matrix to be analyzed. The blending ratio of tobacco shreds was then detected using a convolutional neural network-long short-term memory network regression model.

Benefits of technology

This improves the accuracy and reliability of tobacco blending uniformity analysis, ensuring the consistency of cigarette product quality and smoking experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120071260B_ABST
    Figure CN120071260B_ABST
Patent Text Reader

Abstract

The present application relates to a method, apparatus, computer device, and storage medium for analyzing tobacco blending uniformity. The method comprises: acquiring a hyperspectral image of a tobacco leaf group to be analyzed, performing image feature extraction on the hyperspectral image to obtain spectral features, color features, and texture features; generating a matrix to be analyzed for the tobacco leaf group to be analyzed based on the spectral features, color features, and texture features; inputting the matrix to be analyzed into a pre-built tobacco blending ratio detection model to obtain the tobacco blending ratio of the tobacco leaf group to be analyzed; acquiring a hyperspectral image of the tobacco leaf group to be analyzed, performing image feature extraction on the image features and the tobacco leaf group to be analyzed; inputting the matrix to be analyzed into the detection model for detection to obtain the tobacco blending ratio of the tobacco leaf group to be analyzed; utilizing the hyperspectral image for feature extraction and subsequent blending uniformity analysis to improve the accuracy and reliability of the analysis.
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 a method, apparatus, computer equipment, computer-readable storage medium, and computer program product for analyzing the uniformity of tobacco blending. Background Technology

[0002] In the production of cigarettes, the uniform blending of tobacco leaves is a key factor affecting the quality and taste stability of the finished product. Tobacco leaves include one or more components such as shredded tobacco, stems, reconstituted tobacco leaves, and expanded tobacco. The uniformity of the blending of these components directly affects the smoking experience and quality consistency of the cigarette product.

[0003] In traditional techniques, RGB images are used to analyze the blending state of tobacco shreds.

[0004] However, current methods for analyzing the blending state of tobacco using RGB images suffer from low accuracy. Summary of the Invention

[0005] Therefore, it is necessary to provide a method, apparatus, computer equipment, computer-readable storage medium, and computer program product for analyzing the uniformity of tobacco blending that can improve the accuracy of analysis, in response to the above-mentioned technical problems.

[0006] In a first aspect, this application provides a method for analyzing the uniformity of tobacco blending, including:

[0007] Acquire hyperspectral images of the tobacco shreds in the leaf group to be analyzed;

[0008] Image features are extracted from the hyperspectral image to obtain spectral features, color features, and texture features. Based on the tobacco shreds of the leaf group to be analyzed, the spectral features, color features, and texture features, an analysis matrix of the tobacco shreds of the leaf group to be analyzed is generated.

[0009] The matrix to be analyzed is input into a pre-constructed tobacco blending ratio detection model to obtain the tobacco blending ratio of the tobacco group to be analyzed.

[0010] In one embodiment, acquiring a hyperspectral image of the tobacco shreds in the leaf group to be analyzed includes:

[0011] The original hyperspectral image, whiteboard hyperspectral image, and blackboard hyperspectral image of the tobacco shreds of the leaf group to be analyzed were acquired using a hyperspectral imager; the whiteboard hyperspectral image is a total reflectance hyperspectral image, and the blackboard hyperspectral image is a non-reflectance hyperspectral image;

[0012] Based on the hyperspectral images of the whiteboard and the blackboard, the original hyperspectral image is corrected to obtain the corrected hyperspectral image;

[0013] The corresponding binarized image mask is obtained based on the corrected hyperspectral image, and the background of the corrected hyperspectral image is segmented using the binarized image mask to obtain the hyperspectral image.

[0014] In one embodiment, spectral features are extracted through the following steps:

[0015] The hyperspectral image of the tobacco shred region of the leaf group to be analyzed was determined from the hyperspectral image;

[0016] Obtain the pixel spectra within the hyperspectral image of the tobacco shred region of the leaf group to be analyzed, and determine the average value corresponding to the spectrum of each pixel.

[0017] The average value is used as the spectral characteristics of the tobacco shreds in the leaf group to be analyzed.

[0018] In one embodiment, color features are extracted through the following steps:

[0019] Based on the hyperspectral image, obtain the corresponding RGB image; the RGB image includes the R channel image, G channel image, and B channel image.

[0020] Obtain the mean, variance, and skewness of each channel in the R-channel, G-channel, and B-channel images, respectively.

[0021] Based on the mean, variance, and skewness of each channel, a color feature vector is constructed.

[0022] The color feature vector is used as the color feature of the tobacco shreds in the leaf group to be analyzed.

[0023] In one exemplary embodiment, texture features are extracted through the following steps:

[0024] Principal component analysis was performed on the hyperspectral image to obtain the target principal component image;

[0025] The gray-level co-occurrence matrix method is used to calculate the contrast, homogeneity, energy, and correlation of the target principal component image.

[0026] Contrast, homogeneity, energy, and correlation were used as the texture features corresponding to the tobacco shreds of the leaf group to be analyzed.

[0027] In one embodiment, the tobacco shreds of the leaf group to be analyzed correspond to the theoretical blending ratios of each tobacco component constituting the tobacco shreds of the leaf group to be analyzed; based on the tobacco shreds of the leaf group to be analyzed, spectral characteristics, color characteristics, and texture characteristics, an analysis matrix of the tobacco shreds of the leaf group to be analyzed is generated, including:

[0028] Data-level fusion of spectral features, color features, and texture features yields the feature matrix of the tobacco shreds in the leaf group to be analyzed.

[0029] Based on the feature matrix and the theoretical blending ratio, the analysis matrix of the tobacco shreds in the leaf group to be analyzed is obtained.

[0030] Secondly, this application also provides a device for analyzing the uniformity of tobacco blending, comprising:

[0031] The image acquisition module is used to acquire hyperspectral images of the tobacco shreds in the leaf group to be analyzed;

[0032] The feature extraction module is used to extract image features from hyperspectral images to obtain spectral features, color features, and texture features, and to generate an analysis matrix of the tobacco shreds in the tobacco shreds to be analyzed based on the tobacco shreds in the tobacco shreds to be analyzed, the spectral features, the color features, and the texture features.

[0033] The analysis module is used to input the matrix to be analyzed into a pre-built tobacco blending ratio detection model to obtain the tobacco blending ratio of the tobacco group to be analyzed.

[0034] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0035] Acquire hyperspectral images of the tobacco shreds in the leaf group to be analyzed;

[0036] Image features are extracted from the hyperspectral image to obtain spectral features, color features, and texture features. Based on the tobacco shreds of the leaf group to be analyzed, the spectral features, color features, and texture features, an analysis matrix of the tobacco shreds of the leaf group to be analyzed is generated.

[0037] The matrix to be analyzed is input into a pre-constructed tobacco blending ratio detection model to obtain the tobacco blending ratio of the tobacco group to be analyzed.

[0038] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0039] Acquire hyperspectral images of the tobacco shreds in the leaf group to be analyzed;

[0040] Image features are extracted from the hyperspectral image to obtain spectral features, color features, and texture features. Based on the tobacco shreds of the leaf group to be analyzed, the spectral features, color features, and texture features, an analysis matrix of the tobacco shreds of the leaf group to be analyzed is generated.

[0041] The matrix to be analyzed is input into a pre-constructed tobacco blending ratio detection model to obtain the tobacco blending ratio of the tobacco group to be analyzed.

[0042] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:

[0043] Acquire hyperspectral images of the tobacco shreds in the leaf group to be analyzed;

[0044] Image features are extracted from the hyperspectral image to obtain spectral features, color features, and texture features. Based on the tobacco shreds of the leaf group to be analyzed, the spectral features, color features, and texture features, an analysis matrix of the tobacco shreds of the leaf group to be analyzed is generated.

[0045] The matrix to be analyzed is input into a pre-constructed tobacco blending ratio detection model to obtain the tobacco blending ratio of the tobacco group to be analyzed.

[0046] The aforementioned method, apparatus, computer equipment, computer-readable storage medium, and computer program product for analyzing the uniformity of tobacco blending involve acquiring hyperspectral images of the tobacco shreds to be analyzed, extracting image features from the hyperspectral images to obtain spectral, color, and texture features, and generating an analysis matrix based on the tobacco shreds, spectral features, color features, and texture features. This analysis matrix is ​​then input into a pre-constructed tobacco blending ratio detection model to obtain the blending ratio of the tobacco shreds in the analysis group. The process of acquiring hyperspectral images of the tobacco shreds to be analyzed and extracting image features, generating a corresponding analysis matrix based on the extracted image features and the tobacco shreds, and inputting the analysis matrix into a detection model for detection yields the blending ratio of the tobacco shreds in the analysis group. Utilizing hyperspectral images for feature extraction and subsequent blending uniformity analysis improves the accuracy and reliability of the analysis. Attached Figure Description

[0047] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0048] Figure 1 This is a diagram illustrating the application environment of a tobacco blending uniformity analysis method in one embodiment.

[0049] Figure 2 This is a flowchart illustrating a method for analyzing the uniformity of tobacco blending in one embodiment.

[0050] Figure 3 This is a flowchart illustrating the method for analyzing the uniformity of tobacco blending in another embodiment;

[0051] Figure 4 This is a structural diagram of a tobacco blending ratio detection model in one embodiment;

[0052] Figure 5This is a structural block diagram of a tobacco blending uniformity analysis device in one embodiment;

[0053] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0054] In order to make the purpose, technical solutions and advantages of this application more clearly understood, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0055] The tobacco blending uniformity analysis method provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, server 104 acquires cigarette preparation data from tobacco processing equipment 102 via the network. Typically, tobacco processing includes one or more components such as shredded tobacco, stems, reconstituted tobacco leaves, and expanded tobacco. The uniformity of the blending of these components directly affects the smoking experience and quality consistency of the cigarette product. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated on server 104 or located in the cloud or on other network servers. Server 104 acquires the tobacco processing equipment 102 to be analyzed and uses a hyperspectral imager to acquire the corresponding hyperspectral image. Image features are extracted from the hyperspectral image to obtain spectral features, color features, and texture features. Based on the tobacco processing, spectral features, color features, and texture features, an analysis matrix is ​​generated for the tobacco processing. This analysis matrix is ​​then input into a pre-constructed tobacco blending ratio detection model to obtain the tobacco blending ratio of the tobacco processing, thus achieving the analysis of the blending uniformity of the tobacco processing. Among them, server 104 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.

[0056] In one exemplary embodiment, such as Figure 2 As shown, a method for analyzing the uniformity of tobacco blending is provided, which is then applied to... Figure 1 Taking server 104 as an example, the explanation includes the following steps S201 to S203. Wherein:

[0057] Step S201: Obtain the hyperspectral image of the tobacco shreds in the leaf group to be analyzed.

[0058] The tobacco leaf group to be analyzed can be understood as a mixture of various tobacco components in a certain proportion. The mixing proportion should be a reasonable proportion after the designed proportion of each component of the cigarette brand has been adjusted up and down within a certain range. The hyperspectral image can be understood as a hyperspectral image obtained by collecting the aforementioned tobacco leaf group to be analyzed using a hyperspectral imager.

[0059] For example, server 104 obtains samples of tobacco, stems, reconstituted tobacco, and expanded tobacco of a specified brand from tobacco processing equipment 102 on the cigarette manufacturing line. It then adjusts the designed proportions of each component of the cigarette brand within a certain range to obtain a reasonable proportion. The various tobacco components are then mixed according to this reasonable proportion to obtain tobacco samples of different mixing ratios. The theoretical mixing ratios of tobacco, stems, reconstituted tobacco, and expanded tobacco in the tobacco samples to be analyzed are recorded. The hyperspectral imager is turned on and preheated for at least n minutes. The tobacco samples to be analyzed are placed on the moving platform of the hyperspectral imager. Appropriate moving platform speed, camera lens position, and camera exposure time are set. The original hyperspectral image of the tobacco samples in the range a-Anm is acquired, and a hyperspectral image is obtained based on the original hyperspectral image. Server 104 acquires each component and mixes them according to the planned proportions. This allows for a clear determination of the specific mixing ratio of the tobacco shreds in the leaf group to be analyzed, facilitating the subsequent construction of the analysis matrix and analysis of the mixing uniformity. Secondly, the hyperspectral imager for acquiring hyperspectral images is turned on and preheated, reducing the impact of baseline drift that may be caused by poor measurement stability. Furthermore, the acquisition of hyperspectral images lays the data foundation for subsequent feature extraction.

[0060] Step S202: Extract image features from the hyperspectral image to obtain spectral features, color features, and texture features. Based on the tobacco shreds of the leaf group to be analyzed, the spectral features, color features, and texture features, generate the analysis matrix of the tobacco shreds of the leaf group to be analyzed.

[0061] Among them, spectral features can be understood as the specific spectral information exhibited by matter after interacting with light, providing important information about the composition, structure and properties of matter; color features can be understood as the color attributes of an object as it appears visually, used to describe and distinguish different objects or materials; texture features can be understood as the structural and shape features of an object's surface, providing important information about the properties and internal structure of matter.

[0062] Optionally, server 104 extracts image features from the hyperspectral image to obtain spectral features, color features, and texture features. It then performs data-level fusion of these features and correlates them with the theoretical blending ratio values ​​recorded in step S201, combining them into a matrix to be analyzed. By extracting spectral, color, and texture features, the physical and chemical properties of cigarettes can be comprehensively analyzed, resulting in a more accurate and comprehensive description. Feature fusion increases the expressive power of the matrix to be analyzed, laying a data foundation for subsequent model training of the detection model using the matrix to be analyzed, and improving the training speed and accuracy of the model.

[0063] Step S203: Input the matrix to be analyzed into the pre-constructed tobacco blending ratio detection model to obtain the tobacco blending ratio of the tobacco group to be analyzed.

[0064] The tobacco blending ratio detection model can be understood as a convolutional neural network-long short-term memory network regression model.

[0065] For example, server 104 uses the matrix to be analyzed to train the detection model. This mainly involves using an adaptive motion estimation algorithm and the L2Loss loss function to fit the relationship between spectral feature data and the blending ratio of each tobacco component, optimizing the model parameters, and obtaining a tobacco blending ratio detection model. In a specific application, the server acquires a hyperspectral image of the tobacco from the leaf group to be analyzed, which records the corresponding theoretical tobacco blending ratio. Image features are extracted from the hyperspectral image, and the extracted image features are fused at the data level. Then, they are correlated with the theoretical tobacco blending ratio to obtain the matrix to be analyzed. This matrix is ​​input into the tobacco blending ratio detection model to obtain the tobacco blending ratio of the leaf group to be analyzed. A visualization of the blending ratio of each tobacco component in the tested leaf group is established. This visualization allows for the spatial distribution analysis of the blending ratio of each component in the tested leaf group. Furthermore, the blending uniformity of the tested leaf group is analyzed based on the detected tobacco blending ratio value and the theoretical tobacco blending ratio value.

[0066] By inputting the hyperspectral image to be analyzed and extracting the image features, data-level fusion is performed to generate the corresponding analysis matrix. This analysis matrix is ​​then passed as input to the trained model to achieve accurate detection of the blending ratio of tobacco shreds, thereby improving the accuracy of the blending uniformity analysis. Secondly, by establishing a visualization diagram of the blending ratio of each tobacco component in the tobacco shreds of the test leaf group, the proportion and spatial distribution of different tobacco components can be intuitively displayed. Visualization helps to analyze the uniformity of the sample and potential defect areas, allowing for timely correction and adjustment, thus ensuring the efficiency of tobacco production.

[0067] In the aforementioned method for analyzing the uniformity of tobacco blending, hyperspectral images of the tobacco shreds to be analyzed are acquired. Image features are extracted from these hyperspectral images to obtain spectral, color, and texture features. Based on these features, an analysis matrix is ​​generated for the tobacco shreds of the analyzed group. This analysis matrix is ​​then input into a pre-constructed tobacco blending ratio detection model to obtain the blending ratio of the tobacco shreds in the analyzed group. The method utilizes hyperspectral images for feature extraction and subsequent blending uniformity analysis, improving the accuracy and reliability of the analysis.

[0068] In one embodiment, acquiring a hyperspectral image of the tobacco shreds from the leaf group to be analyzed includes:

[0069] The original hyperspectral image, white-board hyperspectral image, and black-board hyperspectral image of the tobacco leaf group to be analyzed were acquired using a hyperspectral imager. The white-board hyperspectral image is a total reflectance hyperspectral image, and the black-board hyperspectral image is a non-reflectance hyperspectral image. Based on the white-board hyperspectral image and the black-board hyperspectral image, the original hyperspectral image was corrected to obtain the corrected hyperspectral image. Based on the corrected hyperspectral image, the corresponding binarized image mask was obtained, and the background of the corrected hyperspectral image was segmented using the binarized image mask to obtain the hyperspectral image.

[0070] Among them, a whiteboard hyperspectral image can be understood as an image with a relatively bright background (usually white or light-colored) and a relatively dark foreground object (e.g., black or dark-colored); a blackboard hyperspectral image can be understood as an image with a dark background (usually black or dark-colored) and a brighter foreground object (e.g., white, yellow, etc.).

[0071] Optionally, server 104 uses a hyperspectral imager to acquire the original hyperspectral image of the tobacco leaf group to be analyzed. After acquiring the hyperspectral image of the tobacco leaf group, it is also necessary to acquire a black and white plate image under the same experimental parameters and environment to correct the light source intensity and reduce the influence of the instrument's dark current. The white plate hyperspectral image is acquired after placing a 200*25*10nm polytetrafluoroethylene (PTFE) sample with 100% reflectivity below the lens. The black plate hyperspectral image is acquired after covering the camera lens with an opaque lens cap with near-0% reflectivity. The acquired original hyperspectral images are corrected using the following formula:

[0072]

[0073] In the above formula, For the corrected hyperspectral image, The original hyperspectral image, This is a hyperspectral image of a whiteboard. This is a hyperspectral image of a blackboard.

[0074] After obtaining the corrected hyperspectral image, the ENVI software is first used to find the bands with large differences in reflectance between the tobacco leaves and the background of the image. A suitable threshold is selected to establish a binarized image mask. Morphological operations such as pixel dilation and erosion are used to optimize the binarized image. Then, based on the obtained binarized image mask, the spectral image of each band in the hyperspectral image is segmented to obtain a hyperspectral image with complete background segmentation.

[0075] 1. Using black and white hyperspectral images, the original hyperspectral images acquired by the hyperspectral imager are corrected. The corrected hyperspectral images better reflect the characteristics of the tobacco shreds in the leaf group to be analyzed, thus improving the usability and effectiveness of the data.

[0076] 2. Using a binarization mask to segment the background of a hyperspectral image can yield a more effective hyperspectral image, which helps improve the accuracy of feature extraction and thus improves the training precision of the model.

[0077] In one embodiment, the spectral features are extracted through the following steps: determining the hyperspectral image of the tobacco shred region to be analyzed from the hyperspectral image; acquiring the pixel spectra within the hyperspectral image of the tobacco shred region to be analyzed, and determining the average value corresponding to the spectrum of each pixel; and using the average value as the spectral feature corresponding to the tobacco shred region to be analyzed.

[0078] For example, server 104 defines the tobacco leaf region in the hyperspectral image with background segmentation as the region of interest (ROI), and extracts the pixel spectra within the ROI. The extracted raw spectra are preprocessed using a wavelet function to reduce spectral noise. Finally, the average value of the spectra of all pixels within a single ROI is calculated to obtain the average spectrum of the tobacco leaf region to be analyzed. This average spectrum is then used as the spectral feature corresponding to the tobacco leaf region to be analyzed. Extracting the pixel spectra within the ROI specifically focuses on the data in the target region, removing background interference. Furthermore, the wavelet function preprocessing effectively reduces unnecessary interference introduced by noise, ensuring the integrity of the spectrum. Secondly, using the average value of the spectral data as the spectral feature corresponding to the tobacco leaf region to be analyzed reflects the overall characteristics of the tobacco leaf region to be analyzed, rather than just the instantaneous information of a single pixel, thus enhancing the overall expressive power of the spectral features.

[0079] In an exemplary embodiment, color features are extracted through the following steps: obtaining the corresponding RGB image based on the hyperspectral image; the RGB image includes an R channel image, a G channel image, and a B channel image; obtaining the mean, variance, and skewness of each channel in the R channel image, G channel image, and B channel image respectively; constructing a color feature vector based on the mean, variance, and skewness of each channel; and using the color feature vector as the color feature of the tobacco shreds in the leaf group to be analyzed.

[0080] Among them, the wavelength of the R (red) channel image is the longest among red, green and blue light, the wavelength of the G (green) channel image is the second longest among red, green and blue light, and the wavelength of the B (blue) channel image is the shortest among red, green and blue light.

[0081] Optionally, server 104 extracts the band images at 657nm (red light), 550nm (green light), and 449nm (blue light) from the hyperspectral image and merges them to form an RGB image. Based on this synthesized RGB image, background segmentation and morphological processing are performed using HSV color space transformation to obtain a complete image of the tobacco leaf group after background removal. Based on this image, the first moment (i.e., the aforementioned mean), second moment (i.e., the aforementioned variance), and third moment (i.e., the aforementioned skewness) of the R, G, and B channel images are calculated respectively. A color feature vector is formed based on the aforementioned n (n is 1, 2, or 3) moments, and this color feature vector is used as the color feature of the tobacco leaf group to be analyzed. By extracting specific wavelength bands of the hyperspectral image (red light, green light, and blue light) and synthesizing an RGB image, visualization effects can be obtained from the hyperspectral data. This process transforms hyperspectral data into color images that are easy for humans to understand, and performs a series of image processing steps based on this to improve the effectiveness of RGB images. Then, the nth-order moments corresponding to each channel image are calculated and fused to generate feature vectors, so that the color features of the tobacco shreds in the analyzed leaf group are unique, which is beneficial to distinguish them from other tobacco shreds in the analyzed leaf group, thereby improving the accuracy of the blending uniformity analysis.

[0082] In one embodiment, texture features are extracted through the following steps: performing principal component analysis on the hyperspectral image to obtain the target principal component image; calculating the contrast, homogeneity, energy, and correlation of the target principal component image using the gray-level co-occurrence matrix method; and using the contrast, homogeneity, energy, and correlation as the texture features corresponding to the tobacco shreds of the leaf group to be analyzed.

[0083] Among them, the gray-level co-occurrence matrix (GLCM) method can be understood as a commonly used image processing and analysis technique used to extract texture features of an image.

[0084] For example, server 104 performs principal component analysis on the hyperspectral image, projecting the high-dimensional spectral data into a low-dimensional space and extracting the first three principal component images that can explain most of the spectral information, thus reducing the data dimensionality while retaining the main information. Texture features are extracted from the principal component images using the Gray-Level Co-occurrence Matrix (GLCM) method. GLCM captures texture information in different regions of the image by analyzing the spatial relationships between pixel gray levels. GLCM is a two-dimensional matrix whose size is related to the number of gray levels in the image. Extracting GLCM from an image mainly includes the following steps: First, the original image is converted to a grayscale image, and the parameters of the GLCM are determined, including the number of gray levels, pixel distance, and orientation. Then, each pixel in the image is traversed, and the gray level relationship between it and its neighboring pixels at a specified distance and orientation is calculated. Finally, based on the calculated gray level relationships, the frequency of each relationship is counted, and the corresponding elements in the GLCM are updated. The extracted texture features include contrast, homogeneity, energy, and correlation.

[0085] 1. Principal component analysis (PCA) is used to project high-dimensional spectral data into a low-dimensional space and extract the first three principal components. This process effectively reduces the dimensionality of the data while preserving the main information in the original data to the maximum extent. This not only reduces computational complexity but also improves the efficiency of subsequent analysis by removing redundant information.

[0086] 2. The GLCM method is used to extract rich texture features from principal component images, providing detailed information about hyperspectral images. By analyzing the spatial relationship between pixel gray levels, texture information in different regions of the image can be captured, improving the overall expressive power of texture features.

[0087] In one embodiment, the tobacco shreds of the leaf group to be analyzed correspond to the theoretical blending ratio of each tobacco component that makes up the tobacco shreds of the leaf group to be analyzed; based on the tobacco shreds of the leaf group to be analyzed, spectral features, color features, and texture features, an analysis matrix of the tobacco shreds of the leaf group to be analyzed is generated, including: performing data-level fusion of spectral features, color features, and texture features to obtain a feature matrix of the tobacco shreds of the leaf group to be analyzed; and obtaining the analysis matrix of the tobacco shreds of the leaf group to be analyzed based on the feature matrix and the theoretical blending ratio.

[0088] The theoretical blending ratio can be understood as the reasonable ratio after the designed proportions of each component of a certain cigarette brand have fluctuated up and down. When the tobacco leaves are mixed according to this ratio, it can be seen that this ratio is the ideal ratio, not the actual blending ratio of the mixed tobacco leaves.

[0089] Optionally, server 104 performs data-level fusion of spectral, color, and texture features to obtain a feature matrix of the tobacco leaf group to be analyzed. Then, based on the feature matrix and the theoretical blending ratio, it combines these features to obtain the analysis matrix of the tobacco leaf group. Data-level fusion combines different types of features (spectral, color, and texture) to comprehensively capture the characteristics of the tobacco leaf group to be analyzed. Adjustments are made based on the theoretical blending ratio when generating the analysis matrix, taking into account the impact of different features on the data results. This approach ensures that the model reasonably considers the importance of each feature in practical applications, making the analysis model's results more realistic and improving the accuracy of the analysis of the blending uniformity of the tobacco leaf group.

[0090] In one exemplary embodiment, such as Figure 3 As shown, a specific implementation of a method for analyzing the uniformity of tobacco blending is provided (the following data is a specific example, and is not limited to the implementation of this application only under this condition), wherein:

[0091] S1. Obtain samples of tobacco shreds, stems, reconstituted tobacco leaves, and expanded tobacco shreds of a specified brand from the cigarette factory's tobacco processing line. Mix the various tobacco shred components in a certain proportion (the mixing proportion should be a reasonable proportion after the designed proportion of each component of the cigarette brand has been adjusted up or down within a certain range). Obtain leaf group tobacco shred samples with different mixing proportions and record the theoretical mixing proportion values ​​of tobacco shreds, stems, reconstituted tobacco leaves, and expanded tobacco shreds in the leaf group tobacco shred samples.

[0092] S2, Hyperspectral Image Acquisition: Hyperspectral images of tobacco leaves in the 400-2500 nm range are acquired using a hyperspectral imager. Before acquisition, the instrument is turned on and preheated for at least 30 minutes to reduce baseline drift caused by poor instrument measurement stability. The tobacco leaf sample is laid flat on a black background with zero reflectance and placed on the moving platform of the hyperspectral imaging system. To avoid distortion and hyperspectral image deformation, appropriate settings are made for the moving platform speed, the distance between the camera lens and the sample, and the camera exposure time.

[0093] S3, Hyperspectral Image Correction: After acquiring hyperspectral images of the tobacco leaves, black and white images need to be acquired under the same experimental parameters and environment to correct the light source intensity and reduce the influence of the instrument's dark current. The white image (i.e., the aforementioned white hyperspectral image) was acquired after placing a 200*25*10nm polytetrafluoroethylene (PTFE) image with 100% reflectivity below the lens. The black image (i.e., the aforementioned black hyperspectral image) was acquired after covering the camera lens with an opaque lens cap with near-0% reflectivity. The following formula was used to correct the acquired original images:

[0094]

[0095] In the above formula, For the corrected hyperspectral image, For hyperspectral images, The image is a whiteboard. This is a blackboard image.

[0096] S4, Hyperspectral Image Thresholding Segmentation: After obtaining the corrected hyperspectral image, ENVI software is first used to find the bands with large differences in reflectance between the tobacco leaves and the image background, and a suitable threshold is selected to establish a binarized image mask. Morphological operations such as pixel dilation and erosion are used to optimize the binarized image. Then, based on the obtained binarized image mask, the spectral image of each band in the hyperspectral image is segmented to obtain a hyperspectral image with complete background segmentation.

[0097] S5, Hyperspectral Image Feature Extraction:

[0098] (1) Spectral features: The tobacco leaf area in the hyperspectral image with background segmentation is defined as the region of interest, and the spectra of the pixels in the region of interest are extracted. The extracted original spectra are preprocessed with wavelet function to reduce spectral noise. Finally, the average value of the spectra of all pixels in a single region of interest is calculated to obtain the average spectrum of the corresponding tobacco leaf sample.

[0099] (2) Color features: The band images at 657nm, 550nm and 449nm in the hyperspectral image were extracted and merged to form an RGB image. Based on the synthesized RGB image, background segmentation and morphological processing were performed after HSV color space transformation to obtain a complete image of the tobacco leaf group with the background removed. Based on this image, the first, second and third moments of the R, G and B channel images were calculated as color features.

[0100] (3) Texture Features: Principal component analysis is performed on the hyperspectral image to project the high-dimensional spectral data into a low-dimensional space. The first three principal component images that can explain most of the spectral information are extracted to reduce the data dimensionality while retaining the main information. Texture features are extracted from the principal component images using the Gray Level Co-occurrence Matrix (GLCM) method. GLCM captures the texture information of different regions in the image by analyzing the spatial relationship between pixel gray levels. GLCM is a two-dimensional matrix whose size is related to the number of gray levels in the image. Extracting GLCM from the image mainly includes the following steps: First, the original image is converted into a grayscale image, and the parameters of GLCM are determined, including the number of gray levels, the distance between pixels, and the orientation. Then, each pixel in the image is traversed, and the gray level relationship between it and its adjacent pixels at a specified distance and orientation is calculated. Finally, based on the calculated gray level relationship, the frequency of each relationship is counted, and the corresponding elements in GLCM are updated. The extracted texture features include: contrast, homogeneity, energy, and correlation. Contrast refers to local variations in a GLCM, representing the degree of difference between local grayscale values ​​in an image; correlation refers to the similarity between row or column elements in a GLCM, representing the joint probability of a specified pair of pixels; energy, also known as uniformity or angular second moment, refers to the sum of squares of all elements in a GLCM; homogeneity refers to the degree of proximity of the element distribution in a GLCM to the diagonal of the GLCM, used to measure the uniformity of local grayscale values ​​in an image.

[0101] S6, Data Fusion: The spectral features, color features, and texture features extracted above are fused at the data level to obtain the feature matrix of each tobacco sample.

[0102] S7, Dataset Partitioning: The feature matrices of all obtained tobacco leaf samples are mapped to their theoretical blending ratios for each tobacco component, forming a sample matrix. This matrix is ​​then divided into a modeling set and a prediction set at a 2:1 ratio using the Kennard-Stone algorithm.

[0103] S8, Construction of Convolutional Neural Network-Long Short-Term Memory Network Regression Model: The structure of the Convolutional Neural Network-Long Short-Term Memory Network Regression Model is as follows... Figure 4As shown, it includes: an input layer (Input:layer m*n), a batch processing layer (BatchNoemalization), a one-dimensional convolutional layer (Conv1D(32,3,1)), a max pooling layer (MaxPool1D(2,2)), a batch processing layer (Batch Noemalization), a long short-term memory network layer (LSTM(32)), a batch processing layer (BatchNoemalization), a long short-term memory network layer (LSTM(16)), and an output layer (Output layer(1)). First, there's the input layer, which receives one-dimensional features (m*n, where m is the number of samples and n is the feature dimension) from the tobacco leaf samples. Next, there's a batch processing layer, primarily used to standardize the input spectral data and improve training stability. Then, there's a one-dimensional convolutional layer with 32 kernels (3*1 size) to extract local features from the spectrum. Following this, a max-pooling layer with a moving window size of 2 and a stride of 2 is used to downsample the convolutional features, reducing data dimensionality while retaining important information. Next, there's a batch processing layer and a long short-term memory (LSTM) network layer with 32 neurons. Then, another batch processing layer and an LSM network layer with 16 neurons are added. Finally, a fully connected layer with one neuron serves as the output layer, using a linear activation function to predict the blending ratio of the tobacco components being tested.

[0104] S9: Train the constructed convolutional neural network-long short-term memory network regression model. Input the feature data of the modeling set samples and the blending ratio data of the tobacco shreds to be tested into the model. Use an adaptive motion estimation algorithm and the MSE loss function to train the model. Fit the relationship between the feature data and the blending ratio of the tobacco shreds to be tested. Set the batch size to 32 and the learning rate to 0.05. After every 100 training iterations, reduce the learning rate by a factor of 10. According to this plan, the training process will terminate once the loss stabilizes to ensure efficient convergence. Using this training method and the above network structure, construct four models for detecting the blending ratio of tobacco shreds, stems, reconstituted tobacco shreds, and expanded tobacco shreds.

[0105] S10: Based on the model constructed above, the mixing ratio of each tobacco component at each pixel in the hyperspectral image of the tobacco shreds to be tested is predicted, forming a visualization of the mixing ratio of the four types of tobacco components in the tobacco shreds to be tested. The spatial distribution of the mixing ratio of each component in the tobacco shreds sample of the tobacco shreds is analyzed through this visualization, and then the mixing uniformity is evaluated.

[0106] Compared with the prior art, this application has the following technical advantages:

[0107] 1. By using hyperspectral imaging technology to obtain spectral information in the visible to near-infrared range, the spectral characteristics of different components in tobacco can be clearly distinguished, thus providing a scientific basis for the quantitative evaluation of blending uniformity.

[0108] 2. Perform image correction and threshold segmentation on the acquired hyperspectral images, and extract features from the hyperspectral images after the above processing. This can improve the expressive power of the extracted features, thereby improving the detection accuracy of the trained model.

[0109] 3. By constructing and training a convolutional neural network-long short-term memory network regression model, the generalization ability and detection accuracy of the trained convolutional neural network-long short-term memory network regression model are improved, thereby improving the accuracy of the analysis of the blending uniformity of the tobacco shreds to be analyzed.

[0110] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0111] Based on the same inventive concept, this application also provides a tobacco blending uniformity analysis device for implementing the tobacco blending uniformity analysis method described above. The solution provided by this device is similar to the solution described in the above method. Therefore, the specific limitations of one or more tobacco blending uniformity analysis device embodiments provided below can be found in the limitations of the tobacco blending uniformity analysis method described above, and will not be repeated here.

[0112] In one exemplary embodiment, such as Figure 5 As shown, a device for analyzing the uniformity of tobacco blending is provided, comprising: an image acquisition module 501, a feature extraction module 502, and an analysis module 503, wherein:

[0113] Image acquisition module 501 is used to acquire hyperspectral images of the tobacco shreds in the leaf group to be analyzed;

[0114] The feature extraction module 502 is used to extract image features from the hyperspectral image to obtain spectral features, color features and texture features, and generate the analysis matrix of the tobacco shreds in ...

[0115] Analysis module 503 is used to input the matrix to be analyzed into a pre-built tobacco blending ratio detection model to obtain the tobacco blending ratio of the tobacco group to be analyzed.

[0116] In one embodiment, the image acquisition module 501 is further configured to acquire, using a hyperspectral imager, the original hyperspectral image, the whiteboard hyperspectral image, and the blackboard hyperspectral image corresponding to the tobacco shreds of the leaf group to be analyzed; the whiteboard hyperspectral image is a total reflectance hyperspectral image, and the blackboard hyperspectral image is a non-reflectance hyperspectral image; based on the whiteboard hyperspectral image and the blackboard hyperspectral image, the original hyperspectral image is corrected to obtain a corrected hyperspectral image; based on the corrected hyperspectral image, a corresponding binarized image mask is obtained, and the background of the corrected hyperspectral image is segmented using the binarized image mask to obtain the hyperspectral image.

[0117] In one embodiment, the feature extraction module 502 includes a spectral feature extraction submodule, which is used to determine the hyperspectral image of the tobacco shred region to be analyzed from the hyperspectral image; acquire the pixel spectra in the hyperspectral image of the tobacco shred region to be analyzed, and determine the average value corresponding to the spectrum of each pixel; and use the average value as the spectral feature corresponding to the tobacco shred region to be analyzed.

[0118] In an exemplary embodiment, the feature extraction module 502 further includes a color feature extraction submodule, used to obtain the corresponding RGB image based on the hyperspectral image; the RGB image includes an R channel image, a G channel image and a B channel image; the mean, variance and skewness of each channel in the R channel image, G channel image and B channel image are obtained respectively; a color feature vector is constructed based on the mean, variance and skewness of each channel; and the color feature vector is used as the color feature of the tobacco shreds of the leaf group to be analyzed.

[0119] In one embodiment, the feature extraction module 502 further includes a texture feature extraction submodule, which is used to perform principal component analysis on the hyperspectral image to obtain a target principal component image; calculate the contrast, homogeneity, energy and correlation of the target principal component image using the gray-level co-occurrence matrix method; and use the contrast, homogeneity, energy and correlation as the texture features corresponding to the tobacco shreds of the leaf group to be analyzed.

[0120] In one embodiment, the tobacco shreds of the leaf group to be analyzed correspond to the theoretical blending ratio values ​​of each tobacco component that makes up the tobacco shreds of the leaf group to be analyzed; the feature extraction module 502 is also used to perform data-level fusion of spectral features, color features and texture features to obtain the feature matrix of the tobacco shreds of the leaf group to be analyzed; and the analysis matrix of the tobacco shreds of the leaf group to be analyzed is obtained based on the feature matrix and the theoretical blending ratio values.

[0121] Each module in the aforementioned tobacco blending uniformity analysis device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0122] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6 As shown, the computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs in the non-volatile storage media to run. The database stores the tobacco leaf groups to be analyzed, hyperspectral images, spectral features, color features, texture features, and matrix data to be analyzed. The I / O interfaces are used for information exchange between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a method for analyzing the uniformity of tobacco blending.

[0123] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0124] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the tobacco blending uniformity analysis method of the above embodiment.

[0125] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the tobacco blending uniformity analysis method of the above embodiment.

[0126] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the tobacco blending uniformity analysis method of the above embodiments.

[0127] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0128] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0129] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0130] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for analyzing the uniformity of tobacco blending, characterized in that, The method includes: Acquire a hyperspectral image of the tobacco shreds in the leaf group to be analyzed; the tobacco shreds in the leaf group to be analyzed correspond to the theoretical mixing ratio values ​​of each tobacco component that makes up the tobacco shreds in the leaf group to be analyzed; Image features are extracted from the hyperspectral image to obtain spectral features, color features, and texture features. The spectral features, color features, and texture features are then fused at the data level to obtain the feature matrix of the tobacco shreds in the leaf group to be analyzed. The color features are extracted through the following steps: obtaining the corresponding RGB image based on the hyperspectral image; obtaining the mean, variance, and skewness of each channel in the R, G, and B channels of the RGB image respectively; constructing a color feature vector based on the mean, variance, and skewness of each channel; and using the color feature vector as the color feature of the tobacco shreds in the leaf group to be analyzed. The texture features are extracted through the following steps: projecting the hyperspectral image into a low-dimensional space to obtain the corresponding low-spectral image, and extracting the first three low-spectral images as target principal component images; calculating the target principal component images using the gray-level co-occurrence matrix method to obtain contrast, homogeneity, energy, and correlation; the contrast is the local variation in the gray-level co-occurrence matrix, characterizing the change in local gray-level values ​​of the image; the homogeneity refers to the degree of proximity of the element distribution in the gray-level co-occurrence matrix to the diagonal, used to measure the uniformity of local gray-level values ​​of the image; the energy is the sum of squares of each element in the gray-level co-occurrence matrix; and the correlation refers to the similarity between row or column elements in the gray-level co-occurrence matrix, characterizing the joint probability of a specified pixel pair; the contrast, homogeneity, energy, and correlation are used as the texture features corresponding to the tobacco shreds of the leaf group to be analyzed. The feature matrix of the tobacco shreds in the leaf group to be analyzed is matched with the theoretical blending ratio of each tobacco component in the leaf group to be analyzed, and the matrix to be analyzed is obtained by combining them. The matrix to be analyzed is input into a pre-constructed tobacco blending ratio detection model to obtain the tobacco blending ratio of the tobacco in the leaf group to be analyzed; the tobacco blending ratio detection model is a convolutional neural network-long short-term memory network regression model.

2. The method according to claim 1, characterized in that, The acquisition of hyperspectral images of the tobacco shreds in the leaf group to be analyzed includes: The original hyperspectral image, whiteboard hyperspectral image, and blackboard hyperspectral image corresponding to the tobacco shreds of the leaf group to be analyzed were acquired using a hyperspectral imager; the whiteboard hyperspectral image is a total reflectance hyperspectral image, and the blackboard hyperspectral image is a non-reflectance hyperspectral image; Based on the hyperspectral images of the whiteboard and the blackboard, the original hyperspectral image is corrected to obtain the corrected hyperspectral image; Based on the corrected hyperspectral image, a corresponding binarized image mask is obtained, and the background of the corrected hyperspectral image is segmented using the binarized image mask to obtain the hyperspectral image.

3. The method according to claim 2, characterized in that, The spectral features are extracted through the following steps: The hyperspectral image of the tobacco shred region of the leaf group to be analyzed is determined from the hyperspectral image; Obtain the pixel spectra within the hyperspectral image of the tobacco shred region of the leaf group to be analyzed, and determine the average value corresponding to the spectra of each pixel. The average value is used as the spectral characteristics of the tobacco shreds in the leaf group to be analyzed.

4. The method according to claim 1, characterized in that, The tobacco shreds to be analyzed are obtained by mixing various tobacco shred components in a certain proportion.

5. A device for analyzing the uniformity of tobacco blending, characterized in that, The device includes: The image acquisition module is used to acquire hyperspectral images of the tobacco shreds in the leaf group to be analyzed; the tobacco shreds in the leaf group to be analyzed correspond to the theoretical mixing ratio values ​​of each tobacco component that makes up the tobacco shreds in the leaf group to be analyzed; The feature extraction module is used to extract image features from the hyperspectral image to obtain spectral features, color features, and texture features, and to perform data-level fusion of the spectral features, color features, and texture features to obtain the feature matrix of the tobacco shreds in the leaf group to be analyzed; the data-level fusion is to combine the spectral features, color features, and texture features; and to match the feature matrix of the tobacco shreds in the leaf group to be analyzed with the theoretical blending ratio values ​​of each tobacco component in the tobacco shreds in the leaf group to be analyzed, and to combine them to obtain the analysis matrix of the tobacco shreds in the leaf group to be analyzed; The color features are extracted through the following steps: obtaining the corresponding RGB image based on the hyperspectral image; obtaining the mean, variance, and skewness of each channel in the R, G, and B channels of the RGB image respectively; constructing a color feature vector based on the mean, variance, and skewness of each channel; and using the color feature vector as the color feature of the tobacco shreds in the leaf group to be analyzed. The texture features are extracted through the following steps: projecting the hyperspectral image into a low-dimensional space to obtain the corresponding low-spectral image, and extracting the first three low-spectral images as target principal component images; calculating the target principal component images using the gray-level co-occurrence matrix method to obtain contrast, homogeneity, energy, and correlation; the contrast is the local variation in the gray-level co-occurrence matrix, characterizing the change in local gray-level values ​​of the image; the homogeneity refers to the degree of proximity of the element distribution in the gray-level co-occurrence matrix to the diagonal, used to measure the uniformity of local gray-level values ​​of the image; the energy is the sum of squares of each element in the gray-level co-occurrence matrix; and the correlation refers to the similarity between row or column elements in the gray-level co-occurrence matrix, characterizing the joint probability of a specified pixel pair; the contrast, homogeneity, energy, and correlation are used as the texture features corresponding to the tobacco shreds of the leaf group to be analyzed. The analysis module is used to input the matrix to be analyzed into a pre-constructed tobacco blending ratio detection model to obtain the tobacco blending ratio of the tobacco in the leaf group to be analyzed; the tobacco blending ratio detection model is a convolutional neural network-long short-term memory network regression model.

6. The apparatus according to claim 5, characterized in that, The device further includes: The image acquisition module is further configured to acquire, using a hyperspectral imager, the original hyperspectral image, the whiteboard hyperspectral image, and the blackboard hyperspectral image corresponding to the tobacco shreds of the leaf group to be analyzed; the whiteboard hyperspectral image is a total reflectance hyperspectral image, and the blackboard hyperspectral image is a non-reflectance hyperspectral image; based on the whiteboard hyperspectral image and the blackboard hyperspectral image, the original hyperspectral image is corrected to obtain a corrected hyperspectral image; based on the corrected hyperspectral image, a corresponding binarized image mask is obtained, and the background of the corrected hyperspectral image is segmented using the binarized image mask to obtain the hyperspectral image.

7. The apparatus according to claim 6, characterized in that, The feature extraction module further includes: The spectral feature extraction submodule is used to determine the hyperspectral image of the tobacco shred region to be analyzed from the hyperspectral image; acquire the pixel spectra within the hyperspectral image of the tobacco shred region to be analyzed, and determine the average value corresponding to the spectra of each pixel; and use the average value as the spectral feature corresponding to the tobacco shred region to be analyzed.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 4.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Intelligent classification system and method for tobacco leaves based on machine vision and hyperspectral technology

    CN103543107A

  • Stone cultural relic disease identification method based on hyperspectral image

    CN119851124A