A hyperspectral image classification method based on learning shapelets

CN122657579APending Publication Date: 2026-08-28GANNAN UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610796453.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-04
Publication Date
2026-08-28

AI Technical Summary

Technical Problem

这些算法采用降维方法对数据进行分类,但分类过程需要计算统计特征,增加了计算复杂度

Benefits of technology

1、本发明通过获取预处理后的高光谱影像数据中每个像素的光谱曲线,并通过分析光谱曲线的特征设定每个像素对应的滑动窗口的长度,能够根据不同区域光谱曲线的特征变化灵活适应窗口大小,即在光谱变化剧烈区域使用较短窗口以保留关键细节信息,而在光谱变化平缓区域使用较长窗口以增强平滑效果和降低噪声干扰,这种动态调整机制不仅提高了光谱特征提取的精度,还能增强光谱曲线的特征表达能力,使不同地物类别之间的光谱特征差异更加显著,从而提升此分类模型的性能和泛化能力,同时提高此方法对不同数据集的适应性,提升了此高光谱影像分类方法的分类效果。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122657579A_ABST
    Figure CN122657579A_ABST
Patent Text Reader

Abstract

The application discloses a hyperspectral image classification method based on learning shapelets, and relates to the technical field of hyperspectral remote sensing image classification, and comprises the steps of image data acquisition, image data preprocessing, spectrum division and clustering, classification model construction, and training and iterative optimization. The application sets the length of the sliding window corresponding to each pixel by analyzing the characteristics of the spectral curve, can flexibly adapt to the window size according to the characteristic change of the spectral curve in different regions, that is, a shorter window is used in a region with a sharp spectral change to retain key detail information, and a longer window is used in a region with a gentle spectral change to enhance the smoothing effect and reduce noise interference. This dynamic adjustment mechanism not only improves the accuracy of spectral feature extraction, but also enhances the feature expression ability of the spectral curve, makes the spectral feature difference between different ground object categories more significant, and improves the classification effect of the hyperspectral image classification method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of hyperspectral remote sensing image classification technology, specifically to a hyperspectral image classification method based on learned shapelets. Background Technology

[0002] Hyperspectral images, rich in spectral information and with high resolution, play a crucial role in remote sensing. Unlike RGB and multispectral images, hyperspectral images can capture fine spectral features in the visible to near-infrared wavelength range, providing valuable data for accurate classification and physicochemical parameter inversion. Therefore, hyperspectral images are widely used in precision agriculture, military reconnaissance, and environmental monitoring. The goal of hyperspectral image classification is to accurately classify surface targets using the detailed spectral information of these images. However, the high dimensionality of hyperspectral data leads to data redundancy and computational complexity. Furthermore, spectral mixing and complex noise interference further complicate the classification process. Therefore, effectively extracting spectral features while addressing noise and complexity issues remains a key challenge in current research.

[0003] Currently, hyperspectral image classification methods based on spectral features can be broadly categorized into two types: First, methods that directly utilize the raw hyperspectral data for classification. These algorithms use similarity metrics to analyze the relationship between the classifying spectrum and the reference spectrum. Common techniques include Euclidean distance (ED), spectral angle mapping (SAM), and spectral information divergence (SID). While these methods fully utilize the spectral features of the raw data, data redundancy often leads to lower classification accuracy and higher computational complexity. Second, methods that first select bands or extract features from the raw hyperspectral image, and then select a downscaled subset as the classification criterion. Common techniques include Principal Component Analysis (PCA), Independent Component Analysis (ICA), wavelet transform, and neural networks. These algorithms use dimensionality reduction methods to classify the data, but the classification process requires calculating statistical features, increasing computational complexity. Furthermore, the calculated statistical features lack physical meaning, and the selected features are often limited to specific processing needs, leading to certain application limitations.

[0004] Based on the above, this invention proposes a hyperspectral image classification method based on learned shapelets with good classification performance. Summary of the Invention

