Improved NAS hyperspectral image classification method combined with circular convolution kernel
By introducing circular convolution kernels and hybrid search spaces into NAS hyperspectral image classification, combined with lightweight Transformer encoder, the problems of uneven feature distribution and boundary effects in traditional methods are solved, and the accuracy and robustness of hyperspectral image classification are improved.
Patent Information
- Application Number
- CN202510569657.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-04
- Publication Date
- 2025-08-15
AI Technical Summary
Traditional convolutional neural networks have problems such as uneven feature distribution, significant boundary effects and insufficient spatial-spectral feature interaction in hyperspectral image classification, especially in high-noise data or small-target scenarios.
The NAS hyperspectral image classification method combined with circular convolution kernel is adopted, and the hybrid search space is designed, circular convolution kernel operations are introduced, and spatial dominant units and spectral dominant units are constructed. Combined with a lightweight Transformer encoder, the network architecture is optimized and feature capture capabilities are enhanced.
It effectively solves the problems of uneven feature distribution and boundary effect in traditional methods, and improves the accuracy and robustness of hyperspectral image classification, especially the discrimination power of complex land objects.
Smart Images

Figure BDA0005386794840000071 
Figure BDA0005386794840000091 
Figure BDA0005386794840000092
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of remote sensing image classification, and in particular relates to an improved NAS hyperspectral image classification method combined with a circular convolution kernel. Background Art
[0002] With the rapid development of remote sensing technology and the widespread application of hyperspectral imaging, hyperspectral image classification has become a core technology for surface environmental monitoring and resource exploration. However, traditional convolutional neural networks generally use square convolution kernels in the feature extraction process, resulting in directional bias in feature distribution and significant boundary effects, making it difficult to effectively capture the isotropic geometric characteristics of complex objects. Furthermore, the neural network architecture relies on manual experience design, which is inefficient and difficult to adapt to the spatial-spectral feature fusion requirements in different scenarios, limiting further improvements in classification accuracy.
[0003] While existing Neural Architecture Search (NAS) technology can, to a certain extent, automate the design of network architectures, its search space is mostly based on traditional square convolution operations, which cannot overcome the inherent limitations of the convolution kernel's geometric properties on feature extraction. Although some studies have attempted to introduce attention mechanisms or feature fusion strategies to optimize classification performance, they have not fundamentally addressed issues such as unbalanced local feature capture and insufficient spatial-spectral information interaction. In particular, in scenarios involving high-noise data or small-target classification, the shortcomings of traditional methods, such as blurred classification boundaries and high misclassification rates, are more pronounced. There is an urgent need for breakthroughs through innovation in convolution kernel morphology and reconstruction of the search space. Summary of the Invention
[0004] The purpose of this paper is to solve the problems of uneven feature distribution and significant boundary effect caused by the square convolution kernel of traditional convolutional neural networks, as well as insufficient spatial-spectral feature interaction in neural architecture search. An improved NAS hyperspectral image classification method combined with a circular convolution kernel is proposed.
[0005] The technical solution adopted by the present invention to solve the above technical problems is: an improved NAS hyperspectral image classification method combined with a circular convolution kernel, the method specifically comprising the following steps:
[0006] Step 1: Randomly select pixels from the hyperspectral datasets of Pavia University and Pavia Center and divide the dataset into fixed-size spatial blocks. Then, apply random cropping, flipping, and rotation to enhance the data.
[0007] Step 2: Design a hybrid search space, which includes spatially dominant units and spectrally dominant units combined with circular convolution kernel operations, and stack four layers of searchable structures;
[0008] The hybrid search space is collaboratively composed of a spatial dominant unit and a spectral dominant unit improved by combining a circular convolution kernel, and the network architecture is dynamically optimized through an inner and outer double-layer search strategy.
[0009] The spatial dominant unit is a local spatial feature extraction engine that focuses on the spatial structural features of ground objects in hyperspectral images (such as edges, textures, and shapes). It captures local to mid-scale spatial contextual information through multi-scale convolution operations, enhancing the model's ability to discriminate the spatial distribution patterns of ground objects. Its candidate operations include spatial convolution operations (acon_3-1, acon_5-1), separable spatial convolution operations (asep_3-1, asep_5-1), joint spatial-spectral convolution chain operations (con_3-3, con_3-5), circular convolution operations (Circ-conv3, Circ-conv5), skip connections, and zero operations.
[0010] The spatial convolution operation acon_3-1 has an LReLU-Conv(1×3×3)-BN structure, which does not perform convolution in the spectral dimension but only performs a 3×3 convolution in the spatial dimension to extract local spatial features. The spatial convolution operation acon_5-1 has an LReLU-Conv(1×5×5)-BN structure, using a larger spatial convolution kernel to capture a wider range of contextual spatial information.
[0011] The structure of the separable spatial convolution operation asep_3-1 is LReLU-Sep(1×3×3)-BN. Depthwise separable convolution can reduce the number of parameters and efficiently extract spatial features. The structure of the separable spatial convolution operation asep_5-1 is LReLU-Sep(1×5×5)-BN, using a larger separable convolution kernel to balance computational efficiency and receptive field.
[0012] The structure of the spatial-spectral joint convolution chain operation con_3-3 is LReLU-Conv(1×3×3)-Conv(5×1×1)-BN, which first performs spatial convolution (1×3×3) and then spectral convolution (3×1×1) to jointly extract spatial-spectral features. The structure of the spatial-spectral joint convolution chain operation con_5-5 is LReLU-Conv(1×5×5)-Conv(5×1×1)-BN, similar to con_3-3, but with a larger spectral convolution kernel to enhance spectral information fusion.
[0013] The structures of the circular convolution operations Circ-conv3 and Circ-conv5 are LReLU-Circ(3×3)-BN and LReLU-Circ(3×3)-BN, respectively. Circular convolution solves the boundary effects and directional bias problems of traditional convolution through cyclic padding and isotropic design.
[0014] The structure of the skip connection (skip_connection) is f(x) = x, which retains the input features, alleviates the gradient disappearance, and allows the network to select cross-layer connections.
[0015] The structure of the zero operation is f(x)=0, which discards the current node input and is used to dynamically adjust the network path.
[0016] The spectral-dominant unit focuses on extracting spectral features. It captures correlations between spectral bands through spectral-dimensional convolution kernels (e.g., 3×1×1), adapting to the high spectral resolution but low spatial detail of HSI. Its candidate operations include spectral convolution operations (econ_3-1, econ_5-1), separable spatial convolution operations (esep_3-1, esep_5-1), joint spatial-spectral convolution chain operations (con_3-3, con_3-5), circular convolution operations (Circ-conv3, Circ-conv5), skip connections, and zero operations.
[0017] The structure of the spectral convolution operation econ_3-1 is LReLU-Conv(3×1×1)-BN. It does not perform convolution in the spatial dimension, but only performs 3×3 convolution in the spectral dimension to extract local spectral features. The structure of the spectral convolution operation econ_5-1 is LReLU-Conv(5×1×1)-BN, with a larger spatial convolution kernel to capture broader contextual spatial information.
[0018] The structure of the separable spectral convolution operation esep_3-1 is LReLU-Sep(3×1×1)-BN. Depthwise separable convolution can reduce the number of parameters and efficiently extract spatial features. The structure of the separable spectral convolution operation esep_5-1 is LReLU-Sep(5×1×1)-BN, using a larger separable convolution kernel to balance computational efficiency and receptive field.
[0019] The structure of the spatial-spectral joint convolution chain operation con_3-3 is LReLU-Conv(1×3×3)-Conv(5×1×1)-BN, which first performs spatial convolution (1×3×3) and then spectral convolution (3×1×1) to jointly extract spatial-spectral features. The structure of the spatial-spectral joint convolution chain operation con_5-5 is LReLU-Conv(1×5×5)-Conv(5×1×1)-BN, similar to con_3-3, but with a larger spectral convolution kernel to enhance spectral information fusion.
[0020] The structures of the circular convolution operations Circ-conv3 and Circ-conv5 are LReLU-Circ(3×3)-BN and LReLU-Circ(5×5)-BN, respectively. Circular convolution solves the boundary effects and directional bias problems of traditional convolution through cyclic padding and isotropic design.
[0021] The structure of the skip connection (skip_connection) is f(x) = x, which retains the input features, alleviates the gradient disappearance, and allows the network to select cross-layer connections.
[0022] The structure of the zero operation is f(x)=0, which discards the current node input and is used to dynamically adjust the network path.
[0023] Step 3: Alternately optimize the internal operation weights and external unit type selection through gradient descent, and use Adam and SGD optimizers to train in stages;
[0024] Step 4: Determine the unit type of each layer based on the search weight, prune low-weight operations, and generate a compact Convolutional Neural Network (CNN) architecture;
[0025] Step 5: Reshape the CNN output features into a sequence and graft the Transformer module;
[0026] Step 6: Use sliding window overlapping inference to smooth the results, repeat the experiment and take the average to verify the performance;
[0027] The beneficial effects of the present invention are:
[0028] The present invention introduces circular convolution kernels to replace traditional square convolution kernels, which can evenly cover neighborhood information in all directions and effectively avoid the problem of loss of edge features of hyperspectral images caused by directional sensitivity of square convolution kernels. It is particularly suitable for the isotropic expression of continuous spectral and spatial features in hyperspectral images. By constructing an improved hybrid search space combined with circular convolution kernels, the neural architecture search technology is used to adaptively optimize the network depth, width and feature fusion path, breaking through the limitations of artificially designed networks on circular convolution parameter combinations, and significantly enhancing the model's dynamic capture capability of spatial-spectral heterogeneous features of hyperspectral images. A multi-scale circular convolution feature adaptive aggregation module is designed to dynamically fuse circular convolution features of different receptive fields through learnable weights, thereby strengthening the complementarity of local details and global contextual information and improving the discrimination of complex land features. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 This is the structural diagram of the improved NAS hyperspectral image classification method combined with circular convolution kernel;
[0030] Figure 2 This is a training flow chart of the improved NAS hyperspectral image classification method combined with circular convolution kernel;
[0031] Figure 3 It is a diagram of internal and external search structure;
[0032] Figure 4 It is the transformer grafting structure diagram;
[0033] Figure 5 It is the feature category information of PaviaC and PaviaU datasets;
[0034] Figure 6 It is the PaviaC dataset;
[0035] In the figure, (a) is the true value map, (b) is the result map;
[0036] Figure 7 It is the PaviaU dataset;
[0037] In the figure, (a) is the true value map, (b) is the result map; DETAILED DESCRIPTION
[0038] Specific implementation method 1: Combination Figure 1 and Figure 2 The present embodiment describes an improved NAS hyperspectral image classification method using a circular convolution kernel, which specifically includes the following steps:
[0039] Step 1: Randomly select pixels from the hyperspectral datasets of Pavia University and Pavia Center and divide the dataset into fixed-size spatial blocks. Then, apply random cropping, flipping, and rotation to enhance the data.
[0040] Step 2: Design a hybrid search space, which includes spatially dominant units and spectrally dominant units combined with circular convolution kernel operations, and stack four layers of searchable structures;
[0041] The hybrid search space is collaboratively composed of a spatial dominant unit and a spectral dominant unit improved by combining a circular convolution kernel, and the network architecture is dynamically optimized through an inner and outer double-layer search strategy.
[0042] The spatial dominant unit is a local spatial feature extraction engine that focuses on the spatial structural features of ground objects in hyperspectral images (such as edges, textures, and shapes). It captures local to mid-scale spatial contextual information through multi-scale convolution operations, enhancing the model's ability to discriminate the spatial distribution patterns of ground objects. Its candidate operations include spatial convolution operations (acon_3-1, acon_5-1), separable spatial convolution operations (asep_3-1, asep_5-1), joint spatial-spectral convolution chain operations (con_3-3, con_3-5), circular convolution operations (Circ-conv3, Circ-conv5), skip connections, and zero operations.
[0043] The spatial convolution operation acon_3-1 has an LReLU-Conv(1×3×3)-BN structure, which does not perform convolution in the spectral dimension but only performs a 3×3 convolution in the spatial dimension to extract local spatial features. The spatial convolution operation acon_5-1 has an LReLU-Conv(1×5×5)-BN structure, using a larger spatial convolution kernel to capture a wider range of contextual spatial information.
[0044] The structure of the separable spatial convolution operation asep_3-1 is LReLU-Sep(1×3×3)-BN. Depthwise separable convolution can reduce the number of parameters and efficiently extract spatial features. The structure of the separable spatial convolution operation asep_5-1 is LReLU-Sep(1×5×5)-BN, using a larger separable convolution kernel to balance computational efficiency and receptive field.
[0045] The structure of the spatial-spectral joint convolution chain operation con_3-3 is LReLU-Conv(1×3×3)-Conv(5×1×1)-BN, which first performs spatial convolution (1×3×3) and then spectral convolution (3×1×1) to jointly extract spatial-spectral features. The structure of the spatial-spectral joint convolution chain operation con_5-5 is LReLU-Conv(1×5×5)-Conv(5×1×1)-BN, similar to con_3-3, but with a larger spectral convolution kernel to enhance spectral information fusion.
[0046] The structures of the circular convolution operations Circ-conv3 and Circ-conv5 are LReLU-Circ(3×3)-BN and LReLU-Circ(3×3)-BN, respectively. Circular convolution solves the boundary effects and directional bias problems of traditional convolution through cyclic padding and isotropic design.
[0047] The structure of the skip connection (skip_connection) is f(x) = x, which retains the input features, alleviates the gradient disappearance, and allows the network to select cross-layer connections.
[0048] The structure of the zero operation is f(x)=0, which discards the current node input and is used to dynamically adjust the network path.
[0049] The spectral-dominant unit focuses on extracting spectral features. It captures correlations between spectral bands through spectral-dimensional convolution kernels (e.g., 3×1×1), adapting to the high spectral resolution but low spatial detail of HSI. Its candidate operations include spectral convolution operations (econ_3-1, econ_5-1), separable spatial convolution operations (esep_3-1, esep_5-1), joint spatial-spectral convolution chain operations (con_3-3, con_3-5), circular convolution operations (Circ-conv3, Circ-conv5), skip connections, and zero operations.
[0050] The structure of the spectral convolution operation econ_3-1 is LReLU-Conv(3×1×1)-BN. It does not perform convolution in the spatial dimension, but only performs 3×3 convolution in the spectral dimension to extract local spectral features. The structure of the spectral convolution operation econ_5-1 is LReLU-Conv(5×1×1)-BN, with a larger spatial convolution kernel to capture broader contextual spatial information.
[0051] The structure of the separable spectral convolution operation esep_3-1 is LReLU-Sep(3×1×1)-BN. Depthwise separable convolution can reduce the number of parameters and efficiently extract spatial features. The structure of the separable spectral convolution operation esep_5-1 is LReLU-Sep(5×1×1)-BN, using a larger separable convolution kernel to balance computational efficiency and receptive field.
[0052] The structure of the spatial-spectral joint convolution chain operation con_3-3 is LReLU-Conv(1×3×3)-Conv(5×1×1)-BN, which first performs spatial convolution (1×3×3) and then spectral convolution (3×1×1) to jointly extract spatial-spectral features. The structure of the spatial-spectral joint convolution chain operation con_5-5 is LReLU-Conv(1×5×5)-Conv(5×1×1)-BN, similar to con_3-3, but with a larger spectral convolution kernel to enhance spectral information fusion.
[0053] The structures of the circular convolution operations Circ-conv3 and Circ-conv5 are LReLU-Circ(3×3)-BN and LReLU-Circ(5×5)-BN, respectively. Circular convolution solves the boundary effects and directional bias problems of traditional convolution through cyclic padding and isotropic design.
[0054] The structure of the skip connection (skip_connection) is f(x) = x, which retains the input features, alleviates the gradient disappearance, and allows the network to select cross-layer connections.
[0055] The structure of the zero operation is f(x)=0, which discards the current node input and is used to dynamically adjust the network path.
[0056] Step 3: Alternately optimize the internal operation weights and external unit type selection through gradient descent, and use Adam and SGD optimizers to train in stages;
[0057] Gradient descent was used to optimize the operation weights ω at each node, retaining the operations with the highest weights. The unit type with the larger weight was selected by comparing α (spatial unit weight) and β (spectral unit weight) at each layer. For the first 15–30 rounds, only the network weights were trained (SGD optimizer with an initial learning rate of 0.025). Subsequent rounds alternated between updating the architecture parameters (Adam optimizer with a learning rate of 0.001) and the network weights.
[0058] Step 4: Determine the unit type of each layer based on the search weight, prune low-weight operations, and generate a compact CNN architecture;
[0059] Step 5: Reshape the CNN output features into a sequence and graft the Transformer module;
[0060] Step 6: Use sliding window overlapping inference to smooth the results, calculate the overall accuracy (OA), average accuracy (AA) and Kappa coefficient (K), repeat the experiment and take the average to verify the performance;
[0061] Specific implementation method 2: Combination Figure 3 This embodiment differs from the first or second embodiment in that the internal and external search process is as follows:
[0062] The goal of the external search is to decide whether each layer of the network should prioritize spatial features or spectral features. To this end, the model introduces two types of candidate units: spatially dominant units (focusing on extracting spatial information such as texture and shape) and spectrally dominant units (focusing on analyzing spectral correlations between bands). Each layer dynamically allocates the contribution ratio of the two units through learnable weight parameters (such as α_spa and α_spe). Shallow networks may rely more on spatial units to capture local details, while deep networks may tend to spectral units to explore global band relationships. Ultimately, the output of this layer is a weighted fusion of the outputs of the two units, ensuring that the model adapts to feature requirements at different levels. This mechanism avoids the limitations of manually preset unit types and improves the flexibility of the architecture.
[0063] After the unit type is selected, the internal search further optimizes the combination of operations within the unit. Each unit (such as spatial or spectral units) contains a set of candidate operations, circular convolution, separable convolution or jump connection. The model evaluates the importance of each operation through a learnable operation weight ω and constructs a directed acyclic graph to connect multiple nodes. The input of each node is the weighted sum of the outputs of the predecessor nodes, and the output of the unit is finally generated by splicing the results of all nodes. This process allows the model to automatically discover efficient operation topologies, such as combining circular convolution with jump connections to enhance feature transfer, or fusing information from different receptive fields through multi-scale convolution. Internal search reduces the trial and error cost of manually designing network structures while improving the richness of feature expression.
[0064] Internal and external search achieve synergy through joint optimization. During training, the model simultaneously updates network weights and architectural parameters, utilizing classification loss and regularization to balance performance and complexity. To minimize computational overhead, a first-order approximation strategy is employed, updating parameters solely based on the gradient of the classification loss, rather than the second-order optimization used in traditional NAS. After training, the architecture is discretized based on the weight parameters: the unit types and operations with the highest weights are retained to form the final network.
[0065] Other steps and parameters are the same as those in the first embodiment.
[0066] Specific implementation method three: Combination Figure 4 This embodiment differs from the first to third embodiments in that the working process of the grafted transformer module is as follows:
[0067] The feature map output by the CNN backbone network has a dimension of B×C×W×H (B is the batch size, C is the number of channels, and W / H is the spatial width and height). Spatial flattening is used to convert it into a sequence of B×N×C, where N=W×H.
[0068] In order to avoid the destruction of the local structure of the image by the traditional absolute position encoding, the relative position offset is adopted. Through the learnable offset matrix B∈R (2W-1)×(2H-1) The relative distance between coded pixels is calculated as:
[0069] P h (x,y),(x′,y′) =Q (x,y) ·K (x′,y′) +B h ∣x-x′∣,∣y-y′∣
[0070] Among them, h represents the attention head index, and the dimension of B covers all possible relative position offsets.
[0071] The default configuration of the Multi-Head Attention (MSA) mechanism is 4 heads of attention, with each head having a hidden dimension d k = C / 4. Generate query, key, and value matrices through independent linear projection, calculate the attention weights of each head, and then concatenate the results.
[0072] Each sub-layer (MSA and MLP) introduces a residual connection to alleviate the gradient vanishing problem. The formula is:
[0073] f out =MLP(LN(f attn +f))+(f attn +f)
[0074] Among them, LN is layer normalization (LayerNorm), and MLP is multilayer perceptron (Multilayer Perceptron).
[0075] Other steps and parameters are the same as those in the first and second embodiments.
[0076] Example
[0077] This embodiment proposes an improved NAS hyperspectral image classification method combined with a circular convolution kernel. The implementation process of the method is shown in Table 1:
[0078] Table 1 Fusion classification network structure algorithm flow based on feature confidence
[0079]
[0080] The specific implementation steps are as follows:
[0081] Step 1: Sample extraction and data preprocessing. Pixels were randomly extracted from the hyperspectral image and proportionally divided into training, validation, and test sets. To adapt the model input, a fixed-size 3D cube was cropped centered on the target pixel. The spectral dimensions were normalized to mitigate data distribution differences. Random cropping and rotation were used as data augmentation strategies to improve model generalization.
[0082] Step 2: Construct a hybrid search space that combines circular convolution kernels. Learnable weights are used to dynamically adjust the emphasis of each layer on spatial / spectral information to match the low spatial resolution and high spectral resolution characteristics of HSI.
[0083] Step 3: Internal and external architecture search. Based on the DARTS differentiable architecture search framework, a two-layer optimization strategy is used to alternately update network and architecture parameters. After the search, the top two operations in each layer are retained based on weight pruning, forming a lightweight network. By comparing the external layer weights, the dominant unit type at different levels is adaptively selected.
[0084] Step 4: Graft the Transformer module onto the optimal architecture found. Flatten the feature map output by the CNN into a sequence of spatial positions. Use multi-head self-attention to calculate global dependencies between pixels, and introduce relative position encoding to preserve spatial information. Use residual connections and MLP to enhance feature interactions, and utilize Hardswish activation to balance nonlinearity and gradient stability, avoiding the training difficulties of a pure Transformer.
[0085] Step 5: Analyze the classification results.
[0086] The network model training and classification result verification experiments of the present invention were completed on the following platforms:
[0087] The hardware configuration includes Intel Core i7-13700HX processor, 16GB DDR5 5600MHz dual-channel memory, NVIDIA GeForce RTX 4050 laptop GPU, the storage system consists of 1TB PCIe 4.0×4NVMe solid-state drive (SSD) and optional 2TB mechanical hard disk (HDD), the operating system is Windows 11 Home Chinese version operating system and integrated Legion ColdFront 5.0 cooling system. The experiment uses two well-known hyperspectral datasets, including the Pavia Center dataset (PaviaC) and the Pavia Campus dataset (PaviaU). The spatial distribution of each dataset, the feature category information, and detailed statistical information are as follows: Figure 5 shown.
[0088] The Pavia Center dataset, acquired by the ROSIS-3 hyperspectral sensor in 2001, covers the core area of Pavia in northern Italy. The dataset consists of 1096×715 pixels with a spatial resolution of 1.3 meters. The spectral range spans 438–864 nanometers, and after denoising, 103 valid bands are retained. The dataset includes 7,456 samples of nine typical urban features, including water bodies, asphalt pavement, and brick buildings. Due to its complex scene and the large number of mixed pixels, this dataset is often used to validate models' ability to jointly analyze spectral and spatial features in urban environments.
[0089] The 2. Pavia University dataset, acquired by the same sensor at the same time, focuses on the University of Pavia and its surrounding area. The images are 610×340 pixels in size and have the same 1.3-meter spatial resolution. The spectral dimensions and preprocessing methods are identical to those of the PaviaCenter dataset, but the feature classification focuses on vegetation and man-made structures, including nine categories such as grass, bare soil, and metal roofs, with a total of 42,776 samples. Its high intra-class diversity and inter-class similarity (e.g., different vegetation states) make it a standard benchmark for testing the anti-aliasing capabilities of algorithms, and it is widely used to evaluate model robustness in scenarios with limited training samples.
[0090] For the evaluation indicators of the model, the three most widely used objective evaluation indicators in the industry are selected: Overall Accuracy (OA), Average Accuracy (AA) and Kappa Coefficient (K). These three evaluation indicators are calculated based on the confusion matrix.
[0091] The following are the evaluation indicators:
[0092] (1) Confusion Matrix: A confusion matrix is an n-row, n-column error matrix that is expressed in a standard form for computational accuracy. The details of the matrix can be found in Table 2. The confusion matrix is a special matrix used to visualize the performance of an algorithm. Each column of the confusion matrix represents the predicted value, and each row represents the true class. The name of this matrix is because its form clearly indicates whether there is confusion between multiple classes, that is, whether one class is predicted as another class.
[0093] Table 2 Composition of confusion matrix
[0094]
[0095] (2) Overall classification accuracy (OA): OA is a basic evaluation indicator that represents the ratio of correctly classified samples to the total number of samples, i.e., overall classification accuracy. Overall classification accuracy is an indicator of the classification accuracy of the entire evaluation algorithm, which refers to the ratio of the number of correctly classified class pixels to the total number of classes:
[0096]
[0097] (3) Average Classification Accuracy (AA): AA is an evaluation indicator of classification accuracy in a classification algorithm. First, the classification accuracy of each type of feature is summed up, and then the average is calculated as the classification accuracy. The average classification accuracy is different from the overall classification accuracy, and focuses on evaluating the classification accuracy of each type of feature in the algorithm:
[0098]
[0099] (4) Kappa coefficient (K): The Kappa coefficient indicates the reduction ratio of completely random classification error. It is also an evaluation index of classification accuracy. As a supplement to the error matrix, it can clearly reflect the effect of classification accuracy:
[0100]
[0101] Among them, n represents the number of rows and columns of the classification matrix, m ij Represents the value of the i-th row and j-th column in the confusion matrix, m i+ is the row sum of the confusion matrix, and m +i It is the column synthesis of the confusion matrix, and N represents all the elements contained in the confusion matrix.
[0102] The objective classification results of the network model used in this invention on two data sets are shown in Table 3. From left to right, the first column is the data set; the second column is the OA data of the classification results; the third column is the AA data of the classification results; the fourth column is the K×100 data of the classification results; the fifth column is the training time of the classification; and the sixth column is the test time of the classification. Figure 6 、 Figure 7 As shown, Figure 6 Represents the classification effect of the PaviaC dataset, Figure 7 Represents the classification effect of the PaviaU dataset.
[0103] Table 3 Classification accuracy of different datasets
[0104]
[0105] The above examples are merely illustrative of the calculation model and process of the present invention and are not intended to limit the embodiments of the present invention. Persons skilled in the art will readily appreciate that other variations or modifications based on the above description are possible. This list of embodiments is not exhaustive; however, any obvious variations or modifications derived from the technical solution of the present invention remain within the scope of protection of the present invention.
Claims
1. A NAS hyperspectral image classification method improved by circular convolution kernel, characterized in that: The method specifically comprises the following steps: Step 1: Randomly select pixels from the hyperspectral datasets of Pavia University and Pavia Center and divide the dataset into fixed-size spatial blocks. Then, apply random cropping, flipping, and rotation to enhance the data. Step 2: Design a hybrid search space, which includes spatially dominant units and spectrally dominant units combined with circular convolution kernels to improve the operation, and stack a 4-layer searchable structure; The hybrid search space is collaboratively composed of a spatial dominant unit and a spectral dominant unit combined with an improved circular convolution kernel, and dynamically optimizes the network architecture through an inner and outer double-layer search strategy. The spatial dominant unit is a local spatial feature extraction engine that focuses on the spatial structural features of ground objects in hyperspectral images (such as edges, textures, and shapes). It captures local to mid-scale spatial contextual information through multi-scale convolution operations, enhancing the model's ability to discriminate the spatial distribution patterns of ground objects. Its candidate operations include spatial convolution operations (acon_3-1, acon_5-1), separable spatial convolution operations (asep_3-1, asep_5-1), joint spatial-spectral convolution chain operations (con_3-3, con_3-5), circular convolution operations (Circ-conv3, Circ-conv5), skip connections, and zero operations. The spatial convolution operation acon_3-1 has an LReLU-Conv(1×3×3)-BN structure, which does not perform convolution in the spectral dimension but only performs a 3×3 convolution in the spatial dimension to extract local spatial features. The spatial convolution operation acon_5-1 has an LReLU-Conv(1×5×5)-BN structure, using a larger spatial convolution kernel to capture a wider range of contextual spatial information. The structure of the separable spatial convolution operation asep_3-1 is LReLU-Sep(1×3×3)-BN. Depthwise separable convolution can reduce the number of parameters and efficiently extract spatial features. The structure of the separable spatial convolution operation asep_5-1 is LReLU-Sep(1×5×5)-BN, using a larger separable convolution kernel to balance computational efficiency and receptive field. The structure of the spatial-spectral joint convolution chain operation con_3-3 is LReLU-Conv(1×3×3)-Conv(5×1×1)-BN, which first performs spatial convolution (1×3×3) and then spectral convolution (3×1×1) to jointly extract spatial-spectral features. The structure of the spatial-spectral joint convolution chain operation con_5-5 is LReLU-Conv(1×5×5)-Conv(5×1×1)-BN, similar to con_3-3, but with a larger spectral convolution kernel to enhance spectral information fusion. The structures of the circular convolution operations Circ-conv3 and Circ-conv5 are LReLU-Circ(3×3)-BN and LReLU-Circ(3×3)-BN, respectively. Circular convolution solves the boundary effects and directional bias problems of traditional convolution through cyclic padding and isotropic design. The structure of the skip connection (skip_connection) is f(x) = x, which retains the input features, alleviates the gradient disappearance, and allows the network to select cross-layer connections. The structure of the zero operation is f(x)=0, which discards the current node input and is used to dynamically adjust the network path. The spectral-dominant unit focuses on extracting spectral features. It captures correlations between spectral bands through spectral-dimensional convolution kernels (e.g., 3×1×1), adapting to the high spectral resolution but low spatial detail of HSI. Its candidate operations include spectral convolution operations (econ_3-1, econ_5-1), separable spatial convolution operations (esep_3-1, esep_5-1), joint spatial-spectral convolution chain operations (con_3-3, con_3-5), circular convolution operations (Circ-conv3, Circ-conv5), skip connections, and zero operations. The structure of the spectral convolution operation econ_3-1 is LReLU-Conv(3×1×1)-BN. It does not perform convolution in the spatial dimension, but only performs 3×3 convolution in the spectral dimension to extract local spectral features. The structure of the spectral convolution operation econ_5-1 is LReLU-Conv(5×1×1)-BN, with a larger spatial convolution kernel to capture broader contextual spatial information. The structure of the separable spectral convolution operation esep_3-1 is LReLU-Sep(3×1×1)-BN. Depthwise separable convolution can reduce the number of parameters and efficiently extract spatial features. The structure of the separable spectral convolution operation esep_5-1 is LReLU-Sep(5×1×1)-BN, using a larger separable convolution kernel to balance computational efficiency and receptive field. The structure of the spatial-spectral joint convolution chain operation con_3-3 is LReLU-Conv(1×3×3)-Conv(5×1×1)-BN, which first performs spatial convolution (1×3×3) and then spectral convolution (3×1×1) to jointly extract spatial-spectral features. The structure of the spatial-spectral joint convolution chain operation con_5-5 is LReLU-Conv(1×5×5)-Conv(5×1×1)-BN, similar to con_3-3, but with a larger spectral convolution kernel to enhance spectral information fusion. The structures of the circular convolution operations Circ-conv3 and Circ-conv5 are LReLU-Circ(3×3)-BN and LReLU-Circ(5×5)-BN, respectively. Circular convolution solves the boundary effects and directional bias problems of traditional convolution through cyclic padding and isotropic design. The structure of the skip connection (skip_connection) is f(x) = x, which retains the input features, alleviates the gradient disappearance, and allows the network to select cross-layer connections. The structure of the zero operation is f(x)=0, which discards the current node input and is used to dynamically adjust the network path. Step 3: Alternately optimize the internal operation weights and external unit type selection through gradient descent, and use Adam and SGD optimizers to train in stages; Step 4: Determine the unit type of each layer based on the search weight, prune low-weight operations, and generate a compact Convolutional Neural Network (CNN) architecture; Step 5: Reshape the CNN output features into a sequence and graft the Transformer module; Step 6: Use sliding window overlapping inference to smooth the results, repeat the experiment and take the average to verify the performance.
2. The method for hyperspectral image classification based on a neural architecture search (NAS) method improved with a circular convolution kernel according to claim 1, characterized in that: The working process of the internal and external search is as follows: The goal of the external search is to decide whether each layer of the network should prioritize spatial features or spectral features. To this end, the model introduces two types of candidate units: spatially dominant units (focusing on extracting spatial information such as texture and shape) and spectrally dominant units (focusing on analyzing spectral correlations between bands). Each layer dynamically allocates the contribution ratio of the two units through learnable weight parameters (such as α_spa and α_spe). Shallow networks may rely more on spatial units to capture local details, while deep networks may tend to spectral units to explore global band relationships. Ultimately, the output of this layer is a weighted fusion of the outputs of the two units, ensuring that the model adapts to feature requirements at different levels. This mechanism avoids the limitations of manually preset unit types and improves the flexibility of the architecture. After the unit type is selected, the internal search further optimizes the combination of operations within the unit. Each unit (such as spatial or spectral units) contains a set of candidate operations, circular convolution, separable convolution or jump connection. The model evaluates the importance of each operation through a learnable operation weight ω and constructs a directed acyclic graph to connect multiple nodes. The input of each node is the weighted sum of the outputs of the predecessor nodes, and the output of the unit is finally generated by splicing the results of all nodes. This process allows the model to automatically discover efficient operation topologies, such as combining circular convolution with jump connections to enhance feature transfer, or fusing information from different receptive fields through multi-scale convolution. Internal search reduces the trial and error cost of manually designing network structures while improving the richness of feature expression. Internal and external search achieve synergy through joint optimization. During training, the model simultaneously updates network weights and architectural parameters, utilizing classification loss and regularization to balance performance and complexity. To minimize computational overhead, a first-order approximation strategy is employed, updating parameters solely based on the gradient of the classification loss, rather than the second-order optimization used in traditional NAS. After training, the architecture is discretized based on the weight parameters: the unit types and operations with the highest weights are retained to form the final network.
3. The improved NAS hyperspectral image classification method combined with circular convolution kernel according to claim 2 is characterized in that: The working process of the grafted transformer module is as follows: The feature map output by the CNN backbone network has a dimension of B×C×W×H (B is the batch size, C is the number of channels, and W / H is the spatial width and height). Spatial flattening is used to convert it into a sequence of B×N×C, where N=W×H. In order to avoid the destruction of the local structure of the image by the traditional absolute position encoding, the relative position offset is adopted. Through the learnable offset matrix B∈R (2W-1)×(2H-1) The relative distance between coded pixels is calculated as: P h (x,y),(x′,y′) =Q (x,y) ·K (x′,y′) +B h ∣x-x′∣,∣y-y′∣ Among them, h represents the attention head index, and the dimension of B covers all possible relative position offsets. The default configuration of the Multi-Head Attention (MSA) mechanism is 4 heads of attention, with each head having a hidden dimension d k = C / 4. Generate query, key, and value matrices through independent linear projection, calculate the attention weights of each head, and then concatenate the results. Each sub-layer (MSA and MLP) introduces a residual connection to alleviate the gradient vanishing problem. The formula is: f out =MLP(LN(f attn +f))+(f attn +f) Among them, LN is layer normalization (LayerNorm), and MLP is multilayer perceptron (Multilayer Perceptron).