Tobacco spectral feature classification method

By combining multi-scale dense graph attention networks and semi-supervised local Fisher discriminant analysis, the problems of high-dimensional redundancy and sample scarcity in tobacco leaf spectral classification are solved, achieving high-precision and robust tobacco leaf classification, which is suitable for batch classification in actual production.

CN121640158APending Publication Date: 2026-03-10CHINA TOBACCO YUNNAN IND
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-02
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Existing tobacco leaf spectral classification methods suffer from problems such as high-dimensional redundancy and information overload, scarce training samples, large spectral variability, and insufficient fusion of multi-scale features, resulting in low classification accuracy and poor robustness.

Method used

A multi-scale dense graph attention network is adopted, and dimensionality reduction is performed through semi-supervised local Fisher discriminant analysis. A multi-scale graph is constructed by combining a simple linear iterative clustering algorithm. Spectral-spatial convolution and an improved graph attention network are used for feature extraction and fusion to achieve cross-scale feature alignment and classification.

Benefits of technology

It achieves high-precision and robust tobacco leaf classification, reduces computational complexity, adapts to limited sample scenarios, and improves classification accuracy and generalization ability, making it suitable for batch classification needs in actual production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121640158A_ABST
    Figure CN121640158A_ABST
Patent Text Reader

Abstract

The invention provides a tobacco leaf spectral feature classification method which is suitable for automatic identification of tobacco leaf varieties, quality grades and pest and disease damage types. The method comprises the following steps: collecting and preprocessing hyperspectral data of tobacco leaves, and reducing dimensionality by adopting semi-supervised local Fisher discriminant analysis (Semi-LFDA); constructing a multi-scale graph structure by using a simple linear iterative clustering (SLIC) algorithm, wherein each superpixel is used as a graph node; extracting shallow layer features through a spectrum-spatial convolution (SSConv) module; an improved graph attention network (GATv2) and a graph node feature alignment (GNFA) module are introduced, and dense feature fusion of a multi-scale graph is realized; and finally, outputting a classification result through feature fusion and a Softmax classifier. According to the method, high-precision classification (OA is larger than or equal to 91%, and Kappa is larger than or equal to 90%) can still be achieved under limited samples, and good robustness and engineering practicability are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of classification technology, and specifically to a method for classifying tobacco leaves by spectral characteristics. Background Technology

[0002] As an important economic crop, the quality of tobacco leaves (such as grade, purity, and degree of pest and disease damage) directly affects the quality and economic benefits of tobacco products. Traditional tobacco leaf classification relies on manual sensory evaluation, which suffers from problems such as strong subjectivity, low efficiency, and poor consistency, making it difficult to meet the needs of large-scale and precise production.

[0003] Hyperspectral technology can capture continuous spectral information of tobacco leaves in the 400-2500 nm wavelength range. Its spectral characteristics can reflect the biochemical components (such as chlorophyll, carotenoids, and nicotine), tissue structure, and stress status of tobacco leaves, providing data support for objective classification. However, the practical application of tobacco hyperspectral data faces the following key challenges:

[0004] 1. High-dimensional redundancy and information overload: Tobacco leaf hyperspectral data usually contains hundreds of bands, some of which are strongly correlated, which not only increases computational complexity but also easily introduces noise interference;

[0005] 2. Scarcity of training samples: The collection, preprocessing (such as drying and grinding) and category labeling (such as variety and grade) of tobacco leaf samples require professional personnel, which is costly and time-consuming, resulting in a limited number of labeled samples, making it difficult to support the training of traditional deep learning models.

[0006] 3. High spectral variability: The spectral characteristics of the same variety of tobacco leaves vary significantly due to factors such as growth cycle (vigorous growth period, maturity period), part (upper leaf, middle leaf, lower leaf), and environmental stress (drought, pests and diseases), making it difficult for a single-scale feature model to fully characterize them.

[0007] 4. Insufficient multi-scale feature fusion: Existing classification methods, such as Support Vector Machine (SVM), single convolutional neural network (CNN), and ordinary graph neural network (GNN), have certain limitations. SVM is difficult to handle high-dimensional nonlinear data, CNN relies on fixed convolutional kernels and cannot adapt to the irregular spatial distribution of tobacco leaves, and ordinary GNN adopts a single graph structure, which cannot effectively fuse spectral-spatial features of different scales, resulting in low classification accuracy and poor robustness.