[0005] To overcome the shortcomings of existing technologies, this invention proposes a hyperspectral image classification method based on learning shapelets with good classification performance. By introducing spectral shapelets, it can effectively mine key local morphological features of spectral curves, thereby enhancing the spectral separability of different land cover categories and improving the classification performance of this method on hyperspectral images.

[0006] A hyperspectral image classification method based on learned shapelets includes the following steps: Image data acquisition: Retrieve hyperspectral image data and its label data from the database; Image data preprocessing involves mean filtering of the hyperspectral image data to obtain preprocessed hyperspectral image data. Spectral segmentation and clustering: The spectral curve of each pixel in the preprocessed hyperspectral image data is obtained. The length of the sliding window corresponding to each pixel is determined by analyzing the characteristics of the spectral curve. Using the sliding window, the spectral vector of each pixel is divided into a group of candidate spectral subsequences. The K-means clustering algorithm is then employed, specifying... The location of each cluster center is determined through iterative optimization, and the candidate spectral subsequences closest to each cluster center are selected as the final representative shapelets set. The classification model is constructed by performing feature transformation on the spectral vector of each pixel based on the final representative set of shapelets to obtain the distance feature matrix, and then constructing a logistic regression model based on the distance feature matrix. Training and iterative optimization: The stochastic gradient descent optimization algorithm is used to iteratively optimize the objective function of the logistic regression model and continuously update the shapelets and classification weights to obtain the optimal model parameters of the logistic regression model. The optimal model parameters are then applied to the logistic regression model to obtain the hyperspectral image classification model.

[0007] As a preferred aspect of the invention, the specific steps for performing mean filtering on the hyperspectral image data to obtain preprocessed hyperspectral image data are as follows: Window definition and boundary processing: Determine the size of the filtering window as needed, and fill the edges of the hyperspectral image in the hyperspectral image data to obtain the filled hyperspectral image; The neighborhood mean calculation involves extracting all pixel values ​​within the neighborhood defined by the filter window for each pixel in the filled hyperspectral image, and calculating the average value of the pixel values ​​in each band within the neighborhood to obtain the filtered value of the pixel in each band. Pixel value update: For each pixel in the filled hyperspectral image, the original pixel value in each band is replaced with the calculated filtered value to obtain the preprocessed hyperspectral image data.

[0008] As a preferred aspect of the invention, the specific steps of obtaining the spectral curve of each pixel in the preprocessed hyperspectral image data and setting the length of the sliding window corresponding to each pixel by analyzing the characteristics of the spectral curve are as follows: Data extraction: Extracting the spectral curve of each pixel in the preprocessed hyperspectral image data; The saliency is calculated by calculating the local gradient, local curvature, and power spectral density of the spectral curve for each pixel. The calculated local gradient, local curvature, and power spectral density are normalized, and the normalized local gradient, local curvature, and power spectral density are weighted and summed to obtain the feature saliency of each pixel. To determine the window length, for each pixel in the spectral image, the length of the sliding window is set based on the feature saliency of that pixel. The specific calculation formula is as follows: ; in Indicates the length of the sliding window. and These represent the minimum and maximum limits for the length of the sliding window, respectively. This indicates the significance of the feature.

[0009] As a preferred aspect of the invention, the specific steps of dividing the spectral vector of each pixel into a set of candidate spectral subsequences using a sliding window are as follows: Determine the window parameters, obtain the spectral vector of the corresponding pixel from the spectral curve of each pixel, and determine the length and sliding step of the sliding window; The number of subsequences is calculated by determining the number of subsequences that can be extracted from the spectral vector of each pixel using the following formula: ; in This represents the number of subsequences that can be extracted from the spectral vector. This represents the total number of bands in the spectral vector. Indicates the sliding step size. Indicates to The calculation result is rounded down; Subsequence extraction utilizes the idea of ​​convolution to construct an index matrix and extracts all candidate spectral subsequences from the spectral vector at once. During this process, when the remaining bands are insufficient to cover the length of the sliding window, the process either fills in zero values ​​or truncates the last candidate spectral subsequence. Batch processing is performed to obtain candidate spectral subsequences for all pixels and organize them to obtain a set of candidate spectral subsequences for each pixel.

