A hyperspectral image contrast learning classification method based on multi-agent cooperation
Patent Information
- Application Number
- CN202611131486.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-29
- Publication Date
- 2026-10-16
AI Technical Summary
然而高光谱图像普遍存在同物异谱与异物同谱现象,且像素级标注成本高昂,实际应用中标注样本稀缺,导致传统深度学习分类方法在少标注、跨场景及复杂语义条件下,特征提取能力与泛化性能显著下降
[0039] This invention proposes a hyperspectral image contrastive learning classification method based on multi-agent collaboration. This framework enhances the adaptive classification capability of hyperspectral images under conditions of limited annotation, cross-scene processing, and semantic complexity by leveraging the interaction and cooperation among multiple agents. The framework utilizes a representation learning agent to extract joint spatial-spectral features, and a sample construction agent dynamically builds positive and negative sample pools and filters out false negative samples, thereby achieving stable contrastive learning feature fusion and separation. Simultaneously, a decision agent evaluates the reliability of the classification results based on the probability and uncertainty output by the classifier and implements corrections. Finally, a scheduling agent provides global feedback to adjust pseudo-labels, fusion weights, and model parameters, significantly improving the model's adaptability and generalization ability to complex data distributions.
Smart Images

Figure CN122929285A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of remote sensing image technology, and in particular relates to a hyperspectral image contrast learning classification method based on multi-agent collaborative hyperspectral image contrast learning. Background Technology
[0002] Hyperspectral images (HSI) possess immense value in land cover mapping, precision agriculture, mineral exploration, and ecological environment monitoring due to their continuous hyperspectral band information and detailed spatial features. However, hyperspectral images commonly exhibit heterospectral variations and homospectral variations, and pixel-level annotation is costly, resulting in a scarcity of labeled samples in practical applications. This leads to a significant decline in the feature extraction and generalization performance of traditional deep learning classification methods under conditions of limited annotation, cross-scene processing, and complex semantics.
[0003] In recent years, contrastive learning has been introduced into hyperspectral image classification as an effective means to alleviate label dependence. However, existing methods still have obvious shortcomings: First, they rely on a single static data augmentation strategy, ignoring the unique spectral dimension physical characteristics of hyperspectral images, making it difficult to generate diverse and effective views. Second, the construction of positive and negative samples is based solely on simple label comparison or feature distance division, which not only fails to fully leverage the advantages of multi-positive sample aggregation, but also easily introduces false negative samples in complex ground scene scenarios, distorting feature classification boundaries and reducing the discriminative power of feature representation.
[0004] In addition, existing hyperspectral classification frameworks mostly adopt a one-way static training mode. On the one hand, they lack a dynamic evaluation and correction mechanism based on classification reliability, making it difficult to correct misclassification caused by spectral confusion and easily leading to the continuous accumulation of false label noise. On the other hand, they lack a global scheduling center, making it impossible to adaptively adjust the fusion weight of classification loss and contrastive learning loss according to the model state, and also unable to dynamically control the process of false label update and difficult sample mining, resulting in unstable training and difficulty in convergence of the model in complex environments.
[0005] Therefore, it is urgent to introduce a multi-agent collaborative mechanism in hyperspectral image classification, and to build a closed-loop framework that integrates sample construction, representation learning, decision evaluation and global scheduling. By using adaptive data augmentation, multi-positive sample comparison mechanism and dynamic loss weight adjustment, we can solve the problems of false negative sample interference and training imbalance, and improve the classification accuracy and model robustness of hyperspectral images under conditions of few samples. Summary of the Invention
[0006] To address the problems existing in the prior art, this invention proposes a hyperspectral image contrast learning classification method based on multi-agent collaboration.
[0007] The technical solution of the present invention is as follows:
[0008] A hyperspectral image contrastive learning classification method based on multi-agent collaborative learning includes:
[0009] A hyperspectral image classification model driven by multiple agents is constructed. The multiple agents include a sample construction agent for dynamically constructing positive and negative samples and completing adaptive screening and quality optimization; a representation learning agent for extracting spatial-spectral joint features and improving feature discrimination ability; a decision agent for evaluating and optimizing the reliability of classification results based on classification confidence and uncertainty; and a scheduling agent for uniformly scheduling the entire process of pseudo-label updating, hard sample mining and model iterative training.
[0010] The input hyperspectral image data is standardized and preprocessed, and spatial neighborhood is constructed to obtain spatial neighborhood block samples. These samples are then used to construct an intelligent agent.
[0011] Based on the samples, an intelligent agent is constructed. By comprehensively utilizing spectral similarity measurement rules and spatial consistency constraints, pseudo-labels are dynamically generated for unlabeled spatial neighborhood block samples, and a difficult sample pool is constructed. Through a multi-condition judgment mechanism, adaptive screening of positive and negative samples is achieved, and potential false negative samples are eliminated.
[0012] Based on the aforementioned representation learning agent, a contrastive learning mechanism is used to perform spatial-spectral joint feature depth extraction on hyperspectral images. The feature space is optimized based on the selected positive and negative samples to reduce the interference of false negative samples on feature learning and to achieve aggregation of similar samples and separation of dissimilar samples.
[0013] Based on the decision-making agent, the classification confidence and prediction uncertainty are calculated according to the classification output results. A comprehensive reliability judgment is made on the prediction results of each category. Based on the evaluation results, adaptive optimization correction is implemented on the classification results to alleviate the misclassification problem caused by spectral confusion.
[0014] Based on the aforementioned scheduling agent, the dynamic updating of pseudo-labels, online mining of difficult samples, and iterative training of the model are globally unified and controlled. Through information interaction and closed-loop feedback between agents, the hyperspectral image classification results are finally output.
[0015] Furthermore, when performing standardized preprocessing and spatial neighborhood construction on the input hyperspectral image data, the original hyperspectral data is first reduced in dimensionality by band selection or principal component analysis to remove redundant bands in the spectral information. Then, a normalization algorithm is used to map the gray values of each band pixel to a preset interval. Then, with each central pixel as the core, the neighborhood range is defined according to the preset spatial scale, and a spatial window containing the central pixel and its surrounding neighboring pixels is extracted to construct a spatial neighborhood block sample that can simultaneously characterize the fine spectral response of ground objects and local spatial texture and morphological structure information. This spatial neighborhood block sample is then input into the sample construction agent.
[0016] Furthermore, the sample construction agent first performs band-by-band spectral response analysis and local spatial texture structure mining on the received spatial neighborhood block samples to obtain the original spectral features and the original spatial features.
[0017] Then, spectral domain data augmentation is performed on the original spectral features and spatial domain data augmentation is performed on the original spatial features to generate multiple sets of augmented views with diversity. Each set of augmented views contains a set of augmented spectral features and a set of augmented spatial features.
[0018] Then, the enhanced spectral features and enhanced spatial features in each group of enhanced views are weighted and fused using a feature fusion method to obtain the spatial-spectral joint feature vector of the corresponding enhanced view;
[0019] Finally, all spatial-spectral joint eigenvectors are normalized to output a standardized set of spatial-spectral joint eigenvectors.
[0020] Furthermore, when the sample construction agent constructs positive samples, it uses the benchmark sample of the current sample pair to be constructed as the anchor sample, constructs the enhanced view of the same hyperspectral sample obtained by different data enhancements as a positive sample, and establishes benchmark constraints by extracting the feature consistency of the same sample under different perturbations.
[0021] Unlabeled samples with the same pseudo-label and whose classification confidence meets the preset reliability conditions are constructed as positive samples, and the class diversity of the positive sample set is expanded by using highly reliable pseudo-label information.
[0022] Meanwhile, samples with consistent spatial neighborhoods and spatial-spectral joint feature similarity that meet preset similarity conditions are constructed as positive samples to ensure the clustering of similar land features in the feature space.
[0023] Furthermore, when the sample construction agent constructs and filters negative samples, it first selects unlabeled samples whose pseudo-labels are different from those of the anchor samples or whose classification prediction categories are different, as well as samples whose spatial-spectral joint feature distance with the anchor samples in the feature space meets the preset distance condition and has significant discriminative power as candidate negative samples.
[0024] Next, the spatial-spectral joint feature similarity between the anchor sample and the candidate negative sample is calculated, and the pseudo-label relationship, predicted category relationship and spatial neighborhood association relationship between the two are comprehensively judged. When the pseudo-label or predicted category of the anchor sample and the candidate negative sample are different, but the spatial-spectral joint feature similarity between the two is higher than the preset similarity threshold, or the spatial neighborhood consistency between the two is higher than the preset neighborhood threshold, the candidate negative sample is determined as a potential false negative sample and removed from the negative sample set to obtain the filtered reliable negative sample set.
[0025] Furthermore, the representation learning agent employs a contrastive learning mechanism to perform spatial-spectral joint feature depth extraction on hyperspectral images. When optimizing the feature space based on the selected positive and negative samples to reduce the interference of false negative samples on feature learning and to achieve the aggregation of similar samples and the separation of dissimilar samples, a contrastive learning loss function is constructed based on the positive sample set and reliable negative sample set selected by the sample construction agent. Cosine similarity is used as the spatial-spectral joint feature similarity. By minimizing the contrastive learning loss, similar samples are guided to move closer to each other and dissimilar samples are moved away from each other in the feature space.
[0026] Furthermore, when the decision-making agent performs reliability assessment and optimization correction on the classification results, it first obtains the class probability distribution of the sample output by the classifier, and extracts the maximum probability value in the class probability distribution as the classification confidence.
[0027] Then, the classification confidence and prediction uncertainty are combined to make a comprehensive reliability judgment on the classification results. For samples that are judged to be of low reliability, the prediction results are smoothed and the categories are corrected by combining the distribution of land cover categories in their spatial neighborhood and spatial consistency constraints, so as to correct the misclassification problem caused by spectral confusion.
[0028] Furthermore, when the scheduling agent achieves closed-loop self-optimization, it sets corresponding confidence thresholds and uncertainty thresholds based on the classification confidence and prediction uncertainty assessment results output by the decision agent. When a sample simultaneously satisfies the conditions of confidence being higher than the threshold and uncertainty being lower than the threshold, the predicted category of the sample is fed back as a reliable pseudo-label to the next round of model training. When a sample does not meet the above conditions, the weight of the sample participating in model training is reduced to avoid interference from noise pseudo-labels in the aggregation and separation process of ground feature features.
[0029] The updated pseudo-labels, sample weights, and adjusted hard sample mining strategies are then fed back to the sample construction agent and the representation learning agent in real time. The agents are then scheduled to work together to perform gradient backpropagation and parameter iteration until the classification model converges.
[0030] Furthermore, during the joint optimization process of the model, the true label corresponding to the sample or the reliable pseudo label generated by the decision agent is first obtained, and the classification loss is calculated by combining the class probability output by the classifier with the cross-entropy loss function.
[0031] Then, the dynamic training weights of the samples are calculated based on the classification confidence and prediction confidence.
[0032] The weights obtained from the calculation are used to dynamically adjust the contribution of different samples in the loss function. Then, the scheduling agent introduces learnable dynamic weight parameters, adaptively weights and fuses the classification loss and the contrastive learning loss, and adds a regularization constraint term to prevent the weight parameters from having extreme values, thus constructing the total loss function.
[0033] Finally, the model is trained by backpropagation through a scheduling agent, and the model training parameters are dynamically adjusted according to the total loss gradient. After multiple rounds of closed-loop iterative optimization, the classification result is output.
[0034] Furthermore, when the scheduling agent executes the multi-agent collaborative mechanism, it serves as the control center of the classification framework and enhances the model's adaptive classification capability under conditions of low labeling, cross-scene, and semantic complexity by utilizing cross-agent interaction and collaboration.
[0035] Inject the positive and negative sample relationships generated by the sample construction agent into each stage of the contrastive learning optimization, guiding the representation learning agent to achieve the aggregation of similar samples and the separation of dissimilar samples in the feature space;
[0036] Simultaneously, it receives class probability and prediction uncertainty information from the decision-making agent, and performs adaptive screening of pseudo-labels and feedback adjustment of model parameters.
[0037] By integrating dynamic interactive information from feature learning, sample construction, and decision feedback, the classification framework can be closed-loop iteratively optimized, thereby comprehensively improving the final classification accuracy.
[0038] Compared with the prior art, the present invention has the following beneficial effects:
[0039] This invention proposes a hyperspectral image contrastive learning classification method based on multi-agent collaboration. This framework enhances the adaptive classification capability of hyperspectral images under conditions of limited annotation, cross-scene processing, and semantic complexity by leveraging the interaction and cooperation among multiple agents. The framework utilizes a representation learning agent to extract joint spatial-spectral features, and a sample construction agent dynamically builds positive and negative sample pools and filters out false negative samples, thereby achieving stable contrastive learning feature fusion and separation. Simultaneously, a decision agent evaluates the reliability of the classification results based on the probability and uncertainty output by the classifier and implements corrections. Finally, a scheduling agent provides global feedback to adjust pseudo-labels, fusion weights, and model parameters, significantly improving the model's adaptability and generalization ability to complex data distributions.
[0040] This invention employs a sample-constructed agent framework to overcome the interference of false negative samples in contrastive learning through dynamic filtering. This agent comprehensively utilizes spectral similarity and spatial consistency to adaptively construct positive samples with multi-level enhanced views, and rigorously eliminates potential false negative samples from candidate negative samples under multiple conditions, injecting high-purity positive-negative sample relationships into each stage of contrastive learning optimization. This enhances stable feature encoding and demonstrates significant advantages in maintaining the discriminative power of classification features under limited labeling conditions.
[0041] This invention employs a representation learning agent to efficiently mine complex material and structural information from hyperspectral images. Based on a high-purity sample set and preliminary features output by a sample construction agent, this agent extracts joint spatial-spectral features with deep semantic meaning. Combining the high-purity samples provided by the sample construction agent, the agent uses a supervised contrastive learning scheme to highly cluster features of similar samples and effectively separate features of dissimilar samples, providing a highly noise-resistant representational foundation for subsequent classification.
[0042] This invention employs a decision agent framework to dynamically enhance the model's adaptive capabilities during the classification process. This agent is a dynamically evaluated module that is aware of prediction reliability, improving the model's generalization ability by combining classification confidence and prediction uncertainty. The agent not only performs reliability assessments on the prediction results of individual samples but also implements adaptive smoothing corrections based on spatial neighborhood consistency, effectively correcting misclassification caused by spectral confusion and improving the model's classification reliability for unknown samples.
[0043] This invention employs a scheduling agent as the global control and optimization hub for the entire classification framework. Based on feedback from the decision agent, this agent dynamically updates pseudo-labels, mines hard samples online, and dynamically allocates training weights, while adaptively adjusting the fusion direction of classification and contrastive learning losses. This mechanism achieves closed-loop iterative optimization of the classification framework, significantly mitigating the performance degradation of traditional static models in complex semantic environments and providing extremely high robustness even with limited annotations.
[0044] This invention utilizes a multi-agent collaborative hyperspectral image contrastive learning classification method, explicitly addressing the performance bottleneck issue in existing hyperspectral classification methods caused by the lack of global coordination and dynamic adaptive mechanisms. Unlike existing methods that rely solely on unidirectional feature extraction, this framework fully integrates dynamic interactive information from sample construction, representation learning, decision evaluation, and global scheduling. Through this novel four-agent collaborative mechanism and a deeply optimized contrastive learning scheme, this framework achieves more robust feature extraction and dynamic model self-optimization even with complex and variable hyperspectral data, comprehensively improving the final classification accuracy. Attached Figure Description
[0045] Figure 1 A comparative learning classification framework for multi-agent collaboration;
[0046] Figure 2 A hyperspectral image contrast learning classification method for multi-agent collaborative learning. Detailed Implementation
[0047] The present invention will be further illustrated below with reference to the accompanying drawings and specific embodiments. It should be understood that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. After reading this invention, any modifications of the invention in various equivalent forms by those skilled in the art will fall within the scope defined by the appended claims.
[0048] Example 1:
[0049] This invention provides a hyperspectral image contrast learning classification method based on multi-agent cooperative learning, such as... Figure 1 and Figure 2 As shown, it includes:
[0050] A hyperspectral image classification model driven by multiple agents is constructed. The multiple agents include a sample construction agent for dynamically constructing positive and negative samples and completing adaptive screening and quality optimization; a representation learning agent for extracting spatial-spectral joint features and improving feature discrimination ability; a decision agent for evaluating and optimizing the reliability of classification results based on classification confidence and uncertainty; and a scheduling agent for uniformly scheduling the entire process of pseudo-label updating, hard sample mining and model iterative training.
[0051] The input hyperspectral image data is standardized and preprocessed and spatial neighborhood is constructed to fully explore the spatial context association information of ground objects, obtain spatial neighborhood block samples, and input the samples to construct intelligent agents, providing a data foundation for subsequent multi-agent collaborative interpretation and feature learning;
[0052] Based on the samples, an intelligent agent is constructed. By comprehensively utilizing spectral similarity measurement rules and spatial consistency constraints, pseudo-labels are dynamically generated for unlabeled spatial neighborhood block samples, and a difficult sample pool is constructed. Through a multi-condition judgment mechanism, accurate adaptive screening of positive and negative samples is achieved, and potential false negative samples are eliminated, thereby significantly improving the quality and reliability of comparative learning samples.
[0053] Based on the aforementioned representation learning agent, a contrastive learning mechanism is used to perform spatial-spectral joint feature depth extraction on hyperspectral images. The feature space is optimized based on the selected positive and negative samples to reduce the interference of false negative samples on feature learning and to achieve aggregation of similar samples and separation of dissimilar samples, thereby significantly improving the discriminative ability of feature representation and the robustness of the model.
[0054] Based on the decision-making agent, the classification confidence and prediction uncertainty are calculated according to the classification output results. A comprehensive reliability judgment is made on the prediction results of each category. Based on the evaluation results, adaptive optimization correction is implemented on the classification results to alleviate the misclassification problem caused by spectral confusion, thereby reducing the overall classification error rate.
[0055] Based on the aforementioned scheduling agent, the dynamic updating of pseudo-labels, online mining of difficult samples, and iterative training of the model are globally unified and controlled. Through information interaction and closed-loop feedback between agents, the classification model achieves continuous self-optimization and adaptive improvement, and finally outputs hyperspectral image classification results.
[0056] Example 2:
[0057] This embodiment, based on Embodiment 1, further designs the following: When performing standardized preprocessing and spatial neighborhood construction on the input hyperspectral image data, firstly, dimensionality reduction processing is performed on the original hyperspectral data through band selection or principal component analysis to remove redundant bands in the spectral information. Then, a normalization algorithm is used to map the gray values of each band pixel to a preset range, eliminating the influence of differences in illumination, atmosphere, and sensor response during the imaging process. Finally, with each central pixel as the core, a neighborhood range is defined according to a preset spatial scale, and the image containing the central pixel and its surrounding neighboring pixels is extracted. A spatial window (at a specific scale) is used to construct spatial neighborhood block samples that can simultaneously represent the fine spectral response and local spatial texture and morphological structure information of ground features. These spatial neighborhood block samples are then input into the sample construction agent, providing a structured input in the spatial-spectral dimension for the representation learning agent. The value of L is an odd number in the range [3, 15]. In this example, L = 7. This is because a window that is too small cannot capture the spatial texture and structural information of ground features, while a window that is too large can easily introduce the mixing of dissimilar ground features, leading to a decrease in feature purity. A 7×7 window can balance local texture details and ground feature category purity, balancing classification accuracy and computation time.
[0058] Example 3:
[0059] This embodiment is further designed based on embodiment two, in that the sample construction agent in this example first performs band-by-band spectral response analysis and local spatial texture structure mining on the received spatial neighborhood block samples to obtain the original spectral features and the original spatial features.
[0060] Then, spectral domain data augmentation is performed on the original spectral features, and spatial domain data augmentation is performed on the original spatial features, generating multiple sets of augmented views with diversity. Each set of augmented views corresponds to a set of augmented spectral features and a set of augmented spatial features. Among them, spatial domain data augmentation is selected from rotation, flipping, cropping, and spatial neighborhood perturbation, while spectral domain data augmentation focuses on introducing a spectral random masking strategy based on hyperspectral physical properties, which can be preset with probability p.mask Perform masking operations on continuous spectral bands or odd / even bands, p mask The value range is [0.1, 0.4]. In this embodiment, the initial value is preferably 0.3, and it is gradually reduced to 0.1 in the later stage of training; at the same time, band perturbation or spectral shift is applied. For hyperspectral samples... The sample-constructing agent generates a differentially enhanced view through the above enhancement methods, expressed by the formula: ; ;in, The original hyperspectral sample is presented in a three-dimensional tensor with dimensions H×W×B, where H and W are the neighborhood space dimensions, B is the number of bands, and pixel values are normalized to the [0,1] interval.
[0061] For the first An enhanced view, For the first Data augmentation operations include rotation, flipping, cropping, and neighborhood perturbation in the spatial domain, as well as band masking, spectral shifting, and noise perturbation in the spectral domain.
[0062] Then, the enhanced spectral features and enhanced spatial features in each group of enhanced views are weighted and fused using a feature fusion method to obtain the spatial-spectral joint feature vector of the corresponding enhanced view;
[0063] Finally, all spatial-spectral joint eigenvectors are normalized to output a standardized set of spatial-spectral joint eigenvectors.
[0064] Specifically, the following weighted fusion method can be used to obtain the joint spatial-spectral data representation:
[0065] ;
[0066] in, For space-spectral joint data, Spectral characteristics, For spatial features, and The adaptive weighting coefficients satisfy the following conditions: ∈[0,1]、 ∈[0,1]、 The coupling constraint relationship;
[0067] Adaptive weight coefficients and The agent is constructed from samples and dynamically calculated based on the spectral saliency and spatial texture richness of the current samples. The calculation formula is α = σ(MLP([ ; ]), β = 1 - α, where σ is the Sigmoid function and MLP is a lightweight multilayer perceptron. This design allows samples dominated by spectral information to be automatically assigned a larger [value / value]. Samples with rich spatial textures are automatically assigned a larger size. This enables adaptive optimization of feature fusion.
[0068] Example 4:
[0069] This embodiment is further designed based on the first embodiment. In this example, when the sample construction agent constructs a positive sample, the reference sample of the current sample pair to be constructed is used as the anchor sample. The enhanced view obtained by different data enhancements of the same hyperspectral sample is constructed as a positive sample. The reference constraint is established by extracting the feature consistency of the same sample under different perturbations.
[0070] Unlabeled samples with the same pseudo-label and whose classification confidence meets the preset reliability conditions are constructed as positive samples, and the class diversity of the positive sample set is expanded by using highly reliable pseudo-label information.
[0071] Meanwhile, samples with consistent spatial neighborhoods and spatial-spectral joint feature similarity that meet preset similarity conditions are constructed as positive samples to ensure the clustering of similar land features in the feature space.
[0072] Furthermore, the anchor sample in this invention is a benchmark reference sample in the construction of the contrastive learning sample pair. All positive and negative samples are similarity calculated and relationship determined with the anchor sample as the center. Each sample participating in the contrastive learning training can be used as an anchor sample in a sample construction process.
[0073] For anchor samples The positive sample set it constructs is represented as That is, the total set of positive samples , Among them, enhanced view positive samples (different enhancements to the same sample); Anchor sample Views generated using different data augmentations are directly used as baseline positive samples. Pseudo-labeled positive samples (pseudo-labels are consistent and confidence levels meet the criteria) Unlabeled samples with identical labels, whose classification confidence scores for both samples meet the threshold, and whose spatial-spectral joint feature similarity is not lower than the preset threshold are considered positive samples; spatial neighborhood positive samples (spatial proximity and similar features) Samples whose spatial neighborhood consistency meets the threshold and whose spatial-spectral joint feature similarity is not lower than the preset threshold are considered positive samples.
[0074] In the formula, For anchor samples The corresponding set of positive samples; For the sample pseudo-tags; Different enhanced views of the same sample; Spatial-spectral joint feature similarity; The preset positive sample similarity threshold is set in the range of [0.5, 0.9], with a preferred value of 0.75. These are the classification confidence scores for anchor samples and candidate samples, respectively. The classification confidence reliability threshold is set in the range of [0.6, 0.95], with a preferred value of 0.8. This is a measure of spatial neighborhood consistency. ; Let Euclidean distance be the spatial distance between the center pixels of the two samples. The preset spatial neighborhood distance threshold has a value range of [3, 15] (pixels). The preferred value is 7. If the distance is within the threshold, it is considered that the neighborhood is consistent and the value is 1; otherwise, it is 0.
[0075] Example 5:
[0076] This embodiment is further designed based on the fourth embodiment. In this example, when the sample construction agent constructs and filters negative samples, it first selects unlabeled samples whose pseudo-labels are different from the anchor samples or whose classification prediction categories are different, as well as samples whose spatial-spectral joint feature distance with the anchor samples in the feature space meets the preset distance condition and has significant discriminative power as candidate negative samples.
[0077] Next, the spatial-spectral joint feature similarity between the anchor sample and the candidate negative sample is calculated, and the pseudo-label relationship, predicted category relationship and spatial neighborhood association relationship between the two are comprehensively judged. When the pseudo-label or predicted category of the anchor sample and the candidate negative sample are different, but the spatial-spectral joint feature similarity between the two is higher than the preset similarity threshold, or the spatial neighborhood consistency between the two is higher than the preset neighborhood threshold, the candidate negative sample is determined as a potential false negative sample and removed from the negative sample set to obtain the filtered reliable negative sample set.
[0078] Furthermore, for anchor samples The set of negative samples after filtering is represented as follows:
[0079] ;
[0080] in For a reliable set of negative samples, For the sample pseudo-tags For feature similarity, The preset negative sample similarity threshold represents the upper limit of similarity that candidate negative samples must meet; its data source is the hyperparameter preset. The value range is [0.5, 0.9], with a preferred value of 0.75; and and Must meet < Gradient constraints; if the threshold is too high, similar outlier samples are easily mixed in; if it is too low, the negative samples are too simple and offer no benefit to model optimization. To determine the potential set of negative samples obtained.
[0081] Example 6:
[0082] This embodiment, based on Embodiment 5, further designs the following: In this example, the representation learning agent uses a contrastive learning mechanism to perform spatial-spectral joint feature depth extraction on the hyperspectral image. When optimizing the feature space based on the selected positive and negative samples to reduce the interference of false negative samples on feature learning and to achieve the aggregation of similar samples and the separation of dissimilar samples, a high-quality positive sample set is constructed based on the samples selected by the agent. A contrastive learning loss function is constructed with a reliable set of negative samples. Cosine similarity is used as the spatial-spectral joint feature similarity. By minimizing the contrastive learning loss, samples of the same type are guided to move closer to each other in the feature space, while samples of different types move further apart, thereby enhancing the discriminative power of the spatial-spectral joint features and the robustness of the model to complex terrain scenes.
[0083] Furthermore, the formula for the spatial-spectral joint feature similarity is:
[0084] ;
[0085] In the formula, Let i be the spatial-spectral joint feature vector of the i-th sample. It is the spatial-spectral joint feature vector of the k-th sample; For feature similarity;
[0086] The contrastive learning loss The calculation formula is:
[0087] ;
[0088] in, negative samples The corresponding weights, in physical terms, represent the weights contributing to the loss of negative samples of varying difficulty; the data source is dynamically calculated based on sample difficulty; the value range is [0.1, 2.0], with higher weights for more difficult samples. The temperature parameter has a value range of [0.01, 1.0], and in this embodiment, τ is preferably 0.07; and These are the positive and negative sample sets, respectively; their physical meaning is the number of samples participating in training in a single iteration. The data source is the training batch setting, with a value range of 8 to 256, preferably 32, subject to GPU memory constraints.
[0089] Example 7:
[0090] This embodiment, based on Embodiment Six, further designs the following: when the decision-making agent performs reliability assessment and optimization correction on the classification results, it first obtains the class probability distribution of the samples output by the classifier, extracts the maximum probability value in the class probability distribution as the classification confidence level, and uses it to measure the degree of certainty of the model in predicting the class. The calculation formula is as follows: ,;in, Indicates that the sample belongs to the category The probability of; The physical meaning is the degree of confidence the model has in predicting the category; the data source is the output of the classifier with the maximum probability; the value range is [0,1], and the higher the value, the higher the degree of confidence the model has in the prediction result; To maximize the probability, the predicted probability for all categories is maximized.
[0091] Then, the information entropy of the category probability distribution is calculated as a prediction uncertainty index to assess the ambiguity and potential risk of the classification results. The calculation formula is as follows: ;
[0092] Let be the prediction uncertainty (information entropy) of the i-th sample. The higher the entropy value, the more ambiguous the classification result and the lower the reliability. c takes values from 1 to C, where C is the total number of land cover categories. Let be the probability that the i-th sample is predicted by the classifier to be of class c;
[0093] Then, the classification confidence and prediction uncertainty are combined to make a comprehensive reliability judgment on the classification results. For samples that are judged to be of low reliability, the prediction results are smoothed and the categories are corrected by combining the distribution of land cover categories in their spatial neighborhood and spatial consistency constraints, so as to correct the misclassification problem caused by spectral confusion.
[0094] Example 8:
[0095] This embodiment, based on Embodiment 7, further designs the following: When the scheduling agent achieves closed-loop self-optimization, it sets corresponding confidence and uncertainty thresholds based on the classification confidence and prediction uncertainty assessment results output by the decision agent. The confidence threshold ranges from 0.6 to 0.95, preferably 0.8. Too low a threshold introduces noisy pseudo-labels, leading to model drift; too high a threshold results in low utilization of unlabeled data. This value ensures pseudo-label accuracy > 90% while covering a sufficient number of unlabeled samples. The normalized uncertainty threshold ranges from 0.2 to 0.8, preferably 0.4; it forms a double check with the confidence threshold, further filtering samples with ambiguous probability distributions and improving the overall quality of pseudo-labels. When a sample simultaneously satisfies a confidence level higher than the threshold and an uncertainty level lower than the threshold, i.e. and The predicted class of the sample is used as a reliable pseudo-label and fed back into the next round of model training. When a sample does not meet the above conditions, its weight in model training is reduced. To avoid interference from noisy pseudo-labels in the aggregation and separation process of ground feature, and to ensure that feature learning fits the spectral-spatial distribution characteristics of real ground features; or to temporarily postpone its inclusion in the next round of training (removing the sample from the next round of pseudo-label supervised training samples), thus suppressing the negative impact of noisy labels on model performance;
[0096] The updated pseudo-labels, sample weights, and adjusted hard sample mining strategies are then fed back to the sample construction agent and the representation learning agent in real time. The agents are then scheduled to work together to perform gradient backpropagation and parameter iteration until the classification model converges.
[0097] Example 9:
[0098] This embodiment, based on Embodiment 8, further designs the following: during the joint optimization process of the model, it first obtains the true labels corresponding to the samples or reliable pseudo labels generated by the decision-making agent. The classification loss is calculated using the cross-entropy loss function, combining the class probabilities output by the classifier. ;
[0099] Then, the dynamic training weights of the samples are calculated based on the classification confidence and prediction confidence. The formula for calculating these dynamic training weights is as follows: For classification confidence, in the formula, To predict confidence level ;
[0100] The calculated weights are used to dynamically adjust the contribution of different samples to the loss function, and then the scheduling agent introduces learnable dynamic weight parameters. The classification loss and supervised contrastive learning loss are adaptively weighted and fused, and a regularization constraint term is added to prevent extreme values of the weight parameters to construct the total loss function, which is expressed as follows: ,in, For classifying losses, To monitor and compare learning loss, The fusion weights are dynamically adjusted by the agent during training iterations, representing the proportion of classification loss in the total loss, balancing feature learning and classification optimization; the parameter type is a trainable and dynamically schedulable correction compensation parameter; the initialization rule is an initial value of 0.3, with a focus on contrastive learning to optimize the feature space in the early stages of training; To prevent extreme values of the weight parameters, a regularization constraint is used. The scheduling agent uses this formula to focus on unsupervised contrastive learning to optimize the feature space in the early stages of training, and to focus on classification surface optimization in the later stages of training.
[0101] Finally, the model is trained by backpropagation through a scheduling agent. The model training parameters are dynamically adjusted according to the total loss gradient. After multiple rounds of closed-loop iterative optimization, the feature representation generated by the representation learning agent has both discriminative and generalizable properties under conditions of few labels. Finally, the classification result is output.
[0102] Example 10:
[0103] This embodiment is further designed based on the first embodiment in that, when the scheduling agent executes the multi-agent collaborative mechanism, it acts as the control center of the classification framework and enhances the model's adaptive classification ability under conditions of few labels, cross-scene and semantic complexity by utilizing the interaction and cooperation between agents.
[0104] Inject the positive and negative sample relationships generated by the sample construction agent into each stage of the contrastive learning optimization, guiding the representation learning agent to achieve the aggregation of similar samples and the separation of dissimilar samples in the feature space;
[0105] Simultaneously, it receives class probability and prediction uncertainty information from the decision-making agent, and performs adaptive screening of pseudo-labels and feedback adjustment of model parameters.
[0106] By integrating dynamic interactive information from feature learning, sample construction, and decision feedback, the classification framework can be closed-loop iteratively optimized, thereby comprehensively improving the final classification accuracy.
[0107] Example 11:
[0108] An electronic device according to the present invention includes a memory and a processor. The memory stores a computer program, and the processor is used to call and run the computer program stored in the memory to perform the method as described in any of the above embodiments.
[0109] The present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of any of the above embodiments.
[0110] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention 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 the present invention should be included within the scope of protection of the present invention.
Claims
1. A hyperspectral image contrast learning classification method based on multi-agent collaborative learning, characterized in that, include: A hyperspectral image classification model driven by multiple agents is constructed. The multiple agents include a sample construction agent for dynamically constructing positive and negative samples and completing adaptive screening and quality optimization; a representation learning agent for extracting spatial-spectral joint features and improving feature discrimination ability; a decision agent for evaluating and optimizing the reliability of classification results based on classification confidence and uncertainty; and a scheduling agent for uniformly scheduling the entire process of pseudo-label updating, hard sample mining and model iterative training. The input hyperspectral image data is standardized and preprocessed, and spatial neighborhood is constructed to obtain spatial neighborhood block samples. These samples are then used to construct an intelligent agent. Based on the samples, an intelligent agent is constructed. By comprehensively utilizing spectral similarity measurement rules and spatial consistency constraints, pseudo-labels are dynamically generated for unlabeled spatial neighborhood block samples, and a difficult sample pool is constructed. Through a multi-condition judgment mechanism, adaptive screening of positive and negative samples is achieved, and potential false negative samples are eliminated. Based on the aforementioned representation learning agent, a contrastive learning mechanism is used to perform spatial-spectral joint feature depth extraction on hyperspectral images. The feature space is optimized based on the selected positive and negative samples to reduce the interference of false negative samples on feature learning and to achieve aggregation of similar samples and separation of dissimilar samples. Based on the decision-making agent, the classification confidence and prediction uncertainty are calculated according to the classification output results. A comprehensive reliability judgment is made on the prediction results of each category. Based on the evaluation results, adaptive optimization correction is implemented on the classification results to alleviate the misclassification problem caused by spectral confusion. Based on the aforementioned scheduling agent, the dynamic updating of pseudo-labels, online mining of difficult samples, and iterative training of the model are globally unified and controlled. Through information interaction and closed-loop feedback between agents, the hyperspectral image classification results are finally output.
2. The hyperspectral image contrast learning classification method based on multi-agent collaborative hyperspectral image classification according to claim 1, characterized in that, When performing standardized preprocessing and spatial neighborhood construction on the input hyperspectral image data, the original hyperspectral data is first reduced in dimensionality by band selection or principal component analysis to remove redundant bands in the spectral information. Then, the gray values of each band pixel are mapped to a preset interval using a normalization algorithm. Next, with each central pixel as the core, the neighborhood range is defined according to a preset spatial scale. A spatial window containing the central pixel and its surrounding neighboring pixels is extracted to construct a spatial neighborhood block sample that can simultaneously characterize the fine spectral response of ground objects and local spatial texture and morphological structure information. This spatial neighborhood block sample is then input into the sample construction agent.
3. The hyperspectral image contrast learning classification method based on multi-agent collaborative learning according to claim 2, characterized in that, The sample construction agent first performs band-by-band spectral response analysis and local spatial texture structure mining on the received spatial neighborhood block samples to obtain the original spectral features and original spatial features. Then, spectral domain data augmentation is performed on the original spectral features and spatial domain data augmentation is performed on the original spatial features to generate multiple sets of augmented views with diversity. Each set of augmented views contains a set of augmented spectral features and a set of augmented spatial features. Then, the enhanced spectral features and enhanced spatial features in each group of enhanced views are weighted and fused using a feature fusion method to obtain the spatial-spectral joint feature vector of the corresponding enhanced view; Finally, all spatial-spectral joint eigenvectors are normalized to output a standardized set of spatial-spectral joint eigenvectors.
4. The hyperspectral image contrast learning classification method based on multi-agent collaborative hyperspectral image classification according to claim 1, characterized in that, When constructing positive samples, the sample construction agent uses the benchmark sample of the current sample pair to be constructed as the anchor sample, and constructs the enhanced view of the same hyperspectral sample obtained by different data enhancements as a positive sample. The benchmark constraint is established by extracting the feature consistency of the same sample under different perturbations. Unlabeled samples with the same pseudo-label and whose classification confidence meets the preset reliability conditions are constructed as positive samples, and the class diversity of the positive sample set is expanded by using highly reliable pseudo-label information. Meanwhile, samples with consistent spatial neighborhoods and spatial-spectral joint feature similarity that meet preset similarity conditions are constructed as positive samples to ensure the clustering of similar land features in the feature space.
5. The hyperspectral image contrast learning classification method based on multi-agent collaborative learning according to claim 4, characterized in that, When the sample construction agent constructs and filters negative samples, it first selects unlabeled samples whose pseudo-labels are different from those of the anchor samples or whose classification prediction categories are different, as well as samples whose spatial-spectral joint feature distance with the anchor samples in the feature space meets the preset distance condition and has significant discriminative power as candidate negative samples. Next, the spatial-spectral joint feature similarity between the anchor sample and the candidate negative sample is calculated, and the pseudo-label relationship, predicted category relationship and spatial neighborhood association relationship between the two are comprehensively judged. When the pseudo-label or predicted category of the anchor sample and the candidate negative sample are different, but the spatial-spectral joint feature similarity between the two is higher than the preset similarity threshold, or the spatial neighborhood consistency between the two is higher than the preset neighborhood threshold, the candidate negative sample is determined as a potential false negative sample and removed from the negative sample set to obtain the filtered reliable negative sample set.
6. The hyperspectral image contrast learning classification method based on multi-agent collaborative learning according to claim 5, characterized in that, The representation learning agent employs a contrastive learning mechanism to perform spatial-spectral joint feature depth extraction on hyperspectral images. When optimizing the feature space based on the selected positive and negative samples to reduce the interference of false negative samples on feature learning and to achieve the aggregation of similar samples and the separation of dissimilar samples, a contrastive learning loss function is constructed based on the positive sample set and reliable negative sample set selected by the agent. Cosine similarity is used as the spatial-spectral joint feature similarity. By minimizing the contrastive learning loss, similar samples are guided to move closer to each other and dissimilar samples are moved away from each other in the feature space.
7. The hyperspectral image contrast learning classification method based on multi-agent collaborative hyperspectral image classification according to claim 6, characterized in that, When the decision-making agent evaluates and optimizes the classification results, it first obtains the class probability distribution of the sample output by the classifier, and extracts the maximum probability value in the class probability distribution as the classification confidence. Then, the classification confidence and prediction uncertainty are combined to make a comprehensive reliability judgment on the classification results. For samples that are judged to be of low reliability, the prediction results are smoothed and the categories are corrected by combining the distribution of land cover categories in their spatial neighborhood and spatial consistency constraints, so as to correct the misclassification problem caused by spectral confusion.
8. The hyperspectral image contrast learning classification method based on multi-agent collaborative learning according to claim 7, characterized in that, When the scheduling agent achieves closed-loop self-optimization, it sets corresponding confidence thresholds and uncertainty thresholds based on the classification confidence and prediction uncertainty assessment results output by the decision agent. When a sample simultaneously meets the conditions of confidence being higher than the threshold and uncertainty being lower than the threshold, the predicted category of the sample is fed back as a reliable pseudo-label to the next round of model training. When a sample does not meet the above conditions, the weight of the sample participating in model training is reduced to avoid interference from noise pseudo-labels in the aggregation and separation process of ground feature features. The updated pseudo-labels, sample weights, and adjusted hard sample mining strategies are then fed back to the sample construction agent and the representation learning agent in real time. The agents are then scheduled to work together to perform gradient backpropagation and parameter iteration until the classification model converges.
9. The hyperspectral image contrast learning classification method based on multi-agent collaborative learning according to claim 8, characterized in that, During the joint optimization of the model, the true label corresponding to the sample or the reliable pseudo label generated by the decision agent is first obtained. Combined with the class probability output by the classifier, the classification loss is calculated using the cross-entropy loss function. Then, the dynamic training weights of the samples are calculated based on the classification confidence and prediction confidence. The weights obtained from the calculation are used to dynamically adjust the contribution of different samples in the loss function. Then, the scheduling agent introduces learnable dynamic weight parameters, adaptively weights and fuses the classification loss and the contrastive learning loss, and adds a regularization constraint term to prevent the weight parameters from having extreme values, thus constructing the total loss function. Finally, the model is trained by backpropagation through a scheduling agent, and the model training parameters are dynamically adjusted according to the total loss gradient. After multiple rounds of closed-loop iterative optimization, the classification result is output.
10. The hyperspectral image contrast learning classification method based on multi-agent collaborative learning according to claim 1, characterized in that, When the scheduling agent executes the multi-agent collaboration mechanism, it acts as the control center of the classification framework and enhances the model's adaptive classification capability under conditions of low labeling, cross-scene, and semantic complexity by utilizing the interaction and collaboration between agents. Inject the positive and negative sample relationships generated by the sample construction agent into each stage of the contrastive learning optimization, guiding the representation learning agent to achieve the aggregation of similar samples and the separation of dissimilar samples in the feature space; Simultaneously, it receives class probability and prediction uncertainty information from the decision-making agent, and performs adaptive screening of pseudo-labels and feedback adjustment of model parameters. By integrating dynamic interactive information from feature learning, sample construction, and decision feedback, the classification framework can be closed-loop iteratively optimized, thereby comprehensively improving the final classification accuracy.