[0008] To address the aforementioned issues, there is an urgent need for a tobacco leaf spectral classification method that can efficiently reduce dimensionality, adapt to limited samples, and integrate multi-scale features. Summary of the Invention

[0009] This invention aims to overcome the shortcomings of existing tobacco leaf spectral classification methods, such as high-dimensional redundancy, sample dependence, and insufficient multi-scale feature capture. It provides a tobacco leaf spectral feature classification method based on multi-scale dense graph attention network to achieve high-precision and robust classification of tobacco leaf categories (variety, grade, pests and diseases).

[0010] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:

[0011] A method for classifying the spectral characteristics of tobacco leaves includes the following steps:

[0012] S1. Acquisition and Preprocessing of Tobacco Leaf Spectral Data: Hyperspectral data of tobacco leaves were acquired, labeled with tobacco leaf categories, noise bands were removed and smoothed, and semi-supervised local Fisher discriminant analysis was used to reduce the dimensionality of the processed data to obtain the dimensionality-reduced data. ;

[0013] S2. Multi-scale graph construction: The Simple Linear Iterative Clustering Algorithm (SLIC) is used for... The corresponding hyperspectral image is segmented into superpixels to generate at least two graphs at different scales. Each superpixel serves as a graph node, and the node feature is the average spectral feature of all pixels within the superpixel. A pixel-node association matrix for each scale is constructed and pre-stored. and regularization matrix ;

[0014] S3, Shallow Feature Extraction: [This section appears to be incomplete and requires further context.] The SSConv module, which performs spectral-spatial convolution, is applied to extract shallow spectral-spatial features by sequentially passing the spectral convolution submodule and the spatial convolution submodule. ;

[0015] S4. Multi-scale graph attention feature learning: An improved graph attention network, GATv2, is applied sequentially to the graph at each scale. Dense connections between graphs at different scales are achieved through a GNFA module that aligns graph node features. The GNFA module... and This involves transforming and aligning node features between pixel space and graph space to obtain cross-scale fused pixel-level features. ;

[0016] S5. Feature Fusion and Classification: [This section appears to be incomplete and requires further context.] The SSConv module is input again to fuse features, and the tobacco leaf classification results are output through a fully connected layer and a Softmax function.

[0017] Furthermore, in step S1, the acquisition and preprocessing of tobacco leaf spectral data specifically includes:

[0018] S1.1. Use a hyperspectral imager to collect hyperspectral data of tobacco leaf samples, covering the spectral band range of 400-2500nm, and obtain a hyperspectral data tensor of size H×W×C (H is the height, W is the width, and C is the number of bands), while labeling the sample category.

[0019] S1.2. Eliminate noise bands and use Gaussian filtering to smooth the spectral curve and remove random noise;

[0020] S1.3. Semi-supervised local Fisher discriminant analysis is used to reduce the dimensionality of the processed data.

[0021] Furthermore, in the dimensionality reduction process of step S1.3, labeled samples are set. Unlabeled samples Total sample Where d is the original number of bands, and n = n' + n'';

