Unsupervised hyperspectral image band selection method and device based on variable granularity search

By optimizing the selection of hyperspectral image bands using a variable granularity search method, the problems of high computational complexity and fixed-size subsets are solved, achieving low-redundancy, high-information band combinations and improving classification accuracy.

CN120833556BActive Publication Date: 2025-11-25ANHUI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511333608.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-18
Publication Date
2025-11-25
Estimated Expiration
2045-09-18

AI Technical Summary

Technical Problem

Existing methods for selecting bands in hyperspectral images are computationally complex and can only obtain a fixed-size subset of bands, ignoring the correlation between subsets of different sizes.

Method used

An unsupervised hyperspectral image band selection method based on variable granularity search is adopted. The search space is reduced by coarse-grained grouping and combined with a dynamic granularity refinement mechanism to gradually transition to fine-grained search, optimize the statistical and spatial information of band subsets, and consider the relationship between band subsets of different sizes.

Benefits of technology

It significantly reduces computational complexity, improves classification accuracy, obtains low-redundancy, high-information band combinations, and improves classification accuracy while maintaining time efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120833556B_ABST
    Figure CN120833556B_ABST
Patent Text Reader

Abstract

The application provides an unsupervised hyperspectral image band selection method and device based on variable granularity search, relates to the technical field of hyperspectral images, and solves the technical problems that the prior art has high computational complexity and can only obtain a fixed-scale band subset while ignoring the correlation between different scale subsets. The method comprises the following steps: acquiring a hyperspectral image; preprocessing the hyperspectral image to generate a label image; grouping features of the image bands according to the label image to obtain band grouping; screening the band grouping based on a variable granularity search algorithm to obtain a candidate band subset; and optimizing the candidate band subset based on a single-target search algorithm to obtain an optimal band subset. The application is used in the unsupervised hyperspectral image band selection process.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of hyperspectral image, and particularly relates to an unsupervised hyperspectral image band selection method and device based on variable granularity search. BACKGROUND

[0002] At present, the research on hyperspectral image band selection mainly focuses on designing band selection methods by using different evolutionary algorithm frameworks (such as genetic algorithm, particle swarm optimization, etc.). Although these methods have made certain progress, there are still two key limitations: first, most of the existing methods select bands by optimizing statistical and spatial information, resulting in high computational complexity; second, traditional methods can only obtain a fixed-size band subset, ignoring the relevance between different-size subsets, which is crucial for finding the optimal solution. SUMMARY

[0003] The present application provides an unsupervised hyperspectral image band selection method and device based on variable granularity search, which solves the technical problems of high computational complexity and only obtaining a fixed-size band subset while ignoring the relevance between different-size subsets in the prior art.

[0004] To achieve the above purpose, the present application adopts the following technical solutions:

[0005] In a first aspect, an unsupervised hyperspectral image band selection method based on variable granularity search is provided, comprising:

[0006] S1, obtaining a hyperspectral image; wherein the hyperspectral image comprises a plurality of image bands;

[0007] S2, preprocessing the hyperspectral image to generate a label image;

[0008] S3, grouping the image bands according to the features of the label image to obtain band grouping;

[0009] S4, filtering the band grouping based on a variable granularity search algorithm to obtain a candidate band subset;

[0010] S5, optimizing the candidate band subset based on a single-objective search algorithm to obtain an optimal band subset.

[0011] Based on the technical scheme, in the unsupervised hyperspectral image band selection method based on variable granularity search provided in the application, through the innovative variable granularity coding strategy, coarse granularity grouping is used in the initial stage to greatly reduce the search space and significantly reduce the calculation complexity; then a dynamic granularity refinement mechanism is used to gradually transition from coarse granularity to fine granularity search, which not only ensures the global exploration ability but also realizes local fine optimization, effectively balancing the search efficiency and the quality of the solution. Compared with the prior art, the method not only optimizes the statistical and spatial information of the band subset, but also considers the relationship between different size band subsets, uses the historical information in the evolution process to guide the search direction, thereby obtaining a band combination with low redundancy and high information quantity, which significantly improves the classification accuracy while maintaining the time efficiency.

[0012] In combination with the first aspect, in a possible implementation manner, the pre-processing of the hyperspectral image comprises:

[0013] S21, filtering and denoising the hyperspectral image to obtain a denoised image;

[0014] S22, performing dimension reduction on the denoised image by principal component analysis to obtain a principal component image;

[0015] S23, performing entropy rate superpixel segmentation on the principal component image to obtain a label image.

[0016] In combination with the first aspect, in a possible implementation manner, the feature grouping of the image band according to the label image comprises:

[0017] S31, calculating a band feature vector of a plurality of image bands and the label image; wherein the band feature vector comprises mutual information MI and Pearson correlation coefficient PCC, the MI is the information sharing amount between the image band and the label image, and the PCC is the linear correlation between the image band and the label image;

[0018] S32, grouping the band feature vector by a k-means clustering algorithm to obtain a band grouping corresponding to the band feature vector.

[0019] In combination with the first aspect, in a possible implementation manner, the screening of the band grouping based on the variable granularity search algorithm comprises:

[0020] S41, initializing individuals, a population, a preset value Num and a first stage iteration number X; wherein the population is composed of a plurality of individuals; and the individual represents a selection state of the band grouping;

