Hyperspectral unmixing method, device, and readable storage medium

By extracting the central spectrum and local neighborhood features of hyperspectral images, generating conditional state information and performing cross-attention calculations, the problems of unmixing accuracy and spatial continuity of hyperspectral unmixing methods in complex scenes are solved, achieving more accurate abundance estimation and clearer ground feature boundaries.

CN122330029BActive Publication Date: 2026-08-04CHINA UNIV OF GEOSCIENCES (WUHAN)
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA UNIV OF GEOSCIENCES (WUHAN)
Filing Date
2026-06-05
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

Existing hyperspectral unmixing methods suffer from insufficient unmixing accuracy, poor spatial continuity, and easily blurred boundaries in complex scenarios, making it difficult to accurately decompose mixed pixels.

Method used

Conditional state information is generated by extracting the central spectrum and local neighborhood spatial features of the target pixel, and spatial-spectral fusion features are calculated based on cross-attention. The abundance vector is then calculated and reconstructed using a semi-fixed dictionary.

Benefits of technology

It significantly improves the accuracy of abundance estimation, the continuity of spatial distribution, and the clarity of ground feature boundaries in complex scenarios, effectively suppressing boundary leakage and component confusion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122330029B_ABST
    Figure CN122330029B_ABST
Patent Text Reader

Abstract

This application discloses a hyperspectral unmixing method, apparatus, and readable storage medium, relating to the field of hyperspectral image processing technology. The hyperspectral unmixing method includes: acquiring a hyperspectral image to be unmixed; identifying each pixel in the hyperspectral image as a target pixel and extracting the central spectrum and local neighborhood image patches of the target pixel; extracting spectral features of the central spectrum and generating conditional state information based on the central spectrum; extracting spatial features from the local neighborhood image patches and filtering the spatial features based on the conditional state information to obtain a subset of spatial features; performing cross-attention calculation on the spectral features and the spatial feature subset to obtain spatial-spectral fusion features; calculating the abundance vector of the target pixel based on the spatial-spectral fusion features; and collecting the abundance vectors of all pixels in the hyperspectral image to generate an abundance map corresponding to each candidate endmember. This application provides a solution to improve the accuracy and spatial continuity of hyperspectral unmixing in complex scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of hyperspectral image processing technology, and in particular to hyperspectral demixing methods, devices and readable storage media. Background Technology

[0002] Hyperspectral images, characterized by continuous spectral bands and high spectral resolution, can effectively characterize the differences in spectral responses of different land features or materials in the visible, near-infrared, and short-wave infrared ranges. Therefore, they have significant application value in tasks such as land feature identification, material analysis, environmental monitoring, and remote sensing interpretation. However, due to limitations in sensor spatial resolution, a pixel in a real hyperspectral image is usually not composed of a single land feature, but rather a mixture of multiple components, resulting in mixed pixel phenomena. Hyperspectral demixing technology aims to decompose the pixel spectrum into several endmember spectra and their corresponding abundance values, and is a key means to achieve sub-pixel-level land feature identification.

[0003] In recent years, deep learning-based hyperspectral unmixing methods have attempted to improve unmixing performance by automatically learning spatial-spectral features through autoencoders and attention mechanisms. However, these methods often directly and indiscriminately aggregate neighborhood features when utilizing spatial information. In reality, when a target pixel is located at the boundary of a land cover or in a heterogeneous region, its neighborhood often contains pixels with materials inconsistent with its own. Existing methods lack a precise mechanism to distinguish between neighborhood pixels and the target pixel, and can only aggregate this information indiscriminately, leading to boundary leakage, oversmoothing, spatial artifacts, and component confusion, which affects the accuracy of the unmixing results and the ability to preserve spatial structure. Summary of the Invention

[0004] The main objective of this application is to provide a hyperspectral unmixing method, device, and readable storage medium, aiming to solve the technical problems of insufficient unmixing accuracy, poor spatial continuity, and easy blurring of boundaries in existing hyperspectral unmixing methods under complex scenarios.

[0005] To achieve the above objectives, this application proposes a hyperspectral unmixing method, which includes: Obtain the hyperspectral image of the object to be unmixed; Each pixel in the hyperspectral image is identified as a target pixel, and the center spectrum and local neighborhood image patches of the target pixel are extracted. Extract the spectral features of the central spectrum and generate conditional state information based on the central spectrum; Spatial features are extracted from local neighborhood image patches, and the spatial features are filtered based on conditional state information to obtain a subset of spatial features; Cross-attention calculation is performed on spectral features and spatial feature subsets to obtain spatial-spectral fusion features; The abundance vector of the target pixel is calculated based on the spatial-spectral fusion feature. Abundance vectors of all pixels in the hyperspectral image are collected to generate abundance maps corresponding to each candidate endmember.

[0006] Optionally, the spectral features include original features and derivative features, and the conditional state information includes first information and second information; The steps of extracting spectral features from the central spectrum and generating conditional state information based on the central spectrum include: Calculate the derivative spectrum of the central spectrum; The original features are obtained by feature encoding of the central spectrum; By performing feature encoding on the derivative spectrum, derivative features are obtained; Preset statistics of the central spectrum and derivative spectrum are extracted respectively, and first information is generated based on the preset statistics of the central spectrum and derivative spectrum. The first information is used to characterize the spatial region attributes of the target pixel. Second information is generated based on a preset statistic of the derivative spectrum, wherein the second information is used to characterize the spectral complexity of the central spectrum; Optionally, the step of extracting spatial features from local neighborhood image patches includes: Extract multiple initial spatial feature maps of different scales from local neighborhood image patches; Based on the first information, the fusion weights of each initial spatial feature map are generated, and the initial spatial feature maps are weighted and fused according to the fusion weights to obtain spatial features.

[0007] Optionally, the step of filtering spatial features based on conditional state information to obtain a subset of spatial features includes: Flatten the spatial features into a sequence of spatial location units; Calculate the correlation score between each spatial location unit in the spatial location unit sequence and the target pixel based on the first information; The retention ratio is determined based on the second information, and the retention quantity K is determined based on the retention ratio and the total number of spatial location units; The top K spatial location units with the highest relevance scores are retained, and a subset of spatial features is generated based on the retained spatial location units.

[0008] Optionally, the step of performing cross-attention calculation on spectral features and spatial feature subsets to generate spatial-spectral fusion features includes: Using the original features as the first query, and each spatial location unit in the spatial feature subset as the first key and the first value, the similarity between the first query and the first key is calculated. The first value is then weighted and summed using the similarity to obtain the first attention feature. Using derivative features as the second query, and each spatial location unit of the spatial feature subset as the second key and the second value, the similarity between the second query and the second key is calculated. The second value is then weighted and summed using the similarity to obtain the second attention feature. The first attention feature and the second attention feature are fused to obtain the spatial spectrum fusion feature.

[0009] Optionally, the step of calculating the abundance vector of the target pixel based on the spatial-spectral fusion features includes: The spatial spectrum fusion features are mapped to initial scores corresponding to each candidate endmember; The initial score is sparsified to obtain the abundance vector of the target pixel. The number of non-zero abundance values ​​in the abundance vector of all pixels in the hyperspectral image does not exceed a preset threshold.

[0010] Optionally, the step of sparsifying the initial score to obtain the abundance vector of the target pixel includes: Sort the initial scores of each candidate terminal element from high to low. Based on the sorting results, select the j highest-scoring candidate terminal elements as target candidate terminal elements and the remaining candidate terminal elements as non-target candidate terminal elements. Here, j equals the preset threshold. The initial score of each target candidate endmember is normalized to obtain the abundance value of each target candidate endmember; Set the abundance value of non-target candidate endmembers to 0; According to the preset order of each candidate endmember, the abundance vector of the target pixel is formed by the abundance value of the target candidate endmember and the abundance value set to 0.

[0011] Optionally, after acquiring the hyperspectral image to be unmixed, the hyperspectral unmixing method further includes: Obtain an external spectral library, and resample the external spectral library based on the hyperspectral image to obtain the basic spectral library; A learnable residual matrix is ​​superimposed on a basic spectral library, and bounded constraints are imposed on the residual matrix to limit the adjustment range of the residual matrix, resulting in a semi-fixed dictionary; Following the step of calculating the abundance vector of the target pixel based on spatial-spectral fusion features, the hyperspectral unmixing method also includes: A semi-fixed dictionary is used to decode and reconstruct the abundance vector to generate a reconstructed spectrum; The reconstructed spectra of all pixels in the hyperspectral image are collected to generate a reconstructed hyperspectral image.

[0012] In addition, to achieve the above objectives, this application also proposes a hyperspectral demixing apparatus, the apparatus comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the hyperspectral demixing method as described above.

[0013] In addition, to achieve the above objectives, this application also proposes a readable storage medium, which is a computer-readable storage medium storing a program for implementing the hyperspectral demixing method. The program for implementing the hyperspectral demixing method is executed by a processor to implement the steps of the hyperspectral demixing method as described above.

