Medical image segmentation method and system based on robust sequence hint optimization

By performing uncertainty quantification and robustness cue generation on the initial segmentation mask, combined with weighted fusion and iterative termination judgment, the robustness and iterative optimization problems of existing medical image segmentation methods are solved, achieving higher accuracy and more efficient segmentation results.

CN122265197APending Publication Date: 2026-06-23KUNMING LEZI TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
KUNMING LEZI TECH CO LTD
Filing Date
2026-03-23
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Existing medical image segmentation methods lack robustness in complex scenarios, rely on the accuracy of initial prompts, lack an evaluation and feedback mechanism for the uncertainty of segmentation results, cannot autonomously correct errors, and lack effective iterative optimization and termination judgment mechanisms, resulting in low segmentation accuracy and increased computational costs.

Method used

By quantifying the uncertainty of the initial segmentation mask, robust hints are generated. Combined with weighted fusion and iterative termination judgment mechanisms, robust hints are automatically generated, the initial hint deviation is corrected, the segmentation results are optimized, and a scientific iterative termination judgment mechanism is constructed to ensure segmentation accuracy and efficiency.

Benefits of technology

It significantly improves the accuracy and automation of medical image segmentation, provides more reliable clinical diagnostic support, avoids premature termination or excessive iteration, and reduces computational costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122265197A_ABST
    Figure CN122265197A_ABST
Patent Text Reader

Abstract

This invention discloses a medical image segmentation method and system based on robust sequence prompt optimization, specifically relating to the field of medical image segmentation technology. This invention quantifies the uncertainty of the initial segmentation mask, generates an uncertainty map by combining pixel probability variance and pixel-level entropy, accurately locates and segments blurred regions, and automatically generates robust prompts based on the map. Through binarization, connected component analysis, and redundancy removal, the prompts are ensured to be highly targeted and without redundancy, and can autonomously correct initial prompt deviations and segmentation errors. Then, weighted fusion is used to generate an optimized segmentation mask, significantly improving segmentation accuracy. This effectively solves the problems of insufficient robustness and difficulty in handling image noise and pathological morphological changes in traditional methods, providing more reliable image support for clinical diagnosis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical image segmentation technology, and more specifically, to a medical image segmentation method and system based on robust sequence prompting optimization. Background Technology

[0002] Medical image segmentation is a crucial step in computer-aided diagnosis, surgical planning, and disease follow-up. Traditional methods (such as thresholding and region growing) and early deep learning methods (such as U-Net) typically complete the segmentation in one go. They are sensitive to changes in image quality, noise, and pathological morphology, lack robustness, and are difficult to correct errors. In recent years, prompt-based segmentation models have demonstrated strong generalization capabilities. Users can guide the model to segment by providing interactive prompts such as points and bounding boxes.

[0003] However, in complex medical scenarios, existing segmentation methods still have the following technical shortcomings in practical applications:

[0004] While existing prompt-based segmentation models have demonstrated some generalization ability through user interaction prompts (such as dots and boxes), they still have obvious shortcomings in practical applications. The segmentation effect of such models is highly dependent on the accuracy of the initial prompts. If the initial prompts input by the user are biased, the model cannot correct the errors on its own.

[0005] Meanwhile, the model lacks an effective evaluation and feedback mechanism for the uncertainty of the segmentation results, and cannot identify and optimize ambiguous segmentation regions.

[0006] In addition, existing prompt generation strategies are mostly static designs that do not take into account the dynamic changes during the segmentation process. The generated prompts are often redundant or not targeted enough, making it difficult to efficiently guide the model to iterate and optimize the segmentation results. For example, in organ segmentation tasks, the initial prompts may not cover the blurry areas of organ edges. After the model completes the segmentation based solely on the initial prompts, it cannot autonomously discover and supplement key prompt information, resulting in low segmentation accuracy of edge regions.