[0010] As a preferred aspect of the invention, the K-means clustering algorithm is employed, specifying... The specific steps for determining the location of each cluster center through iterative optimization, and selecting the candidate spectral subsequences closest to each cluster center as the final representative shapelets set, are as follows: The optimal number of clusters is determined based on the set of candidate spectral subsequences for all pixels and using the elbow rule. ; Initialize cluster centers by randomly selecting the first cluster center from the set of candidate spectral subsequences of all pixels. Then, based on the weighted average distance of each candidate spectral subsequence to the existing cluster center, select the remaining cluster centers sequentially until a cluster center is determined. One initial cluster center; Clustering assignment: Calculate the Euclidean distance from each candidate spectral subsequence to each cluster center, and assign each candidate spectral subsequence to the cluster to which the nearest cluster center belongs; Update the cluster centers by calculating the average value of all candidate spectral subsequences within each cluster and using this average value as the new cluster centers. Iterative optimization: Repeat the first two steps until the change in the position of the cluster center is less than the preset threshold or the maximum number of iterations is reached. Subsequence selection involves choosing the candidate spectral subsequence closest to the cluster center in each cluster, and combining all selected candidate spectral subsequences to obtain the final representative shapelets set.

[0011] As a preferred aspect of the invention, the optimal number of clusters is determined based on the set of candidate spectral subsequences of all pixels and using the elbow rule. The specific steps are as follows: Calculate the sum of squared intra-cluster errors for the candidate spectral subsequence set of all pixels at different numbers of clusters. The specific calculation formula is as follows: ; in Indicates the number of clusters. Indicates the first Clusters, Indicates candidate spectral subsequences, Indicates the first The center of each cluster, Represents candidate spectral subsequences To the cluster center The weighted Euclidean distance; Plotting the sum of squared errors within a cluster With the number of clusters A changing elbow plot, selecting the elbow point as the optimal number of clusters. .

[0012] As a preferred aspect of the invention, the specific steps of performing feature transformation on the spectral vector of each pixel based on the final representative shapelets set to obtain a distance feature matrix, and constructing a logistic regression model based on the distance feature matrix are as follows: The minimum Euclidean distance between the spectral vector of each pixel and each candidate spectral subsequence in the final representative shapelets set is calculated. Convert all the calculated minimum Euclidean distances into matrix form to obtain the distance feature matrix; The distance feature matrix is ​​normalized, and the normalized distance feature matrix is ​​used as the feature input to construct a logistic regression model.

[0013] As a preferred aspect of the invention, the specific steps of iteratively optimizing the objective function of the logistic regression model using the stochastic gradient descent optimization algorithm and continuously updating the shapelets and classification weights to obtain the optimal model parameters of the logistic regression model are as follows: Initialize parameters, randomly initialize classification weights, bias terms, and shapelets; Calculate the predicted value and, using the current model parameters, calculate the predicted probability for each hyperspectral image sample. Calculate the loss function based on the predicted probability and the true label data. The loss function value includes the cross-entropy loss and regularization term of logistic regression. Calculate the gradient: calculate the gradient of the loss function with respect to the classification weights. The formula is the difference between the predicted value and the true value multiplied by the corresponding feature value, plus the gradient of the regularization term. Calculate the gradient of the loss function with respect to the shapelets: first calculate the difference between the predicted value and the true value, then multiply by the Euclidean distance between the corresponding feature value and the shapelets, and finally multiply by the gradient of the shapelets. Iterative optimization involves updating the classification weights, bias terms, and shapelets based on the calculated gradient and using the learning rate. This process is repeated until the maximum number of iterations is reached or the change in the loss function value is less than a certain threshold, thus obtaining the optimal model parameters for the logistic regression model.