[0021] S42, iterating the population by a granularity-based crossover operator to obtain a crossover population;

[0022] S43, obtain a variation population by iterating the crossover population based on a granularity-based variation operator;

[0023] S44, obtain a classification error rate of the population and the variation population using a KNN classifier;

[0024] S45, select the first Num individuals with the lowest classification error rate as a new population;

[0025] S46, repeat S42-S45 until the number of iterations reaches X to obtain a candidate waveband subset.

[0026] With reference to the first aspect above, in a possible implementation manner, the obtaining manner of the crossover population comprises:

[0027] S51, input a coarse-grained parent individual p and a fine-grained parent individual q;

[0028] S52, convert p to the same granularity level as q to obtain p1;

[0029] S53, perform a crossover operation on p1 and q to obtain offspring individuals O1 and O2;

[0030] S54, repeat S51-S53 to traverse the population to obtain a crossover population.

[0031] With reference to the first aspect above, in a possible implementation manner, the crossover operation on p1 and q comprises:

[0032] constructing empty offspring individuals O1 and O2, and comparing p1 and q;

[0033] when the bit positions of p1 and q are both 1, setting the corresponding bit positions of O1 and O2 to 1;

[0034] when the bit positions of p1 and q are both 0, setting the corresponding bit positions of O1 and O2 to 0;

[0035] when the bit positions of p1 and q are different, randomly selecting a bit from an index set corresponding to the different bit positions, setting the bit position corresponding to the index of O1 to 1 and setting the bit positions corresponding to the remaining indexes to 0, and setting the bit positions of O2 to be opposite to those of O1.

[0036] With reference to the first aspect above, in a possible implementation manner, the obtaining manner of the variation population comprises:

[0037] S71, select variation bit positions from O1 and O2 to obtain a variation set;

[0038] S72, calculate the variation probability P of each bit position in the variation set by the formula i ​; wherein n is the total number of image bands, and are the average ranks of the MI and PCC of the i-th bit, respectively;

[0039] S73, calculate the mutation probability of the non-mutation bits in O1 and O2 using the bit mutation in NSGA-II;

[0040] S74, mutate the bits with mutation probability greater than the mutation threshold, and keep the bits with mutation probability less than or equal to the mutation threshold unchanged, to obtain a mutation population.

[0041] In combination with the first aspect, in a possible implementation, the method further includes:

[0042] S81, repair the number of bands corresponding to the candidate band subset to obtain a high-quality band subset with a fixed number of bands;

[0043] S82, iteratively update the high-quality band subset using single-point crossover and bit mutation in NSGA-II to obtain an updated band subset;

[0044] S83, obtain the classification error rate of the high-quality band subset and the updated band subset using the KNN classifier;

[0045] S84, select the first Num band subsets with the lowest classification error rate to obtain a new high-quality band subset;

[0046] S85, repeat S82-S84 until the iteration number reaches a preset maximum value to obtain an optimal band subset.

[0047] In combination with the first aspect, in a possible implementation, the method further includes:

[0048] comparing the number of bands with a preset threshold;

[0049] when the number of bands is greater than the preset threshold, randomly selecting bands exceeding the number to discard;

[0050] when the number of bands is less than the preset threshold, randomly selecting bands with a difference number from the hyperspectral image to supplement;

[0051] when the number of bands is equal to the preset threshold, keeping the number of bands unchanged.

[0052] In a second aspect, an electronic device is provided, comprising: a communication unit and a processing unit; the communication unit is configured to acquire a hyperspectral image; the processing unit is configured to pre-process the hyperspectral image to generate a label image; perform feature grouping on the image bands according to the label image to obtain band grouping; perform filtering on the band grouping based on a variable granularity search algorithm to obtain a candidate band subset; and perform optimization on the candidate band subset based on a single-target search algorithm to obtain an optimal band subset.

[0053] In a third aspect, an electronic device is provided, comprising: a processor and a storage medium; the storage medium comprises instructions, and the processor is configured to execute the instructions to implement the method described in the first aspect and any possible implementation manner of the first aspect. The electronic device can be an electronic device or a chip in an electronic device.

[0054] In a fourth aspect, an unsupervised hyperspectral image band selection system based on a variable granularity search is provided, comprising: an image acquisition device, a cloud computing device, and a network device; the image acquisition device is configured to acquire a hyperspectral image; the cloud computing device is configured to pre-process the hyperspectral image to generate a label image; perform feature grouping on the image bands according to the label image to obtain band grouping; perform filtering on the band grouping based on a variable granularity search algorithm to obtain a candidate band subset; and perform optimization on the candidate band subset based on a single-target search algorithm to obtain an optimal band subset; and the network device is configured to transmit data acquired by the image acquisition device to the cloud computing device.

[0055] In a fifth aspect, a computer readable storage medium is provided, and the computer readable storage medium stores instructions, when the instructions are executed on an electronic device, the electronic device performs the method described in the first aspect and any possible implementation manner of the first aspect.

[0056] In a sixth aspect, a computer program product is provided, and the computer program product comprises instructions, when the computer program product is executed on an electronic device, the electronic device performs the method described in the first aspect and any possible implementation manner of the first aspect.

[0057] The application provides an unsupervised hyperspectral image band selection method and device based on variable granularity search.