[0022] Calculate the local inter-class scatter matrix of the labeled samples. Local intra-class scatter matrix Through formula Regularization ( , Let be the total divergence matrix, where It is the identity matrix. For cumulative contribution rate, the regularization parameter The value ranges from 0.2 to 0.4;

[0023] Solving the generalized eigenvalue problem Select cumulative contribution rate The transformation matrix is ​​formed by ≥99% of the eigenvectors, reducing the dimensionality of the original data to r dimensions. Obtain the dimensionality-reduced data .

[0024] Furthermore, in step S2, the multi-scale graph construction specifically includes:

[0025] S2.1 Set at least 3 different numbers of superpixels, with each superpixel corresponding to one graph node;

[0026] S2.2, The feature of each node is the average spectral feature of all pixels within its corresponding superpixel, i.e. ,in, Let m be the set of pixels of the m-th superpixel. for The number of pixels;

[0027] S2.3 Construct the pixel-node correlation matrix for each scale. , Let be the number of superpixels at the k-th scale. If the n-th pixel belongs to the m-th superpixel, then... Otherwise, it is 0; at the same time, the regularization matrix is ​​calculated. ,in, It is a diagonal matrix, with diagonal elements Pre-deposit and Used for subsequent feature transformation.

[0028] Furthermore, in step S3, the shallow feature extraction specifically includes:

[0029] S3.1, To Batch normalization, 1×1 convolution, and LeakyReLU activation are performed sequentially to capture fine-grained features of the tobacco leaf spectral dimension;

[0030] S3.2. Two consecutive 3×3 depthwise separable convolutions are used, with LeakyReLU activation inserted in between, to extract the spatial distribution features of tobacco leaves;

[0031] S3.3 Obtain shallow features .

[0032] Furthermore, in step S4, the multi-scale graph attention feature learning specifically includes:

[0033] S4.1. For each scale k of the graph, apply a two-layer GATv2 network:

[0034] First layer: Employs a 4-head attention mechanism, with input as... Through formula Update node features, where W is the learnable weight. Attention coefficient Calculated using the following formula: calculate;

[0035] The second layer employs a single-head attention mechanism, fusing the outputs of four attention heads to obtain node-level features at this scale. ;

[0036] S4.2. For adjacent scales k and k+1, feature alignment and transfer are achieved using GNFA:

[0037] Encoding: Pixel-level features at scale k pass Convert to node-level features ;

[0038] Decoding: updating node-level features pass Convert back to pixel-level features ,in, Let k be the graph adjacency matrix of scale k;

[0039] Alignment: As one of the inputs at scale k+1, it enables cross-scale feature transfer;

[0040] S4.3. Employing a dense connection strategy similar to DenseNet, the output features at the (k+1)th scale... This allows the feature dimensions to grow exponentially while preserving effective features at each scale.

[0041] Furthermore, in step S5, the feature fusion and classification specifically include:

[0042] S5.1 High-dimensional feature fusion: This involves fusing the final pixel-level feature map. Input the SSConv module again, compress the channel dimension through 1×1 convolution, and fuse multi-scale features through 3×3 convolution to obtain the fused features. ;

[0043] S5.2, Classification Output: ... After flattening, the material is input into a fully connected layer. The probability of each category is calculated using the Softmax function, and the category with the highest probability is output as the tobacco classification result.

[0044] Furthermore, after step S5, the following steps are also included:

[0045] S6. Model Training and Validation: The Adam optimizer and cross-entropy loss function are used. During this process, the learning rate is 1e-3, the weight decay is 1e-5, the number of training epochs is 600-800, and the batch size is 32. Then, 5-fold cross-validation is used, and the overall accuracy (OA), average accuracy (AA), and Kappa coefficient are used as evaluation metrics to iteratively optimize the model parameters.

[0046] Compared with the prior art, the beneficial effects of the present invention are:

[0047] 1. High efficiency in dimensionality reduction and noise suppression: By combining Semi-LFDA with semi-supervised information, redundancy and noise are effectively removed while preserving key spectral features of tobacco leaves (such as biochemical component-related bands), thus reducing computational complexity.

[0048] 2. Adaptable to scenarios with limited samples: The multi-scale graph structure utilizes superpixels to aggregate local information, reducing the dependence on labeled samples; GATv2's attention mechanism can focus on key features, improving classification robustness under small sample conditions;

[0049] Comprehensive capture of multi-scale features: SLIC is used to construct maps at different scales to adapt to the spectral differences of different parts of tobacco leaves (such as veins and mesophyll) and different growth stages; the GNFA module realizes cross-scale feature alignment, avoiding the feature misalignment problem of traditional multi-scale methods;

[0050] 3. High accuracy and strong generalization: Dense connections and spectral-spatial convolution fuse multi-scale and multi-dimensional features, enabling the model to cope with complex scenarios such as tobacco diseases and pests, and mixed varieties. Experimental verification shows that the method achieves OA≥91% and Kappa≥90% in tobacco classification tasks, which is significantly better than SVM (OA≈75%), single CNN (OA≈80%), and ordinary GAT (OA≈85%).

[0051] 4. Highly practical for engineering applications: Simplified end-to-end process with pre-calculated... and It can improve reasoning speed and adapt to the needs of batch classification of tobacco leaves in actual production. Attached Figure Description

[0052] Figure 1 This is a flowchart illustrating the tobacco leaf spectral feature classification method described in the invention.

[0053] Figure 2 Schematic diagram of tobacco leaf hyperspectral data acquisition and preprocessing

[0054] Figure 3 A schematic diagram of multi-scale graph attention feature learning Detailed Implementation

[0055] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0056] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.