[0014] The present invention has the following advantages: 1. This invention acquires the spectral curve of each pixel in preprocessed hyperspectral image data and sets the length of the sliding window corresponding to each pixel by analyzing the characteristics of the spectral curve. It can flexibly adapt the window size according to the feature changes of the spectral curve in different regions. That is, a shorter window is used in areas with drastic spectral changes to retain key details, while a longer window is used in areas with gentle spectral changes to enhance the smoothing effect and reduce noise interference. This dynamic adjustment mechanism not only improves the accuracy of spectral feature extraction, but also enhances the feature expression ability of the spectral curve, making the differences in spectral features between different land cover categories more significant, thereby improving the performance and generalization ability of this classification model. At the same time, it improves the adaptability of this method to different datasets and enhances the classification effect of this hyperspectral image classification method.

[0015] 2. This invention uses the K-means clustering algorithm to specify... By iteratively optimizing the location of each cluster center, the candidate spectral subsequences closest to each cluster center are selected as the final representative shapelets set. This method can efficiently extract the most representative shapelets set from a large number of spectral subsequences, thereby significantly reducing data dimensionality and complexity and reducing computational cost. Furthermore, since the cluster centers represent the most discriminative spectral features in the dataset, the shapelets set is more representative, which enhances the generalization ability of this classification model and improves classification accuracy and efficiency, thus improving the classification effect of this hyperspectral image classification method.

[0016] 3. This invention transforms the spectral vector of each pixel based on the final representative shapelets set to obtain a distance feature matrix. This transforms the complex spectral curve features of hyperspectral data into a low-dimensional and discriminative feature representation, reducing data dimensionality and computational complexity. It also highlights the spectral differences between different categories. Using this distance feature matrix as feature input to construct a logistic regression model, the efficiency of logistic regression can be leveraged to quickly learn the linear relationship between features and categories, achieving high-precision classification. Furthermore, it can output probability values ​​to aid in the interpretation of results. Overall, it significantly improves computational efficiency while maintaining classification accuracy, thus enhancing the classification effect of this hyperspectral image classification method. Attached Figure Description

[0017] Figure 1 This is a flowchart illustrating a hyperspectral image classification method based on learning shapelets used in an embodiment of the present invention. Detailed Implementation

[0018] To enable those skilled in the art to better understand the technical solutions of this invention, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of this invention.

[0019] Example 1: A hyperspectral image classification method based on learned shapelets, such as... Figure 1 As shown, it includes the following steps: Image data acquisition: Retrieve hyperspectral image data and its label data from the database; Image data preprocessing involves mean filtering of the hyperspectral image data to obtain preprocessed hyperspectral image data. Spectral segmentation and clustering: The spectral curve of each pixel in the preprocessed hyperspectral image data is obtained. The length of the sliding window corresponding to each pixel is determined by analyzing the characteristics of the spectral curve. Using the sliding window, the spectral vector of each pixel is divided into a group of candidate spectral subsequences. The K-means clustering algorithm is then employed, specifying... The location of each cluster center is determined through iterative optimization, and the candidate spectral subsequences closest to each cluster center are selected as the final representative shapelets set. The classification model is constructed by performing feature transformation on the spectral vector of each pixel based on the final representative set of shapelets to obtain the distance feature matrix, and then constructing a logistic regression model based on the distance feature matrix. Training and iterative optimization: The stochastic gradient descent optimization algorithm is used to iteratively optimize the objective function of the logistic regression model and continuously update the shapelets and classification weights to obtain the optimal model parameters of the logistic regression model. The optimal model parameters are then applied to the logistic regression model to obtain the hyperspectral image classification model.

[0020] The specific steps for performing mean filtering on the hyperspectral image data to obtain preprocessed hyperspectral image data are as follows: Window definition and boundary processing: Determine the size of the filtering window as needed, and fill the edges of the hyperspectral image in the hyperspectral image data to obtain the filled hyperspectral image; The neighborhood mean calculation involves extracting all pixel values ​​within the neighborhood defined by the filter window for each pixel in the filled hyperspectral image, and calculating the average value of the pixel values ​​in each band within the neighborhood to obtain the filtered value of the pixel in each band. Pixel value update: For each pixel in the filled hyperspectral image, the original pixel value in each band is replaced with the calculated filtered value to obtain the preprocessed hyperspectral image data.

