Hyperspectral classification method and system based on spatial-spectral prototype feature learning
By constructing a local spatial-spectral neighborhood set and learning the optimal prototype set and projection based on spatial-spectral prototype feature learning, the problem of low classification accuracy of small sample hyperspectral images is solved, and efficient classification results are achieved. This method is applicable to hyperspectral images and aerospace remote sensing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NANJING UNIV OF AERONAUTICS & ASTRONAUTICS
- Filing Date
- 2022-05-11
- Publication Date
- 2026-06-05
AI Technical Summary
In hyperspectral image classification, existing methods have low classification accuracy when there are few training samples (small sample size), especially due to the high dimensionality of hyperspectral images and the influence of mixed pixel noise, making it difficult to effectively extract discriminative spectral-spatial features.
We employ a spatial-spectral prototype feature learning approach. By using maximum noise ratio dimensionality reduction and local spatial-spectral neighborhood set construction, combined with the spatial-spectral prototype feature learning algorithm, we learn the optimal spatial-spectral prototype set and linear projection for small-sample hyperspectral image classification.
It significantly improves the classification accuracy of hyperspectral images under small sample conditions, enhances classification performance and improves computational efficiency, and is suitable for hyperspectral classification and aerospace remote sensing.
Smart Images

Figure CN115496933B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to hyperspectral image processing and application technology, and in particular to a hyperspectral classification method and system based on spatial-spectral prototype feature learning. Background Technology
[0002] Hyperspectral images are characterized by "image-spectrum integration," containing not only rich spectral information but also rich spatial information. Among them, hyperspectral image classification technology is a research hotspot in the field of remote sensing. Its goal is to determine the land cover category of each pixel in the image by analyzing its spectral and spatial characteristics. To solve the hyperspectral image classification problem, researchers have proposed classic classification methods such as spectral angle matching, support vector machines, and MLR. However, these methods still have two main problems: (1) When the number of training samples is small, the classification model needs more training parameters as the spectral dimension increases, and the high data dimension of hyperspectral images will lead to a decrease in classification accuracy. (2) The presence of mixed spectral pixels will bring noise to the classification map. Among them, manual feature extraction methods such as EMP, JSRC, and KSRC have good classification results when there are enough training samples, but the classification accuracy will decrease rapidly when there are few training samples (small samples). In addition, some feature extraction methods based on deep learning networks, such as CNN, SSRN, and HybridSN, can automatically extract spatial-spectral features, which also greatly improves the classification accuracy. However, training deep learning networks requires a large number of training samples to learn network parameters, so classification accuracy drops sharply when the number of training samples is small. Therefore, how to extract discriminative spectral-spatial features and significantly improve the classification accuracy of hyperspectral images under the condition of a small number of training samples remains a problem worthy of research. Summary of the Invention
[0003] Purpose of the invention: The purpose of this invention is to provide a hyperspectral classification method based on spatial-spectral prototype feature learning, which can extract discriminative spectral-spatial features and significantly improve the classification accuracy of hyperspectral images under conditions of a small number of training samples (small sample size).
[0004] Another objective of this invention is to provide a hyperspectral classification system based on spatial-spectral prototype feature learning.
[0005] Technical solution: The hyperspectral classification method based on spatial-spectral prototype feature learning of the present invention includes the following steps:
[0006] S1. The original hyperspectral image χ is reduced in dimension using the maximum noise ratio method to obtain the dimension-reduced hyperspectral image Z; Each dimension-reduced pixel z in the dimension-reduced hyperspectral image Z is then assigned a dimension reduction pixel z using spectral similarity and spatial structure context information. iConstruct a local spatial-spectral neighborhood set F i =[f i 1 ,...,f i M ], where z i f represents the i-th dimension-reduced pixel in Z. i 1 Represents the relationship with pixel z i The first pixel with the smallest cosine similarity, f i M Represents the relationship with pixel z i The Mth pixel with the smallest cosine similarity;
[0007] S2. Randomly select some dimension-reduced pixels z from the dimension-reduced hyperspectral image Z. i As training samples, the remaining dimensionality-reduced pixels are used as test samples, constructing a training space-spectral set F = [F1, F2, ..., F...]. N ], where N represents the total number of training samples, F1, F2 and F N These are the dimensionality-reduced pixels z1, z2, and z3 in the training samples, respectively. N The corresponding local spatial-spectral neighborhood set; based on the training spatial-spectral set F = [F1, F2, ..., F N The optimal spatial-spectral prototype set is calculated using the spatial-spectral prototype feature learning algorithm, along with the corresponding training sample label data. and linear projection W, where, It is the optimal spatial-spectral prototype set P i The first element, It is the optimal spatial-spectral prototype set P i The l-th element, i = 1, 2, ..., N;
[0008] S3. Employ the optimal set of space-spectral prototypes. The test samples are classified using linear projection W.
[0009] Furthermore, the method for constructing the local spatial-spectral neighborhood set in step S1 is as follows:
[0010] S11. The first three principal components are extracted from the original hyperspectral image χ using principal component analysis (PCA) as the base image. The base image is then segmented using the superpixel oversegmentation method to generate a 2-D superpixel image of the original hyperspectral image χ.
[0011] S12. Map the index of the 2-D superpixel image to the dimension-reduced hyperspectral image Z to obtain the 3D superpixel image;
[0012] S13. For the i-th dimension-reduced pixel z in the dimension-reduced hyperspectral image Z... i , reduce the dimension of pixels z i The reduced-dimensional pixel z is composed of all pixels in its corresponding superpixel and the corresponding superpixel. i The local spatial neighborhood set is represented as Where m represents the dimension-reduced pixel z i The number of pixels in the corresponding superpixel This indicates that the dimension-reduced pixel z i The first pixel in the corresponding superpixel excluding itself. This indicates that the dimension-reduced pixel z i The (m-1)th pixel in the corresponding superpixel, excluding itself;
[0013] S14, at the i-th dimension-reduced pixel z i Find the M pixels with the smallest similarity to the cosine in the corresponding local spatial neighborhood set, and form the reduced-dimensional pixel z. i The local spatial-spectral neighborhood set F i =[f i 1 ,...,f i M ].
[0014] Furthermore, the formula for calculating cosine similarity in step S14 is as follows:
[0015]
[0016] in, For z i The j-th pixel in the corresponding superpixel.
[0017] Furthermore, the spatial-spectral prototype feature learning algorithm in step S2 includes the following steps:
[0018] S21. Initialize the spectral space prototype set P i 'And linear projection W', construct the target loss function J using the sigmoid function;
[0019] S22. The gradient of the target loss function J with respect to the linear projection W is calculated using the gradient descent method. And the target loss function J relative to... gradient It is the j-th parameter vector of a point in the subspace, where the subspace is a subset of the data matrix. The subspace obtained by applying singular value decomposition, μ i For the local spatial-spectral neighborhood set F i =[f i1 ,...,f i M [middle f] i 1 ,...,f i M The average value;
[0020] S23. The gradient of the calculated target loss function J with respect to the linear projection W. and the target loss function J relative to gradient The step size τ of gradient descent is calculated using the limited-memory BFGS method;
[0021] S24. Calculate the direction of gradient descent;
[0022] S25. Update the linear projection W and W using the finite-memory BFGS method. According to the updated From the formula The optimal spatial-spectral prototype set P was calculated. i U i For data matrix [f i 1 -μ i ,...,f i M -μ i The orthonormal basis obtained by applying singular value decomposition is j = 1, 2, ..., l, where l represents the total number of parameter vectors of points in the subspace.
[0023] Furthermore, step S21 specifically includes the following steps:
[0024] S211, For each dimension-reduced pixel z i According to its local spatial-spectral neighborhood set F i =[f i 1 ,...,f i M ], by formula The initial spectral space prototype set is calculated.
[0025] Then from the formula g = W' T f calculates the initial linear projection W', where f represents F i In the initial linear projection W', g represents a sample corresponding to f;
[0026] S212. For each sample g in the initialized linear projection W', firstly, use the following formula to initialize the spectral space prototype sets of the corresponding same and different classes respectively. The nearest neighbors a and b are calculated in the following way:
[0027]
[0028] sth a ∈P i 'and h a ∈Class(f)
[0029]
[0030] sth b ∈P i 'and
[0031] Among them, h a This represents the initial spectral space prototype set P. i 'Samples h that belong to the same class as sample g. b The representation represents the initial spectral space prototype set P. i 'Samples g belong to different classes. The function d(·) is used to calculate the Euclidean distance, and then the equation ppw(g)=W' is used. T a and ppb(g) = W' T b calculates the projections ppw(g) and ppb(g) of the nearest neighbors a and b;
[0032] S213, Use the sigmoid function To calculate the loss, where Q f Defined as β represents a parameter, according to the formula The target loss function J is calculated.
[0033] Furthermore, the formula for calculating the direction of gradient descent in step S24 is as follows:
[0034]
[0035]
[0036] Where A represents the direction vector of gradient descent, and W(τ) represents the curve path of gradient descent.
[0037] Furthermore, in step S3, each test spectral-spatial set γ in the test sample is classified using the following method:
[0038] S31. Calculate the optimal spatial-spectral prototype set P of the training spectral space set. i projection The calculation formula is:
[0039]
[0040] Calculate the projection γ of the spectral prototype of the test spectral space set γ. * The calculation formula is:
[0041] γ * =Wγ;
[0042] S32. Calculate the projection γ of the spectral prototype of the test spectral space set γ. * And the optimal set of spatial-spectral prototypes P for training the spectral space set. i projection Distance between The calculation formula is:
[0043]
[0044] S33. Determine the classification results;
[0045] From the formula Assign labels to the spectral space prototype set with the minimum geometric distance, determine the label of the test spectral space set γ, and achieve classification.
[0046] The hyperspectral classification system based on spatial-spectral prototype feature learning of the present invention includes:
[0047] The image processing module performs dimensionality reduction on the original hyperspectral image χ using the maximum noise ratio method to obtain the dimensionality-reduced hyperspectral image Z; and uses spectral similarity and spatial structure context information to assign dimensionality reduction values to each pixel z in the dimensionality-reduced hyperspectral image Z. i Construct a local spatial-spectral neighborhood set F i =[f i 1 ,...,f i M ], where z i f represents the i-th dimension-reduced pixel in Z. i 1 Represents the relationship with pixel z i The first pixel with the smallest cosine similarity, f i M Represents the relationship with pixel z i The Mth pixel with the smallest cosine similarity;
[0048] The sample partitioning module is used to randomly select some dimension-reduced pixels z from the dimension-reduced hyperspectral image Z. i The remaining pixels, after being reduced in dimension, serve as training samples and as test samples.
[0049] The training module constructs a training space-spectral set F = [F1, F2, ..., F...]. N], where N represents the total number of training samples, F1, F2 and F N These are the dimensionality-reduced pixels z1, z2, and z3 in the training samples, respectively. N The corresponding local spatial-spectral neighborhood set; based on the training spatial-spectral set F = [F1, F2, ..., F N The optimal spatial-spectral prototype set is calculated using the spatial-spectral prototype feature learning algorithm, along with the corresponding training sample label data. and linear projection W, where P i It is F i The corresponding optimal spatial-spectral prototype set, It is the optimal spatial-spectral prototype set P i The first element, It is the optimal spatial-spectral prototype set P i The l-th element;
[0050] The classification module was tested using the optimal set of spatial-spectral prototypes. The test samples are classified using linear projection W.
[0051] An apparatus of the present invention includes a memory and a processor, wherein:
[0052] Memory is used to store computer programs that can run on a processor;
[0053] A processor is configured to execute the steps of the hyperspectral classification method based on spatial-spectral prototype feature learning when running the computer program.
[0054] The present invention provides a storage medium storing a computer program, which, when executed by at least one processor, implements the steps of the hyperspectral classification method based on spatial-spectral prototype feature learning.
[0055] Beneficial effects: Compared with the prior art, the present invention has the following advantages:
[0056] (1) Based on spectral similarity and spatial structure information, this invention constructs a local spatial-spectral set for each hyperspectral data sample, which can accurately mine local spatial-spectral information and greatly improve the classification accuracy under small sample conditions;
[0057] (2) The present invention designs a spatial-spectral prototype learning model to learn a set of spatial-spectral prototypes to optimize the use of the similarity and variance of pixels in each spatial-spectral set and to mine unseen spatial-spectral variations, which can provide more supplementary information, especially in the case of small samples, which can significantly improve classification accuracy.
[0058] (3) The present invention simultaneously learns a linear discriminant projection, so that each test local spectral space set and its nearest neighbor spectral space prototype set are optimally classified into the same class in the projection target subspace, which can further improve the classification performance;
[0059] (4) Finally, the present invention adopts the simplest nearest neighbor classifier, which completes the classification task by measuring the minimum geometric distance between the projected test spectral space set and the optimal projected spectral space prototype set, which is beneficial to improving computational efficiency.
[0060] (5) Compared with other similar methods, the method proposed in this invention can greatly improve the classification accuracy under small sample conditions and can be applied to fields such as hyperspectral classification and aerospace remote sensing. Attached Figure Description
[0061] Figure 1 This is a schematic flowchart of the method of the present invention;
[0062] Figure 2 The dataset is the experimental real hyperspectral dataset, where (a) is the experimental real hyperspectral pseudo-color image and (b) is the real label image;
[0063] Figure 3 In the middle (a), (b), and (c), respectively, the curves of the overall classification accuracy (OA), average classification accuracy (AA), and consistency test Kappa of the SSPLNN algorithm of the present invention when the spectral dimension r after dimensionality reduction increases from 5 to 50.
[0064] Figure 4 In the middle (a), (b), and (c), respectively, the overall classification accuracy (OA), average classification accuracy (AA), and Kappa coefficient of the consistency test of the SSPLNN algorithm of the present invention are curves when the number of superpixels L increases from 30 to 120 (for the Indian Pines and Salinas datasets) and from 100 to 300 (for the Pavia University dataset).
[0065] Figure 5 Figures (a)-(h) show a comparison of the classification results of experimental images by the classification method SSPLNN and seven classifiers described in this invention: MFASRC, LCMR, HybridSN, S-DMM, MCMs-2DCNN, DGCN-DC, and Semi-S. Detailed Implementation
[0066] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments.
[0067] This invention presents a hyperspectral classification method based on spatial-spectral prototype feature learning. First, by utilizing spectral similarity and spatial structure context information, a local spatial-spectral neighbor set is constructed for each sample in the original hyperspectral image to accurately explore local spectral-spatial information. Then, a spatial-spectral prototype learning model is designed to learn a set of spatial-spectral prototypes to optimize the use of the similarity and variance of pixel samples in each spatial-spectral set, uncovering unknown spatial-spectral variations. This provides more complementary information even with small sample sizes, significantly improving classification accuracy. Furthermore, the designed spatial-spectral prototype learning model simultaneously learns linear discriminative projection, ensuring that each test local spatial-spectral set and its nearest neighbor spatial-spectral prototype set are optimally classified into the same category in the projected target subspace, further enhancing classification performance. Finally, a nearest neighbor classifier is used to complete the classification task and determine the label by measuring the minimum geometric distance between the projected test spectral spatial set and the optimal projected spectral spatial prototype set, improving computational efficiency. Compared with similar classical hyperspectral image classification methods, this invention's classification method achieves higher classification accuracy with small sample sizes and can be applied to hyperspectral classification and aerospace remote sensing. Figure 1 As shown, the specific steps include:
[0068] S1. The original hyperspectral image χ is reduced in dimension using the maximum noise ratio method to obtain the dimension-reduced hyperspectral image Z; Each dimension-reduced pixel z in the dimension-reduced hyperspectral image Z is then assigned a dimension reduction pixel z using spectral similarity and spatial structure context information. i Construct a local spatial-spectral neighborhood set F i =[f i 1 ,...,f i M ], where z i f represents the i-th dimension-reduced pixel in Z. i 1 Represents the relationship with pixel z i The first pixel with the smallest cosine similarity, f i M Represents the relationship with pixel z i The Mth pixel with the smallest cosine similarity;
[0069] The method for constructing the local spatial-spectral neighborhood set is as follows:
[0070] S11. The first three principal components are extracted from the original hyperspectral image χ using principal component analysis (PCA) as the base image. The base image is then segmented using the superpixel oversegmentation method to generate a 2-D superpixel image of the original hyperspectral image χ.
[0071] S12. Map the index of the 2-D superpixel image to the dimension-reduced hyperspectral image Z to obtain the 3D superpixel image;
[0072] S13. For the i-th dimension-reduced pixel z in the dimension-reduced hyperspectral image Z... i , reduce the dimension of pixels z i The reduced-dimensional pixel z is composed of all pixels in its corresponding superpixel and the corresponding superpixel. i The local spatial neighborhood set is represented as Where m represents the dimension-reduced pixel z i The number of pixels in the corresponding superpixel This indicates that the dimension-reduced pixel z i The first pixel in the corresponding superpixel excluding itself. This indicates that the dimension-reduced pixel z i The (m-1)th pixel in the corresponding superpixel, excluding itself;
[0073] S14, at the i-th dimension-reduced pixel z i Find the M pixels with the smallest similarity to the cosine in the corresponding local spatial neighborhood set, and form the reduced-dimensional pixel z. i The local spatial-spectral neighborhood set F i =[f i 1 ,...,f i M ];
[0074] The formula for calculating cosine similarity is:
[0075]
[0076] Among them, z i Let i be the i-th dimension-reduced pixel in Z. For z i The j-th pixel in the corresponding superpixel.
[0077] S2. Randomly select some dimension-reduced pixels z from the dimension-reduced hyperspectral image Z. i As training samples, the remaining dimensionality-reduced pixels are used as test samples, constructing a training space-spectral set F = [F1, F2, ..., F...]. N ], where N represents the total number of training samples, F1, F2 and F N These are the dimensionality-reduced pixels z1, z2, and z3 in the training samples, respectively. N The corresponding local spatial-spectral neighborhood set; based on the training spatial-spectral set F = [F1, F2, ..., F N The optimal spatial-spectral prototype set is calculated using the spatial-spectral prototype feature learning algorithm, along with the corresponding training sample label data. And linear projection W, where the training space-spectral set F = [F1, F2, ..., F N Each F1, F2, ..., F in ] N Each corresponds to an optimal spatial-spectral prototype set P1, P2, ..., P N That is, P i It is F i The corresponding optimal spatial-spectral prototype set, It is the optimal space-spectral prototype set P i The first element, It is the optimal spatial-spectral prototype set P i The l-th element in the array, where i = 1, 2, ..., N;
[0078] The spatial-spectral prototype feature learning algorithm includes the following steps:
[0079] S21. Initialize the spectral space prototype set P i 'And linear projection W', the target loss function J is constructed using the sigmoid function; specifically:
[0080] S211, For each dimension-reduced pixel z i According to its local spatial-spectral neighborhood set F i =[f i 1 ,...,f i M ], by formula The initial spectral space prototype set is calculated. Where μ i For the local spatial-spectral neighborhood set F i =[f i 1 ,...,f i M [middle f] i 1 ,...,f i M The average value;
[0081] Then from the formula g = W' T f calculates the initial linear projection W', where f represents F i In the initial linear projection W', g represents a sample corresponding to f;
[0082] S212. For each sample g in the initialized linear projection W', firstly, use the following formula to initialize the spectral space prototype sets of the corresponding same and different classes respectively. The nearest neighbors a and b are calculated in the following way:
[0083]
[0084] sth a ∈P i 'and h a ∈Class(f)
[0085]
[0086] sth b ∈P i 'and
[0087] Among them, h a This represents the initial spectral space prototype set P. i 'Samples h that belong to the same class as sample g. b This represents the initial spectral space prototype set P. i 'Samples g belong to different classes. The function d(·) is used to calculate the Euclidean distance, and then the equation ppw(g)=W' is used. T a and ppb(g) = W' T b calculates the projections ppw(g) and ppb(g) of the nearest neighbors a and b;
[0088] S213, Use the sigmoid function To calculate the loss, where Q f Defined as β represents a parameter, according to the formula The target loss function J is calculated.
[0089] S22. The gradient of the target loss function J with respect to the linear projection W is calculated using the gradient descent method. And the target loss function J relative to... gradient It is the j-th parameter vector of a point in the subspace, where the subspace is the data matrix [f i 1 -μ i ,...,f i M -μ i The subspace obtained by applying singular value decomposition, μ i For the local spatial-spectral neighborhood set F i =[f i 1 ,...,f i M [middle f] i 1 ,...,fi M The average value;
[0090] S23. The gradient of the calculated target loss function J with respect to the linear projection W. and the target loss function J relative to gradient The step size τ of gradient descent is calculated using the limited-memory BFGS (L-BFGS) method.
[0091] S24. Calculate the direction of gradient descent. The formula is:
[0092]
[0093] curve
[0094] Where A represents the direction vector of gradient descent, and W(τ) represents the curve path of gradient descent;
[0095] S25. Update the linear projection W and W using the L-BFGS method. According to the updated From the formula The optimal spatial-spectral prototype set P was calculated. i , where μ i For the local spatial-spectral neighborhood set F i =[f i 1 ,...,f i M [middle f] i 1 ,...,f i M The average value, u i For data matrix [f i 1 -μ i ,...,f i M -μ i The orthonormal basis obtained by applying singular value decomposition is j = 1, 2, ..., l, where l represents the total number of parameter vectors of points in the subspace.
[0096] S3. Employ the optimal set of space-spectral prototypes. The test samples are classified using linear projection W; specifically:
[0097] S31. For each test spectral-spatial set γ, from equation P i * =WP iLet i = 1, 2, ..., N. Calculate the optimal set of spatial-spectral prototypes P for the training spectral space set. i Projection P i * From equation γ * =Wγ calculates the projection γ of the spectral prototype of the test spectral space set γ. * ;
[0098] S32. For each test spectral-spatial set γ, from equation D(γ) * ,P i * )=||γ * -P i * || 2 , i = 1, 2, ... N, calculate the projection γ of the spectral prototype of the test spectral space set γ. * And the optimal set of spatial-spectral prototypes P for training the spectral space set. i Projection P i * The distance between D(γ) * ,P i * );
[0099] S33. For each test spectral-spatial set γ, from the equation Class(γ) = argmin i=1,2,...N D(γ * ,P i * Assign labels to the spectral space prototype set with the minimum geometric distance, determine the label of the test spectral space set γ, and achieve classification.
[0100] The present invention provides a hyperspectral classification system based on spatial-spectral prototype feature learning, comprising:
[0101] The image processing module performs dimensionality reduction on the original hyperspectral image χ using the maximum noise ratio method to obtain the dimensionality-reduced hyperspectral image Z; and uses spectral similarity and spatial structure context information to assign dimensionality reduction values to each pixel z in the dimensionality-reduced hyperspectral image Z. i Construct a local spatial-spectral neighborhood set F i =[f i 1 ,...,f i M ], where z i f represents the i-th dimension-reduced pixel in Z. i 1 Represents the relationship with pixel z i The first pixel with the smallest cosine similarity, f i MRepresents the relationship with pixel z i The Mth pixel with the smallest cosine similarity;
[0102] The sample partitioning module is used to randomly select some dimension-reduced pixels z from the dimension-reduced hyperspectral image Z. i The remaining pixels, after being reduced in dimension, serve as training samples and as test samples.
[0103] The training module constructs a training space-spectral set F = [F1, F2, ..., F...]. N ], where N represents the total number of training samples, F1, F2 and F N These are the dimensionality-reduced pixels z1, z2, and z3 in the training samples, respectively. N The corresponding local spatial-spectral neighborhood set; based on the training spatial-spectral set F = [F1, F2, ..., F N The optimal spatial-spectral prototype set is calculated using the spatial-spectral prototype feature learning algorithm, along with the corresponding training sample label data. and linear projection W, where P i It is F i The corresponding optimal spatial-spectral prototype set, It is the optimal spatial-spectral prototype set P i The first element, It is the optimal spatial-spectral prototype set P i The l-th element;
[0104] The classification module was tested using the optimal set of spatial-spectral prototypes. The test samples are classified using linear projection W.
[0105] An apparatus of the present invention includes a memory and a processor, wherein:
[0106] Memory is used to store computer programs that can run on a processor;
[0107] The processor is configured to, when running the computer program, execute the steps of the hyperspectral classification method based on spatial-spectral prototype feature learning as described above, and achieve the same technical effect as the method described above.
[0108] The present invention provides a storage medium storing a computer program, which, when executed by at least one processor, implements the steps of the hyperspectral classification method based on spatial-spectral prototype feature learning described above, and achieves the same technical effect as the method described above.
[0109] Example 1:
[0110] To better demonstrate the spatial-spectral prototype feature learning method of this invention and its advantages in hyperspectral classification, a specific example is used to compare the classification method described in this invention with existing classic classifiers such as MFASRC, LCMR, HybridSN, S-DMM, MCMs-2DCNN, DGCN-DC, and Semi-S.
[0111] The comparison method is: to Figure 2 The real hyperspectral images of Indian Pines were classified. Only 5 labeled pixels were randomly selected from each class as the training sample set, and the remaining pixels were used as the test sample set. The classification results of the above 8 classification methods were compared. The classification results are expressed using overall classification accuracy (OA), average classification accuracy (AA), Kappa coefficient, and classification accuracy of each class. Furthermore, to further illustrate the impact of the reduced spectral dimension r on the SSPLNN classification method, classification experiments were conducted on the experimental images when the reduced spectral dimension r increased from 5 to 50. The classification results are expressed using OA, AA, and Kappa coefficients. Additionally, to illustrate the impact of the number of superpixels L on the SSPLNN classification method, classification experiments were conducted on the experimental images when the number of superpixels L increased from 30 to 120 (for the Indian Pines and Salinas datasets) and from 100 to 300 (for the Pavia University dataset). The classification results are expressed using OA, AA, and Kappa coefficients.
[0112] Figure 3 In Figures (a), (b), and (c), respectively, the overall classification accuracy (OA), average classification accuracy (AA), and Kappa coefficient of the SSPLNN algorithm of this invention are curves showing that the spectral dimension r after dimensionality reduction increases from 5 to 50. Figure 3 As shown in (a), (b), and (c), for all three hyperspectral datasets, the OA, AA, and Kappa coefficients increase rapidly as the dimensionality r after dimensionality reduction increases from 5 to 20. As r continues to increase from 20 to 50, the classification accuracy of the OA, AA, and Kappa coefficients for the three datasets decreases slightly. The main reason is that as the dimensionality r after dimensionality reduction increases from 5 to 20, more and more key spectral information from the original hyperspectral dataset is preserved. However, as r continues to increase, some noise information is introduced, leading to a decrease in classification accuracy. Since the goal of the method in this invention is to obtain the highest classification accuracy, a dimensionality r of 20 after dimensionality reduction is selected in this invention.
[0113] Figure 4In Figures (a), (b), and (c), the overall classification accuracy (OA), average classification accuracy (AA), and Kappa coefficient of the SSPLNN algorithm of this invention are plotted as follows: the number of superpixels L increases from 30 to 120 (for the Indian Pines and Salinas datasets), and from 100 to 300 (for the Pavia University dataset). Figure 4 As shown in (a), (b), and (c), for the Indian Pines and Salinas datasets, the classification accuracy OA, AA, and Kappa coefficients increase and peak as the number of superpixels L increases from 30 to 80. For the Pavia University dataset, the classification accuracy OA, AA, and Kappa coefficients increase and peak as the number of superpixels L increases from 100 to 160. The main reason is that if the number of superpixels L is too large, the size of a single superpixel is too small, and the spatial structure information used for classification cannot be fully explored. Conversely, if the number of superpixels L is too small, the size of a single superpixel is too large, which is likely to introduce some dissimilar pixels, especially in edge regions. The purpose of the method in this invention is to obtain the highest classification accuracy, so in the method of this invention, the number of superpixels L is selected as 80 for the Indian Pines and Salinas datasets, and the number of superpixels L is selected as 160 for the Pavia University dataset.
[0114] Table 1 shows the simulation results comparing the OA, AA, Kappa coefficients and classification accuracy of eight classification methods on the experimental hyperspectral images. As can be seen from Table 1, the method SSPLNN of this invention achieved higher OA, AA, and Kappa coefficients, indicating the best classification result. Figure 5 Images (a)-(h) are comparisons of the classification results of experimental images using the classification method SSPLNN and seven classifiers described in this invention: MFASRC, LCMR, HybridSN, S-DMM, MCMs-2DCNN, DGCN-DC, and Semi-S. Figure 5 It can be seen that the classification method SSPLNN proposed in this invention can provide the best visual classification results, especially in the detailed structural regions that are misclassified by the comparison classification methods.
[0115] Table 1 shows the simulation results comparing the OA, AA, Kappa coefficients, and classification accuracy of the eight classification methods for the experimental images when the sample size is five randomly selected from each class.
[0116]
[0117]
[0118] In summary, this invention first constructs a local spectral space set for each pixel based on spectral similarity and spatial structure context information, enabling accurate mining of local spectral spatial information. Then, the method designs a spectral-spatial prototype learning model to learn a set of spectral-spatial prototypes to optimize the utilization of pixel similarity and variance in each spectral-spatial set and to uncover unseen spectral-spatial variations, significantly improving classification accuracy even with small sample sizes. Simultaneously, the method also learns a linear discriminant projection, further enhancing classification performance. Finally, the method employs a nearest neighbor classifier to complete the classification task, which improves computational efficiency.
[0119] The above embodiments are merely illustrative of the present invention and are not intended to limit the invention. Any person skilled in the art should recognize that within the scope of the technology disclosed in this invention, readily conceived variations or substitutions, as well as modifications and variations to the above embodiments, will fall within the scope of the claims of this invention.
Claims
1. A hyperspectral classification method based on spatial-spectral prototype feature learning, characterized in that, Includes the following steps: S1. The original hyperspectral image is processed using the maximum noise ratio method. Dimensionality reduction is performed to obtain the dimensionality-reduced hyperspectral image. ; By leveraging spectral similarity and spatial structural context information, the dimensionality-reduced hyperspectral image... Each dimension-reduced pixel in Construct a local spatial-spectral neighborhood set ,in express The first in One dimension-reduced pixel, Represents pixels The first pixel with the lowest cosine similarity. Represents pixels The cosine similarity is the smallest 1 pixel; S2, from the dimensionality-reduced hyperspectral image Randomly select some dimensionality-reduced pixels The remaining reduced-dimensional pixels serve as training samples, and the rest are used as test samples to construct a training space-spectral set. ,in This represents the total number of training samples. , and Dimensionally reduced pixels in the training samples , and The corresponding local spatial-spectral neighborhood set; Based on training space-spectral set The optimal spatial-spectral prototype set is calculated using the spatial-spectral prototype feature learning algorithm, along with the corresponding training sample label data. and linear projection ,in, It is the optimal space-spectral prototype set The first element, It is the optimal space-spectral prototype set The Middle One element, The spatial-spectral prototype feature learning algorithm includes the following steps: S21. Initialize the spectral space prototype set and linear projection The target loss function is constructed using the sigmoid function. ; S22. The target loss function is calculated using the gradient descent method. Compared to linear projection gradient And calculate the target loss function. Compared to gradient , It is the first point in the subspace A parameter vector, where the subspace is a data matrix. The subspace obtained by applying singular value decomposition, For local spatial-spectral neighborhood set middle The average value; S23, Calculation-based target loss function Compared to linear projection gradient and target loss function Compared to gradient The step size of gradient descent is calculated using the limited-memory BFGS method. ; S24. Calculate the direction of gradient descent; S25. Update the linear projection using the finite-memory BFGS method. and According to the updated , by formula The optimal set of spatial-spectral prototypes was calculated. ,in For data matrix The orthonormal basis obtained by applying singular value decomposition , This represents the total number of parameter vectors representing points within the subspace; S3. Employ the optimal set of space-spectral prototypes. and linear projection The test samples are classified for testing.
2. The hyperspectral classification method based on spatial-spectral prototype feature learning according to claim 1, characterized in that, The method for constructing the local spatial-spectral neighborhood set in step S1 is as follows: S11. Principal component analysis (PCA) was used to analyze the original hyperspectral image. The first three principal components are extracted as the base image, and the base image is segmented using the superpixel oversegmentation method to generate the original hyperspectral image. 2D superpixel image; S12. Map the index of the 2-D superpixel image to the dimension-reduced hyperspectral image. This yields a 3D superpixel image; S13. For the dimension-reduced hyperspectral image The first in dimensionality reduction pixels Dimensionality reduction pixels The pixel in this dimension-reduced pixel consists of all pixels in its corresponding superpixel. The local spatial neighborhood set is represented as ,in Represents dimensionality reduction pixels The number of pixels in the corresponding superpixel This indicates the dimension-reduced pixel. The first pixel in the corresponding superpixel excluding itself. This indicates the dimension-reduced pixel. The corresponding superpixel other than itself 1 pixel; S14, in the dimensionality reduction pixels Find the region in the corresponding local neighborhood that has the lowest similarity to the cosine. Each pixel constitutes the dimension-reduced pixel. Local spatial-spectral neighborhood set .
3. The hyperspectral classification method based on spatial-spectral prototype feature learning according to claim 2, characterized in that, The formula for calculating cosine similarity in step S14 is: ; in, for The corresponding superpixel 1 pixel.
4. The hyperspectral classification method based on spatial-spectral prototype feature learning according to claim 1, characterized in that, Step S21 specifically includes the following steps: S211, For each dimension-reduced pixel According to its local spatial-spectral neighborhood set , by formula The initial spectral space prototype set is calculated. ; Then from the formula The initial linear projection is calculated. ,in express One of the samples, Indicates the initial linear projection The middle corresponds to A sample; S212, For the initial linear projection Each sample in First, the initial spectral space prototype sets of the corresponding same and different classes are obtained respectively using the following formulas. The nearest neighbor is calculated in the middle. and : ; and ; ; and ; in, Represents the initial spectral space prototype set. In and sample Samples belonging to the same category, Represents the prototype set in the initialized spectral space. In and sample Samples belonging to different classes, function Used to calculate Euclidean distance, and then by the formula and Calculate the nearest neighbor and projection and ; S213, Use the sigmoid function To calculate the loss, where Defined as , Represents parameters, according to the formula The target loss function is calculated. .
5. The hyperspectral classification method based on spatial-spectral prototype feature learning according to claim 1, characterized in that, The formula for calculating the direction of gradient descent in step S24 is: ; ; in, This represents the direction vector of gradient descent. This represents the curve path of gradient descent.
6. The hyperspectral classification method based on spatial-spectral prototype feature learning according to claim 1, characterized in that, In step S3, each test spectrum-space set in the test sample is processed. The following methods are used for classification: S31. Calculate the optimal space-spectral prototype set of the training spectral space set. projection The calculation formula is: , ; Calculate the test spectral space set Projection of the spectral space prototype The calculation formula is: ; S32. Calculate the test spectral space set Projection of the spectral space prototype and the optimal set of spatial-spectral prototypes for training spectral spaces projection Distance between The calculation formula is: , ; S33. Determine the classification results; From the formula Assign labels to the prototype set of spectral spaces with the minimum geometric distance to determine the test spectral space set. Tags are used to achieve categorization.
7. A hyperspectral classification system based on spatial-spectral prototype feature learning, characterized in that, include: The image processing module uses the maximum noise ratio method to process the original hyperspectral image. Dimensionality reduction is performed to obtain the dimensionality-reduced hyperspectral image. ; Furthermore, by utilizing spectral similarity and spatial structure context information, the dimensionality-reduced hyperspectral image is... Each dimension-reduced pixel in Construct a local spatial-spectral neighborhood set ,in express The first in One dimension-reduced pixel, Represents pixels The first pixel with the lowest cosine similarity. Represents pixels The cosine similarity is the smallest 1 pixel; The sample partitioning module is used to partition the sample from the dimensionality-reduced hyperspectral image. Randomly select some dimensionality-reduced pixels The remaining pixels, after being reduced in dimension, serve as training samples and as test samples. The training module constructs the training space – a spectral set. ,in, This represents the total number of training samples. , and Dimensionally reduced pixels in the training samples , and The corresponding local spatial-spectral neighborhood set; based on the training space-spectral set The optimal spatial-spectral prototype set is calculated using the spatial-spectral prototype feature learning algorithm, along with the corresponding training sample label data. and linear projection ,in, yes The corresponding optimal spatial-spectral prototype set, It is the optimal space-spectral prototype set The first element, It is the optimal space-spectral prototype set The Middle The spatial-spectral prototype feature learning algorithm includes the following steps: (Number of elements;) S21. Initialize the spectral space prototype set and linear projection The target loss function is constructed using the sigmoid function. ; S22. The target loss function is calculated using the gradient descent method. Compared to linear projection gradient And calculate the target loss function. Compared to gradient , It is the first point in the subspace A parameter vector, where the subspace is a data matrix. The subspace obtained by applying singular value decomposition, For local spatial-spectral neighborhood set middle The average value; S23, Calculation-based target loss function Compared to linear projection gradient and target loss function Compared to gradient The step size of gradient descent is calculated using the limited-memory BFGS method. ; S24. Calculate the direction of gradient descent; S25. Update the linear projection using the finite-memory BFGS method. and According to the updated , by formula The optimal set of spatial-spectral prototypes was calculated. ,in For data matrix The orthonormal basis obtained by applying singular value decomposition , This represents the total number of parameter vectors representing points within the subspace; The classification module was tested using the optimal set of spatial-spectral prototypes. and linear projection The test samples are classified for testing.
8. A device, characterized in that, Includes memory and processor, wherein: Memory is used to store computer programs that can run on a processor; A processor, configured to, while running the computer program, perform the steps of the hyperspectral classification method based on spatial-spectral prototype feature learning as described in any one of claims 1-6.
9. A storage medium, characterized in that, The storage medium stores a computer program that, when executed by at least one processor, implements the steps of the hyperspectral classification method based on spatial-spectral prototype feature learning as described in any one of claims 1-6.