[0014] The technical solution proposed in this application, after acquiring the hyperspectral image to be unmixed, first extracts the central spectrum and local neighborhood spatial features of the target pixel, respectively. Then, by setting up parallel spectral and spatial branches, on the one hand, the spectral branch extracts spectral features from the central spectrum and generates conditional state information to describe the pixel state based on the central spectrum. This information reflects attributes such as whether the target pixel is in a homogeneous region or a land cover boundary, and whether its spectral curve changes gently or drastically, thus enabling subsequent spatial processing to obtain a priori state indication of the current pixel. On the other hand, the spatial branch extracts spatial features of local neighborhood image patches and evaluates the correlation of each part of the spatial features based on the aforementioned conditional state information. Parts with strong correlation to the target pixel are retained, while parts with weak correlation or that may introduce interference are discarded, resulting in a filtered subset of spatial features. This filtering mechanism allows the spatial branch to actively exclude neighborhood information unrelated to the material composition of the current pixel, retaining only the spatial context that truly contributes to abundance estimation. The spectral features extracted from the spectral branch are then cross-attentionally calculated with the filtered spatial feature subset output from the spatial branch to generate spatial-spectral fusion features. The abundance vector of the target pixel is then calculated based on these fusion features. Finally, the abundance vectors of all pixels are aggregated to generate the abundance map corresponding to each candidate endmember. This approach solves the technical problem of existing hyperspectral unmixing methods struggling to balance unmixing accuracy, spatial continuity, and boundary preservation in complex scenarios. It significantly improves the accuracy of abundance estimation, the continuity of spatial distribution, and the clarity of ground feature boundaries in complex scenes, effectively suppressing boundary leakage and component confusion. Attached Figure Description

[0015] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0016] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 The overall structure diagram of the model provided for the hyperspectral unmixing method of this application; Figure 2 This is a schematic flowchart of the hyperspectral demixing method provided in Embodiment 1 of this application; Figure 3 This is a comparison of abundance diagrams provided in Example 1 of the hyperspectral unmixing method of this application; Figure 4 This is a structural diagram of the CMSSF module provided in Embodiment 3 of the hyperspectral demixing method of this application; Figure 5 This is a structural diagram of the UA-TSCA module provided in Embodiment 4 of the hyperspectral demixing method of this application; Figure 6 This application embodiment shows a schematic diagram of the hardware operating environment of the hyperspectral demixing method.

[0018] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0019] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application. To make the above-mentioned objectives, features, and advantages of this application more apparent and understandable, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0020] Example 1 With the rapid development of hyperspectral remote sensing technology, hyperspectral images, with their continuous and high-resolution spectral information, have demonstrated irreplaceable application value in fields such as geological exploration, precision agriculture, environmental monitoring, and urban remote sensing. However, limited by the spatial resolution of imaging sensors, hyperspectral images commonly exhibit mixed pixel phenomena, meaning that a single pixel often contains mixed spectra of multiple land features or materials. Existing unmixing methods struggle to accurately decompose each component and its proportion, resulting in problems such as insufficient spatial consistency, blurred boundaries, and difficulty in distinguishing weak features in complex scenes.

[0021] Based on this, the embodiments of this application propose a hyperspectral unmixing method in the first embodiment. The hyperspectral unmixing methods of each embodiment of this application can be applied to a hyperspectral image processing device, which may be a computer, server, embedded processing board, remote sensing data workstation, or other device with data processing capabilities. The device stores a computer program that implements the method, and the hyperspectral unmixing method of each embodiment is executed by running the computer program. The following description of the executing entity is omitted; please refer to... Figure 2 The hyperspectral unmixing method includes steps S10 to S70: Step S10: Obtain the hyperspectral image to be demixed.

[0022] It should be noted that the hyperspectral image in this embodiment is a three-dimensional data cube output by a hyperspectral imaging system, containing spatial height, spatial width, and spectral dimensions. Each spatial location corresponds to a continuous spectral curve, which is composed of reflectance or radiance values ​​in multiple bands. The hyperspectral image to be demixed in this embodiment can be raw data directly acquired by the hyperspectral imaging sensor, or data that has undergone preprocessing such as radiometric correction, atmospheric correction, and geometric correction, as long as it can provide spectral information of each pixel in different bands.

[0023] Furthermore, it should be noted that the acquired hyperspectral image is provided as input data to a pre-constructed dual-branch feature fusion network. This dual-branch feature fusion network refers to a neural network architecture containing two parallel processing branches: a spectral branch and a spatial branch. These branches are used to process the spectral and spatial information in the image, respectively. The two branches are independent in data processing and can be executed in parallel to improve processing efficiency. The above steps only represent the data input action and do not limit the subsequent specific operations within the network. Additionally, it should be noted that the specific network structure of this dual-branch feature fusion network is not fixed and can be reasonably designed according to actual needs. This embodiment does not impose specific limitations on this.

[0024] For example, in this specific implementation, the Urban hyperspectral dataset is used as an example. This dataset was acquired by a HYDICE (Hyperspectral Digital Imagery Collection Experiment) sensor, with an image size of 307×307 pixels. The original data contains 210 bands, and after removing bands with water vapor absorption and severe noise, 162 bands are selected as valid input. The preprocessed Urban dataset is used as the hyperspectral image to be demixed. It should be noted that this dataset was selected only for the purpose of illustrating the implementation process and effects of this embodiment, and does not mean that this embodiment is only applicable to this dataset or similar scenarios; other hyperspectral images are also applicable.

[0025] Step S20: Each pixel in the hyperspectral image is identified as a target pixel, and the center spectrum and local neighborhood image blocks of the target pixel are extracted.

[0026] It should be noted that by sequentially traversing all pixels in the hyperspectral image, each pixel is treated as a target pixel. For each target pixel, the central spectrum and local neighborhood image patches are extracted. The central spectrum of a target pixel refers to the sequence of reflectance or radiance values ​​in different bands, containing material information about the corresponding ground features. In mathematical expressions or neural network calculations, this is often represented by a spectral vector, i.e., a vector form of the reflectance value sequence. Specifically, the reflectance values ​​of all bands at the pixel location of the target pixel are read from the hyperspectral image, forming a vector with a length equal to the number of bands. A one-dimensional sequence, for example denoted as ,in This indicates the number of bands. Simultaneously, a pre-defined image region, or local neighborhood image patch, is extracted spatially, centered on the target pixel's location. This local neighborhood image patch contains spatial distribution information of neighboring pixels around the target pixel, such as the edges, textures, and homogeneous regions of ground features. It should be noted that although each pixel is spatially independent, the processing flow for each target pixel is the same, and the network parameters used in the processing are shared across the entire image, thus ensuring the consistency and globality of the unmixing results.

[0027] In one feasible implementation, the size of the local neighborhood image patch is predetermined, for example, a square region with an odd number of pixels in both height and width. In practice, the local neighborhood image patch can be considered as a subset of three-dimensional data with a size of... ,in Let be the spatial side length of the neighborhood. The band number is denoted by . Each spatial location in this local neighborhood image patch corresponds to a neighboring pixel, and each neighboring pixel has a complete spectral curve. By introducing local neighborhood image patches, spatial branching can simultaneously utilize the spectral information and spatial arrangement relationships of neighboring pixels, providing spatial continuity and boundary constraints for unmixing.

[0028] For example, in a specific implementation, the 307×307 pixels in the Urban hyperspectral dataset are sequentially used as target pixels to be processed. Specifically, a traversal approach can be adopted. For each target pixel, firstly, based on its pixel location, the reflectance values ​​of that pixel location across all 162 bands are read from the hyperspectral image, forming a one-dimensional spectral vector of length 162, which serves as the center spectrum of that target pixel. Simultaneously, a local neighborhood image patch of size 9×9 pixels is extracted from the hyperspectral image, centered on the pixel location of the target pixel. This image patch also contains 162 bands. The extracted center spectrum will be used for subsequent spectral branching processing, and the extracted local neighborhood image patch will be used for subsequent spatial branching processing.

[0029] Step S30: Extract the spectral features of the central spectrum and generate conditional state information based on the central spectrum.

[0030] It should be noted that the central spectrum extracted in step S20 is received as input via the spectral branch. This spectral vector is transformed and compressed through an internal encoding network to extract more discriminative and compact spectral features. Simultaneously, the central spectrum itself is analyzed to calculate a set of information describing the target pixel's state, namely, conditional state information. Specifically, the inherent attributes of the central spectrum, such as its numerical distribution, undulation morphology, and local rate of change, objectively reflect the spatial characteristics of the target pixel and the complexity of its spectral shape. For example, whether the target pixel is located at a land cover boundary or in a homogeneous region, or whether the spectral curve of the central spectrum is smooth or subject to drastic changes. In practical design, any method capable of generating pixel state information from spectral features is applicable. Of course, those skilled in the art can also use other equivalent encoding and mapping methods; this embodiment does not specifically limit this.

[0031] Understandably, the input to the spectral branch depends only on the central spectrum of the target pixel, not on its neighborhood information, so the spectral branch can be executed in parallel with the spatial branch.

[0032] Step S40: Extract spatial features from the local neighborhood image patch, and filter the spatial features based on the conditional state information to obtain a subset of spatial features.

[0033] It should be noted that for each target pixel's local neighborhood image patch, the spatial branch receives the local neighborhood image patch as input. Spatial features are extracted from this local neighborhood image patch through an internal coding network. These spatial features reflect the spatial distribution, texture, edges, and other structural information of the ground features. The extracted spatial features exist in the form of a spatial feature map, where each location corresponds to a spatial location in the local neighborhood; that is, each spatial location corresponds to a neighboring pixel. It is understandable that the input to the spatial branch does not depend on the completion time of the spectral branch; the two can be executed in parallel. It is important to emphasize that in the same forward propagation, the spectral branch first generates conditional state information. During this process, the spatial branch can perform preliminary spatial feature extraction on the local neighborhood image patch extracted in step S20 in parallel.