[0058] It should be understood that the description of technical features, technical solutions, advantages or similar language in the present application does not imply that all features and advantages can be achieved in any single embodiment. On the contrary, it can be understood that the description of a feature or advantage means that the specific technical feature, technical solution or advantage is included in at least one embodiment. Therefore, the description of technical features, technical solutions or advantages in the specification does not necessarily refer to the same embodiment. Furthermore, the technical features, technical solutions and advantages described in the embodiments can be combined in any appropriate manner. Those skilled in the art will understand that the embodiments can be implemented without one or more specific technical features, technical solutions or advantages of a specific embodiment. In other embodiments, additional technical features and advantages can be identified in specific embodiments that do not embody all embodiments. BRIEF DESCRIPTION OF DRAWINGS

[0059] Figure 1 A system architecture diagram of an unsupervised hyperspectral image band selection system based on variable granularity search is provided for the embodiments of the present application;

[0060] Figure 2 A flowchart of an unsupervised hyperspectral image band selection method based on variable granularity search is provided for the embodiments of the present application;

[0061] Figure 3 A hyperspectral image diagram is provided for the embodiments of the present application;

[0062] Figure 4 A hyperspectral image diagram after principal component analysis processing is provided for the embodiments of the present application;

[0063] Figure 5 A hyperspectral image diagram after entropy rate superpixel segmentation processing is provided for the embodiments of the present application;

[0064] Figure 6 A population encoding method and initialization diagram of variable granularity search is provided for the embodiments of the present application;

[0065] Figure 7 A schematic diagram of a hyperspectral image after selecting the optimal band subset provided in an embodiment of this application;

[0066] Figure 8 This is a schematic diagram of the crossover operation for variable granularity search provided in an embodiment of this application;

[0067] Figure 9 This is a schematic diagram of the mutation operation for variable granularity search provided in an embodiment of this application;

[0068] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0069] Figure 11 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0070] In the description of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B. The "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. Furthermore, "at least one" means one or more, and "multiple" means two or more. The terms "first," "second," etc., do not limit the quantity or order of execution, and "first," "second," etc., do not necessarily imply differences.

[0071] It should be noted that, in this application, the terms "exemplary" or "for example" are used to indicate that something is being described as an example, illustration, or illustration. Any embodiment or design described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0072] The unsupervised hyperspectral image band selection method based on variable granularity search provided in this application embodiment can be applied to, for example... Figure 1 In the unsupervised hyperspectral image band selection system 100 based on variable granularity search shown, such as Figure 1 As shown, the communication system includes: an image acquisition device 10, a cloud computing device 20, and a network device 30.

[0073] Among them, the image acquisition device 10 is used to acquire hyperspectral images.

[0074] The cloud computing device 20 is configured to preprocess the hyperspectral image to generate a label image, group the image bands according to the label image to obtain a band group, filter the band group based on a variable granularity search algorithm to obtain a candidate band subset, and optimize the candidate band subset based on a single-target search algorithm to obtain an optimal band subset.

[0075] The network device 30 is configured to transmit data acquired by the image acquisition device 10 to the cloud computing device 20.

[0076] To solve the technical problem of high computational complexity and only fixed-size band subsets in the prior art, the embodiment of the present application provides an unsupervised hyperspectral image band selection method based on a variable granularity search, which comprises the following steps:

[0077] S1, acquiring a hyperspectral image; wherein the hyperspectral image comprises a plurality of image bands;

[0078] S2, preprocessing the hyperspectral image to generate a label image;

[0079] S3, grouping the image bands according to the label image to obtain a band group;

[0080] S4, filtering the band group based on a variable granularity search algorithm to obtain a candidate band subset;

[0081] S5, optimizing the candidate band subset based on a single-target search algorithm to obtain an optimal band subset.

[0082] Therefore, the technical problem of high computational complexity and only fixed-size band subsets in the prior art is solved.

[0083] As shown in Figure 2 the embodiment of the present application provides an unsupervised hyperspectral image band selection method based on a variable granularity search, which comprises the following steps:

[0084] S201, acquiring a hyperspectral image.

[0085] The hyperspectral image comprises a plurality of image bands.

[0086] For example, a Headwall Nano-Hyperspec airborne hyperspectral imaging system (spectral range 400-1000nm, resolution 5nm) is used to take aerial photographs of a target scene under sunny and cloudless weather conditions at a local time of 10:00-14:00 (solar elevation angle > 45°), the flight height is set to 100 meters, the spatial resolution is 0.1 meters, and the platform position and attitude data are recorded synchronously by GPS / IMU, as shown in Figure 3As shown, finally, a hyperspectral image cube (RAW format, single scene covering 500*500 pixels) containing 270 continuous wave bands and radiometrically calibrated is obtained.

[0087] S202, pre-processing the hyperspectral image to generate a label image.

[0088] In some implementations, the pre-processing of the hyperspectral image includes:

[0089] S21, filtering and denoising the hyperspectral image to obtain a denoised image;

[0090] S22, dimension reduction of the denoised image by principal component analysis to obtain a principal component image;

[0091] S23, entropy rate superpixel segmentation of the principal component image to obtain a label image.

[0092] For example, the acquisition of the label image described above is implemented using Python, and the specific code is as follows:

[0093] # S22: Principal component analysis dimension reduction

[0094] X = denoised.reshape(-1, hs_image.shape[2])

