Hyperspectral image earth and rockfill dam filling material source fine classification method
By adopting linear discriminant analysis and iterative clustering segmentation methods in hyperspectral image classification, combined with multi-scale dual branch map convolutional neural network, the problem of space perception field limit is solved, and the classification of earth and rock dam filling material sources is improved Accuracy, achieving more refined feature extraction and classification effects.
Patent Information
- Application Number
- CN202410921705.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-10
- Publication Date
- 2024-11-15
Smart Images

Figure CN118968118A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of hyperspectral remote sensing image processing, and in particular relates to a hyperspectral imagery method for fine classification of earth-rock dam filling material sources. Background Art
[0002] Hyperspectral images (HSI) have been widely used in various remote sensing fields such as target detection, agricultural monitoring, and marine safety in recent years. Hyperspectral images are different from conventional two-dimensional digital images. They are three-dimensional cube data, consisting of two-dimensional digital images and one-dimensional spectral dimensions. Spectral bands contain rich geographic feature information. Therefore, feature selection and feature extraction are particularly important for hyperspectral pixel classification. In the past, the commonly used classification methods for hyperspectral images included: K-NN, K Nearest Neighbour, Extreme Learning Machine (ELM), and Support Vector Machine (SVM). They all use spectral information for classification. K-NN is the simplest classifier in the field of machine learning; and extreme learning machine is a new type of fast learning algorithm. For a single hidden layer neural network, ELM can randomly initialize input weights and biases and obtain corresponding output weights. Support vector machine (SVM) pursues the best approximation of the model through small sample data training to obtain the best balance between model complexity and learning ability. It is one of the widely used machine learning algorithms. In addition, principal component analysis (PCA) reduces noise interference by compressing spectral bands through frequency band selection, which can retain important features and is also commonly used in hyperspectral image classification.
[0003] In recent years, image classification based on deep learning methods has become increasingly popular. The basic idea of deep learning image classification is to extract abstract features from raw image data through dense connections of multiple layers of neurons, using simple linear equations and activation functions, and to form specific network weight parameters through training of a large amount of raw data, thereby improving the classification accuracy of images. The spectral dimensions of hyperspectral images are as many as dozens or even hundreds of bands. Chen et al. first introduced the concept of deep learning into hyperspectral image classification and proposed a model based on stacked autoencoders (SAE). The model used autoencoders to extract raw data information and finally used SVM for classification. However, this method only used spectral information but ignored the use of spatial information. In order to further utilize the spatial feature information of hyperspectral images, a hyperspectral algorithm based on convolutional neural network (CNN) was proposed. CNN has made great breakthroughs in the field of computer vision due to its excellent image representation ability and has been successfully applied to the field of hyperspectral image classification. Makantasis et al. designed a model based on 2D convolutional neural network. The intermediate pixels were packed into fixed-size blocks by filling the surrounding pixels, which were input into the neural network for spatial information extraction and finally sent to the multi-layer perceptron for classification.
[0004] However, the size of the graph structure in the convolutional neural network is mostly fixed, which limits the range of the spatial perception field of view. Generally speaking, a larger spatial perception field of view will not be able to capture the detailed features of the image, while a smaller spatial perception field of view will not be able to capture the global features of the image, resulting in insufficient extraction of spatial features at different scales, which ultimately affects the classification accuracy of the earth-rock dam filling material source. Summary of the invention
[0005] In order to solve the above technical problems, the present invention proposes a hyperspectral imaging earth-rock dam filling material source fine classification method to achieve accurate classification of earth-rock dam filling material sources.
[0006] The present invention is achieved through the following technical solutions:
[0007] A hyperspectral imagery earth-rock dam filling material source fine classification method comprises the following steps:
[0008] S1: Collect hyperspectral images of earth-rock dam filling material sources;
[0009] S2: Use linear discriminant analysis to reduce the dimension of hyperspectral image data X to obtain low-dimensional data X lda ;
[0010] S3: Linear iterative clustering superpixel segmentation is used to segment graph nodes of two different finenesses, including fine segmentation of graph nodes V for the original data X and segmentation of graph nodes V for the low-dimensional data X.lda Roughly split the graph nodes V lda ;
[0011] S4: Based on V and V lda Calculate the Laplacian matrix separately and The calculation formula of the Laplace matrix is:
[0012]
[0013] Among them A i is the adjacency matrix, V(a) and V(b) are arbitrary graph nodes, and C is the number of spectral dimensions;
[0014]
[0015] Where I is the shape and A i The same identity matrix, D i A i The degree matrix of
[0016] Constructing a fine segmentation graph structure
[0017] and the coarse segmentation graph structure
[0018] S5: Construct a multi-scale dual-branch graph convolutional neural network using two graph structures G and G with different fineness lda The convolutional neural network is trained until the contrast loss L con and the cross entropy loss L cro Converge and output the final classification result.
[0019] Preferably, the process of segmenting the graph nodes at two different finenesses in S3 is as follows:
[0020] S31: Fine segmentation is characterized by increasing the number of superpixel nodes for the original data X and reducing the probability that heterogeneous pixels belong to the same superpixel;
[0021] S32: Rough segmentation representation for low-dimensional data X lda , reduce the number of superpixel nodes and more fully consider the characteristics of neighboring similar nodes.
[0022] Preferably, the multi-scale dual-branch graph convolutional neural network in S5 includes a feature extraction module and a contrast fusion classification module; the feature extraction module includes two sub-networks of the same structure, each sub-network is composed of three multi-scale graph convolution modules MSGM connected in series, and each multi-scale graph convolution module MSGM includes a multi-scale graph convolution layer, a normalization layer, and a LeakyRelu activation function layer; the contrast fusion classification module includes a fully connected layer and a Softmax activation function layer, wherein the number of input channels of the fully connected layer is the feature dimension, and the number of output channels is the number of categories of earth-rock dam filling material sources.
[0023] Preferably, the comparison fusion classification module in S5 includes the following processing steps:
[0024] S521: extract features Z and Z from the two sub-networks of the feature extraction module lda Calculate the cosine similarity and obtain the contrast loss L con ;
[0025] S522: Add the two sets of features and send them to the fully connected layer classifier for classification, and output the classification result The classifier operation is expressed as:
[0026]
[0027] Where Z fin The final feature is obtained by averaging the two features. is the parameter matrix of the classifier, σ(·) is the Softmax activation function, and its formula is
[0028]
[0029] Where x represents the pixel features in the data;
[0030] S523: Using the cross entropy loss function to classify the results Calculate the cross entropy loss L with the true label Y cro The specific formula is
[0031]
[0032] Where L i is the loss of the i-th sample, N is the number of samples, M is the number of categories, and p ic is the predicted probability that the i-th sample belongs to the c-th class, y ic is the true label of the cth class of the ith sample.
[0033] Preferably, the feature extraction step of the multi-scale graph convolution layer in S5 is:
[0034] S5111: The Laplace matrix calculated in S4 is used to select edges with large weights in different proportions to retain and edges with small weights to discard, resulting in three different Laplace matrices and Respectively representing retaining 33% of the edges, 67% of the edges, and all the edges to construct graph structures of three different scales;
[0035] S5112: Perform graph convolution operations based on graph structures of three different scales to extract features of different scales. The specific formula of the multi-scale graph convolution layer is:
[0036]
[0037] Where X (l) is the input data of the current multi-scale graph convolution layer, and is the learnable parameter matrix of the multi-scale graph convolutional layer, and is the offset, and is the Laplacian matrix of graph structures of three different scales, X (l+1) is the output data of the current multi-scale graph convolution layer.
[0038] Preferably, the contrast loss L is obtained in S521 con The specific process is:
[0039] For the features Z and Z extracted from the two lda Decode and convert to pixel-level structure, and calculate contrast loss on pixel-level features, so that the features extracted from different graph structures are as similar as possible, and the contrast loss L con The calculation formula is:
[0040]
[0041] Where Z and Z lda Represents the feature maps extracted from different graph structures, and x and y represent the pixel features therein.
[0042] The beneficial effects of the present invention are:
[0043] Compared with the prior art, the present invention constructs a graph structure of different fineness by using hyperspectral data of different dimensions, then constructs a multi-scale dual-branch graph convolutional neural network, and then uses graph structures of different fineness and different scales to perform graph convolution feature extraction, thereby training a multi-scale dual-branch graph convolutional neural network, and then optimizes the feature extraction of the two branches by constructing a contrast loss function, and finally outputs the classification result. The number of pixels contained in the coarsely divided graph structure is large, which enables the superpixel to obtain more pixel features and express the features of this type of pixel in a more generalized manner. However, its overly rough boundary segmentation will cause the mixing of different types of pixels, thereby reducing the accuracy of classification. The boundary segmentation of superpixels in the finely divided graph structure is relatively fine, reducing the mixing of different types of pixels, but the number of pixels contained in its superpixels is relatively small, which makes the superpixels obtain fewer pixel features, and it is difficult to express the features of this type of pixels well, thereby reducing the accuracy of classification. This method utilizes graph structures of different fineness and scales to improve the network's extraction of features of different scales and the final classification effect. The introduction of the contrast loss function makes the features extracted by graph structures of different fineness as similar as possible. The features extracted by the two graph structures of different fineness influence and improve each other, so that the network can classify the sources of earth-rock dam filling materials more finely. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for describing the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0045] Figure 1 A schematic diagram of a flow chart for constructing a graph structure of the present invention;
[0046] Figure 2 Schematic diagram of the multi-scale dual-branch graph convolutional neural network of the present invention. DETAILED DESCRIPTION
[0047] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0048] In this embodiment, the earth-rock dam filling material source is finely classified, and the specific process is as follows:
[0049] like Figure 1 As shown:
[0050] S1: Collecting the hyperspectral image of the filling material source of the earth-rock dam, storing and reading the hyperspectral image of the filling material source of the earth-rock dam obtained by the hyperspectral camera in digital form;
[0051] S2: Use the linear discriminant analysis method to reduce the dimension of the hyperspectral image data (original data) X to obtain low-dimensional data X lda ;
[0052] S3: Use the linear iterative clustering superpixel segmentation method to perform two different levels of graph node segmentation, including fine segmentation of the original data X to obtain graph nodes V, with a specific number of about 3000 nodes, and for the low-dimensional data X lda Roughly split the graph nodes V lda , the specific number of nodes is about 1000;
[0053] S4: Based on V and V lda Calculate the Laplacian matrix separately and The calculation formula of the Laplace matrix is:
[0054]
[0055] Among them A i is the adjacency matrix, V(a) and V(b) are arbitrary graph nodes.
[0056]
[0057] Where I is the shape and A i The same identity matrix, D i A i The degree matrix of .
[0058] Constructing a fine segmentation graph structure and the coarse segmentation graph structure
[0059] S5: Build Figure 2 The multi-scale dual-branch graph convolutional neural network shown in Figure 1 initializes all parameters in the original classification network to satisfy a Gaussian distribution with a mean of 0 and a variance of 0.1. Then, the Adam optimizer is used to optimize the two graph structures G and G with different fineness. lda The convolutional neural network is trained until the contrast loss L con and the cross entropy loss L cro If the loss cannot be reduced within 20 iterations, the network parameters with the lowest loss are selected as the final trained network parameters, and the final trained network is used to finely classify the fill material sources of the earth-rock dam in the hyperspectral image.
[0060] Among them, the multi-scale dual-branch graph convolutional neural network includes a feature extraction module and a contrast fusion classification module; the feature extraction module includes two sub-networks with the same structure, each sub-network is composed of three multi-scale graph convolution modules MSGM connected in series, and each multi-scale graph convolution module MSGM includes a multi-scale graph convolution layer, a normalization layer, and a LeakyRelu activation function layer;
[0061] The multi-scale graph convolution layer extracts features from the specified graph structure. The specific steps are as follows:
[0062] S5111: Construct graph structures of different scales, and use the previously calculated Laplace matrix to select different proportions of edges with large weights to retain and edges with small weights to discard, and obtain three different Laplace matrices and They represent retaining 33% of the edges, 67% of the edges, and all the edges respectively.
[0063] S5112: Perform graph convolution operations based on graph structures of three different scales to extract features of different scales. The specific formula of the multi-scale graph convolution layer is:
[0064]
[0065] Where X (l) is the input data of the current multi-scale graph convolution layer, and is the learnable parameter matrix of the multi-scale graph convolutional layer, and is the offset, and is the Laplacian matrix of graph structures of three different scales, X (l+1) is the output data of the current multi-scale graph convolution layer.
[0066] Normalization layer, which normalizes the extracted features, is formulated as
[0067]
[0068] Where T (l) is the input data of the normalization layer, E(·) represents the mean function, Var(·) represents the variance function, ε is a correction to prevent the denominator from being too small, γ and β are learnable parameters used to adjust the mean and variance so that the normalized data conforms to the original distribution as much as possible. is the output data of the normalization layer;
[0069] The LeakyRelu activation function performs nonlinear mapping on features, and its formula is:
[0070]
[0071] Where x represents the pixel features in the data.
[0072] The contrast fusion classification module includes a fully connected layer and a Softmax activation function layer, where the number of input channels of the fully connected layer is the feature dimension, and the number of output channels is the number of earth-rock dam filling material source categories.
[0073] The contrast fusion classification module specifically includes the following steps:
[0074] S521: The features Z and Z extracted by the two sub-networks in the S41 multi-scale graph convolution feature extraction network lda Calculate the cosine similarity and obtain the contrast loss L con , the specific process is:
[0075] For the features Z and Z extracted from the two lda Decode and convert to pixel-level structure, and calculate contrast loss on pixel-level features, so that the features extracted from different graph structures are as similar as possible. The contrast loss calculation formula is:
[0076]
[0077] Where Z and Z lda Represents the feature maps extracted from different graph structures, and x and y represent the pixel features therein.
[0078] S522: Add the two sets of features and send them to the fully connected layer classifier for classification, and output the classification result The classifier operation is expressed as:
[0079]
[0080] Where Z fin The final feature is obtained by averaging the two features. is the parameter matrix of the classifier, σ(·) is the Softmax activation function, and its formula is
[0081]
[0082] Where x represents the pixel features in the data.
[0083] S523: Using the cross entropy loss function to classify the results Calculate the cross entropy loss L with the true label Y cro The specific formula is
[0084]
[0085] Where L iis the loss of the i-th sample, N is the number of samples, M is the number of categories, and p ic is the predicted probability that the i-th sample belongs to the c-th class, y ic is the true label of the cth class of the ith sample.
[0086] The preferred embodiments of the present invention disclosed above are only used to help illustrate the present invention. The preferred embodiments do not describe all details in detail, nor do they limit the invention to only the specific embodiments described. Obviously, many modifications and changes can be made according to the content of this specification.
Claims
1. A hyperspectral imagery earth-rock dam filling material source fine classification method, characterized in that: The following steps are involved: S1: Collect hyperspectral images of earth-rock dam filling material sources; S2: Use linear discriminant analysis to reduce the dimension of hyperspectral image data X to obtain low-dimensional data X lda ; S3: Linear iterative clustering superpixel segmentation is used to segment graph nodes of two different finenesses, including fine segmentation of graph nodes V for the original data X and segmentation of graph nodes V for the low-dimensional data X. lda Roughly split the graph nodes V lda ; S4: Based on V and V lda Calculate the Laplacian matrix separately and The calculation formula of the Laplace matrix is: Among them A i is the adjacency matrix, V(a) and V(b) are arbitrary graph nodes, and C is the number of spectral dimensions; Where I is the shape and A i The same identity matrix, D i A i The degree matrix of Constructing a fine segmentation graph structure and the coarse segmentation graph structure S5: Construct a multi-scale dual-branch graph convolutional neural network using two graph structures G and G with different fineness lda The convolutional neural network is trained until the contrast loss L con and the cross entropy loss L cro Converge and output the final classification result; The multi-scale dual-branch graph convolutional neural network includes a feature extraction module and a contrast fusion classification module; the feature extraction module includes two sub-networks of the same structure, each of which is composed of three multi-scale graph convolution modules MSGM connected in series, and each multi-scale graph convolution module MSGM includes a multi-scale graph convolution layer, a normalization layer, and a LeakyRelu activation function layer; the contrast fusion classification module includes a fully connected layer and a Softmax activation function layer, wherein the number of input channels of the fully connected layer is the feature dimension, and the number of output channels is the number of categories of earth-rock dam filling material sources; The contrast fusion classification module includes the following processing steps: S521: extract features Z and Z from the two sub-networks of the feature extraction module lda Calculate the cosine similarity and obtain the contrast loss L con ; S522: Add the two sets of features and send them to the fully connected layer classifier for classification, and output the classification result The classifier operation is expressed as: Where Z fin The final feature is obtained by averaging the two features. is the parameter matrix of the classifier, σ(·) is the Softmax activation function, and its formula is Where x represents the pixel features in the data; S523: Using the cross entropy loss function to classify the results Calculate the cross entropy loss L with the true label Y cro The specific formula is Where L i is the loss of the i-th sample, N is the number of samples, M is the number of categories, and p ic is the predicted probability that the i-th sample belongs to the c-th class, y ic is the true label of the cth category of the i-th sample; The feature extraction steps of the multi-scale graph convolution layer are: S5111: The Laplace matrix calculated in S4 is used to select edges with large weights in different proportions to retain and edges with small weights to discard, resulting in three different Laplace matrices and Respectively representing retaining 33% of the edges, 67% of the edges, and all the edges to construct graph structures of three different scales; S5112: Perform graph convolution operations based on graph structures of three different scales to extract features of different scales. The specific formula of the multi-scale graph convolution layer is: Where X (l) is the input data of the current multi-scale graph convolution layer, and is the learnable parameter matrix of the multi-scale graph convolutional layer, and is the offset, and is the Laplacian matrix of graph structures of three different scales, X (l+1) is the output data of the current multi-scale graph convolution layer.
2. According to the hyperspectral imaging method for fine classification of earth-rock dam filling material sources according to claim 1, it is characterized in that: The process of segmenting graph nodes at two different levels of precision in S3 is as follows: S31: Fine segmentation is characterized by increasing the number of superpixel nodes for the original data X and reducing the probability that heterogeneous pixels belong to the same superpixel; S32: Rough segmentation representation for low-dimensional data X lda , reduce the number of superpixel nodes and more fully consider the characteristics of neighboring similar nodes.
3. According to the hyperspectral imaging method for fine classification of earth-rock dam filling material sources in claim 1, it is characterized in that: In S521, the contrast loss L is obtained. con The specific process is: For the features Z and Z extracted from the two lda Decode and convert to pixel-level structure, and calculate contrast loss on pixel-level features, so that the features extracted from different graph structures are as similar as possible, and the contrast loss L con The calculation formula is: Where Z and Z lda Represents feature maps extracted from different graph structures, and x and y represent pixel features therein.
Citation Information
Cited By
Double-branch model training method for CNN reasoning of Internet of Things
CN119741543A
