A band selection method based on density peak clustering and inverse nearest neighbor
Through inverse nearest neighbor and European distance calculation, combined with feature band selection, an enhanced local density is constructed, which solves the problem of local density peak clustering algorithm ignoring global information in hyperspectral image dimensionality reduction, improves the classification accuracy of band subsets, and achieves more reliable geographic identification and classification.
Patent Information
- Application Number
- CN202211323124.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-27
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2042-10-27
AI Technical Summary
The existing local density peak clustering algorithms tend to ignore the global information of band distribution during the dimensionality reduction of hyperspectral images, resulting in limited classification accuracy of band subsets.
The interband distance is calculated by inverse neighbor and European distance, combined with feature band selection, and enhanced local density is constructed, and subsets of feature bands are selected through weight normalization.
The classification accuracy of band subsets is improved and more reliable basis for land objects is provided.
Smart Images

Figure CN115482406B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, in particular to a density peak clustering band selection method based on inverse nearest neighbor. Background Art
[0002] Hyperspectral images have dozens or even hundreds of continuous spectral bands, and their rich spectral information provides a reliable basis for object recognition and classification. However, when labeled samples are limited, a large number of spectral bands will lead to the "curse of dimensionality" problem. In addition, there is a strong correlation between adjacent bands, which not only increases the computational complexity but may also reduce classification accuracy. Hyperspectral dimensionality reduction can effectively solve this problem. Currently, the main dimensionality reduction methods include feature extraction and band selection. Feature extraction converts high-dimensional data into low-dimensional data through transformation, which changes the physical meaning of the original data. Band selection selects a representative subset of bands from the original data bands. While reducing the dimensionality, it can retain the physical meaning of the original data and has better interpretation and expression capabilities for the original data. Therefore, it has been widely studied.
[0003] Density Peak Based Clustering (DPC) combines the advantages of both sorting and clustering. The algorithm is based on two assumptions: (1) the local density of the cluster center is greater than the local density of the surrounding areas; and (2) the cluster center is farther away from the sample points with higher local density than it. The band selection algorithm based on density peak clustering uses local density to describe the density information of the band. However, the existing local density method tends to ignore the global information of the band distribution and cannot effectively describe the distribution characteristics of the band, resulting in limited accuracy of band subset classification.
[0004] Therefore, in order to solve the above problems, this application proposes a density peak clustering band selection method based on inverse neighbor, which adopts band inverse neighbor, Euclidean distance to calculate the distance between bands and feature band selection to make the selected band subset have better classification accuracy, which can effectively solve the density information of the local density description band, and thus make the hyperspectral influence provide a reliable basis for ground object recognition and classification. Summary of the Invention
[0005] The purpose of the present invention is to fill the gap in the prior art and provide a density peak clustering band selection method based on inverse neighbor. The method adopts band inverse neighbor, Euclidean distance to calculate the distance between bands and feature band selection to make the selected band subset have better classification accuracy, which can effectively solve the density information of the local density description band, thereby making the hyperspectral influence provide a reliable basis for ground object recognition and classification.
[0006] In order to achieve the above object, the present invention provides a density peak clustering band selection method based on inverse nearest neighbor, comprising the following steps:
[0007] S1, generation of band inverse neighbors;
[0008] S1 includes the following steps:
[0009] S1-1, use Euclidean distance to calculate the distance between any two bands and get the distance matrix D L×L ;
[0010] S1-2, based on the distance matrix D, obtain the K nearest neighbors of each band;
[0011] S1-3, constructing a K-nearest neighbor directed graph based on the band and its K-nearest neighbors, obtaining the inverse neighbors of the band, as well as the shared neighbors and shared inverse neighbors between the bands;
[0012] S2, construction of enhanced local density;
[0013] S2 includes the following steps:
[0014] S2-1, the similarity between bands is calculated using the union of shared nearest neighbors and shared inverse nearest neighbors;
[0015] S2-2, constructing enhanced local density using the average Euclidean distance and similarity between the band and its inverse neighbors;
[0016] S3, feature band selection;
[0017] S3 includes the following steps:
[0018] S3-1, calculate the minimum distance and information entropy factor of each band;
[0019] S3-2, normalize the three factors of local density, minimum distance and information entropy, and use the product of the three as the weight of each band;
[0020] S3-3, sort the weights in descending order and select the required number of band subsets.
[0021] The similarity of the enhanced local density in S2 contains the neighbor and reverse neighbor information of the band.
[0022] Compared with the existing technology, the present invention adopts the band inverse nearest neighbor, Euclidean distance to calculate the distance between bands and feature band selection to make the selected band subset have better classification accuracy, which can effectively solve the density information of the local density description band, and thus the hyperspectral effect provides a reliable basis for ground object recognition and classification. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 This is the overall structural diagram of the density peak clustering band selection method based on inverse neighbor of the present invention.
[0024] Figure 2 This is a K-nearest-neighbor directed graph according to an embodiment of the present invention.
[0025] Figure 3 is the adjacency matrix of an embodiment of the present invention.
[0026] Figure 4 The figure is a schematic diagram comparing the OA values obtained by different algorithms on the Indian Pines dataset with different numbers of bands according to an embodiment of the present invention.
[0027] Figure 5 This is a schematic diagram comparing OA values obtained by different algorithms on the Pavia University dataset with different numbers of bands according to an embodiment of the present invention.
[0028] Figure 6 This is a schematic diagram comparing OA values obtained by different algorithms on the Botswana dataset with different numbers of bands according to an embodiment of the present invention. DETAILED DESCRIPTION
[0029] The present invention will now be further described with reference to the accompanying drawings. The present invention provides a density peak clustering band selection method based on inverse nearest neighbor, comprising the following steps:
[0030] S1, generation of band inverse neighbors;
[0031] S1 includes the following steps:
[0032] S1-1, use Euclidean distance to calculate the distance between any two bands and get the distance matrix D L×L ;
[0033] S1-2, based on the distance matrix D, obtain the K nearest neighbors of each band;
[0034] S1-3, constructing a K-nearest neighbor directed graph based on the band and its K-nearest neighbors, obtaining the inverse neighbors of the band, as well as the shared neighbors and shared inverse neighbors between the bands;
[0035] S2, construction of enhanced local density;
[0036] S2 includes the following steps:
[0037] S2-1, the similarity between bands is calculated using the union of shared nearest neighbors and shared inverse nearest neighbors;
[0038] S2-2, constructing enhanced local density using the average Euclidean distance and similarity between the band and its inverse neighbors;
[0039] S3, feature band selection;
[0040] S3 includes the following steps:
[0041] S3-1, calculate the minimum distance and information entropy factor of each band;
[0042] S3-2, normalize the three factors of local density, minimum distance and information entropy, and use the product of the three as the weight of each band;
[0043] S3-3, sort the weights in descending order and select the required number of band subsets.
[0044] The similarity of the enhanced local density in S2 contains the neighbor and reverse neighbor information of the band.
[0045] Example:
[0046] In order to make the technical solution of the present invention more clear and specific to those skilled in the art, the present invention is further described in detail below with reference to the accompanying drawings. The specific steps of the density peak clustering band selection method based on inverse nearest neighbor of the present invention are as follows:
[0047] Step S1: Generation of band inverse neighbors:
[0048] Step S1.1: Use the Euclidean distance to calculate the distance between any two bands and obtain the distance matrix D. L×L ;
[0049] Assume X = [x1, x2, ...x L ]∈R N×L It is a two-dimensional matrix composed of all hyperspectral bands, where N represents the number of pixels, L represents the number of bands, and x i Represents the i-th band vector. Using the Euclidean distance, calculate the distance between any two bands and obtain the distance matrix D L×L . Two-band x i and x j The Euclidean distance calculation formula is:
[0050]
[0051] Step S1.2: Based on the distance matrix D, obtain the K nearest neighbors of each band;
[0052] Based on the distance matrix D, the band x i The distances to other bands are arranged in ascending order, and the Kth distance is recorded as d ik , select the distance less than d ik The band is used as band x i K nearest neighbor KNN(x i ), KNN(x l ) is:
[0053] KNN(x i )={x i ∈X|D(x i, x j )≤d ik}
[0054] Inspired by directed graphs, each band and its K nearest neighbors are regarded as nodes of the graph, and directed edges are created between corresponding nodes to generate a K nearest neighbor directed graph.
[0055] Assume that bands 1 to 6 are taken as an example and a K-nearest neighbor directed graph is constructed, such as Figure 2 As shown in the table. The arrow from band i to band j indicates that the K nearest neighbors of band i are band j. From the figure, we can see that the K nearest neighbors of band 1 are bands 5 and 6, and the K nearest neighbors of band 2 are bands 1 and 5.
[0056] Step S1.3: construct a K-nearest-neighbor directed graph based on the band and its K-nearest-neighbors, and obtain the inverse neighbors of the band, as well as the shared neighbors and shared inverse neighbors between the bands;
[0057] Based on the K-nearest neighbor directed graph, the adjacency matrix can be obtained. Figure 2 The adjacency matrix of the K-nearest neighbor directed graph is as follows Figure 3 As shown, the i-th row of the adjacency matrix represents the outgoing edge of band i, that is, the K nearest neighbors of band i, and the i-th column represents the incoming edge of band i, that is, the inverse nearest neighbors of band i. Band x i The inverse neighbor RNN(x l ) means if band x i In band x j Among the K nearest neighbors, the band x j Band x i The reverse neighbor of RNN(x l ) is:
[0058] RNN(x i )-{x j ∈X|x l ∈KNN(x j ))
[0059] like Figure 3 As shown in the figure, according to the definition of inverse neighbors, the inverse neighbors of band 1 are bands 2, 3, and 4. The inverse neighbors of band 2 are 3 and 4.
[0060] In the K-nearest neighbor directed graph, the number of K-nearest neighbors of each band is the same, but the number of reverse neighbors of each band is different. The number of reverse neighbors at the center of the band cluster is greater than the number of reverse neighbors at the edge of the band cluster. Let band x i The outdeg(x i ) represents band x i The number of K nearest neighbors, indegree indeg(x i ) represents band x i The number of inverse neighbors of , the two expressions are:
[0061] outdeg(x i )=|KNN(x i )|
[0062] indeg(x l )=|RNN(x l )|
[0063] like Figure 3 As shown in the figure, according to the definition of out-degree and in-degree, the out-degree of band 1 is 2 and the in-degree is 3; the out-degree of band 2 is 2 and the in-degree is 2. In the K-nearest-neighbor directed graph, each band has the same in-degree but different out-degrees. The out-degree can effectively describe the distribution characteristics of the bands, which is one of the reasons for using inverse nearest neighbors.
[0064] The intersection of the K nearest neighbors between two bands is the shared K nearest neighbors. Based on the idea of shared K nearest neighbors, the shared inverse nearest neighbors are constructed using the inverse nearest neighbors between bands. The two expressions are:
[0065] outSNN(x i , x j )=KNN(x i )∩KNN(x j )
[0066] inSNN(x i , x j )=RNN(x i )∩RNN(x1)
[0067] Among them, outSNN(x i , x j ) represents band x i and band x j Shared K nearest neighbor band set, inSNN(x i , x j ) represents band x i and band x j Shared inverse neighbor band set.
[0068] In this embodiment, if Figure 3 As shown in FIG, according to the definition of shared neighbors and shared inverse neighbors, the shared K nearest neighbors of band 1 and band 2 are band 5, and the shared inverse neighbors are band 3 and band 4.
[0069] Step S2: Construction of enhanced local density:
[0070] Step S2.1, calculate the similarity between bands using the union of the number of shared nearest neighbors and the number of shared inverse nearest neighbors;
[0071] The present invention constructs similarity by using the number of shared neighbors and the number of shared inverse neighbors. The similarity includes the K-nearest neighbors and inverse neighbors information between bands. Among them, the K-nearest neighbors can reflect the local characteristics of the band, and the inverse neighbors obtain the density information of the band from a global perspective. The combination of the two can more comprehensively understand the distribution characteristics of the band, thereby better describing the density of the band. The construction calculation method is:
[0072] SS(x i , x j )=|inSNN(x i1 x j1 )UoutSNN(x i , x j )|
[0073] Where SS(x i , x j ) represents the new similarity.
[0074] The more the number of shared nearest neighbors and shared inverse nearest neighbors between two bands, the more similar the two bands are and the closer their distribution is, and the more likely the two bands are to belong to the same band cluster.
[0075] Step S2.2, constructing enhanced local density using the average Euclidean distance and similarity between the band and its inverse neighbors;
[0076] The present invention constructs a new local density based on the inverse neighbor information of each band. The enhanced local density of each band is defined according to the ratio of the average Euclidean distance and similarity between each band and its inverse neighbor. The definition formula of the enhanced local density is as follows:
[0077]
[0078] Among them, ρ i Indicates band x i The enhanced local density of |inSNN(x i , x j )∪outSNN(x i , x j )|'s |·| represents the number of sets.
[0079] The enhanced local density of each band is calculated using the formula. When a band is a noise band, it has no inverse neighbors, and the enhanced local density is 0. This means that the enhanced local density is robust to noise and can exclude noise bands.
[0080] Step S3: Feature band selection:
[0081] Step S3.1, calculating the minimum distance and information entropy factor of each band;
[0082] Based on the assumption that the cluster centers have a large local density and the distances between different cluster centers are relatively far, the minimum distance from each band to the band with a higher density than it is calculated. i To the enhanced local density greater than it and the nearest band x j The distance between them is δ i , if band x i The enhanced local density is the largest, then δ i Equal to the maximum distance between this band and other bands, δ i The calculation expression is:
[0083]
[0084] The enhanced local density in the center of the band cluster is large and is far away from the band with higher enhanced local density. That is, when the band ρ i and δ i If both have large values, the band is more likely to become the center of the band cluster. However, if only two factors ρ and δ are used, although a band subset with low correlation can be obtained, it cannot guarantee that the selected band has rich information. In order to make the selected band contain rich information, the information entropy is introduced to evaluate the information content of the band. For band x i , the expression of its information entropy is:
[0085]
[0086] Where Ω is the grayscale color space and p(z) is the probability of grayscale z appearing in the image.
[0087] Information entropy can be used to measure the average amount of information contained in an image. The larger the band information entropy, the richer the information contained in the band.
[0088] Step S3.2: normalize the three factors of local density, minimum distance, and information entropy, and use the product of the three as the weight of each band;
[0089] The above expression calculates the enhanced local density ρ of each band i , distance δl, information entropy H i , but the values of the three are not on the same order of magnitude. In order to eliminate this effect, the normalization method is used to normalize the values of the three to [0,1]. The normalization formula of local density ρ is:
[0090]
[0091] The normalization method of distance δ and information entropy H is the same as that of local density ρ.
[0092] Step S3.3: Arrange the weights in descending order and select the required number of band subsets:
[0093] The product of the three is used as the weight index ω of each band, and ω is used to measure the importance of the band. The calculation formula is:
[0094] ω1=ρ1×δ1×H1
[0095] Use the above formula to calculate the weight values ω of all bands, arrange ω in descending order, and take the first M bands to form a band subset Y with low correlation and large amount of information.
[0096] According to the above research route, a processing algorithm was written, and three hyperspectral standard datasets, Indian Pines, Pavia University, and Botswana, were selected for testing. The Indian Pines dataset contains 16 land object categories, a spatial size of 145×145, a spatial resolution of 20m, and a total of 220 spectral bands. After removing 20 water absorption bands, the remaining 200 bands are used for band selection and classification research. Pavia University contains 9 land object categories, a spatial size of 610×340, a spatial resolution of 1.3m, and a total of 103 spectral bands. The Botswana dataset contains 14 land object categories, a spatial size of 1476×256, a spatial resolution of 30m, and a total of 242 spectral bands. After removing the noise bands, the remaining 145 bands are used for band selection and classification research. Compared with several other existing advanced algorithms, including MVPCA, WaLuDi, EFDPC, SNNC, and FNGBS. The comparison results are as follows. Figure 4-6 The band subsets obtained by the inverse nearest neighbor-based density peak clustering band selection method have better classification performance than the bands selected by other advanced algorithms, especially when the number of bands is small.
[0097] The above are merely preferred embodiments of the present invention and are intended to help understand the method and core concept of this application. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions based on the concept of the present invention fall within the scope of protection of the present invention. It should be noted that for those skilled in the art, various improvements and modifications that do not depart from the principles of the present invention should also be considered within the scope of protection of the present invention.
[0098] The present invention comprehensively solves the problem in the prior art that the density peak clustering algorithm used in the band selection of the hyperspectral dimensionality reduction method easily ignores the global information of the band distribution, cannot effectively describe the distribution characteristics of the band, and leads to limited classification accuracy of the band subset. The method adopts the band inverse nearest neighbor, Euclidean distance to calculate the distance between bands and feature band selection to make the selected band subset have better classification accuracy, which can effectively solve the density information of the local density description band, thereby making the hyperspectral influence provide a reliable basis for ground object recognition and classification.
Claims
1. A density peak clustering band selection method based on inverse nearest neighbor, characterized in that: The following steps are involved: S1, generation of band inverse neighbors; Said S1 comprises the following steps: S1-1, use Euclidean distance to calculate the distance between any two bands and get the distance matrix D L×L ; S1-2, based on the distance matrix D, obtain the K nearest neighbors of each band; S1-3, constructing a K-nearest neighbor directed graph based on the band and its K-nearest neighbors, obtaining the inverse neighbors of the band, as well as the shared neighbors and shared inverse neighbors between the bands; S2, construction of enhanced local density; The S2 comprises the following steps: S2-1, the similarity between bands is calculated using the union of shared nearest neighbors and shared inverse nearest neighbors; S2-2, constructing enhanced local density using the average Euclidean distance and similarity between the band and its inverse neighbors; S3, feature band selection; The S3 includes the following steps: S3-1, calculate the minimum distance and information entropy factor of each band; S3-2, normalize the three factors of local density, minimum distance and information entropy, and use the product of the three as the weight of each band; S3-3, sort the weights in descending order and select the required number of band subsets.
2. The method for selecting bands based on density peak clustering based on inverse nearest neighbor according to claim 1, characterized in that: The similarity of the enhanced local density in S2 includes the neighbor and reverse neighbor information of the band.