Hyperspectral image classification method based on adaptive L-BFGS algorithm

Through the adaptive L-BFGS algorithm, the deep network model is trained, and the rapid and accurate classification of hyperspectral images is achieved, which solves the problems of slow convergence speed and local optimality of network models, and improves the efficiency of feature extraction and classification.

CN115937565BActive Publication Date: 2025-08-22SUZHOU UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210133932.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-14
Publication Date
2025-08-22
Estimated Expiration
2042-02-14

AI Technical Summary

Technical Problem

In the existing hyperspectral image classification methods, network models have slow convergence speed and are prone to fall into local optimal points, making it difficult to fully explore the spatial and spectral characteristics of hyperspectral images, and conventional optimization algorithms are difficult to achieve the convergence state quickly and accurately.

Method used

Adaptive L-BFGS algorithm is used for network parameter training, and the null spectral feature mapping is constructed by building a deep network model, combining adaptive selection of memory scales to achieve fast and accurate feature extraction and fusion, and the second-order optimization characteristics of the L-BFGS algorithm are used to improve convergence speed and recognition accuracy.

Benefits of technology

It significantly improves the convergence speed and recognition accuracy of hyperspectral image classification, solves the problems of slow convergence and local optimality in traditional methods, and realizes efficient feature extraction and classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115937565B_ABST
    Figure CN115937565B_ABST
Patent Text Reader

Abstract

The present invention relates to a hyperspectral image classification method based on an adaptive L‑BFGS algorithm, which utilizes convolutional layers and long short-term memory network layers to extract pixel spatial features and fuses them with spectral features to ultimately achieve the purpose of classification. At the same time, an improved second-order optimization algorithm is used to update and optimize the parameters of the network model, thereby solving the problems of excessive number of samples, excessive amount of data, and difficulty in updating parameters in this application scenario, improving the convergence speed of the algorithm, and solving the problem that the algorithm easily falls into the local optimum. The present invention regards the arrangement of pixels in the local space as continuous information and utilizes the long short-term memory network layer to extract features from it, thereby ensuring the diversity of hyperspectral image pixel features and contributing to the improvement of classification effect. The present invention fuses spatial spectrum features using a splicing operation to achieve the purpose of multimodal learning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of hyperspectral image processing, and in particular to a hyperspectral image classification method based on an adaptive L-BFGS algorithm. Background Art

[0002] Hyperspectral image (HSI) classification distinguishes different ground objects by assigning a single label to each pixel. It has been widely used in fields such as forest surveying, urban detection, and land cover mapping. Hyperspectral images are typically three-dimensional cube data, with two spatial dimensions describing the spatial location of ground objects and one spectral dimension describing the variation in their spectral reflectance at different wavelengths. Therefore, hyperspectral images contain rich spatial and spectral features. However, due to the strong correlation between the bands in hyperspectral images, there is a high amount of redundant information between bands, which hinders the extraction and expression of important information.

[0003] The current mainstream approach is to map pixels into specific subspaces through feature extraction. This mapping reduces the strong correlation between bands, yielding embedded features rich in discriminative information and improving pixel recognition. Considering the "image-spectrum integration" advantage of hyperspectral images, i.e., the consistency between the spatial and spectral information of pixels, existing hyperspectral image classification methods can generally be divided into spectral feature classification methods and spatial-spectral feature classification methods.

[0004] Spectral feature classification methods exploit the critical discriminative information within spectral curves by designing deep network models tailored to the structure of hyperspectral pixels. These methods do not consider the spatial information of the pixels. Classic hyperspectral image feature classification network models include autoencoders (AEs), variational autoencoders (VAEs), long short-term memory networks (LSTMs), and generative adversarial networks (GANs). However, the features extracted by these models are relatively simple and fail to fully exploit the advantages of hyperspectral images.

[0005] With the advancement of computer processing and analysis capabilities, the speed of training spatial-spectral feature classification network models has also increased significantly. Therefore, the current mainstream method is spatial-spectral feature classification. Spatial features in hyperspectral images describe the specific spatial location of pixels, while spectral information describes the continuous spectral curve composed of the spectral reflectance of pixels at various wavelengths in the hyperspectral image. Spatial-spectral feature classification methods generally use multiple mapping networks to obtain spatial and spectral features, and utilize feature fusion modules to achieve a joint expression of features from different modalities. The combination of spatial-spectral features improves the completeness of pixel information and achieves multi-sensor data fusion by constructing a multi-stream deep network model. A commonly used deep network model is the convolutional neural network, which achieves local-to-global optimization by performing convolution operations on local neighborhood information of pixels. This type of method often requires processing a large number of hyperspectral pixels. As the range of spatial information selection increases, the amount of information gradually increases, making it difficult for conventional network optimization algorithms to quickly converge to a stable result.

