A SAM-oriented consensus-driven adaptive prompt single-sample medical image segmentation method

By employing adaptive consistency feature fusion, consensus-driven prompt generation, and dual-index optimization, the problems of missegmentation and generalization instability in the SAM-based medical image segmentation method without training are solved, achieving efficient and robust medical image segmentation suitable for rapid deployment under various imaging conditions.

CN122156230APending Publication Date: 2026-06-05UNIV OF ELECTRONICS SCI & TECH OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
UNIV OF ELECTRONICS SCI & TECH OF CHINA
Filing Date
2026-02-24
Publication Date
2026-06-05

Smart Images

  • Figure CN122156230A_ABST
    Figure CN122156230A_ABST
Patent Text Reader

Abstract

The application discloses a SAM-oriented consensus-driven adaptive prompt single-sample medical image segmentation method, and belongs to the technical field of image segmentation in an intelligent medical system. The method does not require additional training, uses SAM2 as a prompt segmentation device, generates a robust query similar graph through an adaptive consistency multi-base feature fusion module, constructs spatially dispersed positive and negative prompts through a consensus prior-driven spatial multi-prompt generation module, and then dynamically optimizes the prompts and segmentation results in the reasoning period through a double-index verified prompt optimization module. The application solves the problems of easy confusion of similar graphs, insufficient prompt coverage and lack of reasoning verification mechanism in existing methods, improves the precision and generalization of single-sample medical image segmentation, and is suitable for clinical applications in a labeled scarce scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image segmentation technology, specifically to a consensus-driven adaptive cueing single-sample medical image segmentation method oriented towards SAM. Background Technology

[0002] Medical image segmentation is one of the core technologies of intelligent medical systems. Its purpose is to accurately separate target anatomical structures or lesion regions from medical images, providing crucial support for disease diagnosis, treatment planning, and prognostic assessment. In clinical practice, medical image annotation often requires a significant investment of time and effort from professional physicians. Furthermore, imaging differences from different centers and equipment can lead to data domain shifts. Additionally, medical images commonly suffer from low contrast, blurred boundaries, and similar appearances of anatomical structures. These factors make acquiring large-scale annotated data extremely challenging. Therefore, few-sample medical image segmentation technology has emerged. It aims to achieve reliable segmentation of similar targets in a query image using only a small number of annotated support samples, thereby reducing annotation costs and improving deployment efficiency for new organs and lesions.

[0003] Existing few-shot medical image segmentation methods are mainly divided into two categories: training-required methods and training-free methods. Training-required methods typically rely on large-scale datasets for pre-training, meta-learning, or end-to-end training, learning segmentation rules through techniques such as prototype learning and support-query correspondence modeling. While these methods can achieve certain performance in identically distributed tests, they have significant shortcomings: on the one hand, when deployed to new hospitals, new equipment, or new imaging protocols, additional data and computing power are required for adaptation training, increasing the cost of practical applications; on the other hand, the learned feature representations are susceptible to domain shift, and in scenarios involving cross-center, low-contrast, or similar anatomical structures, support-query correspondences are prone to degradation, leading to unstable or even significantly reduced generalization performance.

[0004] With the development of cue-based segmentation models, training-free few-shot segmentation methods based on SAM have become a research hotspot. These methods construct a support-query similarity response map during the inference phase, automatically selecting positive and negative cue points to input into the SAM to obtain segmentation results. Some methods also introduce iterative cue refinement strategies. However, existing training-free methods based on SAM still have many problems that need to be solved: First, the generation of automatic prompts is highly dependent on the reliability of the similarity response map. However, the low contrast and blurred boundaries of medical images can cause non-target tissues to generate similarity responses to the target region, leading to foreground response confusion and drift, and thus missegmentation. Second, the prompt initialization strategy is relatively simple, often using extreme response points or local peaks in the similarity map. This results in an overly concentrated spatial distribution of prompt points, making it difficult to cover slender structures, complex boundaries, or morphologically varied target regions, which is prone to undersegmentation. Furthermore, simple thresholding or Top-K selection can introduce fragmented pseudo-foregrounds, reducing the robustness of the prompts. Finally, most methods adopt a one-time prompt output mode, lacking a mechanism for verifying the prompt quality and segmentation results during the inference period. This makes it impossible to correct errors caused by prompt offset and insufficient coverage in a timely manner, resulting in the segmentation results being highly sensitive to the initial prompts. In complex scenarios, problems such as false detection of overlapping regions and missed detection of small structures can easily occur. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention provides a consensus-driven adaptive cueing single-sample medical image segmentation method oriented towards SAM, which solves the problems mentioned in the background technology.