[0021] The specific steps for obtaining the spectral curve of each pixel in the preprocessed hyperspectral image data and setting the length of the sliding window corresponding to each pixel by analyzing the characteristics of the spectral curve are as follows: Data extraction: Extracting the spectral curve of each pixel in the preprocessed hyperspectral image data; The saliency is calculated by calculating the local gradient, local curvature, and power spectral density of the spectral curve for each pixel. The calculated local gradient, local curvature, and power spectral density are normalized, and the normalized local gradient, local curvature, and power spectral density are weighted and summed to obtain the feature saliency of each pixel. To determine the window length, for each pixel in the spectral image, the length of the sliding window is set based on the feature saliency of that pixel. The specific calculation formula is as follows: ; in Indicates the length of the sliding window. and These represent the minimum and maximum limits for the length of the sliding window, respectively. This indicates the significance of the feature.

[0022] The above steps acquire the spectral curve of each pixel in the preprocessed hyperspectral image data and set the length of the sliding window corresponding to each pixel by analyzing the characteristics of the spectral curve. This allows for flexible adaptation of the window size based on the characteristic changes of the spectral curve in different regions. Specifically, a shorter window is used in areas with drastic spectral changes to retain key details, while a longer window is used in areas with gentle spectral changes to enhance smoothing and reduce noise interference. This dynamic adjustment mechanism not only improves the accuracy of spectral feature extraction but also enhances the feature representation ability of the spectral curve, making the differences in spectral features between different land cover categories more significant. This improves the performance and generalization ability of the classification model, while also increasing the adaptability of the method to different datasets and enhancing the classification effect of this hyperspectral image classification method.

[0023] The specific steps for dividing the spectral vector of each pixel into a set of candidate spectral subsequences using a sliding window are as follows: Determine the window parameters, obtain the spectral vector of the corresponding pixel from the spectral curve of each pixel, and determine the length and sliding step of the sliding window; The number of subsequences is calculated by determining the number of subsequences that can be extracted from the spectral vector of each pixel using the following formula: ; in This represents the number of subsequences that can be extracted from the spectral vector. This represents the total number of bands in the spectral vector. Indicates the sliding step size. Indicates to The calculation result is rounded down; Subsequence extraction utilizes the idea of ​​convolution to construct an index matrix and extracts all candidate spectral subsequences from the spectral vector at once. During this process, when the remaining bands are insufficient to cover the length of the sliding window, the process either fills in zero values ​​or truncates the last candidate spectral subsequence. Batch processing is performed to obtain candidate spectral subsequences for all pixels and organize them to obtain a set of candidate spectral subsequences for each pixel.

[0024] It should be noted that a spectral image is a three-dimensional dataset containing spatial and spectral information. A spectral curve is a curve showing how the spectral information of a pixel in a spectral image changes with wavelength. A spectral vector is a vector composed of the spectral values ​​of the spectral curve in each band, and is a discretized representation of the spectral curve. Specifically, a spectral image can be described by its spectral curve, which can be represented as a spectral vector to facilitate processing and analysis in a computer. A spectral vector is a digital representation of the spectral information of a pixel in a spectral image and can be used in various spectral analysis and processing algorithms.

[0025] The K-means clustering algorithm is used, specifying... The specific steps for determining the location of each cluster center through iterative optimization, and selecting the candidate spectral subsequences closest to each cluster center as the final representative shapelets set, are as follows: The optimal number of clusters is determined based on the set of candidate spectral subsequences for all pixels and using the elbow rule. ; Initialize cluster centers by randomly selecting the first cluster center from the set of candidate spectral subsequences of all pixels. Then, based on the weighted average distance of each candidate spectral subsequence to the existing cluster center, select the remaining cluster centers sequentially until a cluster center is determined. One initial cluster center; Clustering assignment: Calculate the Euclidean distance from each candidate spectral subsequence to each cluster center, and assign each candidate spectral subsequence to the cluster to which the nearest cluster center belongs; Update the cluster centers by calculating the average value of all candidate spectral subsequences within each cluster and using this average value as the new cluster centers. Iterative optimization: Repeat the first two steps until the change in the position of the cluster center is less than the preset threshold or the maximum number of iterations is reached. Subsequence selection involves choosing the candidate spectral subsequence closest to the cluster center in each cluster, and combining all selected candidate spectral subsequences to obtain the final representative shapelets set.