[0057] In the description of this invention, it should also be noted that, unless otherwise explicitly specified and limited, the terms "set," "install," "connect," and "link" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.

[0058] Please see Figure 1-3 This invention provides a method for classifying the spectral characteristics of tobacco leaves, comprising the following steps:

[0059] S1. Acquisition and Preprocessing of Tobacco Leaf Spectral Data: Hyperspectral data of tobacco leaves were acquired, labeled with tobacco leaf categories, noise bands were removed and smoothed, and semi-supervised local Fisher discriminant analysis was used to reduce the dimensionality of the processed data to obtain the dimensionality-reduced data. ;

[0060] Specifically, the steps include:

[0061] S1.1 Use a hyperspectral imager, such as AVIRIS or DJI Matrice 600 Pro with a hyperspectral camera, to collect hyperspectral data of tobacco leaf samples. The spectral band range covers 400-2500nm. Obtain a hyperspectral data tensor with dimensions H×W×C (H is the height, W is the width, and C is the number of bands). At the same time, label the sample category. The category label is at least one of variety, grade, and pest / disease type.

[0062] S1.2 Eliminate noise bands, such as eliminating interference in the water vapor absorption bands of 1300-1400nm and 1800-1900nm, and use Gaussian filtering to smooth the spectral curve and eliminate random noise;

[0063] S1.3. Semi-supervised local Fisher discriminant analysis (Semi-LFDA) is used to reduce the dimensionality of the processed data;

[0064] During dimensionality reduction, labeled samples are set. Unlabeled samples Total sample ,in, d is the original number of bands, and n is the total number of samples, which can be obtained by the formula n=n'+n'' (n' is the number of labeled samples + n'' is the number of unlabeled samples);

[0065] Calculate the local inter-class scatter matrix of the labeled samples. Local intra-class scatter matrix Through formula ,in: This is the total scatter matrix (calculated based on all samples). It is a d×d identity matrix. This is the regularization parameter, with a value ranging from 0.2 to 0.4;

[0066] Solving the generalized eigenvalue problem We select eigenvectors corresponding to the eigenvalues ​​such that the cumulative contribution rate η ≥ 99%. These eigenvectors form a transformation matrix, reducing the dimensionality of the original data to r dimensions. Obtain the dimensionality-reduced data .

[0067] S2. Multi-scale graph construction: The Simple Linear Iterative Clustering Algorithm (SLIC) is used for... The corresponding hyperspectral image is segmented into superpixels to generate at least two graphs at different scales. Each superpixel serves as a graph node, and the node feature is the average spectral feature of all pixels within the superpixel. A pixel-node association matrix for each scale is constructed and pre-stored. and regularization matrix ;

[0068] Specifically, the steps include:

[0069] S2.1 Set at least 3 different superpixel counts, such as 100, 200, 400, and 800, to adapt to the differences in tobacco leaf size. Each superpixel corresponds to a graph node.

[0070] S2.2, The feature of each node is the average spectral feature of all pixels within its corresponding superpixel, i.e. ,in, Let m be the set of pixels of the m-th superpixel. for The number of pixels;

[0071] S2.3 Construct the pixel-node correlation matrix for each scale. Where N = H × W is the total number of pixels. Let be the number of superpixels at the k-th scale. If the n-th pixel belongs to the m-th superpixel, then... Otherwise, it is 0; at the same time, the regularization matrix is ​​calculated. ,in,

[0072] diagonal matrix ;

[0073] diagonal elements That is, the total number of pixels belonging to the m-th superpixel;

[0074] Pre-deposit and Used for subsequent feature transformation.

[0075] S3, Shallow Feature Extraction: [This section appears to be incomplete and requires further context.] The SSConv module, which performs spectral-spatial convolution, is applied to extract shallow spectral-spatial features by sequentially passing the spectral convolution submodule and the spatial convolution submodule. ;

[0076] Specifically, the steps include:

[0077] S3.1, To Batch normalization, 1×1 convolution (compressing the channel dimension to r / 2), and LeakyReLU activation (slope=0.2) are performed sequentially to capture fine-grained features of the tobacco leaf spectral dimension;

[0078] S3.2. Two consecutive 3×3 depthwise separable convolutions are used, with LeakyReLU activation inserted in between, to extract the spatial distribution features of tobacco leaves, such as leaf texture and edges;

[0079] S3.3 Obtain shallow features .

[0080] S4. Multi-scale graph attention feature learning: An improved graph attention network, GATv2, is applied sequentially to the graph at each scale. Dense connections between graphs at different scales are achieved through a GNFA module that aligns graph node features. The GNFA module... and This involves transforming and aligning node features between pixel space and graph space to obtain cross-scale fused pixel-level features. ;

[0081] Specifically, the steps include:

[0082] S4.1. For each scale k of the graph, apply a two-layer GATv2 network:

[0083] First layer: Employs a 4-head attention mechanism, with input as... Through formula Update node features, where W is the learnable weight. Attention coefficient Calculated using the following formula: calculate;

[0084] The second layer employs a single-head attention mechanism, fusing the outputs of four attention heads to obtain node-level features at this scale. ;

[0085] S4.2. For adjacent scales k and k+1, feature alignment and transfer are achieved using GNFA:

[0086] Encoding: Pixel-level features at scale k pass Convert to node-level features ;

[0087] Decoding: updating node-level features pass Convert back to pixel-level features ,in, Let k be the graph adjacency matrix of scale k;

[0088] Alignment: As one of the inputs at scale k+1, it enables cross-scale feature transfer;

[0089] S4.3. Employing a dense connection strategy similar to DenseNet, the output features at the (k+1)th scale... || represents channel concatenation, causing the feature dimension to grow exponentially. For example, after 4 scales, the dimension becomes 2 from the initial value. 4 This multiplies the effective features at each scale.

[0090] S5. Feature Fusion and Classification: [This section appears to be incomplete and requires further context.] The SSConv module is input again to fuse features, and the tobacco leaf classification results are output through a fully connected layer and a Softmax function.

[0091] Specifically, the steps include:

[0092] S5.1 High-dimensional feature fusion: This involves fusing the final pixel-level feature map. Input the SSConv module again, compress the channel dimension through 1×1 convolution, and fuse multi-scale features through 3×3 convolution to obtain the fused features. ;

[0093] S5.2, Classification Output: ... After flattening, the material is input into a fully connected layer. The probability of each category is calculated using the Softmax function, and the category with the highest probability is output as the tobacco classification result.

[0094] In addition, after step S5, the following steps are included: S6, Model Training and Validation: The Adam optimizer and cross-entropy loss function are used. In this process, the learning rate = 1e-3, the weight decay = 1e-5, the number of training epochs = 600-800, and the batch size = 32. Then, 5-fold cross-validation is used. Preferably, 25 labeled samples are selected from each class as the training set, and the rest are used as the test set. The overall accuracy OA, average accuracy AA, and Kappa coefficient are used as evaluation indicators to iteratively optimize the model parameters.

[0095] Example 2:

[0096] To better evaluate the advantages of the spectral feature classification method described in this invention, the method described in this invention is compared with traditional SVM, CNN and ordinary GAT in conjunction with specific embodiments below.

[0097] Experimental preparation:

[0098] Sample collection: Three tobacco varieties (Yunyan 87, K326, and Zhongyan 100) were collected, each variety containing three quality grades (superior, medium, and inferior), with 50 samples collected from each grade, for a total of 450 samples. A hyperspectral imager (resolution = 0.043m, bands = 400-2500nm, 270 bands in total) was used to collect spectral data of the samples, and category labels (variety-grade) were added.

[0099] Data preprocessing: Water vapor absorption bands (1300-1400nm, 1800-1900nm) were removed, leaving 220 bands; Gaussian filtering (standard deviation = 1.5) was used to smooth the spectrum; Semi-LFDA dimensionality reduction (β = 0.3, cumulative contribution rate = 99%) was used to reduce the number of bands to 95 dimensions;

[0100] Multi-scale map construction: Set the number of SLIC superpixels to four scales: 800, 1000, 1200, and 1400, and construct the corresponding maps. and The matrix is ​​stored in GPU memory;