[0006] To achieve the above objectives, the present invention provides the following technical solution: a consensus-driven adaptive cueing single-sample medical image segmentation method oriented towards SAM, comprising the following steps: S1. Obtain labeled support image-mask pairs and the query image to be segmented, using SAM2 as the prompting segmenter; S2. The adaptive consistency multi-basic feature fusion module processes the support and query features extracted by multiple frozen encoders to generate a robust query similarity graph. S3. Using a consensus prior-driven spatial diversity cue generation module, the query similarity graph is converted into a foreground and background consensus prior, thereby generating spatially dispersed positive and negative cues, which are then input into SAM2 to obtain the initial prediction mask. S4. The prompt optimization module, which is verified by dual indicators, constructs a verification criterion based on the segmenter confidence score and the cross-graph similarity consistency score. During the inference period, it adaptively filters, supplements and optimizes the prompts and prediction masks, and outputs the final segmentation mask.

[0007] Optionally, the processing procedure of the adaptive consistency multi-basic feature fusion module in step S2 includes: extracting and aligning support features and query features for each frozen encoder; performing support foreground prototype extraction, consistency scoring, and encoder-specific query similarity graph calculation through the encoder consistency evaluation module; normalizing the consistency score to a fusion weight using softmax; and performing weighted fusion of the query similarity graphs corresponding to each encoder to obtain the final fused similarity graph.

[0008] Optionally, the supporting foreground prototype is obtained by masked average pooling within the supporting foreground region, calculated using the following formula:

[0009] in For the first A prototype supporting encoder. To support masks, For pixels; the consistency score is the mean cosine similarity between features within the supporting foreground and the prototype supporting the foreground, calculated as follows: The planning extends to the [0, 1] interval; the encoder-specific query similarity map is obtained by calculating the cosine similarity between the query features and the supporting foreground prototype.

[0010] Optionally, the prior for the prospect consensus described in step S3 adopts... The retention strategy is constructed and defined as follows: ,in For indicator functions, This is the merged query similarity graph. To query the first similar image Similarity values ​​corresponding to large elements Selected from similarity responses at a fixed ratio; The background consensus prior is obtained by filtering background candidates through a low similarity threshold and retaining the largest connected component, defined as follows: , This is a preset background threshold.

[0011] Optionally, the process of generating positive and negative prompts in step S3 includes: Prior consensus on the future Consensus Priors with Context Candidate pixels within Construct clustered feature vectors containing normalized coordinates and similarity values. , respectively in and Internally, K-means clustering is performed, and the pixel positions corresponding to the cluster centers are taken as positive and negative cue points to form a set of positive and negative cue points. The +1 indicates the foreground label and the -1 indicates the background label.

[0012] Optionally, the processing procedure of the dual-index verification prompt optimization module in step S4 includes: Extract the query prototype from the current prediction mask, project it back to the support side to calculate the support similarity graph, and combine it with the encoder consistency weight to obtain the cross-graph similarity consistency score. Obtain the confidence score output by SAM2. The requirement for updating is that both indicators must be significantly improved.

[0013] Optionally, the query prototype is obtained by applying mask average pooling within the current prediction mask region, calculated using the following formula:

[0014] in For the first A query prototype for an encoder. The current prediction mask is used; the cross-graph similarity consistency score is obtained by averaging the supporting similar graphs within the supporting foreground and then weighting and summing it with the encoder consistency weight.

[0015] Optionally, the acceptance criteria for the updated notification are:

[0016]

[0017] in This represents the current iteration number. This is the next iteration number; under this constraint, a filtering operation is performed on the cue set, region discrimination and retention are performed on the multi-connected component prediction, negative cue is added where the prediction conflicts with the background prior, and positive cue is added where the foreground coverage is insufficient.

[0018] Optionally, the frozen encoder includes DINOv2, DepthAnythingV2 and SAM2 image encoders, which work together to extract diverse heterogeneous features to improve the comprehensiveness and robustness of feature representation.

[0019] Optionally, the number of iterations for optimization in step S4 is set to a preset fixed value. When the upper limit of this iteration is reached or there are no candidate updates that can meet the conditions for improving both indicators, the iteration is terminated and the final segmentation result is output.