[0026] The above steps specify the K-means clustering algorithm. By iteratively optimizing the location of each cluster center, the candidate spectral subsequences closest to each cluster center are selected as the final representative shapelets set. This method can efficiently extract the most representative shapelets set from a large number of spectral subsequences, thereby significantly reducing data dimensionality and complexity and reducing computational cost. Furthermore, since the cluster centers represent the most discriminative spectral features in the dataset, the shapelets set is more representative, which enhances the generalization ability of this classification model and improves classification accuracy and efficiency, thus improving the classification effect of this hyperspectral image classification method.

[0027] The specific steps for determining the optimal number of clusters based on the candidate spectral subsequence set of all pixels and using the elbow rule are as follows: Calculate the sum of squared intra-cluster errors for the candidate spectral subsequence set of all pixels at different numbers of clusters. The specific calculation formula is as follows: ; in Indicates the number of clusters. Indicates the first Clusters, Indicates candidate spectral subsequences, Indicates the first The center of each cluster, Represents candidate spectral subsequences To the cluster center The weighted Euclidean distance; Plotting the sum of squared errors within a cluster With the number of clusters A changing elbow plot, selecting the elbow point as the optimal number of clusters. .

[0028] The specific steps for performing feature transformation on the spectral vector of each pixel based on the final representative shapelets set to obtain a distance feature matrix, and constructing a logistic regression model based on the distance feature matrix are as follows: The minimum Euclidean distance between the spectral vector of each pixel and each candidate spectral subsequence in the final representative shapelets set is calculated. Convert all the calculated minimum Euclidean distances into matrix form to obtain the distance feature matrix; The distance feature matrix is ​​normalized, and the normalized distance feature matrix is ​​used as the feature input to construct a logistic regression model.

[0029] The above steps transform the spectral vector of each pixel based on the final representative set of shapelets to obtain a distance feature matrix. This transforms the complex spectral curve features of hyperspectral data into a low-dimensional and discriminative feature representation, reducing data dimensionality and computational complexity. It also highlights the spectral differences between different categories. Using this distance feature matrix as feature input to construct a logistic regression model, the efficiency of logistic regression can be leveraged to quickly learn the linear relationship between features and categories, achieving high-precision classification. Furthermore, it can output probability values ​​to aid in the interpretation of results. Overall, it significantly improves computational efficiency while maintaining classification accuracy, thus enhancing the classification performance of this hyperspectral image classification method.

[0030] The specific steps for iteratively optimizing the objective function of the logistic regression model using the stochastic gradient descent optimization algorithm, and continuously updating the shapelets and classification weights to obtain the optimal model parameters of the logistic regression model are as follows: Initialize parameters, randomly initialize classification weights, bias terms, and shapelets; Calculate the predicted value and, using the current model parameters, calculate the predicted probability for each hyperspectral image sample. Calculate the loss function based on the predicted probability and the true label data. The loss function value includes the cross-entropy loss and regularization term of logistic regression. Calculate the gradient: calculate the gradient of the loss function with respect to the classification weights. The formula is the difference between the predicted value and the true value multiplied by the corresponding feature value, plus the gradient of the regularization term. Calculate the gradient of the loss function with respect to the shapelets: first calculate the difference between the predicted value and the true value, then multiply by the Euclidean distance between the corresponding feature value and the shapelets, and finally multiply by the gradient of the shapelets. Iterative optimization involves updating the classification weights, bias terms, and shapelets based on the calculated gradient and using the learning rate. This process is repeated until the maximum number of iterations is reached or the change in the loss function value is less than a certain threshold, thus obtaining the optimal model parameters for the logistic regression model.