[0034] Based on this, the spatial branch calls upon the conditional state information generated by the spectral branch to evaluate different parts of the extracted spatial features. The purpose of the evaluation is to determine whether each spatial location in the spatial features is related to the current target pixel in terms of land cover composition. The evaluation can be based on spectral similarity, feature consistency, or other correlation measures, which are calculated from the conditional state information. According to the evaluation results, the spatial branch retains the parts that are strongly correlated with the target pixel and discards the parts that are weakly correlated or may introduce interference. In this way, the spatial features that originally contained all spatial locations are simplified into a subset containing only relevant spatial locations, namely the spatial feature subset. This embodiment does not limit the specific spatial feature extraction method or the specific algorithm for selection.

[0035] Step S50: Perform cross-attention calculation on the spectral features and the spatial feature subset to obtain the spatial-spectral fusion features.

[0036] It should be noted that cross-attention is a feature interaction mechanism used to fuse information from two different sources. In this embodiment, the spectral features obtained in step S30 are used as the query, and each element in the spatial feature subset obtained in step S40 is used as the key and value. By calculating the correlation between the query and the key, an attention weight is obtained. Then, the values ​​are weighted and summed using this weight to obtain a comprehensive feature representation that fuses spectral and spatial features, i.e., a spatial-spectral fusion feature. The specific implementation of cross-attention calculation can use standard scaled dot product attention or other variations, as long as it can achieve weighted aggregation of values ​​based on the similarity between the query and the key. This embodiment does not limit the specific mathematical form of the attention mechanism, nor does it limit the dimensions or number of heads of the query, key, and value, as long as it can achieve the interactive fusion between the spectral features and the spatial feature subset.

[0037] Step S60: Calculate the abundance vector of the target pixel based on the spatial-spectral fusion features.

[0038] It should be noted that the abundance vector refers to the set of proportions of each candidate endmember in the target pixel. Its dimension is the same as the total number of candidate endmembers, the value of each element in the set is between 0 and 1, and the sum of all elements is 1. Candidate endmembers refer to the types of pure substances that may exist in the hyperspectral image. Their set and order are predetermined, for example, endmembers selected from an external spectral library and arranged in a fixed order. In this embodiment, the spatial-spectral fusion features generated in step S50 are converted into abundance vectors that satisfy the above physical constraints. This conversion can be achieved in various ways, such as first compressing the spatial-spectral fusion features into an initial score equal to the number of candidate endmembers through linear transformation, and then obtaining the final abundance vector through sparsification and normalization functions. This embodiment does not limit the specific conversion method or the specific function, as long as it can calculate an abundance vector that satisfies the physical constraints based on the spatial-spectral fusion features. It should be noted that the obtained abundance vector corresponds one-to-one with the candidate endmembers, and their order is determined by the preset order of the candidate endmembers to ensure that the abundance vectors of different pixels have consistent interpretability.

[0039] Step S70: Collect the abundance vectors of all target pixels and generate the abundance map corresponding to each candidate endmember.

[0040] It should be noted that an abundance map is a two-dimensional image created by reorganizing the abundance values ​​of each candidate endmember across all pixels according to their spatial location in the hyperspectral image. Specifically, for each candidate endmember, the abundance values ​​corresponding to each candidate endmember are extracted from the abundance vector of each target pixel, and these abundance values ​​are reorganized according to the row and column order of the hyperspectral image to obtain the abundance map corresponding to each candidate endmember. The value of each pixel in the abundance map represents the abundance proportion of a certain candidate endmember at that location, thus visually displaying the spatial distribution of different land features or materials.

[0041] It is understood that this embodiment only involves the aggregation and spatial rearrangement of abundance vectors, and does not involve additional feature extraction or computation. Since the spatial size of the hyperspectral image is known, the abundance map of each candidate endmember can be obtained by arranging the abundance vectors of all target pixels sequentially according to their spatial indices. The generation of the abundance map is a routine output step of the hyperspectral unmixing method, and those skilled in the art can choose the storage format or visualization method as needed.

[0042] In a specific implementation, the method of this embodiment is experimentally verified using the Urban hyperspectral dataset described above as an example. The Urban hyperspectral dataset has different numbers of endmember settings; six endmembers are selected for illustration. The six endmember types include: asphalt pavement, grass, trees, rooftops, metal, and soil. The preprocessed Urban hyperspectral dataset is used as the hyperspectral image to be unmixed. This embodiment is executed according to steps S10 to S70 to obtain the abundance map corresponding to each candidate endmember, and the results are compared with various existing methods. For example... Figure 3 As shown, Figure 3 The image shows a comparison of abundance maps obtained by unmixing the Urban hyperspectral dataset using this embodiment and different methods. Figure 3 The abundance maps generated by the different methods are compared. It can be seen that the abundance map generated by the method in this embodiment is clearer in the boundary area and the distribution of ground features is more continuous. In particular, it has a better ability to distinguish spectrally similar endmembers, such as grassland and trees, thus verifying the effectiveness of this embodiment.

[0043] The experimental results are shown in Table 1.

[0044] Table 1 Comparison of Evaluation Indicators for the Urban Hyperspectral Dataset

[0045] Table 1 shows the proposed method, which is the method of this embodiment. On the Urban hyperspectral dataset, the RMSE (Root Mean Square Error) is 0.03146 ​​and the SRE (Signal Reconstruction Error ratio) is 16.227 dB, both of which are better than the comparison methods SUNSAL, SUNSAL-TV, S²WSU, MuCAEU and A2SN, indicating that the method of this embodiment has better spectral reconstruction capability and unmixing accuracy.

[0046] In this embodiment, parallel spectral and spatial branches are set up to extract the spectral features and local neighborhood spatial features of the target pixel, respectively. On the one hand, the spectral branch extracts spectral features from the spectrum of the target pixel and generates conditional state information describing the local state of the pixel based on these spectral features. This information reflects whether the target pixel is in a homogeneous region or a land cover boundary, and whether its spectral curve changes gently or drastically, thus enabling subsequent spatial processing to obtain a priori state indication of the current pixel. On the other hand, the spatial branch extracts spatial features of local neighborhood image patches around the target pixel and evaluates the correlation of each part of the spatial features based on the aforementioned conditional state information. Parts with strong correlation to the target pixel are retained, while parts with weak correlation or that may introduce interference are discarded, resulting in a filtered subset of spatial features. This filtering mechanism allows the spatial branch to actively exclude neighborhood information unrelated to the material composition of the current pixel, retaining only the spatial context that is truly helpful for abundance estimation. The spectral features extracted from the spectral branch are then cross-attentionally calculated with the filtered spatial feature subset output from the spatial branch to generate spatial-spectral fusion features. The abundance vector of the target pixel is then calculated based on these fusion features. Finally, the abundance vectors of all pixels are aggregated to generate the abundance map corresponding to each candidate endmember. This approach solves the technical problem of existing hyperspectral unmixing methods struggling to balance unmixing accuracy, spatial continuity, and boundary preservation in complex scenarios. It significantly improves the accuracy of abundance estimation, the continuity of spatial distribution, and the clarity of ground feature boundaries in complex scenes, effectively suppressing boundary leakage and component confusion.

[0047] Furthermore, this embodiment may also include steps of semi-fixed dictionary construction and decoding reconstruction to output a reconstructed hyperspectral image. Specifically, in this embodiment, the hyperspectral demixing method further includes steps S01 to S02: Step S01: Obtain an external spectral library and resample the external spectral library based on the hyperspectral image to obtain a basic spectral library.

[0048] It should be noted that, since the band settings of different hyperspectral sensors may differ, the spectral library needs to be resampled in order to align the endmember spectra in the external spectral library with the hyperspectral image to be demixed in the band dimension.

[0049] In one feasible implementation, spectral library resampling can be performed using interpolation. Specifically, the center wavelength sequence of the bands in the hyperspectral image to be demixed is used as the target abscissa, and the wavelength sequence of the original spectral library is used as the original abscissa. Interpolation is performed on the spectral curve of each candidate endmember to obtain a resampled spectrum that corresponds one-to-one with the bands of the target image. The interpolation method can be linear interpolation, spline interpolation, or piecewise cubic Hermite interpolation. Among these, linear interpolation is a commonly used choice due to its simple calculation and stable performance.

[0050] For example, in a specific implementation, the resampled basic spectral library can be denoted as ,in This indicates the number of effective bands in the input hyperspectral image. This indicates the number of candidate endmembers in the candidate spectral library. Their values ​​depend on the data used and the spectral library employed. For some public datasets, The range is roughly between 156 and 224. It can range from dozens to hundreds of types. For example, the Urban hyperspectral dataset... It is 162. The value is 651. It is understood that the above methods and parameters are merely examples, and those skilled in the art can configure them flexibly according to actual needs. This implementation does not impose specific limitations on them.

[0051] Step S02: A learnable residual matrix is ​​superimposed on the basic spectral library, and bounded constraints are applied to the residual matrix to limit the adjustment range of the residual matrix, thus obtaining a semi-fixed dictionary.

[0052] It should be noted that, in order to preserve the physical interpretability of the basic spectral library and adapt to spectral variations in real-world scenarios, this embodiment also constructs a semi-fixed dictionary. The design of the semi-fixed dictionary aims to balance the physical interpretability of the basic spectral library with the ability to adapt to spectral variations in real-world scenarios.

[0053] For example, in a specific implementation, the basic spectral library obtained by resampling is used. As a fixed anchor point, a learnable residual matrix is ​​superimposed. Furthermore, bounded constraints are used to limit the adjustment range of the residuals within a controllable range. Its mathematical expression can be represented as:

[0054] in, For the final semi-fixed dictionary, To and Learnable residual matrices of the same size This is the scaling factor for the residual magnitude.

[0055] With this design, the semi-fixed dictionary always centers on the basic spectral library and only allows for minor adjustments within a controlled range. This allows it to maintain its correspondence with the known spectral library while adapting to spectral variations caused by lighting, weathering, and other factors in real images.

[0056] Furthermore, in another feasible embodiment, after the aforementioned step of calculating the abundance vector of the target pixel based on the spatial-spectral fusion features, the hyperspectral unmixing method further includes steps S03 to S04: Step S03: Decode and reconstruct the abundance vector using the semi-fixed dictionary to generate a reconstructed spectrum.

[0057] It should be noted that decoding and reconstruction is the process of mapping the estimated abundance vector back to the original spectral space, used to verify the accuracy of the abundance estimation or generate additional output. Specifically, for each target pixel, its abundance vector is multiplied by a constructed semi-fixed dictionary to obtain the reconstructed spectral vector.

[0058] For example, in a specific implementation, the abundance vector for each target pixel can be represented as: The constructed semi-fixed dictionary is Using a semi-fixed dictionary The specific calculation formula for decoding and reconstructing the abundance vector can be expressed as:

[0059] in, To reconstruct the spectrum, This represents the abundance value of the pixel across all candidate endmembers.

[0060] Since each endmember spectrum in the semi-fixed dictionary has a clear physical meaning, the reconstructed spectrum can be understood as a synthetic spectrum composed of estimated abundance values. The difference between the reconstructed spectrum and the center spectrum of the target pixel can be used as part of the loss function to train network parameters. Simultaneously, the reconstructed spectrum itself can also serve as an additional output of the unmixing method, allowing users to evaluate the unmixing quality.

[0061] Step S04: Collect the reconstructed spectra of all pixels in the hyperspectral image to generate a reconstructed hyperspectral image.

[0062] It should be noted that the reconstructed hyperspectral image is a complete data cube obtained by rearranging the reconstructed spectra of each target pixel according to its original spatial position. In one feasible implementation, the reconstructed hyperspectral image can be output as an additional result of the final unmixing.

[0063] In this embodiment, an external spectral library is acquired and resampled to obtain a basic spectral library aligned with the hyperspectral image bands. A learnable residual matrix is ​​then superimposed on this basic spectral library, and bounded constraints are applied to construct a semi-fixed dictionary. Since the basic spectral library itself has a clear physical meaning, and the learnable residual matrix is ​​only slightly adjusted within a controlled range, this dictionary can both maintain the correspondence with the standard spectral library and adapt to spectral variations caused by factors such as illumination, weathering, and surface roughness in real-world scenarios. The semi-fixed dictionary significantly improves robustness to spectral mismatch while maintaining the interpretability of the unmixing results. Based on this, this embodiment further utilizes the semi-fixed dictionary to decode and reconstruct the abundance vector, generating a reconstructed spectrum, and then aggregates all reconstructed spectra to obtain a reconstructed hyperspectral image. The comparison between the reconstructed image and the original image can intuitively verify the accuracy of the abundance estimation, enhancing the verifiability and reliability of the scheme and providing more complete technical support for the practical application of hyperspectral unmixing methods.

[0064] Example 2 Based on the first embodiment described above, a second embodiment of the hyperspectral demixing method of this application is proposed. In this embodiment, content that is the same as or similar to that in the first embodiment can be referred to the above description and will not be repeated hereafter. Based on this, this embodiment provides a specific implementation of step S30 and provides an exemplary description of the specific types of spectral features. Specifically, step S30 includes steps S31 to S35: Step S31: Calculate the derivative spectrum of the central spectrum.

[0065] It should be noted that derivative spectroscopy reflects the rate of change of the spectral curve with wavelength, highlighting subtle spectral features and shape variations that are not easily noticeable in the central spectrum. In this embodiment, introducing derivative spectroscopy helps enhance the spectral differences between different materials, especially in cases where endmember spectra are highly similar or where there are weak signal endmembers; derivative spectroscopy can provide more discriminative information. This embodiment does not limit the specific calculation method of derivative spectroscopy, as long as it can generate a spectral sequence reflecting its local variation characteristics based on the central spectrum.

[0066] In one feasible implementation, the derivative spectrum can be obtained by performing a first-order difference on the central spectrum, or by using a higher-order difference or a more complex derivative estimation algorithm.

[0067] For example, in a specific implementation, the spectral vector of the central spectrum is represented as: The corresponding band center can be represented as: ,in Let be the number of bands. Then, by considering the first-order difference between the band spacings, the spectral vector of the derivative spectrum is calculated. , its first The value is:

[0068] in, For the first The reflectivity values ​​at each band correspond to the center wavelength of that band. (Unit: nanometers) For the first One derivative spectral value.

[0069] Furthermore, in one feasible implementation, a scaling factor can also be set. The spectral vector of the derivative spectrum is scaled to obtain the scaled spectral vector of the derivative spectrum. ,Right now:

[0070] in, , and This is a preset constant. Scaled It is still used as the derivative spectrum for subsequent processing, by adjusting... The value of this factor can control the influence weight of the derivative spectrum in subsequent processing, preventing the dominant role of the central spectrum from being weakened due to excessively large or small derivative amplitudes. This scaling factor can be a fixed parameter or an adaptively determined parameter by the network.

[0071] Step S32: Encode the features of the central spectrum to obtain the original features.

[0072] Step S33: Perform feature encoding on the derivative spectrum to obtain the derivative features.

[0073] It should be noted that in this embodiment, the spectral features include original features and derivative features. To fully utilize the complementary information between the original and derivative spectra, this embodiment constructs parallel original and derivative branches, performing independent feature encoding on the central spectrum and derivative spectrum, respectively. Feature encoding refers to converting the input spectral vector into a more discriminative and compact feature representation through nonlinear mapping. This embodiment does not limit the specific encoding network structure. The original and derivative features obtained after encoding will be used as the output of the spectral branch for subsequent interaction with the spatial feature subset. Among them, the original features retain global information such as the overall spectral shape, absorption peak position, and reflectance amplitude of the central spectrum, while the derivative features highlight the local rate of change and subtle absorption features. The two complement each other, jointly constituting a more complete spectral representation, which helps to improve the ability to distinguish highly similar endmembers.

[0074] In one feasible implementation, the central spectral vector obtained in the above steps is... The input is the encoding network of the original branch, which adopts a Transformer encoder structure containing three encoding layers. Each encoding layer includes a multi-head attention mechanism and a feedforward network, and the output feature dimension is 128. The encoder performs a sequence-to-sequence transformation on the center spectrum, extracts the dependencies between bands, and then obtains the original features of fixed length through global average pooling, which are generally represented in vector form.

[0075] Similarly, the derivative spectral vector from the above steps... Or after scaling by a scaling factor The derivative branch's encoding network is used. The derivative branch employs the same Transformer encoder structure as the original branch to ensure consistent feature dimensions in the outputs of both branches, facilitating subsequent fusion. The derivative features are obtained through the same encoding and pooling operations. It should be noted that the encoding network parameters for the two branches can be trained independently or partially shared; this embodiment does not impose such limitations.

[0076] Step S34: Extract preset statistics of the central spectrum and the derivative spectrum respectively, and generate the first information based on the preset statistics of the central spectrum and the derivative spectrum, wherein the first information is used to characterize the spatial region attributes of the target pixel.

[0077] It should be noted that the preset statistics refer to numerical values ​​calculated from the spectral vector that can summarize its statistical distribution characteristics, such as mean, standard deviation, energy, maximum value, minimum value, skewness, kurtosis, etc. In this embodiment, a set of preset statistics is extracted from the spectral vector of the central spectrum and the spectral vector of the derivative spectrum, and these preset statistics are combined to obtain a comprehensive statistical feature representation. Specifically, these preset statistics can be concatenated into a vector, or their weighted sum can be calculated by weighted averaging, or these preset statistics can be input into a fusion network to obtain a fused vector. The final result is the statistical feature representation. Then, feature transformation is performed on the statistical feature representation to obtain the first information. The feature transformation can be a linear transformation or a nonlinear mapping, for example, implemented through a lightweight mapping network or a simple fully connected layer. The first information is usually in the form of a low-dimensional vector, used to characterize the spatial regional attributes of the target pixel, that is, to indicate whether the target pixel is located inside the homogeneous area of ​​the ground object or near the boundary of the ground object. Those skilled in the art can also use other equivalent generation methods, and this embodiment does not specifically limit them.

[0078] In one feasible implementation, three statistics are extracted from the central spectral vector: mean, standard deviation, and energy. Three more statistics are extracted from the derivative spectral vector: absolute mean, standard deviation, and energy. These six statistics are concatenated into a six-dimensional statistical feature vector. This six-dimensional statistical feature vector is input into a lightweight mapping network. The lightweight mapping network first performs layer normalization on the input to stabilize the training process, then increases the dimension from 6 to 128 through a fully connected layer, and performs non-linear activation using the GELU function. Finally, it passes through another fully connected layer to map the 128-dimensional features back to 128 dimensions, outputting a 128-dimensional conditional vector, i.e., the first information. It should be noted that the first information reflects the spatial regional attributes of the target pixel. For example, when the target pixel is located in a homogeneous region, its neighborhood spectrum changes less, and the variance of the statistics is smaller; when it is located in a boundary region, the variance of the statistics is larger, thus guiding subsequent processing strategies. It is understood that the above steps are merely examples, and those skilled in the art can adjust them according to actual needs.