[0006] In order to improve the performance of hyperspectral image feature classification results, existing research has improved the network optimization algorithm. At present, people mainly use first-order optimization algorithms to optimize network parameters. However, first-order optimization algorithms have a slow convergence speed and are prone to falling into local optimal points. Applying them to the training of hyperspectral image feature classification network models makes it difficult to take advantage of the data of hyperspectral images. Although the commonly used second-order optimization algorithm has a fast convergence speed and high accuracy, it consumes huge amounts of memory resources. Chinese invention patent CN113705724A discloses an adaptive L-BFGS algorithm that uses a batch learning method of a second-order optimization algorithm to greatly reduce the amount of storage, significantly improve the convergence speed and accuracy, and is suitable for processing hyperspectral image features. Summary of the Invention

[0007] To this end, the technical problem to be solved by the present invention is to overcome the shortcomings of the existing technology in the hyperspectral image classification scenario, such as slow convergence speed of the network model and easy falling into local optimal points, and propose a classification method for hyperspectral images, which is used to quickly and accurately extract the spatial features and spectral features of hyperspectral images. This method mines important discriminant information through spatial-spectral feature mapping, achieves the purpose of spatial-spectral combination through a feature fusion module, and adopts an improved second-order optimization algorithm to quickly and accurately reach a convergence state.

[0008] To solve the above technical problems, the present invention provides a hyperspectral image classification method based on an adaptive L-BFGS algorithm, which is characterized by comprising the following steps:

[0009] S10: Data preprocessing:

[0010] Obtain pixel data of the hyperspectral image and corresponding spatial data to form input sample 2 and input sample 1;

[0011] Shuffle the input sample 1 and the input sample 2 respectively, and extract a part from each input sample to form the training sample 1 and the training sample 2;

[0012] S20: Build a deep network model:

[0013] The deep network model includes a spatial feature extraction module 1, a spatial feature extraction module 2, a spectral feature extraction module, and a classification module. The convolutional layer and the long short-term memory network layer are used to process the spatial feature extraction module 1 and the spatial feature extraction module 2 respectively to obtain a first output and a second output. The fully connected layer is used to process the spectral feature extraction module to obtain a third output, and the output results are fused.

[0014] The fusion result is input into the classification module to obtain the fourth output;

[0015] S30: Training network model:

[0016] Each time, a small batch of training samples 1 and a small batch of training samples 2 are selected from the training samples 1 and the training samples 2, and the small batch of training samples 1 are used as the spatial feature extraction module 1, the small batch of training samples 1 are transformed to form the spatial feature extraction module 2, and the small batch of training samples 2 are used as the spectral feature extraction module to input into the deep network model of step S20, and all outputs are obtained, and the loss function L is calculated based on the above outputs;

[0017] The L-BFGS algorithm is used to train the network parameters until the network converges. During the training process, K is adaptively selected. * memory scales, where K * =argmin 1≤K≤M {Q K},

[0018]

[0019] S40: Generate classification results:

[0020] Based on the trained deep network model, input sample one and input sample two are input to obtain the category labels of all hyperspectral pixels.

[0021] In one embodiment of the present invention, during the training process, according to K * memory scale, calculate K * Directions And in mixed direction as a search direction.

[0022] In one embodiment of the present invention, during the training process, the parameters in the deep network model are updated according to the following formula:

[0023] xt+1 =x t +μ t ⊙d t

[0024] Among them, μ t is the step size or learning rate, and β is the decay rate, η is the initial step size, and ε is a constant.

[0025] In one embodiment of the present invention, the hyperspectral image in step S10 is normalized and pre-processed, and the value range in the normalization pre-processing is between -1 and 1. The normalization formula is as follows:

[0026]

[0027] where x min Represents the minimum value in the hyperspectral pixel data, x max Indicates the maximum value in the hyperspectral pixel data.

[0028] In one embodiment of the present invention, the number of network layers in the classification module is n, the activation function of the last layer of the classification module in the network is the Sigmoid activation function, and the activation functions used in other network layers are all Tanh activation functions.

[0029] In one embodiment of the present invention, the Sigmoid activation function calculation formula is: The calculation formula of Tanh activation function is:

