Methods, apparatus, equipment and media for hyperspectral endmember extraction combined with neighborhood constraints
By combining a neighborhood-constrained hyperspectral endmember extraction method, a score is constructed using spectral similarity and neighborhood consistency coefficients, and a unique pixel assignment is performed followed by iterative correction. This solves the accuracy and stability problems in hyperspectral endmember extraction and improves the accuracy and applicability of endmember extraction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA UNIV OF GEOSCIENCES (WUHAN)
- Filing Date
- 2026-06-09
- Publication Date
- 2026-07-10
AI Technical Summary
Existing hyperspectral endmember extraction techniques suffer from decreased accuracy and unstable iterative processes under mixed pixels and noise interference, making it difficult to meet the needs of practical applications.
By combining a hyperspectral endmember extraction method with neighborhood constraints, a modified competitive score is constructed by obtaining the spectral similarity and neighborhood consistency coefficient between candidate endmembers and pixels, and a unique pixel assignment is performed. Anomalies are corrected during the iteration process until the iteration stops.
In scenarios with mixed pixels and noise interference, it improves the accuracy and robustness of endmember extraction, reduces the allocation bias caused by isolated noise and boundary pixels, makes the iterative process more stable, avoids error accumulation, and is suitable for accurate demixing and material recognition.
Smart Images