[0101] Model parameters: GATv2 first layer 4-head attention (hidden layer dimension = 64), second layer 1-head attention (hidden layer dimension = 128); SSConv 1×1 convolution output channels = 48, 3×3 depthwise separable convolution group number = 48; training parameters: learning rate = 1e-3, epoch = 700, Adam optimizer, cross-entropy loss.

[0102] Experimental objective: To evaluate the model performance.

[0103] Experimental steps:

[0104] 1. Shallow feature extraction: Apply SSConv to the 95-dimensional data after dimensionality reduction to obtain a shallow feature map with 48 channels;

[0105] 2. Multi-scale graph attention learning:

[0106] Scale 1 (superpixels = 1400): Input shallow features, obtain node features through the first layer (4 heads) and the second layer (1 head) of GATv2, convert them into pixel-level features F1 through GNFA, and concatenate them with shallow features to obtain F1 (96 channels).

[0107] Scale 2 (superpixels = 1200): Input F1, repeat the above process to obtain F2 (192 channels);

[0108] Scale 3 (superpixels = 1000): yields F3 (384 channels);

[0109] Scale 4 (superpixels = 800): yields F4 (768 channels);

[0110] 3. Feature fusion and classification: Input F4 into SSConv (1×1 convolution compressed to 256 channels, 3×3 convolution fusion), the fully connected layer outputs 9 classes (3 varieties × 3 levels) of probability, and Softmax classification is performed;

[0111] 2.4. Validation and Comparison: The Adam optimizer was used with a learning rate of 1e-3 and 600-800 training epochs. The loss function was cross-entropy loss. Five-fold cross-validation was employed. The performance of this method was compared with that of SVM, CNN, and ordinary GAT. The results are shown in the table below:

[0112] Table 1 Model training and validation performance

[0113] method Overall accuracy OA (%) Average accuracy AA (%) Kappa coefficient SVM 74.8 72.3 0.71 CNN 80.5 78.9 0.77 Ordinary GAT 85.2 83.6 0.82 Method of the present invention 91.4 90.7 0.90

[0114] The experimental results show that the method of the present invention is significantly better than the comparative method in the tobacco variety-grade classification task in terms of OA, AA, and Kappa. In particular, for grades with small spectral differences (such as medium and low grade K326), AA is improved by ≥10%, which proves that it can effectively capture the subtle spectral characteristics of tobacco leaves and meet the actual classification requirements.

[0115] Although the invention has been described herein with reference to several illustrative embodiments, it should be understood that many other modifications and implementations can be devised by those skilled in the art, which will fall within the scope and spirit of the principles disclosed herein. More specifically, various modifications and improvements can be made to the components or layout of the subject matter arrangement within the scope of the disclosure, drawings, and claims. Besides modifications and improvements to the components or layout, other uses will be apparent to those skilled in the art.

Claims

1. A method of classifying spectral features of tobacco leaves, characterized by, The method comprises the following steps: S1, tobacco leaf spectral data collection and pretreatment: collect tobacco leaf hyperspectral data, label tobacco leaf category label, remove noise band and smooth processing, use semi-supervised local Fisher discriminant analysis to reduce dimension of the processed data, get reduced dimension data ; S2, multi-scale graph construction: using simple linear iterative clustering algorithm SLIC to The hyperspectral image is segmented into superpixels to generate at least two graphs of different scales, each superpixel serving as a graph node, and the node feature being the average spectral feature of all pixels in the superpixel; a pixel-node association matrix of each scale is constructed and pre-stored and a regularization matrix ; S3, shallow feature extraction: to The spectral-spatial convolution SSConv module is applied, which sequentially passes through the spectral convolution submodule and the spatial convolution submodule to extract shallow spectral-spatial features ; S4, multi-scale graph attention feature learning: the improved graph attention network GATv2 is applied to each scale of the graph in turn, and the dense connection of different scale graphs is realized through the graph node feature alignment GNFA module, and the GNFA module realizes the alignment of node features in the pixel space and the graph space through and The pixel-level features of the cross-scale fusion are obtained ; S5, Feature fusion and classification: the The SSConv module fuses the features again, and outputs the tobacco classification result through a fully connected layer and a Softmax function.