[0095] pca = PCA(n_components=8)

[0096] pc_images = pca.fit_transform(X).reshape(512, 512, 8)

[0097] # S23: Entropy rate superpixel segmentation

[0098] superpixel_labels = slic(pc_images[:,:,:3],

[0099] n_segments=200,

[0100] compactness=0.3,

[0101] sigma=1,

[0102] enforce_connectivity=True)

[0103] The hyperspectral image processed by principal component analysis is shown in Figure 4 The hyperspectral image processed by entropy rate superpixel segmentation is shown in Figure 5 ​

[0104] S203, grouping the image bands according to the label image to obtain band grouping.

[0105] In some implementations, the grouping the image bands according to the label image comprises:

[0106] S31, calculating a band feature vector of the label image and a plurality of image bands; wherein the band feature vector comprises mutual information MI and Pearson correlation coefficient PCC, MI is an information sharing amount between the image band and the label image, and PCC is a linear correlation between the image band and the label image;

[0107] S32, grouping the band feature vectors by a k-means clustering algorithm to obtain a band grouping corresponding to the band feature vectors.

[0108] For example, the above grouping of image bands is implemented using Python, and the specific code is as follows:

[0109] # Calculate mutual information MI

[0110] mi = mutual_info_score(

[0111] np.digitize(band_data, bins=np.linspace(0, 1, 256)),

[0112] np.digitize(flat_labels, bins=np.linspace(0, n_clusters, 256)))

[0113] # Calculate Pearson correlation coefficient PCC

[0114] pcc, _ = pearsonr(band_data, flat_labels)

[0115] # S32: K-means clustering grouping

[0116] kmeans = KMeans(n_clusters=n_clusters, random_state=42)

[0117] band_groups = kmeans.fit_predict(feature_vectors)。

[0118] S204, filtering the band grouping based on a variable granularity search algorithm to obtain a candidate band subset.

[0119] In some implementations, the filtering of the waveband groups based on the variable granularity search algorithm comprises:

[0120] S41, as shown in the figure, initialize individuals, population, preset value Num and first stage iteration number X; wherein the population is composed of a plurality of individuals; the individual represents the selection state of the waveband group; Figure 6

[0121] S42, iterate the population by using the granularity-based crossover operator to obtain a crossover population;

[0122] S43, iterate the crossover population by using the granularity-based mutation operator to obtain a mutation population;

[0123] S44, use the KNN classifier to obtain the classification error rate of the population and the mutation population;

[0124] S45, select the first Num individuals with the lowest classification error rate as the new population;

[0125] S46, repeat S42-S45 until the iteration number reaches X to obtain the candidate waveband subset.

[0126] It should be noted that the individual is represented by binary coding, and one bit i represents a group of wavebands. If i = 1, it means that the corresponding group of wavebands is selected; if i = 0, it means that the corresponding group of wavebands is not selected.

[0127] For example, the acquisition of the above-mentioned candidate waveband subset is realized by using Python, and the specific code is as follows:

[0128] def evaluate(self, individual):

[0129] """Calculate the classification error rate using KNN"""

[0130] selected_groups = self.unique_groups[np.where(individual == 1)[0]]

[0131] band_mask = np.isin(self.band_groups, selected_groups)

[0132] X_subset = self.X_train[:, band_mask]

[0133] knn = KNeighborsClassifier(n_neighbors=5)

[0134] ​knn.fit(X_subset, self.y_train)

[0135] pred = knn.predict(self.X_test[:, band_mask])

[0136] return 1 - accuracy_score(self.y_test, pred).

[0137] S205. Based on the single-objective search algorithm, the candidate band subset is optimized to obtain the optimal band subset.

[0138] In some implementations, the optimization of the candidate band subset based on the single-objective search algorithm includes:

[0139] S81. Repair the number of bands corresponding to the candidate band subset to obtain a high-quality band subset with a fixed number of bands.

[0140] S82. The high-quality band subset is iteratively updated using single-point crossover and positional variation in NSGA-II to obtain the updated band subset.

[0141] S83. Use the KNN classifier to obtain the classification error rate of the high-quality band subset and the updated band subset;

[0142] S84. Select the top Num band subsets with the lowest classification error rate to obtain a new high-quality band subset;

[0143] S85. Repeat S82-S84 until the number of iterations reaches the preset maximum value to obtain the optimal band subset.

[0144] For example, the above optimal band subset can be obtained using Python, and the specific code is as follows:

[0145] def single_point_crossover(self, parent1, parent2):

[0146] S82: Single-point crossover (NSGA-II style)

[0147] crossover_point = np.random.randint(1, self.n_bands-1)

[0148] child = np.concatenate([parent1[:crossover_point], parent2[crossover_point:]])

[0149] return child

[0150] def bitwise_mutation(self, individual, mutation_prob=0.05):

[0151] "S82: Bitwise Mutation (NSGA-II Style)"

[0152] mutation_mask = np.random.rand(self.n_bands) < mutation_prob

[0153] return np.logical_xor(individual, mutation_mask)

[0154] The hyperspectral image after selecting the optimal band subset is as follows: Figure 7 As shown.