[0007] Existing segmentation methods lack effective iterative optimization and termination judgment mechanisms. Most methods output the result directly after completing a segmentation, and cannot dynamically adjust the segmentation strategy according to the segmentation quality. Although some iterative methods attempt to optimize multiple times, they have not established scientific segmentation state evaluation indicators, making it difficult to accurately judge whether the segmentation result has converged. Either the iteration is terminated too early, resulting in insufficient segmentation accuracy, or excessive iteration increases the computational cost without improving the segmentation effect.

[0008] To address this, a medical image segmentation method and system based on robust sequence prompting optimization has been developed. Summary of the Invention

[0009] To overcome the aforementioned deficiencies of the prior art, embodiments of the present invention provide a medical image segmentation method and system based on robust sequence prompting optimization.

[0010] To achieve the above objectives, the present invention provides the following technical solution:

[0011] Medical image segmentation methods based on robust sequence prompting optimization include:

[0012] : Initial interactive prompts for receiving user input and medical images to be segmented ;Will and Input into the pre-built base segmentation model In the process, the initial segmentation mask is obtained. ;

[0013] : Initial segmentation mask Uncertainty quantification is performed to generate an uncertainty map. ;

[0014] Based on uncertainty graph Robust hints are automatically generated through pre-edited hint generation logic. ;

[0015] The generated prompt With medical images Input the basic segmentation model again A new segmentation mask is obtained. By weighted average and The mixture is then fused to generate an optimized segmentation mask. ;

[0016] Calculate and optimize the segmentation mask The uncertainty metric is used to determine the segmentation state coefficient. This coefficient, combined with the boundary pixel change rate and the foreground pixel number change rate, is used to output the segmentation state coefficient. If the segmentation state coefficient is lower than a preset threshold, the iteration terminates and outputs the final segmentation result; otherwise, the segmentation state coefficient is... As the new initial segmentation mask Execute again to .

[0017] Specifically, Initial segmentation mask Quantify uncertainty;

[0018] For the same input and Perform K independent forward propagations; K ≥ 10; obtain K pixel-level foreground probability maps, denoted as... Each The pixel value is the probability that the current pixel belongs to the foreground. ;

[0019] Probability value for K samples Calculate the arithmetic mean and variance to serve as the expected foreground probability and variance of the pixel probability for each pixel; calculate the pixel-level entropy for the probability values ​​of K samples.

[0020] Specifically, Uncertainty map The generation logic;

[0021] After normalizing the pixel probability variance and pixel-level entropy, a weighted fusion is performed to obtain the uncertainty coefficient of each pixel.

[0022] The uncertainty coefficients of all pixels are determined according to medical images. Initial mask The spatial resolution and pixel arrangement order are combined to form a two-dimensional matrix, which serves as an uncertainty map. .

[0023] Specifically, Robustness Tips The generation process;

[0024] By preset threshold Uncertainty map Perform pixel-level binarization;

[0025] That is, through the uncertainty spectrum A threshold comparison is performed on each pixel to generate a binary image with high uncertainty. ;

[0026] For binary graphs Perform 8-neighborhood connectivity analysis to cluster all adjacent high-uncertainty pixels into an independent connected region, which is then used as the set of high-uncertainty regions. Where m is the number of independent regions, each A set of coordinates containing all pixels in the current region;

[0027] For each independent region, the centroid method is used to obtain its core points, and these points are integrated to form the set of potential cue point coordinates for all independent regions. ;

[0028] For each potential cue point, query the current segmentation mask. The pixel value at that coordinate is denoted as ;

[0029] After applying a preset judgment rule to each potential cue point, a preliminary cue point set is generated, consisting of coordinates. Composed of prompt type pairs;

[0030] Medical images The integrated pixel space is divided into several non-overlapping, uniformly sized square local grids. All cue points in the initial cue point set are assigned to the corresponding local grids according to their coordinates. If a local grid contains more than one cue point, each cue point is extracted from the uncertainty map. The uncertainty coefficients in the data are ranked from highest to lowest.

[0031] For each local grid, only the cue point with the highest uncertainty coefficient is retained, and all other cue points within that grid are deleted; the retained cue points from all grids are then integrated to obtain the final cue point set, which is the robust cue. .