[0020] This invention provides a consensus-driven adaptive cueing single-sample medical image segmentation method oriented towards SAM, which has the following beneficial effects: Firstly, through the adaptive consistency multi-fundamental feature fusion module (A) 2The MF module addresses the vulnerability of single-feature representations to domain shift and low-contrast imagery. It integrates heterogeneous features from DINOv2, DepthAnythingV2, and SAM2 image encoders. By dynamically allocating fusion weights through evaluating the consistency of each encoder on the support sample side, it effectively enhances response consistency in target regions, suppresses occasional high-similarity activations in non-target regions, generates more reliable query similarity maps, and reduces the risk of foreground response confusion and drift caused by single similarity maps. This provides a high-quality foundation for subsequent prompt generation and significantly improves the method's adaptability in cross-center and cross-modal medical imaging scenarios.

[0021] Secondly, the consensus-prior-driven Spatial Diversity Cue Generation Module (CoSP) overcomes the shortcomings of existing cue generation methods, such as concentrated cue point distribution, insufficient coverage, and interference from spurious foregrounds. This module constructs a consensus prior for the foreground and background based on a fused similarity graph. The foreground prior employs a Top-K strategy to avoid introducing spurious foregrounds, while the background prior ensures coherence through threshold filtering and maximum connectivity retention. Finally, K-means clustering generates spatially dispersed positive and negative cue points, balancing the confidence level of cue points with comprehensive coverage of the target region. This effectively avoids the problem of cue points being overly concentrated in local areas, adapting to diverse target shapes such as slender structures and complex boundaries, and reducing segmentation errors caused by under-segmentation and spurious foregrounds.

[0022] And through the dual-indicator verification prompt optimization module (M) 2 The PRS module constructs a dynamic verification and optimization mechanism during the inference period, solving the problems of existing methods lacking feedback loops and being unable to correct errors. This module combines the confidence score and cross-graph similarity consistency score output by SAM2 as verification indicators, accepting prompt updates only when both indicators improve. Through prompt filtering, region discrimination, and prompt supplementation, it can effectively eliminate redundant prompts, suppress false detection regions, and supplement positive prompts for insufficiently covered regions and negative prompts for conflicting regions. This timely correction of deviations in the initial prompts and segmentation process significantly reduces the sensitivity of the segmentation results to the initial prompts, improves the stability and accuracy of the segmentation results, and avoids the decline in segmentation quality caused by error accumulation.

[0023] Simultaneously, no additional task-related training or fine-tuning is required; reliable segmentation can be achieved with only a single labeled support sample, significantly reducing the dependence on labeled data and computing resources. This solves the problems of high deployment cost and poor generalization of training-based methods. Experimental verification shows that this invention significantly outperforms existing training-free methods on multi-organ segmentation datasets such as CHAOS and Synapse, as well as polyp segmentation datasets such as CVC-ColonDB, and even surpasses some training-based methods. It demonstrates strong generalization ability and practical application value, making it suitable for rapid deployment of new structures, cross-center promotion, and clinical scenarios with limited labeling costs. This provides strong support for the implementation of intelligent medical systems in resource-constrained environments.

[0024] The modules of this invention are well-complementary and adaptable, with a rigorous overall framework and coherent workflow, enabling precise optimization tailored to the characteristics of medical images. Through a progressive approach involving multi-encoder fusion, consensus prior modeling, and dual-index dynamic optimization, a complete solution is formed, from feature extraction to prompt generation and result optimization. This comprehensively addresses the core pain points of existing technologies, achieving a synergistic improvement in segmentation accuracy, robustness, and deployment efficiency, and providing new ideas and methods for the development of single-sample medical image segmentation technology. Attached Figure Description

[0025] Figure 1 This is a comparison diagram of the technical paths of the present invention and existing methods; Figure 2 This is an overall framework diagram of the present invention; Figure 3 A visualization of multi-organ segmentation results from the CHAOS abdominal MRI dataset; Figure 4 A visualization of multi-organ segmentation results from the Synapse abdominal CT dataset; Figure 5 Visualizations of polyp segmentation results on the CVC-ColonDB, CVC-ClinicDB, and Kvasir datasets; Figure 6 Visualization of ablation experiments for key modules; Figure 7 Similarity maps and segmentation results generated for different encoder types in the adaptive consistency multi-basic feature fusion module. Detailed Implementation

[0026] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.