[0155] Based on the above technical solutions, the unsupervised hyperspectral image band selection method based on variable granularity search provided in this application, through an innovative variable granularity coding strategy, significantly reduces the search space and computational complexity by using coarse-grained grouping in the initial stage. Then, a dynamic granularity refinement mechanism is employed to gradually transition from coarse-grained to fine-grained search, ensuring both global exploration capability and local fine-grained optimization, effectively balancing search efficiency and solution quality. Compared with existing technologies, this method not only optimizes the statistical and spatial information of band subsets but also considers the relationships between band subsets of different sizes, utilizing historical information from the evolutionary process to guide the search direction, thereby obtaining low-redundancy, high-information band combinations, significantly improving classification accuracy while maintaining time efficiency.

[0156] In one possible implementation of this application embodiment, the above-mentioned S204 can be specifically implemented by the following S301 and S302, which are described in detail below:

[0157] S301. The population is iterated through a granularity-based crossover operator to obtain a crossover population.

[0158] In some implementations, such as Figure 8 As shown, the method for obtaining the crossover population includes:

[0159] S51. Input coarse-grained parent individual p and fine-grained parent individual q;

[0160] S52. Convert p to the same granularity level as q to obtain p1;

[0161] S53, cross p1 and q to get offspring O1 and O2;

[0162] S54, repeat S51-S53 to get the crossover population.

[0163] For example, the acquisition of the above-mentioned crossover population is implemented using Python, and the specific code is as follows:

[0164] """Granularity level conversion (S52)"""

[0165] converted = np.zeros_like(individual)

[0166] for new_group in np.unique(to_groups):

[0167] # New group corresponding to the original band mask

[0168] new_mask = (to_groups == new_group)

[0169] # Corresponding original group selection ratio

[0170] original_selected = np.sum(individual & (from_groups == new_group))

[0171] original_total = np.sum(from_groups == new_group)

[0172] if original_total > 0:

[0173] ratio = original_selected / original_total

[0174] # Select the band of the new group according to the ratio

[0175] target_num = int(ratio np.sum(new_mask))

[0176] selected = np.random.choice(np.where(new_mask)[0], target_num,replace=False)

[0177] converted[selected] = 1.

[0178] S302. Iterate the crossover population using a granular mutation operator to obtain the mutated population.

[0179] In some implementations, such as Figure 9 As shown, the method for obtaining the mutant population includes:

[0180] S71. Select the mutated bits from O1 and O2 to obtain the mutation set;

[0181] S72, through calculation formula Calculate the mutation probability P of each bit in the mutation set. i Where n is the total number of image bands, and These are the average rank of MI and PCC for the i-th bit, respectively;

[0182] S73. Calculate the mutation probability of non-mutated bits in O1 and O2 using bit mutation in NSGA-II;

[0183] S74. Mutate the bits with a mutation probability greater than the mutation threshold, and leave the bits with a mutation probability less than or equal to the mutation threshold unchanged to obtain the mutant population.

[0184] It should be noted that for a bit with a value of 1 in O1 and O2, if the corresponding bit in p1 is 1 and the corresponding bit in q is 0, then the bit with a value of 1 in O1 and O2 is marked as a variant bit. and The larger the value, the less important the band represented by the i-th bit is, and therefore the greater the probability of its variation from 1 to 0.

[0185] For example, the above-mentioned mutant population can be obtained using Python. The specific code is as follows:

[0186] # S72: Calculate the probability of the mutated set

[0187] for bit in mutation_set:

[0188] pi = self._calculate_adaptive_prob(bit, n)

[0189] if pi > self.thresh:

[0190] mutation_mask[bit] = True

[0191] # S73: NSGA-II standard position variation

[0192] non_mutation_set = [x for x in range(n) if x not in mutation_set]

[0193] for bit in non_mutation_set:

[0194] if np.random.rand() < self.base_rate:

[0195] mutation_mask[bit] = True.

[0196] Based on the above technical solutions, the crossover operator adopts the dynamic granularity conversion technology to realize effective information exchange between individuals of different granularities, which maintains the search efficiency and ensures the optimization accuracy; the mutation operator dynamically adjusts the mutation probability based on the importance of the wave band, which maintains the population diversity while protecting the high-quality genes. The method effectively overcomes the premature convergence problem in the wave band selection of traditional algorithms, and provides a more intelligent optimization path for the dimensionality reduction of hyperspectral data.

[0197] In a possible implementation manner of the embodiment of the application, the S205 can be implemented through the following S401, which is specifically described as follows.

[0198] S401, repair the number of wave bands corresponding to the candidate wave band subset to obtain a high-quality wave band subset with a fixed number of wave bands.

[0199] In some implementation manners, the repairing of the number of wave bands corresponding to the candidate wave band subset comprises:

[0200] comparing the number of wave bands with a preset threshold value;

[0201] when the number of wave bands is greater than the preset threshold value, randomly selecting wave bands exceeding the number to discard;

[0202] when the number of wave bands is less than the preset threshold value, randomly selecting wave bands with a difference number from the hyperspectral image to supplement;

[0203] when the number of wave bands is equal to the preset threshold value, keeping the number of wave bands unchanged.

[0204] For example, the repairing of the number of wave bands is implemented by using Python, and the specific code is as follows:

[0205] # Case 2: insufficient number

[0206] if all_bands is None:

[0207] all_bands = np.arange(len(band_selection))

[0208] repair_selection = band_selection.copy()

[0209] unselected = np.setdiff1d(all_bands, np.where(repair_selection)[0])