[0031] It should be understood that those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims. Parts not described in detail in this specification are prior art known to those skilled in the art.

Claims

1. A hyperspectral image classification method based on learned shapelets, characterized in that, Includes the following steps: Image data acquisition: Retrieve hyperspectral image data and its label data from the database; Image data preprocessing involves mean filtering of the hyperspectral image data to obtain preprocessed hyperspectral image data. Spectral segmentation and clustering: The spectral curve of each pixel in the preprocessed hyperspectral image data is obtained. The length of the sliding window corresponding to each pixel is determined by analyzing the characteristics of the spectral curve. Using the sliding window, the spectral vector of each pixel is divided into a group of candidate spectral subsequences. The K-means clustering algorithm is then employed, specifying... The location of each cluster center is determined through iterative optimization, and the candidate spectral subsequences closest to each cluster center are selected as the final representative shapelets set. The classification model is constructed by performing feature transformation on the spectral vector of each pixel based on the final representative set of shapelets to obtain the distance feature matrix, and then constructing a logistic regression model based on the distance feature matrix. Training and iterative optimization: The stochastic gradient descent optimization algorithm is used to iteratively optimize the objective function of the logistic regression model and continuously update the shapelets and classification weights to obtain the optimal model parameters of the logistic regression model. The optimal model parameters are then applied to the logistic regression model to obtain the hyperspectral image classification model.

2. The hyperspectral image classification method based on learned shapelets according to claim 1, characterized in that, The specific steps for performing mean filtering on the hyperspectral image data to obtain preprocessed hyperspectral image data are as follows: Window definition and boundary processing: Determine the size of the filtering window as needed, and fill the edges of the hyperspectral image in the hyperspectral image data to obtain the filled hyperspectral image; The neighborhood mean calculation involves extracting all pixel values ​​within the neighborhood defined by the filter window for each pixel in the filled hyperspectral image, and calculating the average value of the pixel values ​​in each band within the neighborhood to obtain the filtered value of the pixel in each band. Pixel value update: For each pixel in the filled hyperspectral image, the original pixel value in each band is replaced with the calculated filtered value to obtain the preprocessed hyperspectral image data.

3. The hyperspectral image classification method based on learned shapelets according to claim 2, characterized in that, The specific steps for obtaining the spectral curve of each pixel in the preprocessed hyperspectral image data and setting the length of the sliding window corresponding to each pixel by analyzing the characteristics of the spectral curve are as follows: Data extraction: Extracting the spectral curve of each pixel in the preprocessed hyperspectral image data; The saliency is calculated by calculating the local gradient, local curvature, and power spectral density of the spectral curve for each pixel. The calculated local gradient, local curvature, and power spectral density are normalized, and the normalized local gradient, local curvature, and power spectral density are weighted and summed to obtain the feature saliency of each pixel. To determine the window length, for each pixel in the spectral image, the length of the sliding window is set based on the feature saliency of that pixel. The specific calculation formula is as follows: ; in Indicates the length of the sliding window. and These represent the minimum and maximum limits for the length of the sliding window, respectively. This indicates the significance of the feature.

4. The hyperspectral image classification method based on learned shapelets according to claim 3, characterized in that, The specific steps for dividing the spectral vector of each pixel into a set of candidate spectral subsequences using a sliding window are as follows: Determine the window parameters, obtain the spectral vector of the corresponding pixel from the spectral curve of each pixel, and determine the length and sliding step of the sliding window; The number of subsequences is calculated by determining the number of subsequences that can be extracted from the spectral vector of each pixel using the following formula: ; in This represents the number of subsequences that can be extracted from the spectral vector. This represents the total number of bands in the spectral vector. Indicates the sliding step size. Indicates to The calculation result is rounded down; Subsequence extraction utilizes the idea of ​​convolution to construct an index matrix and extracts all candidate spectral subsequences from the spectral vector at once. During this process, when the remaining bands are insufficient to cover the length of the sliding window, the process either fills in zero values ​​or truncates the last candidate spectral subsequence. Batch processing is performed to obtain candidate spectral subsequences for all pixels and organize them to obtain a set of candidate spectral subsequences for each pixel.