[0030] In one embodiment of the present invention, the calculation formula of the loss function is:

[0031] L=L cls +L KL1 +L KL2 +L KL3 ,in

[0032] L cls =CrossEntropy(Output, l)

[0033]

[0034]

[0035]

[0036] ∑(·) is the sum of all the contents in the brackets. l is the one-hot code of the sample label, with a size of 1× c, where only one position has a value of 1 and all other positions have values ​​of 0. L cls The final classification accuracy is calculated using cross entropy, LKL1 The spectral similarity between the first and third outputs is calculated using the spectral angular distance, L KL2 The spectral similarity between the second and third outputs is calculated using the spectral angular distance, L KL3 The spectral similarity between the first and second outputs is calculated using the spectral angular distance.

[0037] In one embodiment of the present invention, the calculation formula of cross entropy is:

[0038] CrossEntropy(x,y)=-[xlog(y)+(1-x)log(1-y)].

[0039] In one embodiment of the present invention, in step S10, for each hyperspectral pixel, the pixel itself is taken as the center and the surrounding neighborhood pixels with a size of s×s are selected as the spatial data of the pixel. For the hyperspectral pixels at the edge, the missing data are filled with zeros.

[0040] In one embodiment of the present invention, in step S10, input sample 1 and input sample 2 are shuffled in the same order, and input sample 1 and input sample 2 whose sequence numbers are in the top 30% are selected as training sample 1 and training sample 2. If X×Y×30% is not an integer, it is rounded off.

[0041] Based on the same inventive concept, the present application also provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the methods when executing the program.

[0042] Based on the same inventive concept, the present application also provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of any one of the methods when executed by a processor.

[0043] Based on the same inventive concept, the present application also provides a processor, which is used to run a program, wherein the program executes any one of the methods described when it is run.

[0044] The above technical solution of the present invention has the following advantages over the prior art:

[0045] The hyperspectral image classification method described in the present invention applies a second-order optimization algorithm to the research of hyperspectral image classification. Compared with the mainstream Adam algorithm and RMSProp algorithm in this application scenario, the convergence speed is significantly improved, and the recognition accuracy is also improved. It is an effective means to cope with the current situation of needing to process a large number of samples in this application scenario.

[0046] The adaptive L-BFGS algorithm proposed in this invention uses K* The setting allows the memory scale to change adaptively, solving the problem of fixed memory scale in traditional L-BFGS. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to make the content of the present invention more clearly understood, the present invention is further described in detail below based on specific embodiments of the present invention in conjunction with the accompanying drawings, wherein

[0048] Figure 1 The deep network model described in the present invention;

[0049] Figure 2 The adaptive L-BFGS algorithm of the present invention;

[0050] Figure 3 This is a flow chart of the method for adaptively adjusting the number of memory scales according to the present invention. DETAILED DESCRIPTION

[0051] The present invention will be further described below with reference to the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it. However, the embodiments are not intended to limit the present invention.

[0052] Reference Figure 1 FIG. 1 is a flow chart of a hyperspectral image classification method based on an adaptive L-BFGS algorithm according to the present invention. The classification method according to the present invention comprises the following steps:

[0053] S10: Data preprocessing:

[0054] A hyperspectral image is selected based on the actual research problem, where the image size is X×Y×B, X and Y are the spatial dimensions of the hyperspectral image, B is the number of spectral channels of the hyperspectral image, the label size of the hyperspectral image is X×Y, and the number of hyperspectral pixel categories contained is c.

[0055] Obtain pixel data and corresponding spatial data of the hyperspectral image. Specifically, for each hyperspectral pixel (a total of X × Y hyperspectral pixels), take it as the center and select its surrounding s × s neighboring pixels as the spatial data of the pixel. The size of the spatial data is 1 × s × s × B. For hyperspectral pixels at the edge, perform zero padding on the missing data.

[0056] Before acquiring the data of the hyperspectral image, the hyperspectral image is normalized and preprocessed by setting the neighborhood sliding window size s, where s is an odd number greater than 0. The value range in the normalization preprocessing is between -1 and 1, and the normalization formula is as follows:

[0057]

[0058] where x min Represents the minimum value in the hyperspectral pixel data, x max represents the maximum value in the hyperspectral pixel data, x represents the original data, and x′ represents the normalized result.