[0079] Step S35: Generate the second information based on the preset statistics of the derivative spectrum, wherein the second information is used to characterize the spectral complexity of the central spectrum.

[0080] It should be noted that spectral complexity, or the degree of change in the spectral curve, refers to the magnitude of the change in the central spectral curve between adjacent bands. More dramatic changes indicate a more complex spectral shape, typically corresponding to a higher degree of ground cover mixing or location in a boundary region. Conversely, gentler changes indicate a simpler spectral shape, corresponding to a relatively homogeneous ground cover composition. The second piece of information is an indicator reflecting the spectral complexity of the central spectrum, calculated from the spectral vector of the derivative spectrum. This second piece of information is usually a scalar, such as the absolute value, mean, standard deviation, energy, or maximum value of the spectral vector of the derivative spectrum. This embodiment does not specifically limit the choice of statistical measure.

[0081] In one feasible implementation, the second information can be directly selected as the mean of the absolute values ​​of the derivative, that is, the absolute value of each component is extracted from the spectral vector of the derivative spectrum, and then the arithmetic mean of all absolute value components is calculated, and this average value is used as the second information. The larger the average value, the larger the overall amplitude of the spectral vector of the derivative spectrum, that is, the more drastic the change in the spectral curve of the central spectrum, and the higher the complexity of the spectral shape; conversely, the smaller the average value, the smoother the change in the spectral curve of the central spectrum, and the lower the complexity of the spectral shape. It is understood that this embodiment only uses the mean of the absolute values ​​of the spectral vector of the derivative spectrum as an example, and those skilled in the art can also use other statistical measures to generate the second information, and this embodiment does not impose specific limitations on this.

[0082] In this embodiment, the derivative spectrum of the central spectrum is calculated, and the central spectrum and derivative spectrum are respectively feature-encoded to obtain the original features and derivative features. Since the original features retain the global information of the central spectrum, while the derivative features highlight the rate of change and subtle absorption characteristics of the central spectrum, the two features complement each other, characterizing the spectral properties of the target pixel from different perspectives. Different spectral curves of the same land cover type may show overall reflectance shifts, but their local absorption characteristics still exist. Introducing derivative spectroscopy helps to identify subtle variations of the same material, thereby improving the stability of distinguishing highly similar materials and scenes with different spectra of the same material. This dual-branch feature extraction method, compared to using only the original spectral features, can more comprehensively characterize the spectral properties of the target pixel. Especially in scenes with highly similar endmembers or weak signal endmembers, derivative features can amplify subtle differences between spectra, thus significantly improving the ability of the demixing algorithm to distinguish similar materials. Building upon this foundation, this embodiment further generates first information and second information by extracting preset statistics from the central spectrum and derivative spectrum. These two types of information characterize the state of the target pixel from different dimensions, and can more accurately reflect the region type of the target pixel and the spectral complexity of the light center spectrum. This further enhances the method's ability to identify highly similar endmembers and weak signal endmembers in complex scenes, thereby providing richer and more accurate prior guidance for subsequent processing and laying a solid foundation for improving the accuracy of the entire unmixing method.

[0083] Example 3 Based on the first embodiment, the second embodiment, or a combination of the two embodiments described above, a third embodiment of the hyperspectral demixing method of this application is proposed. In this embodiment, content that is the same as or similar to the above embodiments can be referred to the above description and will not be repeated hereafter. Based on this, this embodiment provides a feasible implementation of the aforementioned steps; specifically, step S40 includes steps S41 to S42: Step S41: Extract multiple preset initial spatial feature maps of different scales from local neighborhood image patches.

[0084] It should be noted that, in order to improve the accuracy of the abundance values ​​of each candidate endmember in hyperspectral unmixing, relying solely on the spectral features of the target pixel itself is often insufficient. Therefore, spatial features need to be introduced as a supplement. This embodiment uses a local neighborhood image patch extracted centered on the target pixel as input. Through spatial branching, multiple preset initial spatial features of different scales are extracted from the local neighborhood image patch, resulting in multiple initial spatial feature maps corresponding to different spatial ranges or receptive fields. Here, different scales refer to the different sizes of the spatial ranges corresponding to these initial spatial feature maps. Initial spatial feature maps with smaller spatial ranges can reflect the local fine structures of ground objects, such as object edges and texture details, while initial spatial feature maps with larger spatial ranges can reflect a broader homogeneous regional context. By extracting multiple initial spatial features at different scales, large-scale context can be fully utilized to suppress noise in homogeneous regions, while small-scale details can be preserved at object boundaries or in heterogeneous regions to avoid cross-object confusion, thereby improving the accuracy and spatial continuity of hyperspectral unmixing.

[0085] In one feasible implementation, the spatial branch can first perform preliminary spatial-spectral encoding on local neighborhood image patches, converting them from a three-dimensional hyperspectral image into a two-dimensional spatial feature map. Then, based on this two-dimensional spatial feature map, multiple initial spatial feature extractions at different scales are performed, resulting in multiple initial spatial feature maps at different scales. The extraction of initial spatial features at multiple different scales can be accomplished by setting multiple parallel two-dimensional convolutional layers, each using a different receptive field. The division of different scales can be determined by the size of the receptive field. The smaller the receptive field, the finer the captured details; the larger the receptive field, the broader the captured context. In this embodiment, the initial spatial feature maps at different scales can be represented as: ,in, Indicates the first The initial spatial feature map output by each scale branch In this embodiment, Setting it to 3 means setting three parallel convolutional branches corresponding to three different scales. Each branch uses a different receptive field to capture the corresponding initial spatial features.

[0086] For example, in a specific implementation, the spatial branch can employ two lightweight 3D convolutional layers to perform joint spatial-spectral encoding of local neighborhood image patches. Specifically, taking the Urban hyperspectral dataset from the above steps as an example, with an extracted size of... The local neighborhood image patch is used as input, where For the number of bands. The spatial branch first employs two lightweight 3D convolutional layers for joint spatial-spectral encoding: the first 3D convolutional layer uses... The first convolutional kernel has 16 output channels; the second 3D convolutional layer uses... The convolutional kernel has 32 output channels. Subsequently, global average pooling is performed along the spectral dimension to compress the three-dimensional features. A two-dimensional spatial feature map is generated, where each spatial location corresponds to a 32-dimensional feature vector, fusing spectral and spatial information from the original neighboring pixels. Then, three initial spatial feature maps at different scales are extracted in parallel from this two-dimensional spatial feature map. In practical implementation, a single... Two-dimensional convolutional branches extract small-scale feature maps Experiencing the Wild Used to capture the edges and texture details of terrain features; using a Two-dimensional convolutional branches extract mesoscale feature maps Experiencing the Wild Used to obtain spatial structures of medium range; using a Two-dimensional convolutional branches extract large-scale feature maps Experiencing the Wild This is used to obtain context from a large, homogeneous region. This results in three initial spatial feature maps. It should be noted that the above-described 3D convolution is merely an example, and those skilled in the art can flexibly adjust it according to actual needs. This embodiment does not impose specific limitations on it.

[0087] Step S42: Generate fusion weights for each initial spatial feature map based on the first information, and then weight and fuse the initial spatial feature maps according to the fusion weights to obtain the spatial features.

[0088] It should be noted that, in order to fully utilize the complementary information contained in spatial feature maps at different scales, this embodiment dynamically calculates the fusion weights of the initial spatial feature maps at each scale based on the first information generated by the spectral branch. The first information characterizes the spatial regional attributes of the target pixel, such as whether it is located in a homogeneous region or at a land cover boundary. Therefore, the weights generated accordingly can adaptively adjust the contribution ratio of features at different scales in the fusion process. For example, increasing the weight of scale features in homogeneous regions can smooth noise, while increasing the weight of scale features at land cover boundaries or in heterogeneous regions can preserve details. This embodiment does not limit the specific method of weight generation or the specific algorithm of weighted fusion, as long as it allows for the combination of the initial spatial feature maps according to their weights.

[0089] In one feasible implementation, the first information is input into a lightweight mapping network, which outputs a vector with a dimension equal to the number of initial spatial feature maps. This vector is then converted into fusion weights corresponding to each scale using a normalization function. The sum of the weights is 1, and each weight value is between 0 and 1. Then, each initial spatial feature map is multiplied by its corresponding weight, and the results are summed element-wise to obtain the weighted fused spatial features.

[0090] Exemplarily, in a specific implementation, reference is made to Figure 4 A CMSSF (Conditional Multi-Scale Spatial Fusion) module can be used to complete the process of weighted fusion of initial spatial feature maps to obtain spatial features. Specifically, this embodiment uses multiple parallel convolutional branches to extract multiple initial spatial feature maps at different scales. In this embodiment The CMSSF module receives these initial spatial feature maps and first information.

[0091] First, the initial information is input into an MLP (Multilayer Perceptron) and mapped by the MLP. The original scores are then converted into three fusion weights using the Softmax function. The sum of all fusion weights is 1, and the specific calculation formula can be expressed as:

[0092] in, , The mapping function represents the multilayer perceptron. Indicates the first piece of information. This represents the total number of parallel convolutional branches.

[0093] Next, each initial spatial feature map is multiplied by its corresponding fusion weight, and then summed element by element to obtain the fused spatial features. This spatial feature can be represented as:

[0094] in, Indicates the first The initial spatial feature map output by each convolutional branch.

[0095] Understandable, Figure 4 The CMSSF module shown is merely one specific implementation of this embodiment. Those skilled in the art can make adaptive adjustments according to actual needs, and this embodiment does not impose specific limitations in this regard. Furthermore, Figure 4The Chinese terms used in this application, such as "multi-scale feature extraction," "3×3 convolution with dilation of 1 / 2 / 3," "scale-level reweighting," "weighted fusion," "multilayer perceptron," and "normalized exponential function," are functional descriptions of the operations in this embodiment or aids in understanding based on direct translation from English. They are intended to help understand the role of each module and are not strict definitions of technical terms. Those skilled in the art should understand that these operations generally have recognized names or equivalent implementations in this technical field. The scope of protection for the above operations in this application is determined by the textual description in the specification; the annotations in the drawings are for illustrative purposes only and do not constitute a limitation on specific naming.

[0096] In this embodiment, relying solely on the spectral features of the target pixel itself is often insufficient to obtain accurate abundance estimation in the field of hyperspectral unmixing, especially when different land features have similar spectra or the target pixel is located in complex areas such as land feature boundaries, where the distinguishing ability of spectral information is limited. Therefore, this embodiment introduces spatial branching and extracts spatial features as a supplement, utilizing the spatial distribution characteristics of neighboring pixels to constrain abundance estimation, thereby improving the continuity and boundary preservation ability of unmixing. The spatial branching in this embodiment first extracts multiple preset initial spatial feature maps at different scales from local neighboring image patches, simultaneously acquiring initial spatial feature maps at multiple scales, providing a rich spatial information foundation for subsequent fusion and overcoming the contradiction that a single scale cannot simultaneously address noise suppression and boundary preservation. Then, the fusion weights of the initial spatial feature maps at each scale are dynamically generated using the first information, and the multi-scale feature maps are weighted and fused according to these weights. The first information directly characterizes the spatial region attributes of the target pixel. The fusion weight generated based on this information enables the spatial branch to automatically increase the weight of scale features in homogeneous regions to make full use of the smoothing effect, and to automatically increase the weight of scale features in ground feature boundaries or heterogeneous regions to preserve details. This allows for more accurate matching of the spatial region type where the pixel is located, and significantly improves the unmixing accuracy of the boundary region while maintaining spatial continuity.

[0097] Example 4 Based on the first, second, and third embodiments, or a combination of these three embodiments, a fourth embodiment of the hyperspectral demixing method of this application is proposed. In this embodiment, content that is the same as or similar to the above embodiments can be referred to the above description, and will not be repeated hereafter. Based on this, this embodiment provides a feasible implementation of the aforementioned steps. For ease of understanding, please refer to... Figure 5 An optional structural model can be adopted, which is used to implement steps S40 to S50.

[0098] Based on this, this embodiment further refines step S40. Specifically, step S40 includes steps A441 to A444: Step A441: Flatten the spatial features into a sequence of spatial location units.

[0099] It should be noted that flattening refers to converting the aforementioned spatial features from a two-dimensional spatial feature map into a one-dimensional sequence, enabling subsequent independent correlation assessment and filtering for each spatial location. The spatial features themselves are spatial feature maps with fixed height, width, and number of channels. Each spatial location corresponds to a feature vector, which encodes the spatial spectral information of its neighboring pixels. Flattening does not change the values ​​of the feature vectors at each location; it only arranges them into a spatial sequence. Each element in the sequence is called a spatial location unit, or spatial token. The flattened sequence retains the original index order of the spatial locations but transforms the two-dimensional relationship of the spatial structure into a linear order, thus facilitating subsequent operations.

[0100] For example, in a specific implementation, the above-mentioned spatial features are used. For example, this spatial feature The size can be expressed as ,in, and They are height and width, respectively. Let be the number of channels. The flattening operation unfolds this spatial feature along the spatial dimension, resulting in a vector of length . sequence Each of them It is The dimensional feature vector corresponds to the th feature in the corresponding space. The spatial locations are arranged in either row-major or column-major order. The flattening process does not involve any numerical calculations; it only changes the organization of the data, thus preserving no information. The flattening order can be from left to right or from top to bottom; the specific order does not affect the correctness of subsequent processing, as long as it remains consistent. The flattened sequence provides a set of spatial location units that can be directly processed one by one in subsequent steps.

[0101] Step A442: Calculate the correlation score between each spatial location unit in the spatial location unit sequence and the target pixel based on the first information.

[0102] It should be noted that the correlation score is used to measure the degree of matching between each spatial location unit and the target pixel in terms of land cover composition. The higher the score, the greater the probability that the neighboring pixel and the target pixel belong to the same type of land cover. In this embodiment, the correlation of each spatial location unit in the spatial location unit sequence is calculated using the first information. Specifically, the spatial location unit and the conditional vector are mapped to the same discriminant space using a learnable projection matrix, and then the inner product between the two is calculated as the score.

[0103] In one feasible implementation, for each spatial location unit Its corresponding relevance score The specific calculation formula is as follows:

[0104] in, and For learnable projection matrices, Let represent a learnable matrix that linearly maps tokens in the space. Let represent the learnable matrix that performs a linear mapping on the first piece of information. This represents the inner product operation. The correlation score is used to characterize the degree of matching between the state of each neighboring pixel and the target pixel. Its detailed process can be represented as follows: First of all Projecting onto a discriminant space can be specifically represented as:

[0105] Next, the first information It is also projected into the same discriminant space, which can be specifically represented as:

[0106] Finally, calculate the inner product of these two projection results:

[0107] The larger the inner product value, the better the spatial location unit matches the state of the target pixel.

[0108] For example, in a specific implementation, in this embodiment, each spatial location unit It can be a 32-dimensional feature vector, the first information It can be 128-dimensional. Then set the projection matrix. Mapping 32 dimensions to 64 dimensions Map 128 dimensions to 64 dimensions. Then calculate each... and The inner product of these two factors yields 81 relevance scores. It should be noted that the above process is merely an example, and those skilled in the art can make adaptive adjustments according to actual needs. This embodiment does not impose specific limitations in this regard.

[0109] Step A443: Determine the retention ratio based on the second information, and determine the retention quantity K based on the retention ratio and the total number of spatial location units.

[0110] It should be noted that the retention ratio controls how many spatial location units most relevant to the target pixel are selected from all spatial location units to participate in subsequent interactions. This retention ratio is not a fixed value, but is dynamically determined based on the second information. When the spectral complexity of the target pixel is high, more spatial location units are retained to obtain richer contextual information; when the spectral complexity is low, fewer spatial location units are retained to avoid redundant information interference.

[0111] In one feasible implementation, the second information is a scalar, which can be represented as follows during actual computation: The retention ratio is calculated using a sigmoid function with learnable parameters, ranging from 0 to 1. Subsequently, the retention ratio and the total number of spatial units are considered. Calculate the actual number of units retained. The calculation is rounded up to ensure that at least one unit is retained. The specific formula for calculating the retention ratio can be expressed as:

[0112] in, To retain the proportion, This is the Sigmoid function, which maps the input to the interval (0,1). and As learnable parameters, the network automatically adjusts their values ​​through training, so that... Able to be based on The change adaptively increases or decreases.

[0113] Subsequently, the number of items retained It can be determined by the following calculation formula:

[0114] in, The total number of spatial location units. The rounding up symbol. The value range is 1 to Integers between [a certain range].

[0115] It is understandable that the above and The value of can be flexibly adjusted according to the actual training data, and the value of the second information also varies with different pixels. and It is also dynamically determined.

[0116] Step A444: Retain the top K spatial location units with the highest relevance scores, and generate a spatial feature subset based on the retained spatial location units.

[0117] It should be noted that after obtaining the correlation scores of all spatial location units and determining the number to be retained... After determining the specific values, the most relevant pixels to the target pixel are selected from all spatial location units in descending order of relevance score. One unit is retained, and the remaining spatial units are discarded directly. Each spatial location unit is organized into a new set based on its respective feature vector, which is called the spatial feature subset. Spatial location units with higher relevance scores have neighboring pixels that are more similar to the target pixel in terms of land cover composition. Retaining these spatial location units helps provide the most valuable spatial context for subsequent abundance estimation. Conversely, low-scoring spatial location units may carry information from the other side of the boundary or heterogeneous regions; discarding them effectively avoids interference. The final spatial feature subset contains only neighborhood information highly correlated with the target pixel, providing clean input for subsequent processing.

[0118] After obtaining the spatial feature subset, the spectral features extracted from the spectral branch are further fused with this spatial feature subset through cross-attention to generate spatial-spectral fusion features, thereby enhancing the synergistic representation of spectral and spatial features. Accordingly, step S50 includes steps S51 to S53: Step S51: Using the original features as the first query, and each spatial location unit in the spatial feature subset as the first key and the first value, calculate the similarity between the first query and the first key, and use the similarity to perform a weighted summation of the first value to obtain the first attention feature.

[0119] It's important to note that the core of cross-attention computation lies in matching the query of one sequence with the key of another sequence, and then weighting and aggregating the values ​​based on the weights obtained from the matching. In this embodiment, the spectral branch uses the original features generated by the original branch as the query, and each spatial location unit in the spatial feature subset simultaneously serves as both the key and the value. By calculating the similarity between the query and the key, the attention weight of each spatial location unit is obtained. These weights are then used to weight and sum the corresponding values, resulting in a feature vector that integrates the target spectral information and the most relevant spatial information—the first attention feature. The first attention feature highlights the neighborhood information that best matches the spectral characteristics of the target pixel.