2. The method according to claim 1, wherein: In step S1, the tobacco spectrum data acquisition and preprocessing specifically comprises: S1.1, using a hyperspectral imager, acquiring hyperspectral data of the tobacco sample, the spectral band range covering 400-2500nm, obtaining a hyperspectral data tensor with a size of HxWxC (H is height, W is width, and C is the number of bands), and labeling the sample category label; S1.2, removing noise bands, and smoothing the spectral curve by using Gaussian filtering to eliminate random noise; S1.3, using semi-supervised local Fisher discriminant analysis to reduce the dimension of the processed data.

3. The method according to claim 2, wherein: In the dimension reduction process of step S1.3, let the labeled samples , the unlabeled samples , and the total samples , where d is the original number of wavebands, and n is the total number of samples. calculating a local inter-class scatter matrix of the labeled samples , a local intra-class scatter matrix , by formula , wherein: is a total scatter matrix, is a dxd identity matrix, is a regularization parameter, and takes a value of 0.2-0.4; Solving generalized eigenvalue problems The eigenvectors corresponding to the eigenvalues are selected so that the cumulative contribution rate η ≥ 99%. These eigenvectors form a transformation matrix, which reduces the original data to r dimensions and The reduced data is obtained.

4. The method according to claim 1, characterized in that: In step S2, the multi-scale graph construction specifically comprises: S2.1, setting at least three different superpixel numbers, each superpixel corresponding to a graph node; S2.2, the feature of each node is the average spectral feature of all pixels within its corresponding superpixel, i.e. wherein, is the set of pixels of the m-th superpixel, is the number of pixels of . S2.3, Constructing the pixel-node association matrix for each scale where N = H x W is the total number of pixels, is the number of superpixels for the kth scale. If the nth pixel belongs to the mth superpixel then , otherwise 0; Simultaneously compute regularization matrix where the diagonal matrix ; diagonal elements i.e. the total number of pixels belonging to the m-th superpixel; pre-stored and for subsequent feature conversion.

5. The method according to claim 1, characterized in that: In step S3, the shallow feature extraction specifically comprises: S3.1、to Batch normalization, 1x1 convolution, and LeakyReLU activation are sequentially performed to capture the fine-grained features of the tobacco spectrum dimension. S3.2, using two consecutive 3x3 depth separable convolutions with LeakyReLU activation inserted in between to extract tobacco spatial distribution features; S3.3, obtaining shallow features .

6. The method according to claim 1, wherein: In step S4, the multi-scale graph attention feature learning specifically comprises: S4.1, for each scale k of the graph, applying a two-layer GATv2 network: The first layer: 4 heads of attention mechanism, input is The node features are updated by the formula , wherein W is a learnable weight, is an attention coefficient, The attention coefficient is calculated by the following formula: Calculation; The second layer: adopt 1 attention mechanism, fusion 4 attention output, get the node level features of this scale ; S4.2, for adjacent scales k and k+1, realizing feature alignment and transmission through GNFA: Encoding: The pixel-level features of scale k are encoded into node-level features By Converting to node-level features ; Decoding: Update the node-level features By Convert back to pixel-level features where, is the graph adjacency matrix at scale k; Align: will As one of the inputs of scale k+1, cross-scale feature transfer is achieved; S4.3, adopt a dense connection strategy similar to DenseNet, the output features of the k+1th scale , make the feature dimension grow exponentially, and retain the effective features of each scale.

7. The method according to claim 1, wherein: In step S5, the feature fusion and classification specifically comprises: S5.1, high-dimensional feature fusion: the final pixel-level feature map is fused to obtain a final feature map The SSConv module is input again, the channel dimension is compressed through 1x1 convolution, 3x3 convolution is used to fuse multi-scale features, and a fused feature is obtained ; S5.2, Classification output: the After flattening, the input is fed into a fully connected layer. The probabilities of each class are calculated by a Softmax function, and the class with the highest probability is output as the tobacco classification result.

8. The method according to claim 1, wherein: After step S5, the following steps are further included: S6, model training and verification: using an Adam optimizer and a loss function of cross-entropy loss, in this process, the learning rate = 1e-3, the weight decay = 1e-5, the training rounds = 600-800, and the batch size = 32; then using 5-fold cross-validation, taking overall accuracy OA, average accuracy AA, and Kappa coefficient as evaluation indexes, and iteratively optimizing the model parameters.