[0032] Specifically, the specific logic of threshold comparison;

[0033] The calculation formula is: ; Indicates the uncertainty coefficient;

[0034] =1 indicates that the current pixel is a high-uncertainty pixel, and vice versa.

[0035] Specifically, the pre-defined judgment rules are explained;

[0036] like =1, the prompt point is at The center is used as the foreground, and background point hints are generated.

[0037] like =0, prompt point is at Using the center as the background, generate foreground attraction prompts.

[0038] Specifically, Optimized segmentation mask The computational logic;

[0039] Based on the old and new segmentation masks and The uncertainty coefficient of the corresponding pixel is used to calculate its weight.

[0040] That is, through , ;in and for and The uncertainty coefficient of the corresponding pixel, and They are respectively and The calculated personalized weights;

[0041] The pixel-level foreground probabilities of the old and new masks are combined with calculated personalized weights and then weighted and averaged to generate an optimized foreground probability map with continuous values. Optimize the prospect probability map of continuous values The final optimized segmentation mask is generated after binarization with a preset fixed threshold. .

[0042] Specifically, The calculation logic for the segmentation state coefficients;

[0043] Optimize the segmentation mask The uncertainty spectrum is generated as . ;right Perform morphological dilation to obtain the dilated mask. ; inflated mask and Perform pixel-level interpolation to obtain a binary image of the boundary region of the mask. ;

[0044] Based on the binary map of the boundary region, the uncertainty spectrum is analyzed. Perform pixel-level filtering to retain the pixel values ​​corresponding to the boundary regions, forming a set of boundary uncertainties;

[0045] Calculate the average uncertainty of the boundary uncertainty set to obtain an uncertainty metric.

[0046] The uncertainty metric, the rate of change of boundary pixels, and the rate of change of the number of foreground pixels are weighted and fused to output the segmentation state coefficient.

[0047] Specifically, the calculation logic for the rate of change of boundary pixels and the rate of change of the number of foreground pixels;

[0048] Extract the set of boundary uncertainties and calculate the proportion of the intersection of boundary pixels in two adjacent iterations as the boundary pixel change rate;

[0049] Statistical optimization of segmentation mask The total number of foreground pixels in the adjacent iterative masks is calculated, and the rate of change is used as the rate of change of the number of foreground pixels.

[0050] The technical effects and advantages of this invention are as follows:

[0051] (1) This invention quantifies the uncertainty of the initial segmentation mask, generates an uncertainty map by combining pixel probability variance and pixel-level entropy, accurately locates the segmentation of the blurred region, automatically generates robust prompts based on the map, and ensures that the prompts are targeted and without redundancy through binarization, connected component analysis and redundancy removal. It can autonomously correct the initial prompt deviation and segmentation error, and then generate an optimized segmentation mask through weighted fusion, which significantly improves the segmentation accuracy and effectively solves the problems of insufficient robustness of traditional methods and difficulty in dealing with image noise and pathological morphological changes, providing more reliable image support for clinical diagnosis.

[0052] (2) The present invention constructs a scientific iteration termination judgment mechanism, integrates uncertainty measurement value, boundary pixel change rate and foreground pixel number change rate to output segmentation state coefficient, realizes accurate judgment of segmentation convergence, avoids insufficient accuracy caused by premature termination, prevents excessive iteration from increasing computational cost, takes into account segmentation efficiency and effect, and greatly improves the automation level and practicality of medical image segmentation. Attached Figure Description

[0053] Figure 1 This is a flowchart of the medical image segmentation method based on robust sequence prompting optimization of the present invention;

[0054] Figure 2 This is a schematic diagram of the medical image segmentation system based on robust sequence prompting optimization according to the present invention. Detailed Implementation

[0055] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0056] Example 1

[0057] like Figure 1 As shown, the medical image segmentation method based on robust sequence prompting optimization is as follows:

[0058] Prompts and Initial Segmentation: Initial interactive prompts received from user input. (Including but not limited to foreground points, background points, and bounding boxes) and the medical image to be segmented. ;Will and Input into the pre-built base segmentation model In (such as the SAM model for medical adaptation), the initial segmentation mask is obtained. ;