5. The hyperspectral image classification method based on learned shapelets according to claim 4, characterized in that, The K-means clustering algorithm is used, specifying... The specific steps for determining the location of each cluster center through iterative optimization, and selecting the candidate spectral subsequences closest to each cluster center as the final representative shapelets set, are as follows: The optimal number of clusters is determined based on the set of candidate spectral subsequences for all pixels and using the elbow rule. ; Initialize cluster centers by randomly selecting the first cluster center from the set of candidate spectral subsequences of all pixels. Then, based on the weighted average distance of each candidate spectral subsequence to the existing cluster center, select the remaining cluster centers sequentially until a cluster center is determined. One initial cluster center; Clustering assignment: Calculate the Euclidean distance from each candidate spectral subsequence to each cluster center, and assign each candidate spectral subsequence to the cluster to which the nearest cluster center belongs; Update the cluster centers by calculating the average value of all candidate spectral subsequences within each cluster and using this average value as the new cluster centers. Iterative optimization: Repeat the first two steps until the change in the position of the cluster center is less than the preset threshold or the maximum number of iterations is reached. Subsequence selection involves choosing the candidate spectral subsequence closest to the cluster center in each cluster, and combining all selected candidate spectral subsequences to obtain the final representative shapelets set.

6. The hyperspectral image classification method based on learned shapelets according to claim 5, characterized in that, The optimal number of clusters is determined based on the candidate spectral subsequence set of all pixels and using the elbow rule. The specific steps are as follows: Calculate the sum of squared intra-cluster errors for the candidate spectral subsequence set of all pixels at different numbers of clusters. The specific calculation formula is as follows: ; in Indicates the number of clusters. Indicates the first Clusters, Indicates candidate spectral subsequences, Indicates the first The center of each cluster, Represents candidate spectral subsequences To the cluster center The weighted Euclidean distance; Plotting the sum of squared errors within a cluster With the number of clusters A changing elbow plot, selecting the elbow point as the optimal number of clusters. .

7. The hyperspectral image classification method based on learned shapelets according to claim 6, characterized in that, The specific steps for performing feature transformation on the spectral vector of each pixel based on the final representative shapelets set to obtain a distance feature matrix, and constructing a logistic regression model based on the distance feature matrix are as follows: The minimum Euclidean distance between the spectral vector of each pixel and each candidate spectral subsequence in the final representative shapelets set is calculated. Convert all the calculated minimum Euclidean distances into matrix form to obtain the distance feature matrix; The distance feature matrix is ​​normalized, and the normalized distance feature matrix is ​​used as the feature input to construct a logistic regression model.

8. The hyperspectral image classification method based on learned shapelets according to claim 7, characterized in that, The specific steps for iteratively optimizing the objective function of the logistic regression model using the stochastic gradient descent optimization algorithm, and continuously updating the shapelets and classification weights to obtain the optimal model parameters of the logistic regression model are as follows: Initialize parameters, randomly initialize classification weights, bias terms, and shapelets; Calculate the predicted value and, using the current model parameters, calculate the predicted probability for each hyperspectral image sample. Calculate the loss function based on the predicted probability and the true label data. The loss function value includes the cross-entropy loss and regularization term of logistic regression. Calculate the gradient: calculate the gradient of the loss function with respect to the classification weights. The formula is the difference between the predicted value and the true value multiplied by the corresponding feature value, plus the gradient of the regularization term. Calculate the gradient of the loss function with respect to the shapelets: first calculate the difference between the predicted value and the true value, then multiply by the Euclidean distance between the corresponding feature value and the shapelets, and finally multiply by the gradient of the shapelets. Iterative optimization involves updating the classification weights, bias terms, and shapelets based on the calculated gradient and using the learning rate. This process is repeated until the maximum number of iterations is reached or the change in the loss function value is less than a certain threshold, thus obtaining the optimal model parameters for the logistic regression model.