[0120] Step S52: Using the derivative feature as the second query, and each spatial location unit in the spatial feature subset as the second key and the second value, calculate the similarity between the second query and the second key, and use the similarity to perform a weighted summation of the second value to obtain the second attention feature.

[0121] Similar to the steps described above, in this embodiment, the spectral branch uses the derivative features generated by the derivative branch as a query, and performs cross-attention calculations with each spatial location unit in the spatial feature subset. The derivative features highlight the rate of change and subtle absorption characteristics of the central spectrum, capturing the spatial information most relevant to changes in the central spectrum, thereby compensating for the deficiencies of the original features in local details.

[0122] In a specific implementation, the query sequence generated for any spectral branch can be represented as follows: The output of cross-attention can be represented as:

[0123] in A subset of spatial features The function is a standard cross-attention operation.

[0124] Step S53: The first attention feature and the second attention feature are fused to obtain the spatial-spectral fusion feature.

[0125] It should be noted that the first attention feature integrates target spectral information with the most relevant spatial information, while the second attention feature integrates derivative spectral information with the most relevant spatial information. Fusing these two features fully utilizes the complementary relationship between the original and derivative features, preventing one feature from masking the other, thus obtaining a more comprehensive joint spatial-spectral representation.

[0126] In one feasible implementation, a concatenation method can be used to directly connect the first attention feature and the second attention feature along the channel dimension, resulting in a joint feature vector whose dimension is the sum of the dimensions of the two features, which serves as the spatial-spectral fusion feature. Alternatively, other methods such as weighted summation or gated fusion can also be used; those skilled in the art can select an appropriate fusion strategy based on actual needs.

[0127] For ease of understanding, in one feasible implementation, reference is made to Figure 5 An optional structural model can be adopted, which is used to implement steps S40 to S50. Figure 5 The internal processing flow of this module is demonstrated. It is understandable that... Figure 5The Chinese terms used in this application, such as "spatial location unit scoring," "retention ratio," "top k counts," "top k spatial location unit selection," "average pooling," "layer normalization and linear layer," and "cross-attention based on selected spatial location units," are functional descriptions of the operations in this embodiment or aids in understanding based on direct translation from English. They are intended to help understand the role of each module and are not strict definitions of technical terms. Those skilled in the art should understand that these operations generally have recognized names or equivalent implementations in this technical field. The scope of protection for the above operations in this application is subject to the textual description in the specification; the annotations in the drawings are for illustrative purposes only and do not constitute a limitation on specific naming.

[0128] In this embodiment, the correlation score between each unit and the target pixel is calculated using the first information, which can assess the degree of correlation between each location in the neighborhood and the central pixel in terms of material composition. Based on this, the retention ratio is dynamically determined according to the second information, and only spatial location units are retained according to the score from high to low, while irrelevant units with low scores are directly discarded and not involved in subsequent calculations. This fundamentally eliminates interfering information from the other side of the boundary or heterogeneous regions, effectively suppressing boundary leakage, spatial artifacts, and component confusion. Simultaneously, the number of units retained adaptively adjusts with the complexity of the spectral shape, achieving a balance between screening efficiency and information fidelity. Next, the spatial feature subset is cross-attention calculated with the original features and derivative features respectively, and the two attention results are then fused. This allows the spectral features to actively query the most relevant spatial locations, avoiding blind aggregation and fully utilizing the complementarity between the overall information of the original spectrum and the changing information of the derivative spectrum. This significantly improves the anti-interference ability, boundary preservation ability, and the ability to distinguish spectral similar endmembers in complex scenarios, improving the abundance estimation accuracy and spatial continuity.

[0129] Example 5 Based on the first, second, third, and fourth embodiments, or a combination of these four embodiments, a fifth embodiment of the hyperspectral unmixing method of this application is proposed. In this embodiment, content that is the same as or similar to the above embodiments can be referred to the above description and will not be repeated hereafter. Based on this, this embodiment provides a feasible implementation of the aforementioned step of calculating the abundance vector of the target pixel based on spatial-spectral fusion features. Step S60 further includes steps S61 to S62: Step S61: Map the spatial spectrum fusion features to the initial scores corresponding to each candidate endmember.

[0130] It should be noted that while the spatial-spectral fusion feature contains both spectral and spatial information of the target pixel, it cannot be directly used as an abundance vector. After spatial-spectral fusion is completed, a prediction head linearly maps the spatial-spectral fusion feature into a score vector with a length equal to the total number of candidate endmembers. Each element in this score vector corresponds one-to-one with a candidate endmember, representing the initial score of that endmember.

[0131] In one feasible implementation, the initial score can be expressed as: ,in, This represents the number of candidate endmembers. A higher score indicates that the network believes the candidate endmember is more likely to exist in the current pixel.

[0132] Step S62: The initial score is sparsified to obtain the abundance vector of the target pixel, wherein the number of non-zero abundance values ​​in the abundance vector of all pixels in the hyperspectral image does not exceed a preset threshold.

[0133] It should be noted that the initial score only represents the relative probability of each candidate endmember; its numerical range is not normalized, and it usually has more non-zero elements, which may not necessarily satisfy the sparsity constraint of the mixed pixels. The purpose of sparsification is to make the final abundance vector conform to the physical fact of hyperspectral unmixing, that is, each pixel is dominated by only a few types of endmembers. This embodiment forces the abundance vector to be sparsity by limiting the number of non-zero abundance values ​​to no more than a preset threshold, thereby avoiding the assignment of extremely small but non-zero abundance values ​​to irrelevant endmembers and improving the physical interpretability of the unmixing results.

[0134] In one feasible implementation, the sparsity processing can be achieved using a Top-k softmax approach. This approach selects the top-scoring candidate endmembers by ranking them, normalizes the scores of only these endmembers, and sets the abundance of the remaining endmembers to zero, thereby ensuring the sparsity of the abundance vector. Specifically, step S62 also includes steps A621 to A624: Step A621: Sort the initial scores of each candidate terminal in descending order, and select the j highest-scoring candidate terminal as the target candidate terminal based on the sorting results, and the remaining candidate terminal as the non-target candidate terminal.

[0135] Where j equals the preset threshold It should be noted that the preset threshold refers to the maximum number of target candidate endmembers allowed to be retained for each pixel. The purpose of sorting is to arrange candidate endmembers according to their scores, facilitating the selection of the highest-scoring endmembers. Sorting is only used to determine which endmembers are selected and does not change the original identifiers of the endmembers themselves; for example, the index of an endmember in the spectral library does not change with sorting. Sorting itself is a specific method to select the top j candidate endmembers with the highest scores, and those skilled in the art can use other equivalent selection algorithms as needed.

[0136] Step A622: Normalize the initial score of each target candidate endmember to obtain the abundance value of each target candidate endmember.

[0137] In one feasible implementation, normalization can be achieved using a Top-k softmax function with a temperature coefficient, specifically calculated as follows:

[0138] in, This represents the j positions with the highest scores. This is a temperature coefficient used to adjust the sharpness of the Top-ksoftmax output distribution. The smaller the value, the more concentrated the weight of the target candidate endmember with the higher score, thus enhancing sparsity; The larger the value, the more uniform the distribution, and the relatively flat the output distribution, which helps improve numerical stability. The denominator only sums over the target candidate endmembers, that is, only over the j highest initial scores, ensuring that the abundance values ​​after normalization are non-negative and sum to 1.

[0139] Step A623: Set the abundance value of non-target candidate endmembers to 0.

[0140] All endmembers not selected as target candidate endmembers have their abundance values ​​set to zero. This means that these endmembers do not account for any proportion in the current pixel, thus satisfying the sparsity constraint of mixed pixels. Since non-target candidate endmembers do not participate in the normalization process, their scores do not affect the abundance allocation of target candidate endmembers, ensuring that abundance calculations are focused only on the few endmembers with the highest scores.

[0141] Step A624: According to the preset order of each candidate endmember, the abundance vector of the target pixel is formed by the abundance value of the target candidate endmember and the abundance value set to 0.

[0142] It should be noted that the candidate endmembers have a predetermined fixed order, such as being arranged according to the index of the endmembers in the spectral library. The abundance vector is a numerical sequence of length equal to the total number of candidate endmembers, and its i-th... The position corresponds to the first The abundance values ​​of each candidate endmember are calculated. In this embodiment, the calculated abundance values ​​of the target candidate endmembers are filled into their corresponding positions according to the preset order of each candidate endmember, and the positions corresponding to the unselected non-target candidate endmembers are filled with 0, thereby forming a complete abundance vector.

[0143] In this embodiment, the spatial-spectral fusion features are mapped to initial scores for each candidate endmember. These initial scores are then sorted, and target and non-target candidate endmembers are processed separately. This process strictly limits the number of non-zero abundance values ​​in the abundance vector of each pixel to a preset threshold j, conforming to the physical fact that hyperspectral mixed pixels are "dominated by a few endmembers." The sparsity processing effectively avoids small but unreasonable abundance allocations, enhancing the physical interpretability of the demixing results. Simultaneously, normalization is performed only on target candidate endmembers, ensuring the non-negativity of abundance values ​​and a sum of 1, eliminating the interference of low-scoring endmembers on the estimation results, and improving the accuracy and noise resistance of abundance estimation. Constructing abundance vectors according to a preset order of candidate endmembers maintains a one-to-one correspondence between the output and input candidate sets. This embodiment significantly improves the sparsity and physical interpretability of abundance estimation while satisfying the constraints of the linear mixture model.