[0059] Medical images Convert to a tensor format supported by the model (e.g., C×H×W, where C is the number of channels and H / W is the image height / width), and use the initial prompts. That is, the point / box coordinates are encoded into a cue tensor that the model can recognize, and then concatenated with the image tensor.

[0060] Encoded and Input activation segmentation model After performing one forward propagation, the model locates the target region by matching visual features guided by prompts;

[0061] The model outputs a foreground probability map, where each pixel represents the probability of belonging to the foreground, ranging from 0 to 1. The probability map is then binarized (with a threshold of 0.5; pixels with a probability ≥ 0.5 are considered foreground and assigned a value of 1; otherwise, they are considered background and assigned a value of 0). This process generates an initial segmentation mask. .

[0062] Additional explanations and constraints It is completely consistent with the spatial resolution and size of medical images, ensuring matching for subsequent pixel-level calculations.

[0063] Segmentation uncertainty quantification: For the initial segmentation mask Uncertainty quantification is performed to generate an uncertainty map. ;

[0064] Specifically:

[0065] For the same input and Perform K independent forward propagations; K≥10, balancing computational efficiency and statistical reliability; obtain K pixel-level foreground probability maps, denoted as... Each The pixel value is the probability that the current pixel belongs to the foreground. ;

[0066] , i, j are the two-dimensional coordinates of pixels.

[0067] Probability value for K samples Calculate the arithmetic mean and variance to represent the expected foreground probability and the variance of the pixel probability for each pixel.

[0068] The expected foreground probability reflects the model's average classification tendency for that pixel; the larger the pixel probability variance, the more ambiguous the model's classification decision for that pixel, and the higher the uncertainty.

[0069] Calculate pixel-level entropy for the probability values ​​of K samples;

[0070] The calculation formula is:

[0071] Pixel-level entropy ; The expected probability of the prospect.

[0072] First, a small offset correction is made to the expected foreground probability of all pixels, as shown in the following formula:

[0073] ;in This is a preset minimum constant.

[0074] Entropy quantifies the degree of disorder in a probability distribution. The higher the entropy value, the closer the probability that the pixel belongs to the foreground or background is to 0.5, and the higher the uncertainty.

[0075] After normalizing the pixel probability variance and pixel-level entropy, a weighted fusion is performed to obtain the uncertainty coefficient of each pixel.

[0076] Uncertainty coefficient ; and These are preset weighting coefficients, and their sum is one. The variance after normalization. This is the pixel-level entropy after normalization.

[0077] The uncertainty coefficients of all pixels are determined according to medical images. Initial mask The spatial resolution and pixel arrangement order are combined to form a two-dimensional matrix, which serves as an uncertainty map. .

[0078] Robust sequence hint generation: Based on uncertainty graphs Robust hints are automatically generated through pre-edited hint generation logic. ;

[0079] Specifically:

[0080] By preset threshold Uncertainty map Perform pixel-level binarization; screen out high-risk areas with segmentation uncertainty far exceeding the conventional level, and convert continuous numerical maps into binary maps that can be directly used for regional analysis;

[0081] The threshold can be set to 0.7 to balance "filtering accuracy" and "region integrity." Too low a threshold will introduce redundant regions, while too high a threshold will lose key ambiguous regions. It can be adjusted according to the modality.

[0082] That is, through the uncertainty spectrum A threshold comparison is performed on each pixel to generate a binary image with high uncertainty. The calculation formula is: ; Indicates the uncertainty coefficient;

[0083] =1 indicates that the current pixel is a high-uncertainty pixel, and vice versa;

[0084] For binary graphs Perform 8-neighborhood connectivity analysis to cluster all adjacent high-uncertainty pixels into an independent connected region, which is then used as the set of high-uncertainty regions. Where m is the number of independent regions, each A set of coordinates containing all pixels in the current region;