[0059] All X × Y spatial data of size 1 × s × s × B are used as input sample 1, and all X × Y hyperspectral pixels of size 1 × B are used as input sample 2. That is, input sample 1 is a spatial dataset, and input sample 2 is a pixel dataset. Input sample 1 and input sample 2 have the same number and a one-to-one correspondence. Input sample 2 at the same location is the center of input sample 1.

[0060] All X×Y input samples 1 and all X×Y input samples 2 are shuffled, and a portion of input samples 1 and input samples 2 are selected as training samples 1 and 2. In this embodiment, the shuffling order is consistent to ensure a consistent one-to-one correspondence between spatial data and pixel data. Specifically, samples with sequence numbers in the top 30% are selected. If X×Y×30% is not an integer, it is rounded up. In other embodiments of the present invention, other numbers of samples may also be selected.

[0061] S20: Build a deep network model:

[0062] The deep network model of the present invention includes a spatial feature extraction module 1, a spatial feature extraction module 2, a spectral feature extraction module and a classification module.

[0063] The spatial feature extraction module 1 consists of m two-dimensional convolutional layers, with the convolution kernel size of k×k, the number of convolution kernels of d, the step size of 1, and the same padding model. This ensures that only the number of convolution channels changes before and after the convolution operation, without changing other sizes. The final output of the spatial feature extraction module 1 after the convolution layer calculation is Output 1 Output 1 Perform an average pooling operation, that is, calculate the average value of its second and third dimensions, and finally obtain the first output of size 1×d:

[0064] The spatial feature extraction module 2 is composed of m long short-term memory network layers, with d nodes. The spatial feature extraction module 2 calculates the final output of the long short-term memory network layer as Output 2 Output 2 After the average pooling operation, that is, the average value of the second dimension is calculated, the second output of size 1×d is finally obtained:

[0065] The spectral feature extraction module consists of a fully connected layer with d nodes. The spectral feature extraction module calculates the third output of size 1×d through the fully connected layer: Output 3 .

[0066] The spatial features are combined with the spectral features. and Output 3 The splicing is performed according to the following formula:

[0067]

[0068] Among them, Concat(·) is a concatenation operation, which concatenates the three in the second dimension to obtain an output feature with a size of 1×3d.

[0069] The concatenated features are fed into the classification module, which consists of n fully connected layers. The number of nodes in the first n-1 layers is d, and the number of nodes in the nth layer is equal to the number of pixel categories, c. The classification module calculates the fourth output, Output, through the fully connected layers, with a size of 1 × c.

[0070] Furthermore, in this embodiment, the number of network layers in the classification module is n, the activation function of the last layer of the classification module in the network is the Sigmoid activation function, and the activation functions used in other network layers are all Tanh activation functions. The Sigmoid activation function calculation formula is: The calculation formula of Tanh activation function is:

[0071] S30: Training network model:

[0072] Each time, small batch training sample 1 and small batch training sample 2 are selected from training sample 1 and training sample 2, small batch training sample 1 is used as spatial feature extraction module 1, small batch training sample 1 is transformed as spatial feature extraction module 2, and small batch training sample 2 is used as spectral feature extraction module to input into the deep network model of step S20, and the total output is: Output 3 And Output. Based on the above output, the loss function L can be calculated;

[0073] The calculation formula of the loss function is: L = L cls +L KL1 +L KL2 +L KL3 ,in

[0074] L cls =CrossEntropy(Output, l)

[0075]

[0076]

[0077]

[0078] ∑(·) is the sum of all the contents in the brackets. l is the one-hot code of the sample label, with a size of 1× c, where only one position has a value of 1 and all other positions have values ​​of 0. L cls The final classification accuracy is calculated using cross entropy, L KL1 Calculation using spectral angular distance and Output 3 The spectral similarity between KL2 Calculation using spectral angular distance and Output 3 The spectral similarity between KL3 Calculation using spectral angular distance and Furthermore, the cross entropy is calculated as follows: CrossEntropy(x, y) = -[xlog(y) + (1-x)log(1-y)].

[0079] The network parameters are trained using the L-BFGS algorithm until the network converges, that is, the value of the loss function L decreases slowly and tends to be stable.

[0080] Specifically, for the L-BFGS algorithm, in this embodiment, the parameter in the randomly initialized deep network model is set to x0, the maximum number of iterations is N, and the initial value of the adaptive change of the upper bound M of the selection interval is M0.

[0081] The gradients gt, st and yt of the loss function L are calculated by forward propagation and back propagation; s t =x t -x t-1 ,y t =g t -g t-1 .