Figure CN122368792A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and more specifically, to a method, apparatus, device, and medium for extracting hyperspectral endmembers by incorporating neighborhood constraints. Background Technology
[0002] Hyperspectral remote sensing imagery plays a crucial role in precision agriculture, mineral exploration, and environmental monitoring due to its rich spectral information. Hyperspectral unmixing is one of the core technologies for analyzing hyperspectral data, aiming to determine the presence of pure substances (i.e., endmembers) in the image and their abundance in each pixel. Therefore, accurately extracting endmembers from hyperspectral data is a key prerequisite for subsequent accurate unmixing and substance identification.
[0003] Existing endmember extraction techniques mainly include methods based on geometric features and methods based on statistical optimization. Methods based on geometric features include vertex component analysis, pixel purity index, and N... Methods like FINDR, based on the geometric distribution characteristics of the data space, can efficiently extract initial endmembers, offering advantages such as simple workflow and convenient deployment in conventional hyperspectral data processing. Methods based on statistical and optimization models, through regression and constraint optimization, can improve the adaptability of endmember solutions in certain scenarios, expanding the applicability of endmember extraction. However, these methods assume that at least one "pure pixel" (i.e., composed entirely of one type of material) must exist in the image, and endmembers are determined by finding the geometric vertices of the data cloud. In practical applications, the "pure pixel" assumption is often not met due to the mixed distribution of ground features, noise interference, and spectral fluctuations of boundary pixels. Mixed pixels are common in images, and endmember extraction methods relying solely on pixel spectral information are prone to local allocation biases. The iterative update process is susceptible to fluctuations caused by abnormal samples, leading to a decrease in extraction accuracy. Summary of the Invention
[0004] The problem addressed by this invention is how to improve the accuracy of endmember extraction.
[0005] To address the aforementioned problems, this invention provides a method, apparatus, device, and medium for extracting hyperspectral endmembers that incorporates neighborhood constraints.
[0006] In a first aspect, the present invention provides a method for extracting hyperspectral endmembers by incorporating neighborhood constraints, comprising: The spectral similarity between each candidate endmember and each pixel in the candidate endmember matrix is obtained, and the neighborhood distribution is statistically analyzed based on the pixel endmember attribution results of historical iterations to determine the neighborhood consistency coefficient of each candidate endmember. The candidate endmember matrix and the pixel are extracted based on spectral data. Based on the spectral similarity and the neighborhood consistency coefficient, a modified competitive score for each candidate endmember for each pixel is constructed. Based on the modified competitive score, each pixel is assigned a unique endmember affiliation. Based on the affiliation result, the spectral features of the corresponding candidate endmember in the candidate endmember matrix are updated. If the updated candidate endmember matrix does not meet the iteration stopping condition, the attribution result is corrected according to the corrected competition score based on the preset anomaly correction rule. Return to the step of obtaining the spectral similarity between each candidate endmember and each pixel in the candidate endmember matrix until the iteration stop condition is met, and output the final endmember extraction result.
[0007] Optionally, determining the neighborhood consistency coefficient of each candidate endmember based on the statistical neighborhood distribution of the pixel endmember attribution results from historical iterations includes: Based on the pixel end-member attribution results of the historical iterations, the proportion of each candidate end-member in the neighborhood is statistically analyzed to obtain the corresponding neighborhood consistency parameter.
[0008] Optionally, the step of assigning unique endmember affiliation to each pixel based on the modified competition score includes: The candidate end-cell with the highest corrected competitive score is taken as the unique assignment result of the corresponding cell; In response to the fact that the modified competition scores of multiple candidate endmembers corresponding to a pixel are all of the maximum value, the candidate endmember with the highest spectral similarity to the pixel is selected as the unique assignment result of the pixel. In response to the fact that the modified competition score and spectral similarity of the multiple candidate endmembers corresponding to a pixel are both at their maximum values, the candidate endmember with the smallest preset endmember index is selected as the unique assignment result of the pixel.
[0009] Optionally, the iteration stopping condition includes: The average spectral angle change between the candidate endmember matrix in the current iteration stage and the candidate endmember matrix in the previous iteration stage is less than the preset convergence threshold.
[0010] Optionally, the step of correcting the attribution result based on the corrected competition score according to the preset anomaly correction rule includes: For each pixel, if the difference between the maximum and the second largest value of the modified competition score of the corresponding candidate end-me is less than a preset first threshold, the pixel is determined to be a low-confidence pixel. In response to the updated candidate terminator matrix satisfying the anomaly correction trigger condition, For the low-confidence pixel, the corresponding candidate end-members are sorted from largest to smallest according to the corrected competition score, and the score difference between each pair of candidate end-members is obtained in sequence. When the score difference is greater than or equal to a preset second threshold, the candidate end-member corresponding to the smaller corrected competition score is assigned to the low-confidence pixel; otherwise, no correction operation is performed; wherein, the preset second threshold is greater than the preset first threshold. The anomaly correction triggering condition includes at least one of the following conditions: The difference in the average spectral angle change between two adjacent iterations is greater than a preset anomaly threshold; for any candidate endmember in the candidate endmember matrix of the current iteration stage, the change in the spectral features between two adjacent iterations is greater than a preset change threshold; the number of low-confidence pixels exceeds a preset percentage threshold of the total number of pixels.
[0011] Optionally, the hyperspectral endmember extraction method incorporating neighborhood constraints further includes: When the change in the spectral features of any candidate endmember in the candidate endmember matrix of the current iteration stage is greater than the preset change threshold in two adjacent iterations, the spectral features of the current iteration stage are weighted and fused with the spectral features of the previous iteration stage to update the spectral features of the current iteration stage. Wherein, a first weight is matched to the spectral features of the current iteration stage, and a second weight is matched to the spectral features of the previous iteration stage, wherein the second weight is greater than the first weight.
[0012] Optionally, the hyperspectral endmember extraction method incorporating neighborhood constraints further includes: During the initial iteration phase, the candidate endmember with the highest spectral similarity to each pixel is selected as the temporary endmember for the corresponding pixel. Based on the statistical neighborhood distribution of the temporary home endpoints, the neighborhood consistency coefficient of each candidate endpoint is determined.
[0013] Secondly, the present invention provides a hyperspectral endmember extraction device incorporating neighborhood constraints, comprising: The processing module is used to obtain the spectral similarity between each candidate endmember and each pixel in the candidate endmember matrix, and to determine the neighborhood consistency coefficient of each candidate endmember based on the statistical neighborhood distribution of the pixel endmember attribution results of historical iterations. The candidate endmember matrix and the pixel are extracted from the spectral data. The attribution module is used to construct a modified competitive score for each candidate endmember for each pixel based on the spectral similarity and the neighborhood consistency coefficient, perform unique endmember assignment for each pixel according to the modified competitive score, and update the spectral features of the corresponding candidate endmember in the candidate endmember matrix based on the attribution results. The correction module is used to correct the attribution result based on the correction competition score in response to the updated candidate end-member matrix not meeting the iteration stop condition, according to the preset anomaly correction rule. The iteration module is used to return the steps of obtaining the spectral similarity between each candidate endmember and each pixel in the candidate endmember matrix until the iteration stop condition is met, and output the final endmember extraction result.
[0014] Thirdly, the present invention provides an electronic device, including a memory and a processor; The memory is used to store computer programs; The processor is configured to, when executing the computer program, implement the hyperspectral endmember extraction method incorporating neighborhood constraints as described in the first aspect.
[0015] Fourthly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the hyperspectral endmember extraction method combined with neighborhood constraints as described in the first aspect.
[0016] The beneficial effects of the hyperspectral endmember extraction method combining neighborhood constraints of the present invention include: relying on the statistical neighborhood distribution of pixel endmember assignment results from historical iterations to determine the neighborhood consistency coefficient of each candidate endmember, and introducing spatial neighborhood information to participate in the calculation, which can overcome the limitations of single spectral features, and make pixels take into account the local spatial distribution pattern when performing endmember matching. Thus, in scenarios with a high proportion of mixed pixels and blurred ground feature boundaries, it can improve the spatial consistency and rationality of assignment determination, and reduce the allocation deviation caused by isolated noise and boundary pixels. Based on the fusion of spectral similarity and neighborhood consistency coefficient, a modified competitive score is constructed, and then the unique assignment of pixels is completed based on the score. The endmember spectral features are updated according to the assignment results. The spatial constraints and spectral features are weighted and fused, making the endmember update more in line with the distribution pattern of ground features in the whole area, and weakening the dependence on pure pixel assumptions. At the same time, the endmember spectrum is iteratively optimized by using whole-area assignment samples, which can improve the purity and representativeness of endmembers, make the iteration process more stable, and reduce the interference of abnormal samples on endmember updates. When the endmember set has not reached a convergence state, the attribution results are dynamically corrected according to the preset anomaly correction rules. This can identify and adjust the deviation allocation results in real time during the iteration process, suppress endmember mutations and iteration fluctuations caused by abnormal samples, improve the stability and convergence efficiency of the iteration process, avoid the accumulation and diffusion of errors in multiple iterations, and further ensure the accuracy of endmember extraction.
[0017] This invention integrates spatial neighborhood constraints into the entire process of spectral matching, competitive allocation, endmember updating, and iterative correction. This allows it to maintain high extraction accuracy and robustness in real-world hyperspectral scenarios where the pure pixel assumption is invalid and mixed pixel distribution is widespread. Without significantly increasing computational complexity and maintaining a simple workflow, it effectively mitigates local allocation bias and iterative instability caused by single spectral information. This results in endmembers that more closely approximate the spectra of real ground objects, making it more suitable for engineering applications requiring accurate unmixing and material identification. Attached Figure Description
[0018] Figure 1 This is a schematic flowchart of the hyperspectral endmember extraction method combined with neighborhood constraints according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the hyperspectral endmember extraction device combined with neighborhood constraints according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0019] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Although some embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present invention. It should be understood that the accompanying drawings and embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of protection of the present invention.
[0020] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.
[0021] The term "comprising" and its variations as used herein are open-ended, meaning "including but not limited to"; the term "based on" means "at least partially based on"; the term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments"; and the term "optionally" means "optional embodiments". Definitions of other terms will be given in the following description. It should be noted that the concepts of "first," "second," etc., mentioned in this invention are used only to distinguish different devices, modules, or units, and are not intended to limit the order of functions performed by these devices, modules, or units or their interdependencies.
[0022] It should be noted that the terms "a" and "a plurality of" used in this invention are illustrative rather than restrictive. Those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0023] The names of the messages or information exchanged between the multiple devices in the embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of these messages or information.
[0024] like Figure 1 As shown, an embodiment of the present invention provides a method for extracting hyperspectral endmembers by incorporating neighborhood constraints, comprising: Step S1: Obtain the spectral similarity between each candidate endmember and each pixel in the candidate endmember matrix, and statistically analyze the neighborhood distribution based on the pixel endmember attribution results of historical iterations to determine the neighborhood consistency coefficient of each candidate endmember. The candidate endmember matrix and the pixel are extracted based on spectral data.
[0025] Specifically, after acquiring hyperspectral data, feature extraction is performed first. For example, the Urban public hyperspectral dataset is used as the source of hyperspectral data. This dataset contains multiple typical urban land cover categories and has a large number of mixed pixels, making it suitable as validation data for hyperspectral endmember extraction methods. First, the dataset undergoes routine preprocessing to remove invalid and obviously anomalous bands. The preprocessed image is then organized into a hyperspectral data matrix, where each column represents the spectral vector of a pixel, and each row represents the reflectance information of a band. Vertex component analysis is used to extract features from the preprocessed data, resulting in a candidate endmember matrix that includes pixels and candidate endmembers. In the initial iteration phase, this candidate endmember matrix serves as the starting point for subsequent iterations and optimizations.
[0026] Methods such as Euclidean distance, Pearson correlation coefficient, and cosine similarity are used to calculate the spectral similarity between the spectral information of each pixel and the spectral information of each candidate endmember. Spectral similarity characterizes the degree of similarity / matching between the spectral curve of the candidate endmember and the spectral curve of the image pixel in terms of shape, numerical variation trend, and reflectance characteristics. It is the core quantitative basis for determining which type of land cover endmember a pixel is most likely to belong to, and is expressed as: , Among them, S k,j (t) This represents the spectral vector m of the k-th candidate endmember in the t-th iteration. k With the spectral vector y of the j-th pixel j The cosine similarity, or spectral similarity, between them, where k represents the candidate endmember index, j represents the pixel index, and m k (t-1)This represents the spectral vector of the k-th candidate endmember in the previous iteration (t-1 rounds), (m k (t-1) ) T y j This represents the inner product of the candidate endmember spectral vector and the pixel spectral vector from the previous round (t-1 round), reflecting the correlation between the two vectors. The larger the value, the closer the vectors are in direction. ||·||2 represents the L2 norm operation, max(0, The value is taken as the larger of the value and 0, which means that the lower limit of the similarity is truncated to 0, ensuring that the output similarity is always non-negative, and avoiding the negative correlation caused by spectral noise or outliers from affecting subsequent calculations.
[0027] By employing a Gaussian kernel function to perform weighted statistics on the assignment results of each pixel within the neighborhood, the weighted proportion is used as a neighborhood consistency coefficient to characterize the concentration and spatial regularity of the distribution of objects in the spatial neighborhood when the current pixel is assigned to a certain candidate end-member. This quantifies the spatial distribution pattern into a calculable neighborhood consistency coefficient, enabling the pixel end-member matching process to take into account both its own spectral characteristics and local spatial structure, effectively improving the rationality of the allocation of mixed pixels and boundary regions, and enhancing the spatial continuity of the overall results.
[0028] Step S2: Construct a modified competitive score for each candidate endmember for each pixel based on the spectral similarity and the neighborhood consistency coefficient, perform unique endmember assignment for each pixel based on the modified competitive score, and update the spectral features of the corresponding candidate endmember in the candidate endmember matrix based on the assignment results.
[0029] Specifically, the spectral similarity and neighborhood consistency coefficient of each candidate endmember corresponding to the same pixel are calculated using, for example, a weighted fusion, to obtain the corrected competition score of the candidate endmember corresponding to the current pixel. This corrected competition score reflects the degree of spectral matching and spatial consistency, and is expressed as: , Where, r k,j (t) Let C represent the corrected competitive score between the k-th candidate endmember and the j-th pixel in the t-th iteration, where λ represents the spatial constraint weight coefficient. k,j (t) Let represent the neighborhood consistency coefficient of the j-th pixel corresponding to the k-th candidate end-cell in the t-th iteration.
[0030] For each pixel, endmember unique assignment is performed using a modified competitive score. This involves iterating through the modified competitive scores of all candidate endmembers and selecting the candidate endmember that satisfies a preset rule as the assigned endmember for that pixel. For example, the candidate endmember with the highest score is chosen as the unique assigned endmember for that pixel. After all pixels are assigned, the spectral information of all pixels assigned to the same candidate endmember is statistically calculated. The calculated results are used to replace the original spectral information of the candidate endmembers, updating the corresponding endmember spectral features in the candidate endmember matrix. This optimizes the endmember spectra based on all effective pixels in the entire domain. The update of the spectral information of each candidate endmember is represented as follows: , Where, m k (t) Indicates the first The first iteration obtained A candidate endmember with updated spectral information, w k,j (t) Indicates the first In the first iteration The pixel is the first The weight of each endpoint.
[0031] Step S3: In response to the updated candidate end-member matrix not meeting the iteration stopping condition, the attribution result is corrected according to the corrected competition score based on the preset anomaly correction rule.
[0032] Specifically, when the iteration has not reached a stable convergence state, the allocation results may contain low-confidence pixels and abnormal biases. Continuing the iteration directly will lead to the accumulation and spread of errors. Based on preset anomaly correction rules, unreliable allocation results are identified and corrected to suppress abnormal fluctuations and improve the quality of iteration convergence. It is determined whether the updated candidate end-member matrix meets the preset iteration stopping conditions, such as whether the maximum number of iterations has been reached. If not, the preset anomaly correction rules are activated. First, it is determined whether the current assignment result meets the correction conditions corresponding to the preset anomaly correction rules. For example, if the loss function value during the iteration process is greater than the preset correction loss value, anomaly correction is activated. At this time, the assignment results of all pixels can be corrected, or only pixels that meet specific preset conditions can be corrected. For example, all pixels can be screened based on the correction competition score. For instance, the candidate end-members corresponding to each pixel can be sorted from largest to smallest according to the correction competition score, and the average difference of the top 10 correction competition scores can be obtained. Pixels with an average difference less than the preset average value are then corrected. For the pixels that are corrected, the candidate end-member corresponding to the second largest correction competition score is selected as the unique assignment result of the corrected end-member.
[0033] Step S4: Return to the step of obtaining the spectral similarity between each candidate endmember and each pixel in the candidate endmember matrix until the iteration stop condition is met, and output the final endmember extraction result.
[0034] This invention relies on the statistical neighborhood distribution of pixel endmember assignment results from historical iterations to determine the neighborhood consistency coefficient of each candidate endmember. By introducing spatial neighborhood information into the calculation, it overcomes the limitations of single spectral features, allowing pixels to consider local spatial distribution patterns during endmember matching. This improves the spatial consistency and rationality of assignment determination in scenarios with a high proportion of mixed pixels and blurred ground feature boundaries, reducing allocation bias caused by isolated noise and boundary pixels. A modified competitive score is constructed based on the fusion of spectral similarity and neighborhood consistency coefficient. The unique assignment of pixels is then completed based on the score, and the endmember spectral features are updated according to the assignment results. Spatial constraints and spectral features are weighted and fused, making the endmember update more consistent with the global ground feature distribution pattern and weakening the dependence on pure pixel assumptions. At the same time, iterative optimization of endmember spectra using global assignment samples can improve the purity and representativeness of endmembers, making the iteration process more stable and reducing the interference of abnormal samples on endmember updates. When the endmember set has not reached a convergence state, the attribution results are dynamically corrected according to the preset anomaly correction rules. This can identify and adjust the deviation allocation results in real time during the iteration process, suppress endmember mutations and iteration fluctuations caused by abnormal samples, improve the stability and convergence efficiency of the iteration process, avoid the accumulation and diffusion of errors in multiple iterations, and further ensure the accuracy of endmember extraction.
[0035] This invention integrates spatial neighborhood constraints into the entire process of spectral matching, competitive allocation, endmember updating, and iterative correction. This allows for high extraction accuracy and robustness even in real-world hyperspectral scenarios where the pure pixel assumption is invalid and mixed pixels are widely distributed. Without significantly increasing computational complexity and maintaining a simple workflow, it effectively mitigates local allocation bias and iterative instability caused by single spectral information. This results in endmembers that more closely approximate the real-world ground object spectra, making them more suitable for engineering applications requiring accurate unmixing and material identification.
[0036] Optionally, the step of determining the neighborhood consistency coefficient of each candidate endmember based on the statistical neighborhood distribution of the pixel endmember attribution results from historical iterations includes: Based on the pixel end-member attribution results of the historical iterations, the proportion of each candidate end-member in the neighborhood is statistically analyzed to obtain the corresponding neighborhood consistency parameter.
[0037] Specifically, the pixel endmember assignment results determined during the historical iteration process are read, i.e., the pixel endmember assignment results output in the previous iteration stage. This result records the unique candidate endmember number to which each pixel belongs. A spatial neighborhood window is constructed centered on the current pixel to be calculated, according to a preset neighborhood range. The neighborhood window can be in the form of a 4-neighborhood, an 8-neighborhood, or a local sliding window. For image edge pixels, only the actually obtainable effective neighboring pixels are used for the statistics. All pixels within the neighborhood window are traversed, and the number of pixels belonging to each candidate endmember is counted. The number of pixels belonging to a particular candidate endmember is divided by the total number of pixels within the neighborhood window to obtain the distribution ratio of that candidate endmember in the current neighborhood. This ratio is directly used as the neighborhood consistency parameter for the current pixel and its corresponding candidate endmembers. The larger the ratio, the more concentrated the distribution of the candidate endmember in the current neighborhood, and the higher the corresponding neighborhood consistency parameter.
[0038] This embodiment obtains the neighborhood consistency parameter by directly statistically analyzing the proportion of candidate endmembers in the neighborhood. The calculation method is simple and efficient, and can quickly quantify the spatial distribution pattern into a constraint index. This effectively enhances the spatial continuity and consistency of endmember attribution, improves the allocation reliability in mixed pixel, boundary pixel, and noisy pixel scenarios, and provides a stable and reliable spatial constraint basis for subsequent correction of competitive scoring.
[0039] Optionally, the step of assigning unique endmember affiliation to each pixel based on the modified competition score includes: The candidate end-cell with the highest corrected competitive score is taken as the unique assignment result for the corresponding pixel.
[0040] In response to the fact that the modified competition scores of the multiple candidate endmembers corresponding to a pixel are all at the maximum value, the candidate endmember with the highest spectral similarity to the pixel is selected as the unique assignment result of the pixel.
[0041] Specifically, the modified competition scores of all candidate endmembers corresponding to the current pixel are traversed, and the maximum modified competition score is selected. The candidate endmember corresponding to the maximum score is directly used as the unique assignment result of the current pixel. If multiple candidate endmembers of the current pixel have modified competition scores equal to the maximum score, the second-level judgment is entered. These candidate endmembers with the same modified competition score are traversed, and their spectral similarity with the current pixel is extracted. The maximum spectral similarity score is selected, and the candidate endmember corresponding to the maximum spectral similarity score is used as the unique assignment result of the current pixel.
[0042] In response to the fact that the modified competition score and spectral similarity of the multiple candidate endmembers corresponding to a pixel are both at their maximum values, the candidate endmember with the smallest preset endmember index is selected as the unique assignment result of the pixel.
[0043] Specifically, if, in the second-level determination, multiple candidate endmembers have the same maximum modified competition score and maximum spectral similarity score, the process proceeds to the third-level determination. The preset endmember indices of these candidate endmembers are read, and the candidate endmember with the smallest preset endmember index value is selected as the unique assignment result for the current pixel. This three-level determination rule is applied sequentially to each pixel in the image, completing the unique endmember assignment for all pixels.
[0044] This embodiment effectively resolves ambiguous scenarios where neither the corrective competition score nor spectral similarity can uniquely determine the end-member, through a three-level progressive attribution determination rule. This ensures that each pixel obtains a unique and reproducible attribution result, avoiding iterative fluctuations caused by fuzzy assignment. At the same time, it prioritizes spatial constraints and spectral matching degree during the determination process, improving the accuracy and reliability of pixel attribution results and providing a stable and reliable basis for global allocation for subsequent end-member spectral updates.
[0045] Optionally, the iteration stopping condition includes: The average spectral angle change between the candidate endmember matrix in the current iteration stage and the candidate endmember matrix in the previous iteration stage is less than the preset convergence threshold.
[0046] Specifically, after updating the candidate endmember matrix in each iteration, the candidate endmember matrix of the current iteration stage is read, denoted as the endmember matrix of the t-th iteration, and the candidate endmember matrix of the previous iteration stage is read, denoted as the endmember matrix of the (t-1)-th iteration. For each pair of corresponding endmembers in the matrix, i.e., the spectral vector of the k-th candidate endmember in the t-th iteration and the spectral vector in the (t-1)-th iteration, the spectral angle between them is calculated to obtain the change in spectral angle of the candidate endmember between the two iterations. The spectral angle changes of all candidate endmembers are iterated, and the average of all changes is calculated to obtain the average spectral angle change of the current iteration stage. The calculated average spectral angle change is compared with a preset convergence threshold, such as 10. -5 The comparison is performed. If the change in the average spectral angle is less than the preset convergence threshold, the current endmember matrix is determined to have reached a stable convergence state and the iteration stop condition is met. If it is greater than or equal to the preset convergence threshold, the endmember matrix is determined to still be in the process of updating and optimizing, and the next round of iteration process needs to be executed.
[0047] This embodiment determines the iteration stopping condition by the change in average spectral angle, which can accurately quantify the overall change in the endmember matrix. Under the premise of ensuring stable convergence of the endmember spectrum, the iteration process is terminated in a timely manner, effectively reducing the computational cost and avoiding redundant calculations and minor fluctuations caused by excessive iteration. At the same time, it provides a clear quantitative basis for the stability and reliability of the endmember extraction results.
[0048] Optionally, the step of correcting the attribution result based on the corrected competition score according to the preset anomaly correction rule includes: For each pixel, if the difference between the maximum and the second largest value of the modified competition score of the corresponding candidate end-member is less than a preset first threshold, the pixel is determined to be a low-confidence pixel.
[0049] Specifically, for each pixel in the image, the corrected competition score of all candidate endmembers corresponding to that pixel is read. The scores are sorted from largest to smallest, and the maximum and second largest corrected competition scores are extracted, with the difference between them calculated. This difference is compared to a preset first threshold. If the difference is greater than the preset first threshold (e.g., 0.03), the pixel is determined to be a low-confidence pixel, i.e., a pixel with ambiguous endmember assignment. If the difference is less than or equal to the preset first threshold, the pixel is determined to be a high-confidence pixel, and its original assignment result is retained without correction.
[0050] In response to the updated candidate terminator matrix satisfying the anomaly correction trigger condition, For the low-confidence pixel, the corresponding candidate end-members are sorted from largest to smallest according to the corrected competition score, and the score difference between each pair of candidate end-members is obtained in sequence. When the score difference is greater than or equal to a preset second threshold, the candidate end-member corresponding to the smaller corrected competition score is assigned to the low-confidence pixel; otherwise, no correction operation is performed; wherein, the preset second threshold is greater than the preset first threshold.
[0051] Specifically, after determining low-confidence pixels, it is further determined whether the anomaly correction trigger condition is met. If met, the anomaly correction process is initiated; if not met, the current assignment result is maintained, and the next iteration continues. Upon entering the anomaly correction process, all determined low-confidence pixels are traversed again. The candidate endmembers corresponding to the low-confidence pixels are sorted from largest to smallest score, and the score difference between every two candidate endmembers is calculated sequentially. This difference is compared with a preset second threshold, such as 0.2. If the difference is greater than or equal to the preset second threshold, the assignment result of the low-confidence pixel is corrected to the candidate endmember corresponding to the smaller corrected competitive score; if the difference is less than the preset second threshold, it indicates that although the pixel's score discrimination is insufficient, it does not reach the level requiring forced correction, and its original assignment result is retained without correction.
[0052] It should be noted that the preset first threshold is used to initially screen pixels with small differences in the correction competition scores from all pixels, i.e., low-confidence pixels whose end-member assignments are uncertain or ambiguous. Since the purpose of this stage is to identify potentially unstable pixels as much as possible and avoid omitting pixels with possible assignment ambiguities, the first threshold is set relatively small. When the difference between the largest and second-largest correction competition scores is lower than this threshold, the pixel is determined to be a low-confidence pixel. The preset second threshold is used to further screen pixels from the identified low-confidence pixels that truly require assignment correction. Only when the difference in the correction competition scores between candidate end-members reaches or exceeds the second threshold does it indicate a significant competitive difference between the candidate end-members, and the current assignment result may be affected by abnormal competition. In this case, correcting the low-confidence pixel to the candidate end-member corresponding to the lower correction competition score has higher reliability; otherwise, the original assignment result is retained without correction. Since this stage is the actual assignment correction process, to avoid over-correction, the preset second threshold must be greater than the preset first threshold, forming a stricter judgment condition to avoid incorrectly correcting slightly ambiguous pixels that do not require adjustment. A first preset threshold, "wide entry," ensures that all suspicious pixels are identified; a second preset threshold, "strict exit," ensures that only pixels meeting the significant difference condition are corrected. If the second preset threshold is less than or equal to the first preset threshold, a large number of blurry pixels will be forcibly corrected, leading to frequent assignment jumps, endmember oscillations, and iteration non-convergence.
[0053] The anomaly correction triggering condition includes at least one of the following conditions: The difference in the average spectral angle change between two adjacent iterations is greater than a preset anomaly threshold, such as 10. -4 ; For any candidate endmember in the candidate endmember matrix of the current iteration stage, the change in spectral characteristics between two adjacent iterations is greater than a preset change threshold, such as 5 × 10⁻⁶. -4 The number of low-confidence pixels exceeds a preset percentage threshold of the total number of pixels, such as 80%.
[0054] Specifically, if any of the above triggering conditions are met, the anomaly correction triggering condition is considered met, and the anomaly correction process is initiated; if not met, the current assignment result is maintained, and the next iteration continues. These anomaly correction triggering conditions enable timely initiation of the correction process when the endmember as a whole is not yet stable, when local endmembers exhibit abnormal fluctuations, or when there are too many fuzzy assigned pixels.
[0055] This embodiment, by classifying low-confidence pixels and combining them with multi-dimensional anomaly correction triggering conditions, can accurately identify unstable factors and fuzzy-assigned pixels in the iteration process. While ensuring overall computational efficiency, it effectively suppresses the interference of abnormal samples on the iteration, eliminates the assignment ambiguity caused by low-confidence pixels, significantly improves the stability and convergence quality of the iteration process, and ensures that the final endmember extraction results have higher accuracy and reliability in complex scenarios, providing more robust basic data support for hyperspectral unmixing and ground feature identification.
[0056] Optionally, the hyperspectral endmember extraction method incorporating neighborhood constraints further includes: When the change in the spectral features of any candidate endmember in the candidate endmember matrix of the current iteration phase is greater than the preset change threshold in two adjacent iterations, the spectral features of the current iteration phase are weighted and fused with the spectral features of the previous iteration phase to update the spectral features of the current iteration phase.
[0057] Wherein, a first weight is matched to the spectral features of the current iteration stage, and a second weight is matched to the spectral features of the previous iteration stage, wherein the second weight is greater than the first weight.
[0058] Specifically, after updating the candidate endmember matrix in each iteration, each candidate endmember in the matrix is traversed, and the spectral feature vector of the current iteration and the spectral feature vector of the previous iteration are read. The change amplitude between the two spectral features is calculated, and the spectral difference can be quantified by spectral angle, Euclidean distance, or cosine distance. The calculated change amplitude is then compared with a preset change threshold, such as 5×10. -4The comparison is performed. If the change amplitude is less than or equal to a preset change threshold, the endmember spectrum update is considered normal, and the spectral features of the current iteration are directly retained. If the change amplitude is greater than the preset change threshold, the endmember spectrum is considered to have abnormal fluctuations, and a weighted fusion update process needs to be initiated. For candidate endmembers identified as having abnormal fluctuations, a first weight is matched to the spectral features of the current iteration, and a second weight is matched to the spectral features of the previous iteration, where the second weight is greater than the first weight. For example, the first weight is 0.3, and the second weight is 0.7. It should be noted that the endmember results from the previous round always retain a larger weight to reduce the abrupt change amplitude of abnormal endmembers and improve the stability of the iteration process. The spectral features of the current iteration are multiplied by the first weight, and the spectral features of the previous iteration are multiplied by the second weight. The weighted results of the two are added together to obtain the fused spectral feature vector. This fused spectral feature vector replaces the original abnormal spectral feature vector of the current iteration, completing the spectral update of the candidate endmember. Iterate through all candidate endmembers and perform the above weighted fusion update operation on each candidate endmember with abnormal spectral changes to obtain the corrected candidate endmember matrix for the current iteration stage, which is used in subsequent iteration processes.
[0059] This embodiment effectively suppresses abrupt changes in endmember spectra caused by noise, abnormal pixels, and other factors during iteration by performing weighted fusion updates of spectral features from two rounds on candidate endmembers with abnormal spectral changes. It retains stable spectral features from the previous round with higher weights while appropriately introducing the optimization trend of the current round, achieving a smooth transition of abnormal endmember spectra. This ensures the stability and continuity of the iteration process, avoids the impact of abnormal fluctuations in a single round on subsequent allocation and convergence results, and improves the robustness and reliability of the final endmember extraction results.
[0060] Optionally, the hyperspectral endmember extraction method incorporating neighborhood constraints further includes: During the initial iteration phase, the candidate endmember with the highest spectral similarity to each pixel is selected as the temporary endmember for the corresponding pixel.
[0061] Based on the statistical neighborhood distribution of the temporary home endpoints, the neighborhood consistency coefficient of each candidate endpoint is determined.
[0062] Specifically, in the initial iteration phase, historical attribution results are not yet formed, making it impossible to directly perform neighborhood consistency statistics and spatial constraint calculations. Therefore, in the initial iteration phase after the iteration process starts, the initialized candidate endmember matrix and all image pixels extracted from hyperspectral data are first read. For each pixel, the spectral similarity between it and all candidate endmembers in the candidate endmember matrix is calculated, obtaining the spectral similarity values for each candidate endmember corresponding to that pixel. These spectral similarities are compared, and the candidate endmember with the largest spectral similarity value is selected as the temporary attribution endmember for the current pixel. This process is repeated for all pixels, determining a unique temporary attribution endmember for each pixel, thus completing the temporary attribution assignment for the entire image. After the temporary attribution results are determined, a corresponding neighborhood window is constructed centered on each pixel. Based on the aforementioned temporary attribution endmember results, the number of pixels attributing each candidate endmember within each neighborhood window is counted, and the distribution ratio of each candidate endmember within the corresponding neighborhood is calculated. This ratio is used as the neighborhood consistency coefficient for each candidate endmember corresponding to the current pixel, completing the determination of the neighborhood consistency coefficient in the initial iteration phase.
[0063] This embodiment determines temporary end-members by using the principle of maximum spectral similarity in the initial iteration stage. This enables the rapid construction of usable neighborhood distribution criteria even without historical iteration data, allowing the neighborhood consistency constraint mechanism to be enabled normally from the first iteration. This achieves synergy between spectral and spatial information from the beginning, effectively improving the rationality of pixel allocation in the initial iteration stage, reducing the interference of noise and mixed pixels on the initialization process, and providing a stable and reliable starting point for subsequent complete iterative optimization.
[0064] like Figure 2 As shown, an embodiment of the present invention provides a hyperspectral endmember extraction device 200 incorporating neighborhood constraints, comprising: The processing module 210 is used to obtain the spectral similarity between each candidate endmember and each pixel in the candidate endmember matrix, and to determine the neighborhood consistency coefficient of each candidate endmember based on the statistical neighborhood distribution of the pixel endmember attribution results of historical iterations. The candidate endmember matrix and the pixel are extracted from the spectral data. The attribution module 220 is used to construct a modified competitive score for each candidate endmember for each pixel based on the spectral similarity and the neighborhood consistency coefficient, perform unique endmember attribution assignment for each pixel according to the modified competitive score, and update the spectral features of the corresponding candidate endmember in the candidate endmember matrix based on the attribution results. The correction module 230 is used to correct the attribution result based on the correction competition score in response to the updated candidate end-member matrix not meeting the iteration stop condition, according to the preset anomaly correction rule. The iteration module 240 is used to return the steps of obtaining the spectral similarity between each candidate endmember and each pixel in the candidate endmember matrix until the iteration stop condition is met, and output the final endmember extraction result.
[0065] like Figure 3 As shown, an electronic device 300 provided in this embodiment of the invention includes a memory 310 and a processor 320; the memory 310 is used to store a computer program; the processor 320 is used to implement the hyperspectral endmember extraction method combined with neighborhood constraints as described above when the computer program is executed.
[0066] Alternatively, an electronic device 300 includes a memory 310 and a processor 320 coupled to the memory 310; the memory 310 is configured to store a computer program; and the processor 320 is configured to perform the following operations when the computer program is executed: The spectral similarity between each candidate endmember and each pixel in the candidate endmember matrix is obtained, and the neighborhood distribution is statistically analyzed based on the pixel endmember attribution results of historical iterations to determine the neighborhood consistency coefficient of each candidate endmember. The candidate endmember matrix and the pixel are extracted based on spectral data. Based on the spectral similarity and the neighborhood consistency coefficient, a modified competitive score for each candidate endmember for each pixel is constructed. Based on the modified competitive score, each pixel is assigned a unique endmember affiliation. Based on the affiliation result, the spectral features of the corresponding candidate endmember in the candidate endmember matrix are updated. If the updated candidate endmember matrix does not meet the iteration stopping condition, the attribution result is corrected according to the corrected competition score based on the preset anomaly correction rule. Return to the step of obtaining the spectral similarity between each candidate endmember and each pixel in the candidate endmember matrix until the iteration stop condition is met, and output the final endmember extraction result.
[0067] This invention provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the hyperspectral endmember extraction method combined with neighborhood constraints as described above.
[0068] Alternatively, a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform the following operations: The spectral similarity between each candidate endmember and each pixel in the candidate endmember matrix is obtained, and the neighborhood distribution is statistically analyzed based on the pixel endmember attribution results of historical iterations to determine the neighborhood consistency coefficient of each candidate endmember. The candidate endmember matrix and the pixel are extracted based on spectral data. Based on the spectral similarity and the neighborhood consistency coefficient, a modified competitive score for each candidate endmember for each pixel is constructed. Based on the modified competitive score, each pixel is assigned a unique endmember affiliation. Based on the affiliation result, the spectral features of the corresponding candidate endmember in the candidate endmember matrix are updated. If the updated candidate endmember matrix does not meet the iteration stopping condition, the attribution result is corrected according to the corrected competition score based on the preset anomaly correction rule. Return to the step of obtaining the spectral similarity between each candidate endmember and each pixel in the candidate endmember matrix until the iteration stop condition is met, and output the final endmember extraction result.
[0069] The present invention will now be described an electronic device 300 that can serve as a server or client of the present invention, which is an example of a hardware device that can be applied to various aspects of the present invention. Electronic device 300 is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic device 300 can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0070] Electronic device 300 includes a computing unit that can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) or a computer program loaded from a storage unit into random access memory (RAM). The RAM may also store various programs and data required for device operation. The computing unit, ROM, and RAM are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.
[0071] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc. In this application, the units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments of the present invention according to actual needs. Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated units can be implemented in hardware or as software functional units.
[0072] While the present invention has been disclosed above, its scope of protection is not limited thereto. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention, and all such changes and modifications will fall within the scope of protection of the present invention.
Claims
1. A method for extracting hyperspectral endmembers using neighborhood constraints, characterized in that, include: The spectral similarity between each candidate endmember and each pixel in the candidate endmember matrix is obtained, and the neighborhood distribution is statistically analyzed based on the pixel endmember attribution results of historical iterations to determine the neighborhood consistency coefficient of each candidate endmember. The candidate endmember matrix and the pixel are extracted based on spectral data. Based on the spectral similarity and the neighborhood consistency coefficient, a modified competitive score for each candidate endmember for each pixel is constructed. Based on the modified competitive score, each pixel is assigned a unique endmember affiliation. Based on the affiliation result, the spectral features of the corresponding candidate endmember in the candidate endmember matrix are updated. In response to the candidate end-member matrix not meeting the iteration stopping condition, the attribution result is corrected according to the corrected competition score based on the preset anomaly correction rule; Return to the step of obtaining the spectral similarity between each candidate endmember and each pixel in the candidate endmember matrix until the iteration stop condition is met, and output the final endmember extraction result.
2. The hyperspectral endmember extraction method combined with neighborhood constraints according to claim 1, characterized in that, The method of determining the neighborhood consistency coefficient of each candidate endmember by statistically analyzing the neighborhood distribution of the pixel endmember attribution results based on historical iterations includes: Based on the pixel end-member attribution results of the historical iterations, the proportion of each candidate end-member in the neighborhood is statistically analyzed to obtain the corresponding neighborhood consistency parameter.
3. The hyperspectral endmember extraction method combined with neighborhood constraints according to claim 1, characterized in that, The step of assigning unique endmember affiliations to each pixel based on the modified competitive score includes: The candidate end-cell with the highest corrected competitive score is taken as the unique assignment result of the corresponding cell; In response to the fact that the modified competition scores of multiple candidate endmembers corresponding to a pixel are all at the maximum value, the candidate endmember with the highest spectral similarity to the pixel is selected as the unique assignment result for the pixel. In response to the fact that the modified competition score and spectral similarity of the multiple candidate endmembers corresponding to a pixel are both at their maximum values, the candidate endmember with the smallest preset endmember index is selected as the unique assignment result of the pixel.
4. The hyperspectral endmember extraction method combined with neighborhood constraints according to claim 1, characterized in that, The iteration stopping conditions include: The average spectral angle change between the candidate endmember matrix in the current iteration stage and the candidate endmember matrix in the previous iteration stage is less than the preset convergence threshold.
5. The hyperspectral endmember extraction method combined with neighborhood constraints according to claim 4, characterized in that, The step of correcting the attribution result based on the preset anomaly correction rules and the corrected competition score includes: For each pixel, if the difference between the maximum and the second largest value of the modified competition score of the corresponding candidate end-me is less than a preset first threshold, the pixel is determined to be a low-confidence pixel. In response to the updated candidate terminator matrix satisfying the anomaly correction trigger condition, For the low-confidence pixel, the corresponding candidate end-members are sorted from largest to smallest according to the corrected competition score, and the score difference between each pair of candidate end-members is obtained in sequence. When the score difference is greater than or equal to a preset second threshold, the candidate end-member corresponding to the smaller corrected competition score is assigned to the low-confidence pixel; otherwise, no correction operation is performed; wherein, the preset second threshold is greater than the preset first threshold. The anomaly correction triggering condition includes at least one of the following conditions: The difference in the average spectral angle change between two adjacent iterations is greater than a preset anomaly threshold; for any candidate endmember in the candidate endmember matrix of the current iteration stage, the change in the spectral features between two adjacent iterations is greater than a preset change threshold; the number of low-confidence pixels exceeds a preset percentage threshold of the total number of pixels.
6. The hyperspectral endmember extraction method combining neighborhood constraints according to claim 5, characterized in that, Also includes: When the change in the spectral features of any candidate endmember in the candidate endmember matrix of the current iteration stage is greater than the preset change threshold in two adjacent iterations, the spectral features of the current iteration stage are weighted and fused with the spectral features of the previous iteration stage to update the spectral features of the current iteration stage. Wherein, a first weight is matched to the spectral features of the current iteration stage, and a second weight is matched to the spectral features of the previous iteration stage, wherein the second weight is greater than the first weight.
7. The hyperspectral endmember extraction method combining neighborhood constraints according to claim 1, characterized in that, Also includes: During the initial iteration phase, the candidate endmember with the highest spectral similarity to each pixel is selected as the temporary endmember for the corresponding pixel. Based on the statistical neighborhood distribution of the temporary home endpoints, the neighborhood consistency coefficient of each candidate endpoint is determined.
8. A hyperspectral endmember extraction device incorporating neighborhood constraints, characterized in that, include: The processing module is used to obtain the spectral similarity between each candidate endmember and each pixel in the candidate endmember matrix, and to determine the neighborhood consistency coefficient of each candidate endmember based on the statistical neighborhood distribution of the pixel endmember attribution results of historical iterations. The candidate endmember matrix and the pixel are extracted from the spectral data. The attribution module is used to construct a modified competitive score for each candidate endmember for each pixel based on the spectral similarity and the neighborhood consistency coefficient, perform unique endmember assignment for each pixel according to the modified competitive score, and update the spectral features of the corresponding candidate endmember in the candidate endmember matrix based on the attribution results. The correction module is used to correct the attribution result based on the correction competition score in response to the updated candidate end-member matrix not meeting the iteration stop condition, according to the preset anomaly correction rule. The iteration module is used to return the steps of obtaining the spectral similarity between each candidate endmember and each pixel in the candidate endmember matrix until the iteration stop condition is met, and output the final endmember extraction result.
9. An electronic device, characterized in that, Including memory and processor; The memory is used to store computer programs; The processor is configured to, when executing the computer program, implement the hyperspectral endmember extraction method incorporating neighborhood constraints as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program that, when executed by a processor, implements the hyperspectral endmember extraction method combined with neighborhood constraints as described in any one of claims 1 to 7.