[0085] For each independent region, the centroid method is used to obtain its core points, and these points are integrated to form the set of potential cue point coordinates for all independent regions. Each coordinate corresponds to a region of high uncertainty.

[0086] That is, for independent regions The arithmetic mean of the coordinates of all pixels within the region is used to obtain the centroid coordinates of the region, which are then used as the core point.

[0087] For each potential cue point, query the current segmentation mask. The pixel value at that coordinate is denoted as ;

[0088] And execute the following prompt type determination rules:

[0089] like =1, the prompt point is at The center is used as the foreground, and background point hints are generated.

[0090] Background point cues are generated to guide the model to relearn the features of the region and correct it to be the background.

[0091] like =0, prompt point is at Using the center as the background, generate foreground viewpoint prompts;

[0092] Before generating the foreground scene, the model is guided to complete the segmentation of the area and correct it to be the foreground.

[0093] After applying the decision rule to each potential cue point, a preliminary cue point set is generated, consisting of coordinates. Composed of prompt type pairs;

[0094] For example .

[0095] Medical images The integrated pixel space is divided into several non-overlapping square local grids of the same size; the division conditions are set by the technicians.

[0096] The grid size is set according to the image resolution (32×32 or 64×64 pixels are recommended, such as dividing a 512×512 image into 16×16 32×32 grids) to ensure that each grid covers a local area and avoids adjacent prompts from spanning grids.

[0097] All the prompts in the initial prompt set are assigned to the corresponding local grids according to their coordinates;

[0098] If a local grid contains more than one cue point, then extract each cue point into the uncertainty map. The uncertainty coefficients in the data are ranked from highest to lowest.

[0099] For each local grid, only the cue point with the highest uncertainty coefficient is retained, and all other cue points within that grid are deleted;

[0100] Because the point with the highest uncertainty coefficient is the position with the most ambiguous segmentation within the grid, its correction value is far higher than that of other adjacent points.

[0101] By integrating all the remaining cue points in the grid, we obtain the final set of cue points after redundancy removal, which is the robust cue. .

[0102] Robustness hints after redundancy removal A set of (pixel coordinates, hint type) pairs, where the hint type is either foreground or background point, with no redundant adjacent points.

[0103] Iterative optimization fusion: The generated prompts With medical images Input the basic segmentation model again A new segmentation mask is obtained. By weighted average and The mixture is then fused to generate an optimized segmentation mask. ;

[0104] Specifically:

[0105] Robustness tips With medical images By inputting a common basic segmentation model and repeating the complete process of segmentation uncertainty quantification (K independent forward propagations → pixel-level foreground probability mean calculation → uncertainty map generation), three types of core data are obtained: new segmentation mask, new mask probability mean map, pixel-level foreground probability expectation, and new mask uncertainty map.

[0106] Based on the old and new segmentation masks and The uncertainty coefficient of the corresponding pixel is used to calculate its weight.

[0107] The lower the uncertainty, the greater the weight, indicating that the segmentation result of that region is more reliable and should dominate the fusion process.

[0108] That is, through , ;in and for and The uncertainty coefficient of the corresponding pixel, and They are respectively and The calculated personalized weights;

[0109] The pixel-level foreground probabilities of the old and new masks are combined with calculated personalized weights and then weighted and averaged to generate an optimized foreground probability map with continuous values. This method retains the probability results of the high-confidence mask while fusing the effective information of the low-confidence mask, and ensures that the probability value after fusion is still in the [0,1] range, providing a reliable basis for subsequent binarization.

[0110] That is, through the formula Calculations are performed to obtain the optimized pixel-level foreground probability. , and These represent the pixel-level foreground probabilities corresponding to the old and new masks, respectively.

[0111] Optimize the prospect probability map of continuous values The final optimized segmentation mask is generated after binarization with a preset fixed threshold. ;

[0112] Iteration termination judgment: Calculate the optimized segmentation mask The uncertainty metric is used to determine the segmentation state coefficient. This coefficient, combined with the boundary pixel change rate and the foreground pixel number change rate, is used to output the segmentation state coefficient. If the segmentation state coefficient is below a preset threshold or the number of iterations reaches a preset maximum value, the iteration is terminated and the output is used as the final segmentation result; otherwise, the segmentation state coefficient is determined. As the new initial segmentation mask Perform the next iteration of optimization;