[0210] # Randomly supplement missing bands

[0211] to_add = np.random.choice(unselected,

[0212] size=target_count - current_selected,

[0213] replace=False)

[0214] repair_selection[to_add] = True

[0215] return repair_selection。

[0216] Based on the above technical solution, through the adaptive repair mechanism, the quality stability of the band subset is ensured, and the diversity of the feature combination is enhanced through the random selection strategy, which provides a more reliable and efficient feature basis for subsequent hyperspectral image classification, target recognition and other applications, and significantly improves the robustness and practicality of the entire processing flow.

[0217] In a possible implementation manner of the embodiment of the application, S301 can be implemented through the following S701, which is specifically described as follows.

[0218] S701, cross operation is performed on p1 and q to obtain offspring individuals O1 and O2.

[0219] In some implementation manners, the cross operation on p1 and q includes:

[0220] constructing empty offspring individuals O1 and O2, and comparing p1 and q;

[0221] when the bit positions of p1 and q are both 1, the corresponding bit positions in O1 and O2 are both set to 1;

[0222] when the bit positions of p1 and q are both 0, the corresponding bit positions in O1 and O2 are both set to 0;

[0223] When the bit positions of p1 and q are different, a bit is randomly selected from the index set corresponding to the different bit positions, the bit position corresponding to the index in O1 is set to 1, the bit positions corresponding to the remaining indexes are set to 0, and the bit position of O2 is set to be opposite to that of O1.

[0224] For example, the above cross operation of p1 and q is implemented using Python, and the specific code is as follows:

[0225] # Process different bit positions

[0226] if len(diff_indices) > 0:

[0227] # Randomly select 1 bit to be 1 (for o1)

[0228] selected = np.random.choice(diff_indices, 1)

[0229] o1[selected] = True

[0230] o1[np.setdiff1d(diff_indices, selected)] = False

[0231] # o2 is negated

[0232] o2[diff_indices] = ~o1[diff_indices].

[0233] Based on the above technical solution, by stably inheriting the consistent features and implementing complementary allocation of the difference features, the integrity of the superior spectral features is preserved, and new high-quality combinations are generated through adaptive recombination of feature bits. This cross strategy not only ensures the convergence of the algorithm, but also significantly enhances the diversity of the population and the expression ability of the features, making the evolution process more effective in exploring the solution space, and providing a more optimized solution for hyperspectral image band selection.

[0234] The above describes the scheme of the embodiments of the present application mainly from the perspective of device implementation. It can be understood that each device, for example, an electronic device, comprises at least one of a corresponding hardware structure and a software module for implementing each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of the examples described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is implemented in hardware or computer software driven hardware depends on the specific application of the technical scheme and design constraints. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0235] The embodiments of the present application can divide the functional units of the electronic device according to the above method examples. For example, each functional unit can be divided according to each function, or two or more functions can be integrated in one processing unit. The integrated unit can be implemented in the form of hardware or software functional unit. It should be noted that the division of units in the embodiments of the present application is illustrative, and is only a logical functional division. Actual implementation can have another division method.

[0236] In the case of using an integrated unit, Figure 10 A possible structure schematic diagram of the electronic device (denoted as electronic device 50) involved in the above embodiments is shown, which includes a processing unit 501 and a communication unit 502, and can also include a storage unit 503. Figure 10 The structure schematic diagram shown can be used to illustrate the structure of the electronic device involved in the above embodiments.

[0237] When Figure 10 When the structure schematic diagram shown is used to illustrate the structure of the electronic device involved in the above embodiments, the processing unit 501 is used to control and manage the actions of the electronic device, the communication unit 502 is used for communication between the electronic device and other devices, and the storage unit 503 is used to store the program code and data of the electronic device.

[0238] For example, the communication unit 502 is used to obtain a hyperspectral image.

[0239] The processing unit 501 is used to pre-process the hyperspectral image to generate a label image, group features according to the label image, obtain a wave band group, filter the wave band group based on a variable granularity search algorithm, obtain a candidate wave band subset, and optimize the candidate wave band subset based on a single-target search algorithm to obtain an optimal wave band subset.

[0240] The processing unit 501 can be a processor or a controller, and the communication unit 502 can be a communication interface, a transceiver, a transceiver, a transceiver circuit, a transceiver device, etc. The communication interface is collectively referred to, and can include one or more interfaces. The storage unit 503 can be a memory. When the electronic device 50 is a chip, the processing unit 501 can be a processor or a controller, and the communication unit 502 can be an input interface and / or an output interface, a pin or a circuit, etc. The storage unit 503 can be a storage unit (for example, a register, a cache, etc.) within the chip, or a storage unit (for example, a read-only memory (ROM), a random access memory (RAM), etc.) located outside the chip.

[0241] The communication unit can also be referred to as a transceiver unit. The antenna and control circuit with transceiver function in the electronic device 50 can be regarded as the communication unit 502 of the electronic device 50, and the processor with processing function can be regarded as the processing unit 501 of the electronic device 50. Optionally, the device for realizing the receiving function in the communication unit 502 can be regarded as a communication unit, and the communication unit is used to execute the receiving steps in the embodiments of the application. The communication unit can be a receiver, a receiver, a receiving circuit, etc. The device for realizing the sending function in the communication unit 502 can be regarded as a sending unit, and the sending unit is used to execute the sending steps in the embodiments of the application. The sending unit can be a transmitter, a sender, a sending circuit, etc.

