Hyperspectral band selection method, electronic device and storage medium
By dividing the population of hyperspectral image data into two independent subpopulations that are iteratively optimized, the problem of insufficient global search capability of hyperspectral band selection methods in the prior art is solved, and the optimal subset of bands is more accurately determined and data processing efficiency is improved.
Patent Information
- Application Number
- CN202411320334.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-09-23
AI Technical Summary
The existing hyperspectral band selection methods lack global search capabilities, and are prone to falling into local optimality and difficult to accurately obtain the best subset of bands.
By dividing the population corresponding to the hyperspectral image data into two sub-populations and allowing the two sub-populations to be iteratively optimized separately, the dual-population structure is used to maintain a high degree of diversity, avoiding premature convergence and falling into local optimal solutions.
This method can increase the chance of finding the global optimal solution, make the determined target band subset closer to the optimal band subset, and in the process of reducing the data dimensions of hyperspectral image, the impact on the classification effect is avoided as much as possible, thereby improving the efficiency of subsequent data processing.
Smart Images

Figure CN118840666B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a hyperspectral band selection method, electronic equipment and storage medium. Background Art
[0002] Hyperspectral remote sensing images have rich spatial and spectral information, and have unique advantages in object recognition and material differentiation. They are widely used in many fields. However, the high dimensionality of hyperspectral images and the high correlation between bands pose significant challenges to subsequent processing algorithms. Band selection, as an important method for dimensionality reduction of hyperspectral images, can effectively reduce data dimensions while retaining key spectral information, thereby reducing the computational burden and improving processing efficiency without significantly affecting the classification effect.
[0003] In the related art, when selecting hyperspectral bands, a global optimization algorithm is usually used to explore the entire search space through multiple iterations and group search methods to find the solution with the optimal objective function value in the entire search space. This optimization algorithm lacks global search capabilities, and the search results are prone to fall into local optimality, making it difficult to accurately obtain the best band subset. Summary of the invention
[0004] The present application is proposed in consideration of the above-mentioned problems. According to one aspect of the present application, a hyperspectral band selection method is provided, the method comprising: acquiring hyperspectral image data; initializing a population based on the hyperspectral image data, wherein the population includes a preset number of individuals, and each of the preset number of individuals corresponds to a different band combination; dividing the population into two sub-populations, wherein the two sub-populations each include the same number of individuals; for each of the two sub-populations, iteratively optimizing the sub-population based on the objective function value of each individual in the sub-population; when the number of iterative optimizations reaches a preset number threshold, searching for the maximum value of the objective function, wherein the individual corresponding to the maximum value of the objective function is the target band subset; wherein the objective function is the trace of the ratio of the inter-class discreteness matrix to the intra-class discreteness matrix of the corresponding individual.
[0005] Exemplarily, the method also includes: for each subpopulation in the two subpopulations, after each iterative optimization, adjusting the size of the subpopulation according to the result of the iterative optimization of the subpopulation; wherein the result of the iterative optimization includes: the number of individuals updated by each of the two subpopulations after the current iterative optimization, and the objective function value of each individual in the subpopulation after the current iterative optimization; wherein the sum of the number of individuals included in the two subpopulations after adjustment is the same as the sum of the number of individuals included in the two subpopulations before adjustment.
[0006] Exemplarily, the adjusting the size of the subpopulation according to the result of iterative optimization of the subpopulation includes: calculating the population update rate of the subpopulation based on the number of individuals updated in the two subpopulations respectively after the current iterative optimization; calculating the average target value of the subpopulation based on the objective function value of each individual in the subpopulation after the current iterative optimization; and adjusting the size of the subpopulation based on at least the population update rate, the average target value and the current size of the subpopulation.
[0007] Exemplarily, the calculating the population update rate of the subpopulation based on the number of individuals updated by the two subpopulations respectively after the current iteration optimization includes: calculating the population update rate of the subpopulation by the following formula:
[0008] ;
[0009] in, represents the population renewal rate of the sub-population, , They respectively represent the number of individuals updated in the two subpopulations after the current iteration optimization, , Respectively represent the sizes of the two sub-populations currently described, Indicates the current size of the subpopulation. Indicates the number of individuals in the subpopulation that have been optimized and updated in the current iteration;
[0010] and / or,
[0011] The calculating the average target value of the sub-population based on the target function value of each individual in the sub-population after the current iteration optimization includes: calculating the average target value of the sub-population by the following formula:
[0012] ;
[0013] in, represents the average target value of the subpopulation, represents the subpopulation, represents the individuals in this subpopulation, represents the objective function value of the individuals in the subpopulation, Indicates the current size of the sub-population;
[0014] and / or,
[0015] The adjusting the size of the sub-population based at least on the population update rate, the average target value and the current size of the sub-population includes: adjusting the size of the sub-population by the following formula:
[0016] ;
[0017] in, represents the size of the subpopulation after adjustment, represents the preset quantity, represents the population renewal rate of the sub-population, represents the average target value of the subpopulation, , Respectively represent the average target values of the two subpopulations, Indicates the current size of the sub-population.
[0018] Exemplarily, initializing a population based on the hyperspectral image data includes: clustering the hyperspectral image data to obtain a clustering result of the hyperspectral image data, the clustering result including a plurality of clustering clusters, each clustering cluster in the plurality of clustering clusters including a plurality of bands; initializing a population based on the clustering result; wherein the bands in the band combination corresponding to each individual in the preset number of individuals correspond one-to-one to the plurality of clustering clusters.
[0019] Exemplarily, initializing the population based on the clustering result includes: using an individual generation operation to generate a preset number of individuals in the population; the individual generation operation includes: randomly selecting a band from each of the multiple clusters to obtain an individual.
[0020] Exemplarily, the iteratively optimizing the subpopulation based on the objective function value of each individual in the subpopulation includes: iteratively optimizing the subpopulation through selection operation, crossover operation and mutation operation in sequence based on the objective function value of each individual in the subpopulation.
[0021] Exemplarily, before iteratively optimizing each of the two subpopulations based on the objective function value of each individual in the subpopulation, the method further includes: segmenting the hyperspectral image data using an entropy rate superpixel segmentation method to obtain multiple superpixels.
[0022] According to another aspect of the present application, an electronic device is provided, including a processor and a memory, wherein a computer program is stored in the memory, and the processor is used to execute the computer program to implement the above method.
[0023] According to another aspect of the present application, a computer-readable storage medium is provided, storing a computer program / instruction, and the computer program / instruction implements the above method when executed by a processor.
[0024] The above technical solution divides the population corresponding to the hyperspectral image data into two sub-populations, and makes the two sub-populations perform iterative optimization independently. This dual-population structure performs iterative optimization independently, which can maintain a high degree of diversity, avoid premature convergence and fall into the local optimal solution, thereby helping to increase the chance of finding the global optimal solution, and then make the determined target band subset closer to the optimal band subset. In short, this method can determine the optimal band subset more accurately. When this method is applied to the processing of hyperspectral image data, the use of this method can avoid the impact on the classification effect as much as possible in the process of reducing the data dimension of the hyperspectral image data, thereby improving the processing efficiency of subsequent data processing without affecting the accuracy of subsequent data processing as much as possible.
[0025] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] By describing the embodiments of the present application in more detail in conjunction with the accompanying drawings, the above and other purposes, features and advantages of the present application will become more apparent. The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation of the present application. In the accompanying drawings, the same reference numerals generally represent the same components or steps.
[0027] Figure 1 A schematic flow chart showing a method for selecting a hyperspectral band according to an embodiment of the present application is shown;
[0028] Figure 2 A real feature map of the Botswana dataset showing an embodiment of the present application;
[0029] Figure 3 A real feature map of the Salinas dataset according to one embodiment of the present application is shown;
[0030] Figure 4 A diagram showing the classification results of Botswana data in one embodiment of the present application is shown;
[0031] Figure 5 A diagram showing the Salinas data classification result of one embodiment of the present application is shown;
[0032] Figure 6 A schematic block diagram of an electronic device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solutions and advantages of the present application more obvious, the example embodiments according to the present application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application, and it should be understood that the present application is not limited to the example embodiments described herein. Based on the embodiments of the present application described in the present application, all other embodiments obtained by those skilled in the art without creative work should fall within the scope of protection of the present application.
[0034] As mentioned above, the methods used for hyperspectral band selection in the related art have poor global search capabilities, are prone to fall into local optimality, and are difficult to accurately obtain the best band subset. Specifically, global optimization algorithms such as genetic algorithms, particle swarm optimization algorithms, simulated annealing algorithms, etc. are usually used in the related art for hyperspectral band selection. These methods usually explore the entire search space through multiple iterations and group search methods to find the solution with the optimal objective function value in the entire search space. Traditional optimization algorithms often lack global search capabilities. At the same time, population feedback mechanisms based on individual quality are rarely constructed, and they are prone to fall into local optimality. In view of this, the present application provides a hyperspectral band selection method, an electronic device, and a storage medium. The method can avoid premature convergence and fall into a local optimal solution by performing dual population evolution based on a feedback mechanism, thereby helping to increase the chance of finding a global optimal solution and making the determined target band subset closer to the optimal band subset. The method, electronic device, and storage medium are described in detail below.
[0035] According to one aspect of an embodiment of the present application, a hyperspectral band selection method is provided. Figure 1 FIG. 5 is a schematic flow chart of a method for selecting a hyperspectral band according to an embodiment of the present application. Figure 1 As shown, the method 100 may include the following steps S110, S120, S130, S140 and S150.
[0036] In step S110 , hyperspectral image data is acquired.
[0037] Optionally, the hyperspectral image data may be raw image data collected by, for example, airborne sensors, aviation sensors, etc., or may be image data obtained by preprocessing the raw data set, including but not limited to filtering, denoising, and the like.
[0038] It can be understood that the hyperspectral image data includes multiple bands, each of which is composed of multiple pixels. Selecting the hyperspectral bands means selecting multiple bands in the hyperspectral image data to determine a band subset, so as to reduce the consumption of computing resources for subsequent processing of the hyperspectral image data and improve processing efficiency.
[0039] In some embodiments, the hyperspectral image data may be represented as ,in, Represent different bands respectively. represents the set of real numbers in mathematical theory, represents the number of pixels, Indicates the number of bands.
[0040] In step S120, a population is initialized based on the hyperspectral image data, wherein the population includes a preset number of individuals, and each of the preset number of individuals corresponds to a different band combination.
[0041] In this step, the population can be initialized based on the hyperspectral image data. For example, different bands can be randomly selected from multiple bands included in the hyperspectral image data to form a band combination to obtain an individual. For another example, the hyperspectral image data can be clustered first, and then a preset number of individuals can be obtained based on the clustering results. Of course, other methods can also be used to initialize the population, which will not be described in detail.
[0042] In the solution of this example, a band combination includes multiple bands. The number of bands in the band combination corresponding to each individual is the same. The number of bands included in the band combination is equal to the number of bands in the band subset that the user ultimately needs to select. The number of bands can be determined according to actual needs, for example, the number of bands can be in the range of [0,50]. In a specific embodiment, the number of bands can be 30.
[0043] Optionally, the preset number can be set according to user needs and will not be described in detail.
[0044] In step S130, the population is divided into two sub-populations, wherein the number of individuals included in each of the two sub-populations is the same. For ease of description, the two sub-populations are hereinafter referred to as the first sub-population and the second sub-population, respectively.
[0045] After the population is initialized, the population can be evenly divided into two sub-populations. In some embodiments, some individuals in the current population can be directly randomly selected as the first sub-population, and the remaining individuals can be used as the second sub-population. For example, if the preset number is 50, 25 individuals can be randomly selected from the current population to form the first sub-population, and the remaining 25 individuals can form the second sub-population. In other embodiments, the first half of the individuals can be composed of the first sub-population according to the sequence number of the individuals in the population, and the second half of the individuals can be composed of the second sub-population. The sequence number of each individual can be determined according to the generation time of the individual, and of course it can also be determined in other ways, which will not be repeated. In some other embodiments, the individuals in the population can be scattered and randomly arranged, and then the first half of the individuals can be composed of the first sub-population, and the second half of the individuals can be composed of the second sub-population. This random division of the two sub-populations can reduce the interference of human factors, which is conducive to providing a more reliable basis for subsequent steps, thereby helping to further increase the chance of finding a global optimal solution.
[0046] In step S140, for each of the two subpopulations, an iterative optimization is performed on the subpopulation based on the objective function value of each individual in the subpopulation.
[0047] In this paper, the trace of the ratio of the individual's inter-class discreteness matrix to the intra-class discreteness matrix is used as the objective function, and the objective function value is the trace of the corresponding individual.
[0048] After obtaining two sub-populations, the two sub-populations can be iteratively optimized respectively. The iterative optimization process includes but is not limited to one or more methods of selection, crossover, mutation, etc.
[0049] It can be understood that in step S140, the two sub-populations are independently iteratively optimized, and the iterative optimization is guided by the objective function value of the individuals in each sub-population. This independent iterative optimization method can be called a dual-population evolutionary algorithm.
[0050] In step S150, when the number of iterative optimization reaches a preset threshold, the maximum value of the objective function is searched, wherein the individual corresponding to the maximum value of the objective function is the target band subset; wherein the objective function is the trace of the ratio of the inter-class discreteness matrix to the intra-class discreteness matrix of the corresponding individual.
[0051] The preset number threshold can be set according to actual needs. For example, the preset number threshold can be determined by comprehensively considering the accuracy and computing efficiency required by the user.
[0052] In the scheme of this example, for each of the two subpopulations, the subpopulation is iteratively optimized based on the objective function value of each individual in the subpopulation. When the number of iterative optimization reaches a preset threshold, the maximum value of the objective function can be searched, that is, the maximum value of the objective function of each individual can be searched. The individual corresponding to the maximum value of the objective function is the optimal solution, that is, the target band subset.
[0053] The above technical solution divides the population corresponding to the hyperspectral image data into two sub-populations, and makes the two sub-populations perform iterative optimization independently. This dual-population structure performs iterative optimization independently, which can maintain a high degree of diversity, avoid premature convergence and fall into the local optimal solution, thereby helping to increase the chance of finding the global optimal solution, and then make the determined target band subset closer to the optimal band subset. In short, this method can determine the optimal band subset more accurately. When this method is applied to the processing of hyperspectral image data, the use of this method can avoid the impact on the classification effect as much as possible in the process of reducing the data dimension of the hyperspectral image data, thereby improving the processing efficiency of subsequent data processing without affecting the accuracy of subsequent data processing as much as possible.
[0054] Exemplarily, the method may further include the following steps: for each of the two subpopulations, after each iterative optimization, adjusting the size of the subpopulation according to the result of the iterative optimization of the subpopulation; wherein the result of the iterative optimization includes: the number of individuals updated in each of the two subpopulations after the current iterative optimization, and the objective function value of each individual in the subpopulation after the current iterative optimization; wherein the sum of the number of individuals included in the two subpopulations after the adjustment is the same as the sum of the number of individuals included in the two subpopulations before the adjustment.
[0055] In this paper, the size of a population is the number of individuals in the population. Similarly, the size of a subpopulation is the number of individuals in the subpopulation.
[0056] It can be understood that for each subpopulation, the number of individuals updated by the current iteration optimization of the subpopulation is the number of individuals that have changed in the subpopulation after the current iteration optimization. For example, if 5 individuals of the subpopulation have changed after a certain iteration optimization (that is, the band combination corresponding to the 5 individuals has changed), then the number of individuals updated by the current iteration optimization of the subpopulation is 5.
[0057] In the scheme of this example, the result of iterative optimization includes: the number of individuals updated by each of the two subpopulations after the current iterative optimization, and the objective function value of each individual in the subpopulation after the current iterative optimization, that is, the size of the subpopulation can be adjusted according to the number of individuals updated by each of the two subpopulations after the current iterative optimization, and the objective function value of each individual in the subpopulation after the current iterative optimization. This method of dynamically adjusting the size of the subpopulation based on the result of iterative optimization as a feedback condition helps to more accurately determine the target band subset.
[0058] As described above, the sum of the number of individuals included in the two subpopulations after adjustment is the same as the sum of the number of individuals included in the two subpopulations before adjustment. In other words, the sum of the number of individuals in the two subpopulations is always equal to the preset number.
[0059] In some embodiments, according to the result of iterative optimization of the subpopulation, adjusting the size of the subpopulation may specifically include the following steps: according to the result of iterative optimization of the subpopulation, determining the target size of the subpopulation; when the target size of the subpopulation is different from the current size of the subpopulation, if the target size of the subpopulation is greater than the current size of the subpopulation, randomly selecting a target number of individuals from the other of the two subpopulations and moving them to the subpopulation; if the target size of the subpopulation is less than the current size of the subpopulation, randomly selecting a target number of individuals from the subpopulation and moving them to the other of the two subpopulations, wherein the target number is the absolute value of the difference between the target size of the subpopulation and the current size of the subpopulation. In this embodiment, when dynamically adjusting the size of the subpopulation, the method of moving individuals from one of the subpopulations to the other subpopulation is adopted, and the individuals to be moved are randomly selected at the same time. This method can avoid the tendency of individual selection, which helps to improve the accuracy of the target band subset finally obtained.
[0060] It is understandable that in the related art, when iteratively optimizing a population, the number of the population is usually fixed. In the solution of this example, by dynamically adjusting the sizes of the two sub-populations based on the results of iterative optimization, it helps to avoid the sub-populations evolving in a bad direction during iterative optimization, which helps to further improve the accuracy of the target band subset finally obtained.
[0061] Exemplarily, adjusting the size of the subpopulation according to the result of iterative optimization of the subpopulation may specifically include the following steps: calculating the population update rate of the subpopulation based on the number of individuals updated in the two subpopulations after the current iterative optimization; calculating the average target value of the subpopulation based on the objective function value of each individual in the subpopulation after the current iterative optimization; and adjusting the size of the subpopulation based on at least the population update rate, the average target value and the current size of the subpopulation.
[0062] In the scheme of this example, after the current iteration optimization, the population update rate and the objective function value of the two subpopulations can be calculated respectively according to the number of individuals updated in the two subpopulations after the current iteration optimization, and based on the objective function value of each individual in the subpopulation after the current iteration optimization. After obtaining the population update rate and the objective function value of each subpopulation, the size of the subpopulation can be adjusted at least according to the population update rate, the average target value and the current size of the subpopulation. For example, for the first subpopulation, the population update rate (which can be called the first population update rate) and the average target value (which can be called the first average target value) of the first subpopulation can be calculated first, and then the size of the first subpopulation can be adjusted at least based on the first population update rate, the first average target value and the current size of the first subpopulation. For the second sub-population, the population update rate (which may be referred to as the second population update rate) and the average target value (which may be referred to as the second average target value) of the second sub-population may be calculated first, and then the size of the second sub-population may be adjusted based at least on the second population update rate, the second average target value, and the current size of the second sub-population.
[0063] Optionally, adjusting the size of the subpopulation based at least on the population update rate, the average target value, and the current size of the subpopulation may specifically include the following steps: determining the target size of the subpopulation based at least on the population update rate, the average target value, and the current size of the subpopulation; when the target size of the subpopulation is different from the current size of the subpopulation, if the target size of the subpopulation is larger than the current size of the subpopulation, randomly selecting a target number of individuals from the other of the two subpopulations and moving them to the subpopulation; if the target size of the subpopulation is smaller than the current size of the subpopulation, randomly selecting a target number of individuals from the subpopulation and moving them to the other of the two subpopulations, wherein the target number is the absolute value of the difference between the target size of the subpopulation and the current size of the subpopulation. The specific adjustment method has been described in detail above and will not be repeated here.
[0064] It can be understood that for each subpopulation, the population update rate and average target value of the subpopulation after iterative optimization can characterize the evolution status of the subpopulation. In the scheme of this example, the population update rate and average target value are used as indicators to adjust the size of the subpopulation, and the size of the subpopulation can be dynamically adjusted to avoid the subpopulation evolving in a bad direction during iterative optimization as much as possible. This method of adjusting the number of subpopulations based on the feedback of the subpopulation evolution results can dynamically allocate computing resources, which helps to further improve the accuracy of the target band subset finally obtained.
[0065] Exemplarily, based on the number of individuals updated by each of the two subpopulations through the current iteration optimization, calculating the population update rate of the subpopulation includes: calculating the population update rate of the subpopulation by the following formula:
[0066] ;
[0067] in, represents the population renewal rate of the sub-population, , They represent the number of individuals updated in the two subpopulations after the current iteration optimization. , Respectively represent the sizes of the two current sub-populations, Indicates the current size of the subpopulation. Indicates the number of individuals in the subpopulation that have been optimized and updated in the current iteration.
[0068] And / or, based on the objective function value of each individual in the subpopulation after the current iteration optimization, calculating the average objective value of the subpopulation, including: calculating the average objective value of the subpopulation by the following formula:
[0069] ;
[0070] in, represents the average target value of the subpopulation, represents the subpopulation, represents the individuals in this subpopulation, represents the objective function value of the individuals in the subpopulation, Indicates the current size of the sub-population.
[0071] and / or,
[0072] At least based on the population update rate, the average target value and the current size of the sub-population, the size of the sub-population is adjusted, including: adjusting the size of the sub-population by the following formula:
[0073] ;
[0074] in, represents the size of the subpopulation after adjustment, Indicates the preset quantity, represents the population renewal rate of the sub-population, represents the average target value of the subpopulation, , Respectively represent the average target values of the two sub-populations, Indicates the current size of the sub-population.
[0075] In the above formula, The value is 1 or 2. It can be understood that when the sub-population is the first sub-population, The value is 1, when the sub-population is the second sub-population, The value is 2.
[0076] The above technical solution can more accurately determine the size of the adjusted sub-population, thereby providing a reliable basis for the adjustment of the sub-population, which helps to allocate computing resources more reasonably and helps to further increase the chance of finding a global optimal solution.
[0077] Exemplarily, step S120, initializing the population based on the hyperspectral image data, may specifically include the following steps S121 and S122.
[0078] In step S121 , the hyperspectral image data is clustered to obtain a clustering result of the hyperspectral image data, where the clustering result includes a plurality of clusters, and each of the plurality of clusters includes a plurality of bands.
[0079] In step S122, based on the clustering result, the population is initialized; wherein the bands in the band combination corresponding to each of the preset number of individuals correspond one-to-one to the multiple clusters.
[0080] Optionally, the method of clustering the hyperspectral image data may include but is not limited to a k-means clustering algorithm, a hierarchical clustering algorithm, a mean shift clustering algorithm, etc. In a specific embodiment of the present application, step S121, clustering the hyperspectral image data, includes: clustering the hyperspectral image data using a k-means clustering algorithm; wherein the k value is the same as the number of bands included in the individual. This algorithm is a relatively mature clustering algorithm with simple calculation and high efficiency. Applying it to clustering hyperspectral image data helps to improve clustering efficiency, and further helps to improve the efficiency of determining the target band subset.
[0081] In this example, the number of clusters included in the clustering result is the same as the number of bands in the band combination corresponding to the individual.
[0082] In the scheme of this example, the bands in the band combination corresponding to each of the preset number of individuals correspond to multiple clusters one by one. That is, for each band combination, the number of bands in the band combination is the same as the number of clusters, and each band in the band combination comes from a different cluster. In some embodiments, a band can be selected from each cluster to obtain an individual. The selection method can be random selection or selection according to a specific rule. For example, the bands in each cluster can be selected in order, which will not be described in detail.
[0083] For ease of understanding, the band combination corresponding to an individual is described below through a specific embodiment. In one embodiment, the number of clusters is 4, and the band combination corresponding to the individual is (1, 3, 5, 10), which means that the individual is composed of band 1 in the first cluster, band 3 in the second cluster, band 5 in the third cluster, and band 10 in the fourth cluster. For ease of description, the band corresponding to the first cluster is called the band at the first position, the band corresponding to the second cluster is called the band at the second position... The band corresponding to the Nth cluster is called the band at the Nth position.
[0084] In the above technical solution, the population is initialized based on the clustering result after clustering the hyperspectral image data. This method helps to improve the efficiency of population initialization, and further helps to improve the efficiency of hyperspectral band selection.
[0085] Exemplarily, step S122, initializing the population based on the clustering results, may specifically include the following steps: using an individual generation operation to generate a preset number of individuals in the population; wherein the individual generation operation includes: randomly selecting a band from each cluster in multiple clusters to obtain an individual.
[0086] In this embodiment, the band combination corresponding to each individual is obtained by randomly selecting a band from each cluster in the multiple clusters. This randomization method can reduce local complexity, ensure the diversity of individual combinations, avoid falling into a local optimal solution, and help to further increase the chance of finding a global optimal solution.
[0087] Exemplarily, step S140, iteratively optimizing the subpopulation based on the objective function value of each individual in the subpopulation, may specifically include the following steps: iteratively optimizing the subpopulation through selection operation, crossover operation and mutation operation in sequence based on the objective function value of each individual in the subpopulation.
[0088] In the scheme of this example, the subpopulation is iteratively optimized by selection operation, crossover operation and mutation operation in sequence. That is, for a subpopulation, the selection operation, crossover operation and mutation operation are performed in sequence during each iterative optimization. It can be understood that the selection operation can select individuals with better objective function values for operation to ensure that the subpopulation develops in a good direction. The crossover operation can enable individuals to interact and change continuously. The mutation operation can give individuals more possibilities. The scheme of this example uses selection operation, crossover operation and mutation operation to iteratively optimize the subpopulation in sequence, which not only helps to ensure the diversity of the subpopulation and avoid falling into the local optimal solution, but also enables the subpopulation to develop in a better direction during evolution. This scheme helps to further increase the chance of finding the global optimal solution.
[0089] Optionally, the selection operation includes: selecting individuals in the subpopulation based on the objective function value of each individual in the subpopulation to obtain a target individual subset.
[0090] In this optional embodiment, for each subpopulation, individuals in the subpopulation can be selected based on the objective function value of each individual in the subpopulation. The objective function value of an individual is proportional to the probability of being selected. That is, the larger the objective function value of an individual, the greater the probability of being selected in the selection operation. This helps to make the subpopulation evolve in a good direction as much as possible.
[0091] Optionally, the crossover operation includes: exchanging at least some of the different bands in the band combination corresponding to any two individuals in the target individual subset based on a preset crossover probability.
[0092] It can be understood that for any two individuals, the different bands between the two individuals refer to the different bands at the same position in the two individuals. For example, the band combination corresponding to one individual is (1,3,5,10), and the band combination corresponding to the other individual is (1,2,5,3). The different bands of the two individuals are the band at the second position and the band at the fourth position. After crossover, the band combinations corresponding to the two individuals can be (1,2,5,3) and (1,3,5,10) respectively.
[0093] As described above, after the selection operation, a target individual subset can be obtained, that is, a set of individuals selected by the selection operation. In this optional embodiment, any two individuals in the target individual subset can be crossed. For example, for each individual, another individual can be randomly selected in the target individual subset for comparison, and the same band of the two individuals at the same position remains unchanged, and different bands at the same position are exchanged with a preset crossover probability.
[0094] The preset crossover probability in this embodiment can be set as needed, for example, the computational cost and the functionality of the crossover operation can be comprehensively considered to determine the preset crossover probability. In a specific embodiment, the preset crossover probability can be 50%, that is, for different bands between two individuals, there is a 50% possibility of crossover exchange and a 50% possibility of not crossover exchange. 50% is a relatively balanced probability. By setting the preset crossover probability to 50%, this embodiment can ensure the functionality of "crossover" and help save computational costs.
[0095] Optionally, the mutation operation includes: for each individual in the target individual subset, mutating the individual based on a preset mutation probability to obtain a new individual. In the solution of this embodiment, the mutation operation can be performed on the target individual subset after the crossover operation, and each individual in the target individual subset is mutated based on a preset mutation probability to obtain a new individual.
[0096] It can be understood that the individual is mutated based on the preset mutation probability, that is, the band at each position in the band combination corresponding to the individual is mutated based on the preset probability to change the selected band at one position or multiple positions, thereby obtaining a new individual. The preset mutation probability can be set according to actual needs, and it can be a fixed probability or a probability that changes with the number of iterations.
[0097] In some embodiments, the preset mutation probability increases as the number of iterative optimizations increases. For example, the preset mutation probability is defined as r , the preset number threshold is 100, the minimum preset mutation probability r min is 0.01, the maximum preset mutation probability r max is 0.1, and the calculation formula of mutation probability in each iteration is:
[0098] r = r min + i / 100( r max - r min );
[0099] In the formula, i Represents the number of iterations. According to this formula, r As the number of iterations increases, it will gradually change linearly from 0.01 to 0.1.
[0100] In the above embodiment, the preset mutation probability increases with the number of iterative optimizations, which helps to improve the diversity of the subpopulation, avoid premature convergence, and explore new search spaces to further prevent the emergence of local optimal solutions. In short, this solution helps to increase the chance of finding a global optimal solution and can make the final target band subset closer to the optimal band.
[0101] Optionally, mutating the individual based on a preset mutation probability to obtain a new individual may specifically include the following steps: when mutating the individual to obtain a mutant individual different from the individual, comparing the objective function value of the mutant individual with that of the individual; when the objective function value of the mutant individual is greater than the objective function value of the individual, determining that the new individual is the mutant individual; when the objective function value of the mutant individual is less than or equal to the objective function value of the individual, determining that the new individual is the individual.
[0102] In this embodiment, the objective function values of the two individuals before and after the mutation can be compared, and the individual with the larger objective function value is retained as a new individual. It can be understood that the larger the objective function value, the better the "quality" of the individual. By retaining the individual with the larger objective function value as a new individual, this embodiment can ensure that the subpopulation always evolves in a good direction during the iterative optimization process, which helps to make the target band subset obtained in the end closer to the optimal band, that is, it helps to improve the accuracy of the result of the hyperspectral band selection.
[0103] Exemplarily, before iteratively optimizing each of the two subpopulations based on the objective function value of each individual in the subpopulation, the method further includes: segmenting the hyperspectral image data using an entropy rate superpixel segmentation method to obtain multiple superpixels.
[0104] It can be understood that each band is composed of many pixels, and superpixel segmentation divides these pixels, that is, divides the band, that is, divides the pixels included in the band into multiple superpixels.
[0105] In some embodiments, the superpixel segmentation result of hyperspectral data obtained using the entropy rate superpixel segmentation method can be expressed as ,in represents a superpixel set, represents the number of superpixels, Indicates superpixels, Indicates Each pixel in a superpixel.
[0106] The above-mentioned example solution can facilitate the calculation of the objective function in the subsequent steps by dividing the hyperspectral image data into multiple superpixels, which is beneficial to improving the efficiency of band selection.
[0107] For example, the objective function can be expressed as:
[0108] ;
[0109] ;
[0110] ;
[0111] in, represents the inter-class dispersion matrix, represents the intra-class dispersion matrix, represents the trace of the matrix, Indicates The number of pixels in a superpixel, It means The mean vector of superpixels, is the mean vector of all superpixels, represents the total number of superpixels, Indicates The first superpixel pixels, Represents the transpose of a matrix.
[0112] Understandably, The mean vector of superpixels is The mean vector of all superpixels is the average of the sum of the pixel values of all pixels in a superpixel, and the mean vector of all superpixels is the average of the sum of the mean vectors of each superpixel.
[0113] In this example, the objective function is It is understandable that in calculating individual When the objective function value is , its objective function value can be expressed as .
[0114] The following is a specific example of the present application, using a real data set to illustrate the application of the hyperspectral band selection method provided by the present application, so as to further describe the present application.
[0115] In this embodiment, the hyperspectral band selection method includes the following steps: segmenting the hyperspectral image data using an entropy rate superpixel segmentation method to obtain multiple superpixels; clustering the hyperspectral image data using a k-means clustering algorithm to obtain clustering results; initializing the population based on the clustering results; dividing the population into two subpopulations; for each of the two subpopulations, based on the objective function value of each individual in the subpopulation, iteratively optimizing the subpopulation through selection operations, crossover operations, and mutation operations in turn, and after each iterative optimization, adjusting the size of the subpopulation according to the result of iterative optimization of the subpopulation; when the number of iterative optimizations reaches a preset number threshold, searching for the maximum value of the objective function, wherein the individual corresponding to the maximum value of the objective function is the target band subset. The specific implementation of each step in this embodiment has been described in detail above and will not be repeated.
[0116] In this embodiment, the real datasets are derived from two sets of public hyperspectral datasets: the Botswana dataset and the Salinas dataset.
[0117] Figure 2 A real feature map of the Botswana dataset of one embodiment of the present application is shown, and the Botswana dataset uses satellite remote sensing images from the African region. After removing noise and water absorption bands, 145 bands are retained. The spatial resolution of each band is 1476×256 pixels, and the wavelength range covered is 400 to 2500 nanometers. This dataset contains 14 recognized feature types.
[0118] Figure 3 A real feature map of the Salinas dataset of one embodiment of the present application is shown. The Salinas dataset comes from the valley area of California, USA. After processing, 20 water absorption bands are removed, and finally 204 bands are retained. The spatial resolution of each band is 512×217 pixels, and the dataset includes 16 types of real features.
[0119] In this embodiment, the hyperspectral band selection method sets the number of selected bands to 30 (i.e., the number of bands in the band set corresponding to each individual is 30), the maximum number of iterations (i.e., the preset number threshold) is set to 100, the population size N=100 (i.e., the preset number is 100), and SVM is used and the Gaussian radial basis kernel function is selected for data classification. 20% of the data points in each class are randomly selected as the training set, and the rest are the test set. The classification results are analyzed using the overall accuracy (OA), average accuracy (AA), and consistency test Kappa coefficient. The classification accuracy result data are shown in Tables 1 and 2, and the classification result graph is shown in Tables 1 and 2. Figure 4 , Figure 5 As shown, Figure 4 A diagram showing the classification results of Botswana data in one embodiment of the present application is shown. Figure 5 A diagram showing the Salinas data classification results of an embodiment of the present application is shown.
[0120] Table 1 Classification accuracy of Botswana dataset
[0121]
[0122] Table 2 Classification accuracy of the Salinas dataset
[0123]
[0124] It can be seen from the classification accuracy of each type of ground objects and the specific values of the Kappa coefficient of the two sets of hyperspectral image data in Tables 1 and 2 that the band subsets of the hyperspectral band selection method of this embodiment have achieved good classification accuracy and Kappa coefficient for multiple data sets, indicating that this method can select band subsets suitable for hyperspectral image classification.
[0125] The method of this embodiment combines clustering with a global optimization algorithm. Through clustering, the size of the algorithm solution space can be reduced and the computational efficiency can be improved. The population size can be dynamically adjusted by using a feedback mechanism based on population quality, and computing resources can be dynamically allocated. The dual population structure can maintain a high diversity of the population. In summary, the solution of this embodiment can avoid premature convergence and falling into a local optimal solution, and effectively increase the chance of finding a global optimal solution.
[0126] According to another aspect of the embodiments of the present application, an electronic device is also provided. Figure 6 FIG. 1 is a schematic block diagram of an electronic device according to an embodiment of the present application. Figure 6 As shown, the electronic device 600 includes: a processor 610 and a memory 620. The memory 620 stores a computer program, and the processor 610 is used to execute the computer program to implement the above method.
[0127] According to another aspect of the embodiment of the present application, a computer-readable storage medium is also provided. The storage medium stores a computer program / instruction, and the computer program / instruction implements the above method when executed by the processor. The storage medium may include, for example, a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a portable compact disk read-only memory (CD-ROM), a USB memory, or any combination of the above storage media. The computer-readable storage medium may be any combination of one or more computer-readable storage media.
[0128] A person skilled in the art can easily understand the implementation structure, working principle and beneficial effects of the electronic device and the computer-readable storage medium by reading the above hyperspectral band selection method, which will not be described in detail here for the sake of brevity.
[0129] Although the exemplary embodiments have been described herein with reference to the accompanying drawings, it should be understood that the exemplary embodiments described above are merely exemplary and are not intended to limit the scope of the present application thereto. A person of ordinary skill in the art may make various changes and modifications therein without departing from the scope and spirit of the present application.
[0130] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0131] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed.
[0132] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present application can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0133] Similarly, it should be understood that in order to streamline the present application and assist in understanding one or more of the various aspects of the application, in the description of exemplary embodiments of the present application, the various features of the present application are sometimes grouped together into a single embodiment, figure, or description thereof.
[0134] Those skilled in the art will appreciate that, except for mutually exclusive features, all features disclosed in this specification and all processes or units of any method or device disclosed in this specification may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification may be replaced by an alternative feature that provides the same, equivalent or similar purpose.
[0135] Furthermore, those skilled in the art will appreciate that although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features from different embodiments is meant to be within the scope of the present application and to form different embodiments.
[0136] The various component embodiments of the present application may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or a digital signal processor (DSP) may be used in practice to implement some or all functions of some modules in the electronic device according to the embodiment of the present application. The present application may also be implemented as a device program (e.g., a computer program and a computer program product) for executing part or all of the methods described herein. Such a program implementing the present application may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0137] The above description is only a specific implementation method or an explanation of a specific implementation method of the present application, and the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be covered by the protection scope of the present application.
Claims
1. A hyperspectral band selection method, characterized in that: include: Acquire hyperspectral image data; Initializing a population based on the hyperspectral image data, wherein the population includes a preset number of individuals, and each of the preset number of individuals corresponds to a different band combination; Dividing the population into two sub-populations, wherein the two sub-populations each include the same number of individuals; For each of the two subpopulations, iteratively optimizing the subpopulation based on the objective function value of each individual in the subpopulation; When the number of iterations of the optimization reaches a preset number threshold, searching for the maximum value of the objective function, wherein the individual corresponding to the maximum value of the objective function is the target band subset; Wherein, the objective function is the trace of the ratio of the inter-class dispersion matrix to the intra-class dispersion matrix of the corresponding individual; The method further comprises: For each of the two subpopulations, After each iteration of the optimization, the size of the sub-population is adjusted according to the result of the iteration optimization of the sub-population; The result of the iterative optimization includes: the number of individuals of the two subpopulations updated by the current iterative optimization, and the objective function value of each individual in the subpopulation after the current iterative optimization; The sum of the numbers of individuals included in the two subpopulations after adjustment is the same as the sum of the numbers of individuals included in the two subpopulations before adjustment; The step of adjusting the size of the sub-population according to the result of iterative optimization of the sub-population includes: Based on the number of individuals updated by the two sub-populations through the current iteration optimization, the population update rate of the sub-population is calculated; Based on the objective function value of each individual in the subpopulation after the current iteration optimization, calculate the average objective value of the subpopulation; Adjusting the size of the sub-population based at least on the population update rate, the average target value, and the current size of the sub-population; The step of calculating the population update rate of the sub-population based on the number of individuals updated by the two sub-populations after the current iteration optimization comprises: calculating the population update rate of the sub-population by the following formula: in, represents the population renewal rate of the sub-population, , Respectively represent the number of individuals updated in the two subpopulations after the current iteration optimization, , Respectively represent the sizes of the two sub-populations currently described, Indicates the current size of the subpopulation. Indicates the number of individuals in the subpopulation that have been optimized and updated in the current iteration; The calculating the average target value of the sub-population based on the target function value of each individual in the sub-population after the current iteration optimization includes: calculating the average target value of the sub-population by the following formula: in, represents the average target value of the subpopulation, represents the subpopulation, represents the individuals in this subpopulation, represents the objective function value of the individuals in the subpopulation, Indicates the current size of the sub-population; The adjusting the size of the sub-population based at least on the population update rate, the average target value and the current size of the sub-population includes: adjusting the size of the sub-population by the following formula: in, represents the size of the subpopulation after adjustment, represents the preset quantity, represents the population renewal rate of the sub-population, represents the average target value of the subpopulation, , Respectively represent the average target values of the two subpopulations, Indicates the current size of the sub-population.
2. The hyperspectral band selection method according to claim 1, characterized in that: Initializing the population based on the hyperspectral image data comprises: Clustering the hyperspectral image data to obtain a clustering result of the hyperspectral image data, wherein the clustering result includes a plurality of clusters, and each of the plurality of clusters includes a plurality of bands; Initializing the population based on the clustering result; The bands in the band combination corresponding to each of the preset number of individuals correspond one-to-one to the multiple clusters.
3. The hyperspectral band selection method according to claim 2, characterized in that: Initializing the population based on the clustering result includes: Using an individual generation operation to generate a preset number of individuals in the population; The individual generation operation includes: A band is randomly selected from each of the multiple clusters to obtain an individual.
4. The hyperspectral band selection method according to claim 1, characterized in that: The iterative optimization of the sub-population based on the objective function value of each individual in the sub-population includes: Based on the objective function value of each individual in the sub-population, the sub-population is iteratively optimized through selection operation, crossover operation and mutation operation in sequence.
5. The hyperspectral band selection method according to claim 1, characterized in that: Before iteratively optimizing each of the two subpopulations based on the objective function value of each individual in the subpopulation, the method further includes: The hyperspectral image data is segmented using an entropy rate superpixel segmentation method to obtain a plurality of superpixels.
6. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a computer program, and the processor is used to execute the computer program to implement the method according to any one of claims 1 to 5.
7. A computer-readable storage medium, characterized in that: A computer program / instruction is stored, and when the computer program / instruction is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Method for selecting high-spectrum remote-sensing image wave band
CN104751176A
Classification-oriented hyperspectral image band selection method
CN113191287A