[0113] Specifically:

[0114] Optimize the segmentation mask The uncertainty spectrum is generated as . ;

[0115] right Perform morphological dilation to obtain the dilated mask. Select 3×3 or 5×5 structural elements, and... Perform a morphological dilation operation;

[0116] The expanded mask and Perform pixel-level interpolation to obtain a binary image of the boundary region of the mask. ;

[0117] Based on the binary map of the boundary region, the uncertainty spectrum is analyzed. Perform pixel-level filtering to retain the pixel values ​​corresponding to the boundary regions, forming a set of boundary uncertainties;

[0118] Calculate the average uncertainty of the boundary uncertainty set to obtain an uncertainty metric.

[0119] This is obtained by performing an arithmetic mean on the set of boundary uncertainties. The lower the value, the smaller the average ambiguity of the boundary region (the core region of segmentation uncertainty) of the optimized mask, and the higher the confidence of the model in segmenting the target boundary.

[0120] Extract the set of boundary uncertainties and calculate the proportion of the intersection of boundary pixels in two adjacent iterations as the boundary pixel change rate;

[0121] The lower the rate of change of boundary pixels, the less the boundary pixels of the mask change, and the fine contour has converged and stabilized.

[0122] Statistical optimization of segmentation mask The total number of foreground pixels in adjacent iteration masks is calculated, and the rate of change is used as the rate of change of the number of foreground pixels.

[0123] The lower the rate of change in the number of foreground pixels, the less significant the pixel size of the segmented target has changed, thus avoiding excessive expansion / contraction of the foreground region during iteration.

[0124] The uncertainty metric, the rate of change of boundary pixels, and the rate of change of the number of foreground pixels are weighted and fused to output the segmentation state coefficient;

[0125] That is, through the formula Calculations are performed to obtain the segmentation state coefficients. ;in , as well as These represent the optimized segmentation mask based on the current method. The calculated uncertainty metric, the rate of change of boundary pixels, and the rate of change of the number of foreground pixels are... , as well as These represent the preset uncertainty reference metric, the boundary pixel reference rate of change, and the foreground pixel count reference rate of change, respectively. , as well as These are preset weighting coefficients, and their sum is one.

[0126] When the uncertainty metric, the rate of change of boundary pixels, and the rate of change of the number of foreground pixels are all at a low level, it indicates that the segmentation result has stabilized in the three core dimensions of "confidence, boundary shape, and target size". Continuing to iterate will not effectively improve the accuracy, but will instead increase the computational cost.

[0127] Example 2

[0128] Please see Figure 2 As shown, based on the robust sequence cueing-based optimized medical image segmentation method provided in Embodiment 1 of this application, Embodiment 2 of this application proposes a robust sequence cueing-based optimized medical image segmentation system. Embodiment 2 is merely a preferred embodiment of Embodiment 1, and its implementation will not affect the individual implementation of Embodiment 1.

[0129] Specifically, the medical image segmentation system based on robust sequence prompting optimization provided in Embodiment 2 of this application includes:

[0130] The initial segmentation module receives initial interactive prompts from the user and the medical image to be segmented, inputs the initial interactive prompts and the medical image into a pre-built basic segmentation model, and outputs an initial segmentation mask;

[0131] The uncertainty quantization module is used to perform uncertainty quantization on the initial segmentation mask and generate an uncertainty map;

[0132] The prompt generation module is used to automatically generate the next set of robust prompts based on the uncertainty map and through preset prompt generation logic;

[0133] The optimization fusion module is used to input the robustness cue and the medical image back into the base segmentation model to obtain a new segmentation mask. The new segmentation mask and the initial segmentation mask are then fused by weighted averaging to generate an optimized segmentation mask.