[0144] Example 6 This application provides a hyperspectral demixing device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the hyperspectral demixing method in the first embodiment described above.

[0145] The following is for reference. Figure 6 The diagram illustrates a structural schematic of a hyperspectral demixing device suitable for implementing embodiments of this application. The hyperspectral demixing device in this embodiment may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 6 The hyperspectral demixing device shown is merely an example and should not be construed as limiting the functionality and scope of this embodiment.

[0146] like Figure 6As shown, the hyperspectral demixing device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.) that can perform various appropriate actions and processes according to a program stored in a read-only memory 1002 or a program loaded from a storage device 1003 into a random access memory 1004. The random access memory 1004 also stores various programs and data required for the operation of the hyperspectral device. The processing unit 1001, the read-only memory 1002, and the random access memory 1004 are interconnected via a bus 1005. An input / output interface 1006 is also connected to the bus. Typically, the following systems can be connected to the input / output interface 1006: input devices 1007 including, for example, a touchscreen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1003 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. Communication device 1009 allows the hyperspectral demixing device to communicate wirelessly or wiredly with other devices to exchange data. Although the figures show hyperspectral demixing devices with various systems, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.

[0147] Specifically, the processes described in the flowchart above can be implemented as computer software programs. For example, this embodiment includes a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from read-only memory 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the method of this embodiment.

[0148] It should be understood that the various parts disclosed in this embodiment can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0149] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the hyperspectral demixing method described in the above embodiments.

[0150] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0151] The aforementioned computer-readable storage medium may be included in the hyperspectral demixing device; or it may exist independently and not assembled into the hyperspectral demixing device.

[0152] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0153] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0154] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0155] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-described hyperspectral demixing method. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the hyperspectral demixing method provided in the above embodiments, and will not be repeated here.

[0156] To facilitate understanding, a feasible implementation method is now proposed. Based on the above embodiments, a reference model is provided, the overall structure of which is as follows: Figure 1 As shown. Figure 1 This is a diagram illustrating the overall structure of the model upon which the hyperspectral unmixing methods described in the above embodiments are based. (Refer to...) Figure 1Specifically, the spectral branch first receives the center spectrum in parallel from the original branch and the derivative branch, and each extracts the original and derivative features through a transformer encoder. Simultaneously, the conditional encoder extracts statistics from the center spectrum and its derivative spectrum to generate first and second information. The spatial branch takes local neighborhood image patches as input, first extracting spatial feature maps of different scales through a multi-scale branch, and then performing weighted fusion based on the first information to obtain the fused spatial features. Subsequently, a correlation score is calculated for this spatial feature, i.e., the spatial location in the image corresponds to the correlation score. Combined with the second information, the top k spatial location units with the highest scores are selected, i.e., the top K spatial location units with the highest correlation are retained as the spatial feature subset. Next, the original and derivative features are cross-attention calculated with the spatial feature subset, and the calculation results are then transformed sequentially through linear projection, a linear layer, a GELU (Gaussian Error Linear Unit) activation function, and another linear layer to obtain the fused spatial-spectral features. Finally, the spatial-spectral fusion features are fed into the scoring head, and the initial scores of each candidate endmember are obtained through linear mapping. Then, the abundance vector is obtained by the Top-k softmax function sparsification, and the abundance map corresponding to each candidate endmember is generated. Figure 1 The data flow shown is consistent with the processing order described above; please refer to the details. Figure 1 Arrows and module labels in the text.

[0157] Understandable, Figure 1 The structure shown is a schematic diagram based on logical functional division. Its purpose is to intuitively illustrate the data flow and dependencies between modules in each embodiment of this application, rather than to restrict the specific implementation method. In practical applications, functional modules can be merged, split, or reorganized as needed. Figure 1 The specific network structures marked in the figures are merely examples. Those skilled in the art, based on the teachings of the above embodiments, can make equivalent substitutions or modifications according to actual application scenarios. These adjustments do not depart from the principles of the embodiments of this application. Furthermore, Figure 1 The Chinese terms used herein are functional descriptions of the operations in this embodiment or are intended to aid understanding based on direct translations from English. They are designed to help readers intuitively grasp the function of each module and the data flow, and are not intended as strict redefinitions of technical terms. Those skilled in the art should understand that the above operations generally have recognized names or equivalent implementations in this technical field. The scope of protection for the above operations in this application is subject to the textual description in the specification; the accompanying drawings are for illustrative purposes only and do not constitute a limitation on specific naming or implementation methods.

[0158] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0159] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.

Claims

1. A hyperspectral unmixing method, characterized in that, The hyperspectral demixing method includes: Obtain the hyperspectral image to be unmixed; Each pixel in the hyperspectral image is identified as a target pixel, and the center spectrum and local neighborhood image patch of the target pixel are extracted. Calculate the derivative spectrum of the central spectrum; The central spectrum is feature-encoded to obtain the original features; The derivative spectrum is feature-encoded to obtain derivative features; Preset statistics of the central spectrum and the derivative spectrum are extracted respectively, and first information is generated based on the preset statistics of the central spectrum and the derivative spectrum, wherein the first information is used to characterize the spatial region attribute of the target pixel; Second information is generated based on a preset statistic of the derivative spectrum, wherein the second information is used to characterize the spectral complexity of the central spectrum; Extract spatial features from the local neighborhood image patch; Flatten the spatial features into a sequence of spatial location units; Calculate the correlation score between each spatial location unit in the spatial location unit sequence and the target pixel based on the first information; The retention ratio is determined based on the second information, and the retention quantity K is determined based on the retention ratio and the total number of spatial location units; The top K spatial location units with the highest correlation scores are retained, and a spatial feature subset is generated based on the retained spatial location units; The original features and the derivative features are used as spectral features. Cross-attention calculation is performed on the spectral features and the spatial feature subset to obtain the spatial-spectral fusion features. The abundance vector of the target pixel is calculated based on the spatial-spectral fusion features; The abundance vectors of all pixels in the hyperspectral image are collected to generate an abundance map corresponding to each candidate endmember.

2. The hyperspectral unmixing method of claim 1, wherein, The step of extracting spatial features from the local neighborhood image patch includes: Extract multiple preset initial spatial feature maps of different scales from the local neighborhood image patch; Based on the first information, a fusion weight is generated for each of the initial spatial feature maps, and the initial spatial feature maps are weighted and fused according to the fusion weight to obtain the spatial features.

3. The hyperspectral unmixing method of claim 1, wherein, The step of performing cross-attention calculation on the spectral features and the subset of spatial features to obtain the spatial-spectral fusion features includes: Using the original features as the first query, and each spatial location unit in the spatial feature subset as the first key and the first value, the similarity between the first query and the first key is calculated, and the first value is weighted and summed using the similarity to obtain the first attention feature; Using the derivative feature as the second query, and each spatial location unit of the spatial feature subset as the second key and the second value, the similarity between the second query and the second key is calculated. The second value is then weighted and summed using the similarity to obtain the second attention feature. The first attention feature and the second attention feature are fused to obtain the spatial-spectral fusion feature.

4. The hyperspectral unmixing method of claim 1, wherein, The step of calculating the abundance vector of the target pixel based on the spatial-spectral fusion features includes: The spatial spectrum fusion features are mapped to initial scores corresponding to each candidate endmember; The initial score is sparsified to obtain the abundance vector of the target pixel, wherein the number of non-zero abundance values ​​in the abundance vector of all pixels in the hyperspectral image does not exceed a preset threshold.

5. The method of claim 4, wherein the hyperspectral unmixing is performed by: The step of sparsening the initial score to obtain the abundance vector of the target pixel includes: The initial scores corresponding to each candidate terminal are sorted from high to low. Based on the sorting result, the j candidate terminals with the highest scores are selected as target candidate terminals, and the remaining candidate terminals are non-target candidate terminals, where j is equal to the preset threshold. The initial score of each target candidate endmember is normalized to obtain the abundance value of each target candidate endmember; Set the abundance value of the non-target candidate endmember to 0; According to the preset order of each candidate endmember, the abundance vector of the target pixel is formed by the abundance value of the target candidate endmember and the abundance value set to 0.

6. The hyperspectral unmixing method of claim 1, wherein, After the step of acquiring the hyperspectral image to be unmixed, the hyperspectral unmixing method further includes: An external spectral library is obtained, and the external spectral library is resampled based on the hyperspectral image to obtain a basic spectral library; A learnable residual matrix is ​​superimposed on the basic spectral library, and a bounded constraint is applied to the residual matrix to limit the adjustment range of the residual matrix, resulting in a semi-fixed dictionary; After the step of calculating the abundance vector of the target pixel based on the spatial-spectral fusion features, the hyperspectral unmixing method further includes: The abundance vector is decoded and reconstructed using the semi-fixed dictionary to generate a reconstructed spectrum; The reconstructed spectra of all pixels in the hyperspectral image are collected to generate a reconstructed hyperspectral image.

7. A hyperspectral unmixing device, characterized by The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the hyperspectral demixing method as described in any one of claims 1 to 6.

8. A readable storage medium, characterized by, The readable storage medium is a computer-readable storage medium, on which a program for implementing the hyperspectral demixing method is stored, and the program for implementing the hyperspectral demixing method is executed by a processor to implement the steps of the hyperspectral demixing method as described in any one of claims 1 to 6.