[0242] Figure 10 The integrated units in the above embodiments can be stored in a computer readable storage medium if they are realized in the form of software function modules and sold or used as independent products. Based on such understanding, the technical solutions of the embodiments of the application can be embodied in the form of software product, and the computer software product is stored in a storage medium, including a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the method described in the embodiments of the application. The storage medium for storing computer software product includes: U disk, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk, and various media that can store program codes.

[0243] Figure 10 The units in the above embodiments can also be referred to as modules, for example, the processing unit can be referred to as a processing module.

[0244] The embodiments of the application also provide a hardware structure diagram of an electronic device (denoted as electronic device 60), which is shown in Figure 11The electronic device 60 comprises a processor 601, and optionally further comprises a memory 602 connected with the processor 601.

[0245] In the first possible implementation, referring to Figure 11 The electronic device 60 further comprises a transceiver 603. The processor 601, the memory 602 and the transceiver 603 are connected through a bus. The transceiver 603 is used for communicating with other devices or communication networks. Optionally, the transceiver 603 can comprise a transmitter and a receiver. The device for realizing the receiving function in the transceiver 603 can be regarded as a receiver, and the receiver is used for executing the receiving steps in the embodiments of the present application. The device for realizing the sending function in the transceiver 603 can be regarded as a transmitter, and the transmitter is used for executing the sending steps in the embodiments of the present application.

[0246] Based on the first possible implementation, Figure 11 The structure diagram shown can be used for illustrating the structure of the electronic device involved in the above embodiments.

[0247] Among them, Figure 11 The system chip in the electronic device can also be illustrated. In this case, the actions performed by the above electronic device can be realized by the system chip, and the specific actions performed can be referred to in the above, and will not be described here.

[0248] In the implementation process, each step in the method provided by the embodiment can be completed by the integrated logic circuit of the hardware in the processor or the instructions in the software form. The steps of the method disclosed in the embodiments of the present application can be directly embodied as hardware processor execution completion, or executed by the combination of hardware and software modules in the processor.

[0249] The processor in the present application can include, but is not limited to, at least one of the following: a central processing unit (CPU), a microprocessor, a digital signal processor (DSP), a microcontroller unit (MCU), or an artificial intelligence processor, and various computing devices running software, each of which can include one or more cores for executing software instructions to perform operations or processing. The processor can be a separate semiconductor chip, or can be integrated with other circuits as a semiconductor chip, for example, it can be integrated with other circuits (such as coding and decoding circuits, hardware acceleration circuits, or various bus and interface circuits) to form a SoC (system on chip), or it can be integrated as a built-in processor in an ASIC. The ASIC integrated with the processor can be packaged separately or packaged together with other circuits. In addition to including cores for executing software instructions to perform operations or processing, the processor can further include necessary hardware accelerators, such as field programmable gate arrays (FPGAs), PLDs (programmable logic devices), or logic circuits that implement special logic operations.

[0250] The memory in the embodiments of the present application can include at least one of the following types: read-only memory (ROM) or other types of static storage devices that can store static information and instructions, random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, and electrically erasable programmable read-only memory (EEPROM). In some scenarios, the memory can also be a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage medium or other magnetic storage device, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and capable of being accessed by a computer, but not limited to.

[0251] The embodiments of the present application also provide a computer readable storage medium including instructions, which, when executed on a computer, cause the computer to perform any of the above methods.

[0252] The embodiments of the present application also provide a computer program product including instructions, which, when executed on a computer, cause the computer to perform any of the above methods.

[0253] The embodiments of the present application also provide a chip, which comprises a processor and an interface circuit, the interface circuit is coupled with the processor, the processor is used to run computer programs or instructions to realize the above method, and the interface circuit is used to communicate with other modules outside the chip.

[0254] In the above embodiments, all or part of the embodiments can be realized by software, hardware, firmware or any combination thereof. When realized by software, all or part of the embodiments can be realized in the form of a computer program product. The computer program product comprises one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable devices. The computer instructions can be stored in a computer readable storage medium or transferred from one computer readable storage medium to another, for example, the computer instructions can be transferred from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (such as infrared, wireless, microwave, etc.) mode. The computer readable storage medium can be any available medium that can be accessed by a computer or data storage device including one or more servers, data centers, etc. integrated with the medium. The available medium can be magnetic medium (such as floppy disk, hard disk, magnetic tape), optical medium (such as DVD), or semiconductor medium (such as solid state disk (solid state disk, SSD)) and the like.

[0255] Although the present application is described herein in conjunction with various embodiments, other variations of the disclosed embodiments can be understood and implemented by those skilled in the art with reference to the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "one" does not exclude a plurality. A single processor or other unit can implement several functions listed in the claims. Some measures are described in mutually different dependent claims, but this does not mean that these measures cannot be combined to produce good results.

[0256] Although the present application has been described in connection with certain specific features and embodiments thereof, it is to be understood that it is provided as an example to the best of the applicant's knowledge and that various modifications and combinations of the described features and embodiments are possible and are within the spirit and scope of the application. Accordingly, the specification and drawings are to be regarded in an illustrative rather than a restrictive sense, and all such modifications and variations are considered within the scope of the present application as defined by the following claims and their equivalents. Obviously, many modifications and variations of the present application are possible in light of the above teachings. It is, therefore, to be understood that within the scope of the claims and their equivalents, the present application can be practiced otherwise than as specifically described.