[0134] The termination judgment module is used to calculate the uncertainty metric, boundary pixel change rate, and foreground pixel number change rate of the optimized segmentation mask, and to obtain the segmentation state coefficient by weighted fusion. If the segmentation state coefficient is lower than the preset threshold or the number of iterations reaches the preset maximum value, the iteration is terminated and the final segmentation result is output. Otherwise, the optimized segmentation mask is used as the new initial segmentation mask, and the module is returned to the segmentation uncertainty quantification module for the next iteration optimization.

[0135] The above formulas are all dimensionless calculations. Dimensionless calculations can be performed using various methods such as standardization, which will not be elaborated here. The formulas are derived from software simulations based on a large amount of collected data, and the preset parameters in the formulas can be set by those skilled in the art according to the actual situation.

[0136] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, ATA hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. The semiconductor medium can be a solid-state ATA hard disk.

[0137] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0138] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0139] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0140] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0141] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0142] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable ATA hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

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

Claims

1. A medical image segmentation method based on robust sequence prompting optimization, characterized in that, Includes the following modules: : Initial interactive prompts for receiving user input and medical images to be segmented ;Will and Input into the pre-built base segmentation model In the process, the initial segmentation mask is obtained. ; : Initial segmentation mask Uncertainty quantification is performed to generate an uncertainty map. ; Based on uncertainty graph Robust hints are automatically generated through pre-edited hint generation logic. ; The generated prompt With medical images Input the basic segmentation model again A new segmentation mask is obtained. By weighted average and The mixture is then fused to generate an optimized segmentation mask. ; Calculate and optimize the segmentation mask The uncertainty metric is used to determine the segmentation state coefficient. This coefficient, combined with the boundary pixel change rate and the foreground pixel number change rate, is used to output the segmentation state coefficient. If the segmentation state coefficient is lower than a preset threshold, the iteration terminates and outputs the final segmentation result; otherwise, the segmentation state coefficient is... As the new initial segmentation mask Execute again to .

2. The medical image segmentation method based on robust sequence prompting optimization according to claim 1, characterized in that: Initial segmentation mask Quantify uncertainty; For the same input and Perform K independent forward propagations; K ≥ 10; obtain K pixel-level foreground probability maps, denoted as... Each The pixel value is the probability that the current pixel belongs to the foreground. ; Probability value for K samples Calculate the arithmetic mean and variance to serve as the expected foreground probability and variance of the pixel probability for each pixel; calculate the pixel-level entropy for the probability values ​​of K samples.

3. The medical image segmentation method based on robust sequence prompting optimization according to claim 2, characterized in that: Uncertainty map The generation logic; After normalizing the pixel probability variance and pixel-level entropy, a weighted fusion is performed to obtain the uncertainty coefficient of each pixel. The uncertainty coefficients of all pixels are determined according to medical images. Initial mask The spatial resolution and pixel arrangement order are combined to form a two-dimensional matrix, which serves as an uncertainty map. .

4. The medical image segmentation method based on robust sequence prompting optimization according to claim 3, characterized in that: Robustness Tips The generation process; By preset threshold Uncertainty map Perform pixel-level binarization; That is, through the uncertainty spectrum A threshold comparison is performed on each pixel to generate a binary image with high uncertainty. ; For binary graphs Perform 8-neighborhood connectivity analysis to cluster all adjacent high-uncertainty pixels into an independent connected region, which is then used as the set of high-uncertainty regions. Where m is the number of independent regions, each A set of coordinates containing all pixels in the current region; For each independent region, the centroid method is used to obtain its core points, and these points are integrated to form the set of potential cue point coordinates for all independent regions. ; For each potential cue point, query the current segmentation mask. The pixel value at that coordinate is denoted as ; After applying a preset judgment rule to each potential cue point, a preliminary cue point set is generated, consisting of coordinates. Composed of prompt type pairs; Medical images The integrated pixel space is divided into several non-overlapping, uniformly sized square local grids. All cue points in the initial cue point set are assigned to the corresponding local grids according to their coordinates. If a local grid contains more than one cue point, each cue point is extracted from the uncertainty map. The uncertainty coefficients in the data are ranked from highest to lowest. For each local grid, only the cue point with the highest uncertainty coefficient is retained, and all other cue points within that grid are deleted; the retained cue points from all grids are then integrated to obtain the final cue point set, which is the robust cue. .