[0027] Please see Figures 1 to 7The present invention provides an embodiment, which is as follows: The hardware environment in this embodiment is as follows: CPU is Intel Core i9-13900K, GPU is NVIDIA RTX4090, and memory is 64GB; the software environment is as follows: operating system is Ubuntu 22.04LTS, deep learning framework is PyTorch 2.0, and Python version is 3.9. The experiment used five commonly used medical image segmentation datasets for performance validation, including CHAOS, Synapse, CVC-ColonDB, CVC-ClinicDB, and Kvasir; Among them, CHAOS is an abdominal MRI dataset used for segmentation of four organs: right kidney, left kidney, liver, and spleen; Synapse is an abdominal CT dataset, also used for evaluation of the above four organs; CVC-ColonDB, CVC-ClinicDB, and Kvasir are all 2D colonoscopy image datasets used for polyp segmentation tasks, and all datasets provide pixel-level annotations. The single-sample segmentation settings are constructed as follows: For the CHAOS and Synapse 3D volume datasets, a five-fold cross-validation scheme is used. The volume data of the current fold in each fold is used as the test set, and the data of the remaining folds are used for training the comparative method. Within each test fold, one volume is selected as the support volume data, and the remaining volume data are used as the query volume data. Inference is performed at the slice level, and the anatomical alignment between the query slice and the support slice is achieved based on the relative position of the organs within the slice range. For the CVC-ColonDB, CVC-ClinicDB, and Kvasir2D datasets, an image-level single-sample scheme is used. Images are grouped into groups of five, with the first image in each group serving as the support image and the remaining four serving as the query images.