[0082] Predict the average value of the next memory scale in, Indicates the K selected at time t-1 * The average value of the memory scale, Represents the average value of the memory scale at the previous moment of the prediction, α∈(0,1). Adjust the upper bound M of the selection interval according to the formula,

[0083] Adjust the upper bound of the candidate interval {1,2,...,M}. Among them, c1∈(0,1), d is a constant set in advance, M t-1 It is the upper bound of the candidate interval at time t-1.

[0084] Calculate γ t and ω t And update the vector pair in

[0085] Calculate each e m (m=1,…,M), and arrange them in ascending order; get in, H m,2 is the vector pair (γ M-m ,ω M-m ),...,(γ M-2 ,ω M-2 ) is the quasi-Newton matrix calculated.

[0086] During the training process, K is determined according to the selection criteria. * Memory size m i (i=1,…,K * ), where K * =argmin 1≤K≤M {Q K}, Because K * It is a non-fixed value, so the choice of memory scale can adapt to changes, solving the problem of fixed number of memory scales in traditional L-BFGS. Calculate K * Directions And calculate the average value of the memory scale Calculate blend direction And use this as the search direction.

[0087] According to the formula and Calculate the step size μ t , which is the learning rate. Then according to the formula x t+1 =x t +μ t ⊙d t Update the parameters in the deep network model. Where β is the decay rate, usually 0.9. η is the initial step size, for example 0.001. ε is a small constant used to ensure numerical stability, usually 10 -6 to 10 -8 .

[0088] If the value of the loss function L decreases slowly and tends to be stable with the increase of the number of iterations, that is, the network converges, and the number of iterations reaches the set maximum number of iterations N, then the training ends; otherwise, let t = t + 1, and randomly select small batch training samples 1 and small batch training samples 2 from training samples 1 and training samples 2 without repetition to continue training.

[0089] S40: Generate classification results:

[0090] The last layer of the deep network model is the classification module, which is specifically the activation function sigmoid used for classification. Therefore, the output of the deep network model is the category label. Therefore, based on the trained deep network model, input sample 1 and input sample 2 are input to obtain the category labels of all hyperspectral pixels.

[0091] Specifically, we take the Indiana Forest Dataset as an example. The dataset is 145×145×200 in size and contains 21,025 pixels. Each pixel contains 200 spectral wavelengths. The entire dataset contains 17 categories, including 16 valid categories and 1 noise category. After removing the pixels belonging to the noise category, there are 10,366 pixels in total. The removed noise category pixels are still used in the following step of constructing spatial data and are only removed after all input samples are constructed. The deep network structure is as follows Figure 1 As shown:

[0092] Input: Input hyperspectral image of size 145×145×200 and label of size 145×145.

[0093] Output: The category of the pixel.

[0094] Parameter settings: neighborhood size is 5, the number of network layers in spatial feature extraction module 1, spatial feature extraction module 2 and spectral feature extraction module is 3, the number of network layers in the classification module is 3, and the subspace dimension is 40.

[0095] (1) Select spatial data

[0096] For each pixel, spatial data of size 1×5×5×200 is obtained as input sample 1, and a pixel of size 1×200 is used as input sample 2. This input sample 1 and input sample 2 are collectively referred to as input samples, and the input samples are input into the deep network model for training.

[0097] (2) Training this network

[0098] All 10,366 input samples were shuffled, and the input samples in the top 30% were selected as training samples, including one training sample 1 and one training sample 2. The number of pixels in a mini-batch was set to 512, and only 512 training samples were selected for each training run. The 512 mini-batch training samples were used as input for the deep network model, which was trained using the adaptive L-BFGS algorithm. After training, an optimized deep network model was obtained.

[0099] (3) Image classification

[0100] All 10,366 samples are input into the trained deep network model for testing, and pixel labels of size 10,366 × 1 are obtained, which are the classifications of the hyperspectral image pixels.

[0101] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0102] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0103] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0104] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0105] Obviously, the above embodiments are merely examples for clarity of explanation and are not intended to limit the implementation methods. The step numbers do not limit the order of the steps. Those skilled in the art will appreciate that other variations or modifications can be made based on the above description. It is not necessary and impossible to enumerate all implementation methods here. Obvious variations or modifications arising therefrom remain within the scope of protection of the present invention.

Claims