5. The medical image segmentation method based on robust sequence prompting optimization according to claim 4, characterized in that: The specific logic of threshold comparison; The calculation formula is: ; Indicates the uncertainty coefficient; =1 indicates that the current pixel is a high-uncertainty pixel, and vice versa.

6. The medical image segmentation method based on robust sequence prompting optimization according to claim 5, characterized in that: Explanation of preset judgment rules; like =1, the prompt point is at The center is used as the foreground, and background point hints are generated. like =0, prompt point is at Using the center as the background, generate foreground attraction prompts.

7. The medical image segmentation method based on robust sequence prompting optimization according to claim 6, characterized in that: Optimized segmentation mask The computational logic; Based on the old and new segmentation masks and The uncertainty coefficient of the corresponding pixel is used to calculate its weight. That is, through , ;in and for and The uncertainty coefficient of the corresponding pixel, and They are respectively and The calculated personalized weights; The pixel-level foreground probabilities of the old and new masks are combined with calculated personalized weights and then weighted and averaged to generate an optimized foreground probability map with continuous values. Optimize the prospect probability map of continuous values The final optimized segmentation mask is generated after binarization with a preset fixed threshold. .

8. The medical image segmentation method based on robust sequence prompting optimization according to claim 7, characterized in that: The calculation logic for the segmentation state coefficients; Optimize the segmentation mask The uncertainty spectrum is generated as . ;right Perform morphological dilation to obtain the dilated mask. ; inflated mask and Perform pixel-level interpolation to obtain a binary image of the boundary region of the mask. ; Based on the binary map of the boundary region, the uncertainty spectrum is analyzed. Perform pixel-level filtering to retain the pixel values ​​corresponding to the boundary regions, forming a set of boundary uncertainties; Calculate the average uncertainty of the boundary uncertainty set to obtain an uncertainty metric. The uncertainty metric, the rate of change of boundary pixels, and the rate of change of the number of foreground pixels are weighted and fused to output the segmentation state coefficient.

9. The medical image segmentation method based on robust sequence prompting optimization according to claim 8, characterized in that: The calculation logic for the rate of change of boundary pixels and the rate of change of the number of foreground pixels; Extract the set of boundary uncertainties and calculate the proportion of the intersection of boundary pixels in two adjacent iterations as the boundary pixel change rate; Statistical optimization of segmentation mask The total number of foreground pixels in the adjacent iterative masks is calculated, and the rate of change is used as the rate of change of the number of foreground pixels.

10. A medical image segmentation system based on robust sequence prompting optimization, applied to the medical image segmentation method based on robust sequence prompting optimization as described in any one of claims 1-9, characterized in that, include: Initial segmentation module: Receives initial interactive prompts from the user and the medical image to be segmented, inputs the initial interactive prompts and the medical image into a pre-built basic segmentation model, and outputs the initial segmentation mask; Uncertainty quantization module: performs uncertainty quantization on the initial segmentation mask to generate an uncertainty map; Hint generation module: Based on the uncertainty map, it automatically generates the next set of robust hints through preset hint generation logic; The optimization fusion module inputs the robustness cue and the medical image back into the base segmentation model to obtain a new segmentation mask. The new segmentation mask and the initial segmentation mask are then fused by weighted averaging to generate an optimized segmentation mask. Termination Judgment Module: Calculates the uncertainty metric, boundary pixel change rate, and foreground pixel number change rate of the optimized segmentation mask, and weights them to obtain the segmentation state coefficient. If the segmentation state coefficient is lower than the preset threshold or the number of iterations reaches the preset maximum value, the iteration is terminated and the final segmentation result is output. Otherwise, the optimized segmentation mask is used as the new initial segmentation mask, and the module returns to the segmentation uncertainty quantification module for the next iteration optimization.