Claims

1. An unsupervised hyperspectral image band selection method based on variable granularity search, characterized in that, include: Acquire a hyperspectral image; wherein the hyperspectral image includes multiple image bands; The hyperspectral image is preprocessed to generate a label image; Based on the label image, the image bands are grouped according to their features to obtain band groups; The band groups are filtered based on a variable granularity search algorithm to obtain a subset of candidate bands; The optimal band subset is obtained by selecting the candidate band subset based on the single-objective search algorithm; The filtering of band groups based on the variable granularity search algorithm includes: S41. Initialize individuals, population, preset value Num, and first-stage iteration number X; where the population consists of several individuals; individuals represent the selection state of band grouping; S42. Iterate the population using a granularity-based crossover operator to obtain a crossover population; S43. Iterate the crossover population using a granular mutation operator to obtain the mutated population; S44. Use the KNN classifier to obtain the classification error rate of the population and the mutant population; S45. Select the top Num individuals with the lowest classification error rate as the new population; S46. Repeat S42-S45 until the number of iterations reaches X, to obtain a subset of candidate bands; The optimization of the candidate band subset based on the single-objective search algorithm includes: S81. Repair the number of bands corresponding to the candidate band subset to obtain a high-quality band subset with a fixed number of bands. S82. The high-quality band subset is iteratively updated using single-point crossover and positional variation in NSGA-II to obtain the updated band subset. S83. Use the KNN classifier to obtain the classification error rate of the high-quality band subset and the updated band subset; S84. Select the top Num band subsets with the lowest classification error rate to obtain a new high-quality band subset; S85. Repeat S82-S84 until the number of iterations reaches the preset maximum value to obtain the optimal band subset.

2. The method according to claim 1, characterized in that, The preprocessing of the hyperspectral image includes: S21. Filter and denoise the hyperspectral image to obtain a denoised image; S22. Dimensionality reduction of the denoised image is performed through principal component analysis to obtain the principal component image; S23. Perform entropy rate superpixel segmentation on the principal component image to obtain the label image.

3. The method according to claim 1, characterized in that, The step of grouping image bands based on the label image includes: S31. Calculate the band feature vectors of several image bands and the label image; wherein, the band feature vectors include mutual information MI and Pearson correlation coefficient PCC, where MI is the amount of information shared between the image band and the label image, and PCC is the linear correlation between the image band and the label image. S32. The band feature vectors are grouped using the k-means clustering algorithm to obtain the band groups corresponding to the band feature vectors.

4. The method according to claim 1, characterized in that, The methods for obtaining the crossover population include: S51. Input coarse-grained parent individual p and fine-grained parent individual q; S52. Convert p to the same granularity level as q to obtain p1; S53. Perform a crossover operation on p1 and q to obtain offspring individuals O1 and O2; S54. Repeat S51-S53 to traverse the population and obtain the crossover population.

5. The method according to claim 4, characterized in that, The crossover operation on p1 and q includes: Construct empty offspring individuals O1 and O2, and compare p1 and q; When the bits of p1 and q are both 1, set the corresponding bits in O1 and O2 to 1. When the bits of p1 and q are both 0, set the corresponding bits in O1 and O2 to 0; When the bits of p1 and q are different, randomly select one bit from the index set corresponding to the different bits, set the bit corresponding to the index in O1 to 1, set the bits corresponding to the other indices to 0, and set the bits of O2 to the opposite of O1.

6. The method according to claim 1, characterized in that, The methods for obtaining the mutant population include: S71. Select the mutated bits from O1 and O2 to obtain the mutation set; S72, through calculation formula Calculate the mutation probability P of each bit in the mutation set. i Where n is the total number of image bands, and These are the average rank of MI and PCC for the i-th bit, respectively; S73. Calculate the mutation probability of non-mutated bits in O1 and O2 using bit mutation in NSGA-II; S74. Mutate the bits with a mutation probability greater than the mutation threshold, and leave the bits with a mutation probability less than or equal to the mutation threshold unchanged to obtain the mutant population.

7. The method according to claim 1, characterized in that, The process of correcting the number of bands corresponding to the candidate band subset includes: The number of bands is compared with a preset threshold. When the number of bands exceeds a preset threshold, the excess bands are randomly selected and discarded. When the number of bands is less than a preset threshold, bands with a difference in value are randomly selected from the hyperspectral image to supplement the image. When the number of bands equals the preset threshold, the number of bands remains unchanged.

8. An electronic device, characterized in that, include: Communication unit and processing unit; The communication unit is used to acquire hyperspectral images; The processing unit is used to preprocess the hyperspectral image to generate a label image; to group the image bands according to the label image to obtain band groups; to filter the band groups based on a variable granularity search algorithm to obtain a candidate band subset; and to optimize the candidate band subset based on a single-objective search algorithm to obtain the optimal band subset.

Citation Information

Patent Citations

  • Target characteristic-oriented multi-target optimization hyperspectral image waveband selection method

    CN114140658A

  • Hyperspectral image isolation anomaly detection method based on nearest neighbor distance

    CN117853931A