1. A hyperspectral image classification method based on an adaptive L-BFGS algorithm, characterized in that: The steps include: S10: Data preprocessing: Obtain pixel data of the hyperspectral image and corresponding spatial data to form input sample 2 and input sample 1; Shuffle the input sample 1 and the input sample 2 respectively, and extract a part from each input sample to form the training sample 1 and the training sample 2; S20: Build a deep network model: The deep network model includes a spatial feature extraction module 1, a spatial feature extraction module 2, a spectral feature extraction module, and a classification module. The convolutional layer and the long short-term memory network layer are used to process the spatial feature extraction module 1 and the spatial feature extraction module 2 respectively to obtain a first output and a second output. The fully connected layer is used to process the spectral feature extraction module to obtain a third output, and the output results are fused. The fusion result is input into the classification module to obtain the fourth output; S30: Training network model: Each time, a small batch of training samples 1 and a small batch of training samples 2 are selected from the training samples 1 and the training samples 2, and the small batch of training samples 1 are used as the spatial feature extraction module 1, the small batch of training samples 1 are transformed to form the spatial feature extraction module 2, and the small batch of training samples 2 are used as the spectral feature extraction module to input into the deep network model of step S20, and all outputs are obtained, and the loss function L is calculated based on the above outputs; The calculation formula of the loss function is: L = L cls +L KL1 +L KL2 +L KL3 ,in: L cls =CrossEntropy(Output,l); ; ; ; ∑(·) is the sum of all the contents in the brackets. l is the one-hot code of the sample label, with a size of 1×c, where only one position has a value of 1 and all other positions have values ​​of 0. L cls The final classification accuracy is calculated using cross entropy, L KL1 The spectral similarity between the first and third outputs is calculated using the spectral angular distance, L KL2 The spectral similarity between the second and third outputs is calculated using the spectral angular distance, L KL3 calculating the spectral similarity between the first output and the second output using the spectral angular distance; The L-BFGS algorithm is used to train the network parameters until the network converges. During the training process, K is adaptively selected. * memory scales, where K * =argmin 1≤K≤M {Q K }, ; During the training process, according to K * memory scale, calculate K * Directions And in mixed direction As a search direction; During training, the parameters in the deep network model are updated according to the following formula: x t+1 =x t +m t ⊙d t; Among them, μ t is the step size or learning rate, ;and ;β is the decay rate, η is the initial step size, and ε is a constant; S40: Generate classification results: Based on the trained deep network model, input sample one and input sample two are input to obtain the category labels of all hyperspectral pixels.

2. The hyperspectral image classification method based on the adaptive L-BFGS algorithm according to claim 1, characterized in that: The hyperspectral image in step S10 is normalized and preprocessed, and the value range in the normalization preprocessing is between -1 and 1. The normalization formula is as follows: ; where x min Represents the minimum value in the hyperspectral pixel data, x max Indicates the maximum value in the hyperspectral pixel data.

3. The hyperspectral image classification method based on the adaptive L-BFGS algorithm according to claim 1, characterized in that: The number of network layers in the classification module is n. The activation function of the last layer of the classification module in the network is the Sigmoid activation function, and the activation functions used in other network layers are all Tanh activation functions.

4. The hyperspectral image classification method based on the adaptive L-BFGS algorithm according to claim 3, characterized in that: The Sigmoid activation function calculation formula is: , the Tanh activation function calculation formula is: .

5. The hyperspectral image classification method based on the adaptive L-BFGS algorithm according to claim 1, characterized in that: The calculation formula for cross entropy is: CrossEntropy(x,y)=-[xlog(y)+(1-x)log(1-y)].

6. The hyperspectral image classification method based on the adaptive L-BFGS algorithm according to claim 1, characterized in that: In step S10, for each hyperspectral pixel, the pixel itself is taken as the center and the surrounding neighborhood pixels with a size of s×s are selected as the spatial data of the pixel. For the hyperspectral pixels at the edge, the missing data are filled with zeros.

7. The hyperspectral image classification method based on the adaptive L-BFGS algorithm according to claim 1, characterized in that: In step S10, the input sample 1 and the input sample 2 are shuffled in the same order, and the input sample 1 and the input sample 2 whose sequence numbers are in the first 30% are selected as the training sample 1 and the training sample 2. If X×Y×30% is not an integer, it is rounded off.

Citation Information

Patent Citations

  • Batch learning method of deep neural network based on adaptive L-BFGS algorithm

    CN113705724A

  • Hyperspectral image classification method based on fusion of multi-scale and multi-dimensional spatial-spectral characteristics

    CN110321963A

  • Space spectrum full convolution hyperspectral image classification method based on superpixel sample expansion

    CN111695467A