[0028] The specific method is as follows: The input of this invention is an annotated support image-mask pair. With the query image to be segmented The output is the final segmentation mask of the query image. The specific implementation steps are as follows: S1, Adaptive Consistency Multi-Based Feature Fusion (A 2 MF module implementation; First, load three pre-trained frozen encoders: DINOv2, DepthAnythingV2 (DAv2), and SAM2 image encoders. None of the three encoders will be trained or fine-tuned; they will be used directly for feature extraction. For each encoder ( (corresponding to the three encoders mentioned above), extracting the supporting images respectively. With query image The features that provide support features are obtained. With query features And align the feature dimensions of both to the same dimension; Perform encoder consistency evaluation: in support of mask Within the indicated foreground region, masked average pooling is used to support the foreground prototype. The calculation formula is: ; Calculate the cosine similarity between the features of each pixel within the supporting foreground region and the supporting foreground prototype, and then... After planning to the interval [0, 1], the average value is used to obtain the consistency score of the encoder. Based on supporting prospect prototypes Calculate query features The cosine similarity between each pixel and the prototype is used to obtain the encoder-specific query similarity map. ; Consistency score of the three encoders Perform softmax normalization to obtain the fusion weights. The calculation formula is: ; Create query similarity graphs corresponding to each encoder By fusion weight Perform a weighted summation to obtain the final fused query similarity graph. ,Right now ; S2, Consensus Prior-Driven Spatial Diversity Hint Generation (CoSP) Module Implementation; Constructing a priori consensus on the future: Set the selection ratio of Top-K to 0.002, i.e., from the fusion query similarity graph. Pixels with the highest similarity ratio of 0.002 are selected from the dataset, and the similarity value corresponding to the Kth largest element is set as the foreground threshold. According to the indicator function Obtaining a priori consensus on the future ; Building background consensus priors: Presetting background thresholds Initial background candidates are obtained through indicator functions. Connectivity analysis is performed on the initial candidate backgrounds, and the connected component with the largest area is retained as the final background consensus prior. ; Generate positive and negative cue points: prior to foreground consensus Consensus Priors with Context Each candidate pixel within Normalize its coordinates and the corresponding similarity value Combining and constructing cluster feature vectors ; respectively in and K-means clustering is performed internally, with each cluster having 3 cluster centers. The pixel position corresponding to each cluster center is used as the cue point. The corresponding cue point is marked as +1 (foreground). The corresponding cue point is marked as -1 (background), forming a set of positive and negative cues. ; Set of prompts Input the SAM2 model to obtain the initial prediction mask. This serves as the starting point for subsequent optimization of prompts; S3, Optimization of dual-indicator verification prompts (M) 2 PRS module implementation; Set the maximum number of iterations for optimization suggestions to 5, and initialize the number of iterations. Current prediction mask ; In each iteration, start with the current prediction mask. Extracting the query prototype: Using the masked average pooling method, in Calculate the query prototype for each encoder within the indicated area. The calculation formula is: ; Query prototype The data is fed back to the support side to calculate the support similarity graph for each encoder. ,in The cosine similarity function is used to support the foreground region. Internal Calculate the average, then combine it with the fusion weights. Weighted summation yields the cross-graph similarity consistency score. ,Right now Simultaneously, obtain the current prediction mask output by SAM2. Corresponding confidence score ; Generate a candidate hint update set: Filter the current hint set, evaluate the contribution of each hint point using leave-one-out validation, and remove redundant hint points; update the current prediction mask. Analyze multi-connected components, preserving prior knowledge of the foreground consensus. Highly overlapping connected components are eliminated, along with discrete pseudo-connected components; based on the current prediction mask and background consensus prior... The conflicting areas supplement negative cue points, where the current prediction mask does not cover the prior consensus on the future. The indicated area is supplemented with positive prompts to form a candidate prompt set. ; Set of candidate prompts Input SAM2 to obtain candidate prediction masks and calculate the corresponding Determine if the condition is met. and If the conditions are met, then accept the update and let If the conditions are not met, the candidate update is discarded. ; The iteration terminates when t reaches the preset iteration limit of 5 times or when no candidate update meets the conditions in two consecutive iterations. As a query image The segmentation results are output.

[0029] In this embodiment, the Dice similarity coefficient is used as a performance evaluation index. This index can effectively measure the degree of overlap between the segmentation result and the real mask. The higher the value, the better the segmentation accuracy.

[0030] The performance advantages of this invention are verified through comparative experiments with existing representative few-shot segmentation methods, including ALPNet, QNet, GMRD, and DSPNet which require training, and Matcher and ProtoSAM which do not require training.

[0031] Table 1 shows a quantitative comparison of segmentation performance on the CHAOS and Synapse datasets, using the Dice coefficient as the evaluation metric. ; As shown in Table 1, the performance of multi-organ segmentation was evaluated on the CHAOS and Synapse datasets. On the CHAOS dataset, the average Dice of this invention reached 78.58%, significantly outperforming existing training-free methods. Specifically, compared to Matcher (39.81%), this invention improved by 38.77 percentage points; compared to ProtoSAM (66.67%), it improved by 11.91 percentage points, demonstrating a clear advantage in training-free methods. Compared to trained methods, even without relying on any task-related training, this invention also performed better: an improvement of 2.16 percentage points compared to ALPNet (76.42%) and 2.85 percentage points compared to DSPNet (75.73%).

[0032] The same trend was observed on the Synapse dataset; the present invention achieved an average Dice of 83.37%, which significantly exceeded the baseline of the no-training method: an improvement of 27.61 percentage points compared to Matcher (55.76%) and an improvement of 9.08 percentage points compared to ProtoSAM (74.29%).

[0033] Furthermore, this invention surpasses all training methods compared: it improves by 3.79 percentage points compared to the strongest training baseline DSPNet (79.58%) and by 3.80 percentage points compared to GMRD (79.57%).

[0034] As shown in Table 2, this invention achieves state-of-the-art performance on all three polyp segmentation benchmarks (CVC-ColonDB, CVC-ClinicDB, and Kvasir). Specifically, the invention achieves a Dice of 73.53% on CVC-ColonDB, 79.22% on CVC-ClinicDB, and 66.35% on Kvasir, with an average Dice of 73.03%. In comparison, the strongest untrained baseline, ProtoSAM, has an average Dice of 70.05%, and Matcher has an average Dice of 69.85%; therefore, the average performance of this invention is improved by 2.98 and 3.18 percentage points, respectively. Consistent improvements are observed on all three datasets, indicating that this method can adapt well to different endoscopic imaging conditions and is robust to common appearance differences in polyp segmentation tasks.

[0035] Table 2 provides a quantitative comparison of three polyp segmentation datasets (including CVC-ColonDB, CVC-ClinicDB, and Kvasir).

[0036] ; Experimental results show that the present invention achieves excellent segmentation performance on all datasets, can accurately segment target organs or lesion regions, effectively avoids problems such as undersegmentation, oversegmentation and missegmentation, and can be adapted to different types of medical images and segmentation tasks without additional training, demonstrating good robustness and generalization ability.

[0037] The effectiveness of each core module was verified through ablation experiments: using only A 2 With the MF module, the segmentation performance was already better than that of a single encoder; after adding the CoSP module, the spatial distribution and coverage of cue points were significantly improved, and the segmentation accuracy was greatly enhanced; further introduction of the MF module... 2 After the PRS module was installed, the stability and accuracy of the segmentation results were further enhanced, fully demonstrating the key role of each module in improving segmentation performance.

[0038] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A consensus-driven adaptive cueing single-sample medical image segmentation method oriented towards SAM, characterized in that, Includes the following steps: S1. Obtain labeled support image-mask pairs and the query image to be segmented, using SAM2 as the prompting segmenter; S2. The adaptive consistency multi-basic feature fusion module processes the support and query features extracted by multiple frozen encoders to generate a robust query similarity graph. S3. Using a consensus prior-driven spatial diversity cue generation module, the query similarity graph is converted into a foreground and background consensus prior, thereby generating spatially dispersed positive and negative cues, which are then input into SAM2 to obtain the initial prediction mask. S4. The prompt optimization module, which is verified by dual indicators, constructs a verification criterion based on the segmenter confidence score and the cross-graph similarity consistency score. During the inference period, it adaptively filters, supplements and optimizes the prompts and prediction masks, and outputs the final segmentation mask.

2. The method according to claim 1, characterized in that, The processing steps of the adaptive consistency multi-basic feature fusion module in step S2 include: extracting and aligning support features and query features for each frozen encoder; performing support foreground prototype extraction, consistency scoring, and encoder-specific query similarity map calculation through the encoder consistency evaluation module; normalizing the consistency score to a fusion weight using softmax; and performing weighted fusion of the query similarity maps corresponding to each encoder to obtain the final fused similarity map.

3. The method according to claim 2, characterized in that, The supporting foreground prototype is obtained by masked average pooling within the supporting foreground region, and the calculation formula is as follows: ; in For the first A prototype supporting encoder. To support masks, For pixels; the consistency score is the mean cosine similarity between features within the supporting foreground and the prototype supporting the foreground, calculated as follows: The planning extends to the [0, 1] interval; the encoder-specific query similarity map is obtained by calculating the cosine similarity between the query features and the supporting foreground prototype.

4. The method according to claim 1, characterized in that, The prior for the foreground consensus mentioned in step S3 is adopted The retention strategy is constructed and defined as follows: ,in For indicator functions, This is the merged query similarity graph. To query the first similar image Similarity values ​​corresponding to large elements Selected from similarity responses at a fixed ratio; The background consensus prior is obtained by filtering background candidates through a low similarity threshold and retaining the largest connected component, defined as follows: , This is a preset background threshold.

5. The method according to claim 4, characterized in that, The process of generating positive and negative prompts in step S3 includes: Prior consensus on the future Consensus Priors with Context Candidate pixels within Construct clustered feature vectors containing normalized coordinates and similarity values. , respectively in and Internally, K-means clustering is performed, and the pixel positions corresponding to the cluster centers are taken as positive and negative cue points to form a set of positive and negative cue points. The +1 indicates the foreground label and the -1 indicates the background label.

6. The method according to claim 1, characterized in that, The processing procedure of the dual-index verification prompt optimization module in step S4 includes: Extract the query prototype from the current prediction mask, project it back to the support side to calculate the support similarity graph, and combine it with the encoder consistency weight to obtain the cross-graph similarity consistency score. Obtain the confidence score output by SAM2. The requirement for updating is that both indicators must be significantly improved.

7. The method according to claim 6, characterized in that, The query prototype is obtained by applying mask average pooling within the current prediction mask region, and the calculation formula is as follows: ; in For the first A query prototype for an encoder. This is the current prediction mask; The cross-graph similarity consistency score is obtained by averaging the supporting similar graphs within the supporting foreground and then weighting and summing it with the encoder consistency weight.

8. The method according to claim 6, characterized in that, The conditions for accepting the updated notification are as follows: ; ; in This represents the current iteration number. This is the next iteration number; under this constraint, a filtering operation is performed on the cue set, region discrimination and retention are performed on the multi-connected component prediction, negative cue is added where the prediction conflicts with the background prior, and positive cue is added where the foreground coverage is insufficient.

9. The method according to claim 1, characterized in that, The frozen encoder includes DINOv2, DepthAnythingV2 and SAM2 image encoders, which work together to extract diverse heterogeneous features to improve the comprehensiveness and robustness of feature representation.

10. The method according to claim 1, characterized in that, In step S4, the number of iterations for optimization is set to a preset fixed value. When the upper limit of this iteration is reached or there is no candidate update that can meet the conditions for improving both indicators, the iteration is terminated and the final segmentation result is output.