Hyperspectral image classification method based on auto-encoder and anchor diagram
By using autoencoder and anchor maps in hyperspectral image classification, the problems of high data dimensions and difficulty in labeling are solved, efficient calculation and precise classification are achieved, and cost and computational burden are reduced.
Patent Information
- Application Number
- CN202510218602.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-26
- Publication Date
- 2025-06-13
AI Technical Summary
There are problems in hyperspectral image classification with high data dimensions and difficulty in labeling, resulting in large calculations and high labeling costs.
The hyperspectral image classification method based on the autoencoder and anchor map is adopted to reduce the data dimension through the autoencoder, and select anchor points in the feature space to construct a similarity matrix, reducing the calculation amount and improving efficiency.
It effectively reduces the computational burden of hyperspectral image data, improves the calculation efficiency and classification accuracy, and reduces the dependence on labeled data, reducing labor costs.
Smart Images

Figure CN120147716A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of hyperspectral image classification and machine learning, and particularly to a hyperspectral image classification method based on an autoencoder and an anchor graph. Background Art
[0002] Compared with panchromatic images and multispectral images, hyperspectral images have richer spectral information, enabling more accurate classification and recognition of ground objects. By analyzing the spectral characteristics of ground objects in different bands, different material types on the earth's surface can be distinguished. In addition, hyperspectral images can capture subtle spectral changes on the earth's surface, so they are of great significance in environmental monitoring, resource exploration, disaster monitoring, etc. As one of the key tasks in hyperspectral image processing, hyperspectral image classification aims to divide each pixel in the image into different ground object categories to achieve precise quantitative analysis and spatial evaluation of the land cover type, which is of great significance in both the field of remote sensing science and earth observation.
[0003] However, hyperspectral image classification still faces several challenges: (1) High dimensionality. Hyperspectral images usually have hundreds or even thousands of bands, and there is a large amount of redundancy in the bands, increasing the time complexity of data analysis and processing; (2) Difficult annotation. Deep learning methods mainly based on Convolutional Neural Network (CNN) and Vision Transformer (ViT) rely on manually fine-annotated data for model training, but it is very difficult and time-consuming to obtain high-quality annotated data, especially for some complex ground object categories or large-scale areas, and the cost of annotated data is extremely high.
[0004] It should be noted that the information disclosed in the above background art section is only used to enhance the understanding of the background of the present invention, and thus may include information that does not constitute the prior art known to those of ordinary skill in the art. Summary of the Invention
[0005] Aiming at the problem of high data dimensionality in hyperspectral image classification, the present invention provides a hyperspectral image classification method based on an autoencoder and an anchor graph, which is used to reduce the computational amount of hyperspectral images and improve the computational efficiency.
[0006] Other features and advantages of the present invention will become apparent through the following detailed description, or be partially learned through the practice of the present invention.
[0007] According to a first aspect of the present invention, there is provided a hyperspectral image classification method based on an autoencoder and an anchor graph, the method comprising:
[0008] Obtain a hyperspectral image and reconstruct the hyperspectral image;
[0009] Construct an autoencoder, where the autoencoder includes an input layer, an encoding layer, an intermediate layer, a decoding layer, and an output layer; initialize the network parameters of the autoencoder;
[0010] Input the reconstructed hyperspectral image into the autoencoder for training, iteratively update the network parameters, and obtain the optimal autoencoder;
[0011] Perform k-means clustering on the encoded data output by the intermediate layer of the optimal autoencoder to obtain the final hyperspectral image classification result.
[0012] In some exemplary embodiments, the reconstructing of the hyperspectral image includes:
[0013] Stretch and expand the image of each band of the hyperspectral image along the spatial dimension, and reconstruct the hyperspectral image data into a second-order matrix.
[0014] In some exemplary embodiments, the number of encoding layers and decoding layers of the autoencoder is exactly equal, and the encoding layer and the decoding layer are fully connected layers.
[0015] In some exemplary embodiments, the network parameters of the autoencoder include S, W, p, where W and p respectively represent the weights and bias terms of each layer, and S represents the similarity coefficient between the data sample points established in the encoded feature space and the anchor point C in each iteration.
[0016] In some exemplary embodiments, the inputting of the reconstructed hyperspectral image into the autoencoder for training includes:
[0017] Perform forward propagation to obtain the intermediate layer data;
[0018] Randomly select anchor points and construct a similarity matrix;
[0019] Perform backpropagation, update the network parameters until the number of iterations.
[0020] In some exemplary embodiments, the loss functions used in the training process include a first loss function, a second loss function, and a third loss function:
[0021] The first loss function represents minimizing the reconstruction error of the autoencoder for the hyperspectral image data;
[0022] The second loss function represents adaptively constructing a similarity map between the sample points and the anchor points by minimizing the distance between the data sample points in the feature space and the selected anchor points, thereby measuring the similarity relationship between the sample points;
[0023] The third loss function represents the regularization of the network weights and bias terms, so as to avoid possible trivial solutions.
[0024] In some exemplary embodiments, the first loss function expression is:
[0025]
[0026] where x i is each initial pixel in the hyperspectral image, is the pixel output by the autoencoder for the corresponding initial pixel of the hyperspectral image.
[0027] In some exemplary embodiments, the second loss function expression is:
[0028]
[0029] where λ 1 is the weight coefficient, is the encoded data output by the middle layer of the autoencoder, γ is the weight coefficient, c j is the anchor point, s ij is the similarity between the sample point and the anchor point.
[0030] In some exemplary embodiments, the third loss function expression is:
[0031]
[0032] where λ 2 is the weight coefficient, W (k) and p (k) respectively represent the weight and bias term of the k-th layer.
[0033] According to a second aspect of the present invention, there is provided a storage medium having stored thereon a computer program, which when executed by a processor implements the hyperspectral image classification method based on an autoencoder and an anchor graph described in the first aspect above.
[0034] According to a third aspect of the present invention, there is provided a computer program product having stored thereon a computer program, which when executed by a processor implements the hyperspectral image classification method based on an autoencoder and an anchor graph described in the first aspect above.
[0035] According to a fourth aspect of the present invention, there is provided an electronic device, comprising:
[0036] a processor; and
[0037] a memory for storing executable instructions of the processor;
[0038] Among them, the processor is configured to implement the hyperspectral image classification method based on the autoencoder and the anchor graph described in the above first aspect when executing the executable instructions.
[0039] The hyperspectral image classification method based on the autoencoder and the anchor graph provided by the embodiments of the present invention uses the autoencoder as the main backbone architecture of the method, which maximally preserves the original data information while reducing the dimension of the samples, reducing the computational amount of the method, and improving the computational efficiency. The present invention constructs an adaptive nearest neighbor similarity matrix between the anchor points and the sample points in the feature space, which greatly reduces the computational amount and improves the running speed of the method compared with the full-sample similarity matrix. At the same time, the present invention integrates the fast graph construction process into the backpropagation and parameter update process of the autoencoder to optimize the result of parameter update. It has the following advantages:
[0040] 1. The present invention uses the autoencoder as the main backbone architecture of the method, so there is no need to perform a large number of cumbersome and refined annotations on the data, which greatly saves labor costs and improves the applicability of the method; and the autoencoder is an interpretable unsupervised machine learning technology, so the model proposed by the present invention has high interpretability;
[0041] 2. By designing the autoencoder structure, the present invention effectively extracts features with richer implications and more efficient and concise feature expressions, reduces the data dimension, effectively reduces the computational burden when processing hyperspectral image data, and improves the computational efficiency;
[0042] 3. The present invention integrates the graph construction process into the parameter update process of the autoencoder, and optimizes the network parameter update of the autoencoder with the graph construction data in the feature space, improving the classification accuracy of hyperspectral images;
[0043] 4. The present invention selects anchor points in the feature space, constructs a bipartite graph between the anchor points and the sample points to represent the similarity relationship between them, replacing the pairwise full-connection mode of sample points in the traditional method, and further improving the running speed and execution efficiency of the model.
[0044] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The accompanying drawings here are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present invention, and are used together with the specification to explain the principles of the present invention. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can obtain other drawings based on these drawings without creative efforts.
[0046] Figure 1Schematic diagram showing the steps of a hyperspectral image classification method based on an autoencoder and an anchor graph;
[0047] Figure 2 Schematic diagram showing the structure of an autoencoder according to an exemplary embodiment of the present invention;
[0048] Figure 3 Schematic flowchart showing a hyperspectral image classification method based on an autoencoder and an anchor graph according to an exemplary embodiment of the present invention. Detailed implementation manners
[0049] Example embodiments will now be described more fully with reference to the accompanying drawings. However, the example embodiments can be implemented in various forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0050] In addition, the accompanying drawings are only schematic illustrations of the present invention and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repeated description will be omitted. Some of the block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in the form of software, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0051] In the prior art, a hyperspectral image classification method based on structured feature reconstruction is proposed. By using an "encoding - reconstruction" mechanism, the input hyperspectral image is mapped and encoded, and then the encoded features are decoded and reconstructed into the original hyperspectral image, which improves the information retention and fully considers the spatial distribution of features. Drawing on the reconstruction idea and the self - expression theory, the utilization rate of image information is improved, and the orderly distributed structural information can be effectively described. However, the above - mentioned method uses the self - expression theory to characterize the sample attributes in the feature space, and the characterization of the similar attributes between samples in the feature space is relatively redundant, and it will greatly increase the computational complexity of the model.
[0052] In view of the disadvantages and deficiencies of the prior art, an exemplary embodiment of the present invention provides a hyperspectral image classification method based on an autoencoder and an anchor graph. Referring Figure 1 to the figure, it may include the following steps:
[0053] Step S11, obtain a hyperspectral image and reconstruct the hyperspectral image;
[0054] Step S12: Construct an autoencoder and initialize the network parameters of the autoencoder.
[0055] Step S13: Input the reconstructed hyperspectral image into the autoencoder for training, iteratively update the network parameters, and obtain the optimal encoder.
[0056] Step S14: Perform k-means clustering on the encoded data output by the optimal autoencoder to obtain the final hyperspectral image classification result.
[0057] Next, each step of the hyperspectral image classification method based on the autoencoder and the anchor graph in this exemplary embodiment will be described in more detail with reference to the accompanying drawings and embodiments.
[0058] In step S11, obtain a hyperspectral image and reconstruct the hyperspectral image.
[0059] Exemplarily, given a hyperspectral image where H and W respectively represent the height and width of each band of the hyperspectral image, and d represents the number of bands of the hyperspectral image. Stretch and expand the image of each band along the spatial dimension, and reconstruct the hyperspectral image data into a second-order matrix where d still represents the number of bands, and n = H×W represents the total number of pixels on each band. For the hyperspectral data where represents each pixel.
[0060] In step S12, construct an autoencoder and initialize the network parameters of the autoencoder.
[0061] To achieve the low-dimensional representation of hyperspectral image data, the present invention uses an autoencoder as the technical approach for feature extraction. As Figure 3 shown, the autoencoder consists of a total of M + 1 layers, namely an input data layer, an encoding layer, an intermediate layer, a decoding layer, and an output data layer. Generally, the number of encoding layers and decoding layers is exactly the same. The forward propagation process of the data is shown in Equation (1):
[0062]
[0063] That is, the input layer is the hyperspectral image data X after reconstruction, and each layer has corresponding weights, bias terms, and activation functions. In the present invention, the activation function is the hyperbolic tangent function, that is:
[0064]
[0065] Exemplarily, as Figure 2 shown, M in the autoencoder of the embodiment of the present invention is taken as 4, and a total of 5 layers of coefficients are included. That is, the input layer, the encoding layer, the intermediate layer, the decoding layer, and the output layer.
[0066] In step S13, the reconstructed hyperspectral image is input into the autoencoder for training, the network parameters are iteratively updated, and the optimal encoder is obtained.
[0067] Exemplarily, for the hyperspectral image data X obtained by the above reconstruction, the following loss function is constructed:
[0068]
[0069] Among them, the first term represents minimizing the reconstruction error of the autoencoder for the hyperspectral image data; the second term represents adaptively constructing a similarity map between the data sample points and the selected anchor points by minimizing the distance between the data sample points in the feature space and the selected anchor points, so as to measure the similarity relationship between the sample points; the third term represents the regularization of the network weights and bias terms, so as to avoid possible trivial solutions.
[0070] Based on the loss function shown in Equation (3), the parameters to be optimized in each iteration are S, W, and p. Among them, W and p respectively represent the weights and bias terms of each layer, and S represents the similarity coefficient between the data sample points and the anchor point C established in the encoded feature space in each iteration. The anchor points in the present invention are randomly selected in the feature space.
[0071] By constructing the loss function shown in Equation (3) and realizing the supervised training of the autoencoding network, the corresponding weight parameters will be updated in each round until the iteration termination condition is satisfied, and the encoded data representation of the final intermediate layer output obtained after training is obtained. It is the low-dimensional space embedding representation obtained after training the original data X, the dimension value is reduced, and the high-efficiency feature representation ability of the original data is retained.
[0072] To achieve the final classification result, for the embedded low-dimensional representation perform k-means clustering, assign corresponding class labels to each pixel, and complete the classification of the hyperspectral image.
[0073] The specific optimization process is as follows:
[0074] Denote L = L 1 + L 2 + L 3 :
[0075]
[0076] Denote And represents the feature representation of the data sample obtained after the non-linear transformation of each layer by the activation function. It can be obtained that:
[0077]
[0078] Therefore, the weights and biases of each layer of the autoencoder can be updated as follows:
[0079]
[0080] For the similarity coefficient s in each iteration process ij , there is the following calculation and optimization process:
[0081]
[0082] That is, construct the similarity matrix S of the data sample points and the anchor point c j in the feature space. The matrix is the similarity matrix between the sample points and the anchor points; since the model (10) is independent for each data sample point, for the i-th sample point, the model is simplified as follows:
[0083]
[0084] where s ij is the element in the i-th row and j-th column of the matrix S, representing the similarity between the i-th sample point and the j-th anchor point, represents the i-th row of the matrix S, and γ is the regularization coefficient. Denote as the Euclidean distance between the i-th sample point and the j-th anchor point, then equation (11) can be written in the following form:
[0085]
[0086] Assume that s i contains l (l ≤ m) non-zero elements, reorder the elements in s i in ascending order, assume then The expression of is:
[0087]
[0088] So far, a single iteration optimization is completed, and the parameters W, p of the autoencoder and the parameter S of the similarity matrix are all updated. When the number of iterations reaches the set number of times, the entire optimization process is completed. Finally, perform a k-means clustering on the obtained encoded data to obtain the final hyperspectral image classification result. The specific flowchart of the training is as shown in the appendix Figure 3 . Forward propagation obtains the intermediate layer encoded data, randomly selects anchor points, constructs a similarity matrix, backpropagates, and updates the network parameters until the number of iterations.
[0089] To simplify the calculation of the loss function, L 2The terms are transformed as follows:
[0090]
[0091] where respectively represent the diagonal matrices formed by the row sum and column sum vectors of matrix S. The final loss function is abbreviated as:
[0092]
[0093] It should be noted that the above-mentioned drawings are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present invention, rather than for limiting purposes. It is easy to understand that the processes shown in the above-mentioned drawings do not indicate or limit the chronological order of these processes. Additionally, it is also easy to understand that these processes can be executed synchronously or asynchronously in, for example, multiple modules.
[0094] In one embodiment, the present application provides a computer program product, including a computer program, which when executed by a processor implements the steps in the above-mentioned method embodiments.
[0095] Furthermore, the above-mentioned drawings are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present invention, rather than for limiting purposes. It is easy to understand that the processes shown in the above-mentioned drawings do not indicate or limit the chronological order of these processes. Additionally, it is also easy to understand that these processes can be executed synchronously or asynchronously in, for example, multiple modules.
[0096] Those skilled in the art will readily think of other embodiments of the present invention after considering the specification and practicing the invention herein. This application is intended to cover any variations, uses, or adaptations of the present invention that follow the general principles of the present invention and include the common general knowledge or conventional technical means in the technical field not disclosed by the present invention. The specification and embodiments are only regarded as exemplary, and the true scope and spirit of the present invention are pointed out by the claims.
[0097] It should be understood that the present invention is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present invention is only defined by the appended claims.
Claims
1. A hyperspectral image classification method based on autoencoder and anchor graph, characterized in that: The method comprises: Acquire a hyperspectral image and reconstruct the hyperspectral image; Construct an autoencoder, where the autoencoder includes an input layer, an encoding layer, an intermediate layer, a decoding layer, and an output layer; initialize the network parameters of the autoencoder; The reconstructed hyperspectral image is input into the autoencoder for training, and the network parameters are iteratively updated to obtain the optimal autoencoder; The final hyperspectral image classification result is obtained by performing k-means clustering on the encoded data output by the intermediate layer of the optimal autoencoder.
2. The hyperspectral image classification method based on autoencoder and anchor graph according to claim 1 is characterized in that: The reconstructing the hyperspectral image comprises: The image of each band of the hyperspectral image is stretched and expanded along the spatial dimension, and the hyperspectral image data is reconstructed into a second-order matrix.
3. The hyperspectral image classification method based on autoencoder and anchor graph according to claim 1 or 2, characterized in that: The number of encoding layers and decoding layers of the autoencoder is completely equal, and the encoding layer and the decoding layer are fully connected layers.
4. The hyperspectral image classification method based on autoencoder and anchor graph according to claim 3 is characterized in that: The network parameters of the autoencoder include S, W, and p, where W and p represent the weight and bias term of each layer respectively, and S represents the similarity coefficient between the data sample point and the anchor point C established in the encoded feature space in each iteration.
5. The hyperspectral image classification method based on autoencoder and anchor graph according to claim 4 is characterized in that: The step of inputting the reconstructed hyperspectral image into the autoencoder for training comprises: Forward propagation obtains the intermediate layer data; Randomly select anchor points and construct a similarity matrix; Back propagation, update network parameters, up to the number of iterations.
6. The hyperspectral image classification method based on autoencoder and anchor graph according to claim 5 is characterized in that: The loss functions used in the training process include the first loss function, the second loss function and the third loss function: The first loss function represents minimizing the reconstruction error of the autoencoder for the hyperspectral image data; The second loss function represents adaptively constructing a similarity graph between the sample point and the anchor point by minimizing the distance between the data sample point and the selected anchor point in the feature space, thereby measuring the similarity relationship between the sample points; The third loss function represents the regularization of the network weights and bias terms so as to avoid possible trivial solutions.
7. The hyperspectral image classification method based on autoencoder and anchor graph according to claim 6 is characterized in that: The first loss function expression is: Among them, x i For each initial pixel in the hyperspectral image, is the pixel output by the autoencoder of the corresponding initial pixel of the hyperspectral image.
8. The hyperspectral image classification method based on autoencoder and anchor graph according to claim 6, characterized in that: The second loss function expression is: Among them, λ1 is the weight coefficient, is the encoded data output by the middle layer of the autoencoder, γ is the weight coefficient, c j is the anchor point, s ij is the similarity between the sample point and the anchor point.
9. The hyperspectral image classification method based on autoencoder and anchor graph according to claim 6, characterized in that: The third loss function expression is: Among them, λ2 is the weight coefficient, W (k) and p (k) They represent the weight and bias term of the kth layer respectively.
10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the hyperspectral image classification method based on an autoencoder and an anchor map is implemented as described in any one of claims 1 to 9.