Automatic segmentation method and device for lesion area in ultrasonic image, medium and product
Through the combination of automated threshold segmentation and improved SAM large model, efficient and accurate segmentation of lesion areas in ultrasound images is achieved, and the problem of insufficient automation and accuracy in the existing technology is solved, and the level of intelligence of lesion areas is improved.
Patent Information
- Application Number
- CN202510446160.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-10
- Publication Date
- 2025-07-25
AI Technical Summary
Existing computer-assisted diagnostic systems lack automation and accuracy in lesion area segmentation in ultrasound imaging, especially in dealing with noise, artifacts, and operator dependence.
The automated threshold segmentation method is used for coarse segmentation, the binary mask of the foreground is obtained, and it is converted into multimodal prompt word information, and the improved SAM model is used for training, combining the sample data set and prompt word information to achieve accurate segmentation of the lesion area.
It significantly improves the efficiency, accuracy and intelligence level of lesion area segmentation, solves the problems of oversegmentation and undersegment caused by speckle noise, low contrast or lesion morphology in ultrasound images, and reduces computational redundancy and manual labeling dependence.
Smart Images

Figure CN120374645A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent medical technology, and particularly to an automated segmentation method, device, medium, and product for lesion regions in ultrasonic images. Background Art
[0002] In the process of medical image diagnosis, especially in the analysis of ultrasonic images of common diseases such as thyroid nodules, breast nodules, and lung nodules, traditional diagnostic methods mainly rely on doctors' personal experience and knowledge, which leads to inconsistencies in diagnostic results and limitations in accuracy. With the development of digital technology, image-based diagnostic techniques such as X-ray imaging, CT (Computed Tomography), and MRI (Magnetic Resonance Imaging) have been widely used to assist doctors in identifying and evaluating organ problems. However, the application of these techniques is still limited by doctors' subjective judgments. To improve the consistency and accuracy of diagnosis, Computer-Aided Diagnosis (CAD) systems have been developed, and they show the potential to improve diagnostic performance in the diagnosis of thyroid, breast, and lung diseases. Nevertheless, the existing CAD systems still need to be improved in terms of automation and precision, especially when dealing with ultrasonic images, and challenges such as noise, artifacts, and high operator dependence need to be addressed. Summary of the Invention
[0003] In response to the problems pointed out in the background art section, this application provides an automated segmentation method, device, medium, and product for lesion regions in ultrasonic images to improve the efficiency, accuracy, and intelligence level of lesion region segmentation in ultrasonic images.
[0004] To achieve the above object, this application provides the following solutions.
[0005] In a first aspect, this application provides an automated segmentation method for lesion regions in ultrasonic images, including:
[0006] Obtain the original ultrasonic image taken of the patient's lesion site and perform preprocessing to obtain the preprocessed ultrasonic image;
[0007] Annotate the preprocessed ultrasonic image, and store the annotated image and the ultrasonic image in one-to-one correspondence to form a sample data set;
[0008] Perform rough segmentation on the foreground and background in the ultrasonic image through an automated threshold segmentation method to obtain a binary mask of the foreground as a rough mask;
[0009] Convert the rough mask into multi-modal prompt word information;
[0010] Use the sample data set and the multi-modal prompt word information to train an improved SAM large model, and use it as a lesion region segmentation model after training;
[0011] Obtain the ultrasonic image to be segmented and its prompt information, and input them into the lesion area segmentation model to automatically segment the lesion area.
[0012] Optionally, obtaining the original ultrasonic image taken of the patient's lesion site and performing preprocessing to obtain the preprocessed ultrasonic image, specifically including:
[0013] Obtain the original ultrasonic image stored in.jpg or.png format taken of the patient's lesion site, and perform cleaning and standardization operations on the original ultrasonic image to obtain the preprocessed ultrasonic image.
[0014] Optionally, coarsely segment the foreground and background in the ultrasonic image by an automated threshold segmentation method to obtain a binary mask of the foreground as the coarse mask, specifically including:
[0015] For ultrasonic images with high contrast and significantly separated gray-level distributions, use the Otsu method to determine the optimal threshold;
[0016] For ultrasonic images with more noise or complex gray-level distributions, use the maximum entropy method to determine the optimal threshold;
[0017] Coarsely segment the foreground and background in the ultrasonic image based on the optimal threshold to obtain a binary mask of the foreground as the coarse mask.
[0018] Optionally, converting the coarse mask into multi-modal prompt information, specifically including:
[0019] Extract the geometric center point of the coarse mask as point prompt information, extract the minimum bounding rectangle of the coarse mask as bounding box prompt information, and use the coarse mask itself as mask prompt information to jointly form multi-modal prompt information.
[0020] Optionally, training an improved SAM large model using the sample dataset and multi-modal prompt information, and using it as the lesion area segmentation model after training, specifically including:
[0021] Perform anisotropic filtering and contrast-limited histogram equalization processing on each ultrasonic image in the sample dataset to generate the preprocessed ultrasonic image;
[0022] Construct a point coordinate matrix P from all the point prompt information extracted from this ultrasonic image, a set of bounding box tensors K from all the bounding box prompt information, and a set of low-resolution masks M from all the mask prompt information, and generate a prompt set H = {P, K, M} for this ultrasonic image;
[0023] Take the pre - processed ultrasound image as the first input to the improved SAM large model, and take the corresponding extracted set of prompt words \(H = \{P, K, M\}\) as the second input to the improved SAM large model. After being processed by the improved SAM large model, a predicted mask is output;
[0024] Calculate the multi - modal contrast edge - aware loss value of the improved SAM large model according to the predicted mask
[0025] Based on Perform unsupervised training and optimization on the improved SAM large model, adjust the network parameters through the backpropagation algorithm, and obtain the improved SAM large model with the smallest as the lesion area segmentation model.
[0026] Optionally, the improved SAM large model specifically includes: a ViT - B encoder, a spatial encoder, a multi - scale texture enhancement module, a cross - attention gating module, a dynamic routing module, a progressive decoder, and a Sigmoid activation layer;
[0027] The ViT - B encoder is used to extract its multi - scale image features \(\{F_l(x), l\in(1,2,\cdots,L)\}\) according to the pre - processed ultrasound image \(x\) which is the first input to the improved SAM large model; where \(F_l(x)\) represents the image feature extracted in the \(l\) - th layer; \(L\) is the number of layers;
[0028] The spatial encoder is used to convert the set of prompt words \(H = \{P, K, M\}\) which is the second input to the improved SAM large model into high - dimensional embedding vectors, and respectively obtain a point prompt encoding \(E_p\), a box prompt encoding \(E_k\), and a mask encoding \(E_m\);
[0029] The multi - scale texture enhancement module is used to obtain a fused feature \(F'_l(x)\) by cross - scale feature fusion of the image feature \(F_l(x)\);
[0030] The cross - attention gating module is used to generate an attention weight matrix \(\alpha\) according to the fused feature \(F'_l(x)\) and the mask encoding \(E_m\), and inject the weighted prompt word semantic information into the fused feature \(F'_l(x)\) based on the attention weight matrix \(\alpha\), and output an enhanced feature \(F''_l(x)\);
[0031] The dynamic routing module is used to splice the point prompt encoding \(E_p\) and the box prompt encoding \(E_k\) with the enhanced feature \(F''_l(x)\) as the input to each stage of the progressive decoder;
[0032] The progressive decoder is used to perform cascaded upsampling on the input of each stage and introduce an edge - aware loss at each stage Finally, output the predicted mask through the Sigmoid activation layer
[0033] Optionally, obtaining the ultrasonic image to be segmented and its prompt word information and inputting them into the lesion area segmentation model to automatically segment the lesion area specifically includes:
[0034] Obtaining the prompt word information of the ultrasonic image to be segmented through an automatic threshold segmentation method or based on user input;
[0035] Inputting the ultrasonic image to be segmented and its prompt word information into the lesion area segmentation model to output a predicted mask of the lesion area
[0036] Adjusting the predicted mask The position and range of to form the finally determined lesion area.
[0037] In a second aspect, the present application provides a computer device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the computer program to implement the automatic segmentation method for the lesion area in the ultrasonic image.
[0038] In a third aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the automatic segmentation method for the lesion area in the ultrasonic image.
[0039] In a fourth aspect, the present application provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the automatic segmentation method for the lesion area in the ultrasonic image.
[0040] According to the specific embodiments provided by the present application, the following technical effects are disclosed.
[0041] An automated segmentation method, device, medium, and product for lesion regions in ultrasound images provided by this application perform rough segmentation of the foreground and background of ultrasound images through an automated threshold segmentation method to obtain rough mask information of the foreground; then extract multi-modal prompt word information from the rough mask and transfer it to an improved SAM large model. Through learning a large number of labeled ultrasound images, the lesion region segmentation model can master the mapping relationship from the rough segmentation result to the precise segmentation result, automatically capture key features such as the morphology, texture, and position of the lesion region in the ultrasound image, and achieve precise segmentation of the lesion region. Compared with directly applying threshold segmentation or traditional deep learning models, this application through the collaborative design of rough segmentation and prompt word guidance not only retains the high efficiency and low computational cost of the threshold method but also uses the generalization ability of SAM to solve the over-segmentation and under-segmentation problems caused by speckle noise, low contrast, or variable lesion morphology in ultrasound images, significantly improving the accuracy of the segmentation boundary and the structural integrity. At the same time, it avoids the computational redundancy of full-image search and the dependence on manual annotation, significantly improving the efficiency, accuracy, and intelligent level of lesion region segmentation. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the following will briefly introduce the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of this application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0043] Figure 1 It is a schematic flowchart of an automated segmentation method for lesion regions in an ultrasound image of this application;
[0044] Figure 2 It is a schematic diagram of the network architecture of the improved SAM large model;
[0045] Figure 3 It is a schematic diagram of annotation based on point prompt information;
[0046] Figure 4 It is a schematic diagram of annotation based on box prompt information;
[0047] Figure 5 It is a schematic diagram of manually adjusting the segmentation result. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0048] The following will clearly and completely describe the technical solutions in the embodiments of this application with reference to the drawings in the embodiments of this application. Obviously, the described embodiments are only some embodiments of this application, rather than all embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of this application.
[0049] This application proposes an automated segmentation method, device, medium, and product for lesion regions in ultrasonic images. The aim is to automatically calculate the threshold for rough segmentation by combining the Otsu method or the maximum entropy method, and use the SAM large model for precise segmentation, so as to solve the limitations of existing ultrasonic image segmentation methods, improve the efficiency, accuracy, and intelligence level of lesion region segmentation in ultrasonic images, provide a brand-new solution for the segmentation of lesion regions such as nodules in ultrasonic images, and assist in improving the objectivity, accuracy, and automation degree of diagnosis.
[0050] To make the above objects, features, and advantages of this application more obvious and understandable, the following further detailed description of this application will be given in conjunction with the accompanying drawings and specific embodiments.
[0051] In an exemplary embodiment, as Figure 1 shown, an automated segmentation method for lesion regions in ultrasonic images is provided, including the following steps 1 to 6.
[0052] Step 1: Obtain the original ultrasonic image of the patient's lesion site and perform preprocessing to obtain the preprocessed ultrasonic image.
[0053] The method developed in this application is a full-process and fully automated dynamic and static ultrasonic image segmentation method, mainly for the analysis of ultrasonic images of common diseases such as thyroid nodules, breast nodules, and lung nodules. Therefore, the lesion regions to be segmented are usually nodule regions. In the data collection and preparation stage, it is necessary to collect a large number of dynamic and static ultrasonic images (also called images) taken of the patient's lesion site, including static ultrasonic image data stored in.jpg or.png format, as well as recorded dynamic ultrasonic image video streams.
[0054] On the one hand, collect ultrasonic image data stored in.jpg or.png format, which are easy to transfer and process between different systems and software. On the other hand, use the OpenCV library to perform frame splitting on the dynamic ultrasonic images, convert each instantaneous image in the video stream into a separate frame (a separate.jpg or.png ultrasonic image) for subsequent analysis and processing. Take all the obtained separate.jpg or.png format ultrasonic images as the original ultrasonic images.
[0055] In the data preprocessing stage, a series of cleaning and standardization operations were performed on the original ultrasound images, including removing noise from the images, adjusting the resolution of the images, etc. Through resampling, the image resolution was unified to 224×224 size to ensure data consistency and the efficiency of model processing. These steps are crucial for improving the recognition ability and analysis accuracy of the model. Through these carefully designed steps, a solid foundation was laid for the automated segmentation and analysis of ultrasound images, enabling this application to be effectively applied in clinical diagnosis and assisting in improving the efficiency and accuracy of diagnosis.
[0056] Step 2: Annotate the preprocessed ultrasound images, and store the annotated images and the ultrasound images in one-to-one correspondence to form a sample data set.
[0057] To ensure the quality of the data and the accuracy of the model, professional doctors or medical imaging experts carefully annotate the preprocessed ultrasound images, following the generally recognized standards and guidelines in the industry to ensure that the positions of the lesion areas in each frame of the image are accurate and error-free, providing high-quality training data for the model. Store the annotated images and the preprocessed ultrasound images in one-to-one correspondence to form a sample data set for use in the subsequent model training process.
[0058] Step 3: Coarsely segment the foreground and background in the ultrasound image through an automated threshold segmentation method to obtain a binary mask of the foreground as the coarse mask.
[0059] This application aims to achieve the initial coarse segmentation of the foreground and background in ultrasound images through an automated threshold calculation method. For this purpose, two algorithms, the Otsu method and the maximum entropy method, are adopted. They each have unique advantages and are applicable to different image feature scenarios. By using these two methods in combination, the adaptability and reliability of the coarse segmentation can be improved.
[0060] Specifically, the Otsu method is a global threshold segmentation technique based on the image gray histogram. Its core lies in determining the optimal threshold by maximizing the between-class variance to achieve the best separation between the foreground and the background. The specific implementation steps include calculating the gray histogram of the image and the normalized probability distribution, then dividing the gray values into foreground and background classes based on the assumed threshold T, and calculating the between-class variance of these two classes. The formula for calculating the between-class variance is:
[0061]
[0062] where w1(T) and w2(T) are the probabilities of the pixels belonging to the foreground and the background respectively; μ1(T) and μ2(T) are the average gray values of the foreground and the background pixels respectively; is the between-class variance of the foreground and the background classes. By traversing all possible thresholds T, select the T that can maximize as the optimal solution, that is, the best threshold.
[0063] The maximum entropy method is a threshold segmentation method based on information theory. Its core idea is to determine the optimal segmentation threshold by maximizing the sum of the entropy values of the foreground and background of the image. This method also first calculates the grayscale histogram and probability distribution of the image, then defines the entropy functions of the foreground and background, and searches for the threshold that maximizes the total entropy. The entropy functions of the foreground and background are defined as follows:
[0064]
[0065] where w1(T) and w2(T) are the probabilities of pixels belonging to the foreground and background respectively. P(i) represents the probability of the gray level i appearing in the image, and I is the total number of gray levels. H1(T) and H2(T) are the entropy values of the foreground and background respectively. The total entropy is defined as:
[0066] H(T) = H1(T) + H2(T) (4)
[0067] The goal is to find the threshold T that maximizes the total entropy H(T), and at this time T is the optimal threshold.
[0068] In this application, the advantages of these two methods are combined, and the applicable method is selected according to different scenarios. For images with high contrast and obvious separation of gray level distributions, the Otsu method is preferentially used to quickly obtain the optimal threshold; for images with more noise or complex gray level distributions, the maximum entropy method is used to obtain the optimal threshold to better adapt to the feature differences. Then, based on the optimal threshold, the foreground and background in the ultrasound image are roughly segmented to obtain a binary mask of the foreground (such as suspected nodules, lesions, etc.) and the background (such as normal tissues), and the binary mask of the foreground is used as the rough mask to be used subsequently. This multi-method combined rough segmentation strategy can effectively obtain the foreground information of the image, providing a solid foundation for the precise segmentation of the SAM large model based on prompt words in the subsequent stage.
[0069] Step 4: Convert the rough mask into multi-modal prompt word information.
[0070] This application realizes the automatic fine segmentation of lesion regions in ultrasound images by integrating traditional threshold segmentation methods with large model segmentation techniques based on visual cues. Specifically, first, the Otsu method or the maximum entropy method is used to perform global threshold rough segmentation on the ultrasound image, generating a binary mask that distinguishes the foreground (such as suspected nodules, lesions) from the background (such as normal tissues). This process quickly locates the target region by maximizing the between-class variance or information entropy, forming an initial pixel-level segmentation result. However, traditional threshold segmentation is vulnerable to noise, uneven gray levels, or blurred boundaries in complex ultrasound images, making it difficult to meet the requirements of medical diagnosis for detail accuracy. Therefore, this application innovatively converts the foreground binary mask (rough mask) of the rough segmentation into multi-modal prompt information and inputs it into the SAM (Segment Anything Model) large model to assist the SAM large model in quickly locating the lesion regions in the ultrasound image.
[0071] Specifically, for each rough mask in each ultrasound image, the geometric center point of the rough mask is extracted as point prompt information, the minimum bounding rectangle of the rough mask is extracted as box prompt information, and the rough mask itself is used as mask prompt information, jointly constituting multi-modal prompt information. These prompts are essentially spatial positioning markers automatically generated from the rough segmentation results through coordinate parsing, connected component analysis, and morphological operations, rather than relying on manual annotation. For example, through post-processing techniques such as opening and closing operations, the geometric center point of the rough mask can be extracted through coordinate parsing as point prompt information, and the minimum bounding rectangle of the rough mask can be extracted through connected component analysis and morphological operations as box prompt information.
[0072] Step 5: Use the sample data set and multi-modal prompt information to train the improved SAM large model, and use it as a lesion region segmentation model after training.
[0073] This application proposes an improved SAM large model. Through the encoder-decoder architecture, it deeply fuses the high-resolution texture features of the original ultrasound images with the spatial constraint information of the prompt words. Among them, the point prompt guides the model to focus on the central region of the target through position encoding, the box prompt defines the rough spatial range of the lesion, and the mask prompt is used as a low-resolution prior feature to perform multi-level feature fusion with the image details. During this process, SAM dynamically enhances the weight of the target area through the self-attention mechanism and gradually refines the boundary in combination with the upsampling operation of the decoder, and finally outputs a pixel-level fine segmentation mask. Compared with directly applying threshold segmentation or traditional deep learning models, through the collaborative design of coarse segmentation and prompt-word guidance, this application not only retains the high efficiency and low computational cost of the threshold method, but also uses the generalization ability of SAM to solve the over-segmentation and under-segmentation problems caused by speckle noise, low contrast or variable lesion morphology in ultrasound images, significantly improving the accuracy of the segmentation boundary and the structural integrity (such as the retention of spiculated edges and microcalcifications), while avoiding the computational redundancy of full-image search and the dependence on manual annotation, providing a robust and scalable technical framework for large-scale medical image analysis.
[0074] In the model training stage, on the one hand, each ultrasound image in the sample dataset is processed by anisotropic filtering and Contrast Limited Adaptive Histogram Equalization (CLAHE) to generate the pre-processed ultrasound image x with a size of 224×224×1, where 224×224 is the height×width of the image and 1 is the number of channels. Then, all the point prompt information extracted from this ultrasound image forms a point coordinate matrix All the box prompt information forms a set of bounding box tensors All the mask prompt information forms a set of low-resolution masks Thus, a set of prompt words H = {P, K, M} for this ultrasound image is generated; where N is the number of multi-modal prompt word information, that is, the number of coarse masks, the point prompt information is two-dimensional coordinate information, the box prompt information is four-dimensional information, and the size of the mask information is 56×56×1.
[0075] Furthermore, the pre-processed ultrasound image is used as the first input to the improved SAM large model, and the corresponding set of extracted prompt words H = {P, K, M} is used as the second input to the improved SAM large model. After being processed by the improved SAM large model, a predicted mask is output During the training process, the multi-modal contrast edge-aware loss value of the improved SAM large model is calculated based on the predicted mask Based on The improved SAM large model is trained and optimized without supervision, and the network parameters are adjusted through the backpropagation algorithm to obtain The smallest improved SAM large model is used as the lesion area segmentation model.
[0076] The network architecture of the improved SAM large model proposed in this application for segmenting the lesion area (such as nodules) in ultrasound images is as Figure 2 shown. Its core lies in constructing an encoder-decoder framework guided by dual-path feature collaboration, and realizing fine mapping through deep fusion of ultrasound image features and rough segmentation prompt information. As Figure 2 shown, the improved SAM large model specifically includes: ViT-B encoder, spatial encoder, multi-scale texture enhancement module, cross-attention gating module, dynamic routing module, progressive decoder, and Sigmoid activation layer. The processing flow of each module of the improved SAM large model will be introduced in detail below.
[0077] The input of the improved SAM large model includes two parallel data streams: the first input is the pre-processed ultrasound image x, and the second input is the prompt word set H = {P, K, M}.
[0078] In the encoding stage, the first input x of the model passes through the ViT-B (Vision Transformer Base) encoder to extract its multi-scale image features {F_l(x), l ∈ (1, 2,..., L)}; where F_l(x) represents the image feature extracted in the l-th layer, which will be abbreviated as F_l for convenience of description below; L is the number of layers. In a specific embodiment, four layers (four stages) are set in the encoding stage, that is, L = 4, then the extracted multi-scale image features include the set {F_1(x), F_2(x), F_3(x), F_4(x)}, and the corresponding resolutions are 56×56, 28×28, 14×14, 7×7 respectively.
[0079] Furthermore, a multi-scale texture enhancement module (MTEM) is embedded in the shallow layer of the model to obtain the fused feature F'_l(x) by cross-scale feature fusion of the image feature F_l(x), and its calculation process can be expressed as follows.
[0080] F'_l = F_l, l = 1(5)
[0081]
[0082] Among them, represents element-wise addition; Conv3×3() represents a 3×3 convolution operation; Cat[] is a channel concatenation operation; Up() is a bilinear upsampling; F'_l represents the fused feature extracted in the l-th layer. The MTEM module enhances the robustness to ultrasound speckle noise through cross-scale feature fusion.
[0083] In a specific embodiment, when l ∈ (1, 2, 3, 4), we have:
[0084] F'_1 = F_1(8)
[0085]
[0086] During the encoding stage, the second input of the model, namely the set of prompt words H = {P, K, M}, is converted into high-dimensional embedding vectors through the spatial encoder, and we respectively obtain the point prompt encoding box prompt encoding and mask encoding Furthermore, the mask encoding E_m interacts with the image fusion feature F'_l(x) through the cross-attention gating module.
[0087] Specifically, the cross-attention gating module (CAGM) is used to generate an attention weight matrix α based on the fusion feature F'_l(x) and the mask encoding E_m. The formula is as follows:
[0088]
[0089] The CAGM module further injects the weighted prompt word semantic information into the fusion feature F'_l(x) based on the attention weight matrix α, and outputs the enhanced feature F”_l(x). The formula is as follows:
[0090] F”_l = F'_l + γ·Conv1×1(α·V(E_m)) (13)
[0091] where Q(), K(), and V() are the query, key, and value projection matrices respectively. Q(F'_l) is the query vector obtained by mapping the image feature fusion feature F'_l through the query projection matrix. K(E _m ) T is the key vector obtained by mapping the mask encoding E_m through the key projection matrix. d is the feature dimension. Softmax() represents the softmax function. α i,j represents the attention weight between the image feature position i and the prompt word feature position j, and its physical meaning is the attention intensity of the model to the prompt word-related region. The role of formula (12) is to generate an attention weight matrix by calculating the similarity between all pairs of spatial positions to guide the model to focus on the semantic region related to the prompt word mask. The element in the i-th row and j-th column of α is α i,j .
[0092] For Equation (13), V(E_m) is the value vector obtained by mapping the mask encoding E_m through the value projection matrix; α·V(E_m) represents weighted summation of the value vector according to the attention weights to generate context features matching the resolution of the image features. γ is a learnable scaling factor, and Conv1×1() represents a 1×1 convolution operation, which enables the model to focus on the semantic regions related to the prompt words. The role of Equation (13) is to inject the weighted semantic information of the prompt words (such as the prior of nodule shape) into the image fusion feature F'_l and output the enhanced feature As part of the features input to each stage of the progressive decoder.
[0093] Furthermore, the point prompt encoding E_p and the box prompt encoding E_k are concatenated with the enhanced feature F”_l(x) through the dynamic routing module and used as the input to each stage of the progressive decoder to further refine the segmentation boundary.
[0094] The decoder of this application adopts a progressive feature refinement structure, called the progressive decoder. The progressive decoder gradually restores the spatial details by cascading and upsampling the inputs at each stage (for example, from F”_4 to F”_1), and introduces an edge-aware loss at each stage Finally, the predicted mask is output through the Sigmoid activation layer
[0095] Among them, the calculation method of the edge-aware loss (Edge-Aware Loss, EAL) is as follows:
[0096]
[0097] Among them, is the predicted mask of the decoding output of the l-th layer, and M gt is the true annotation mask on the annotated image. represents calculating the structural similarity between the predicted mask and the true annotation mask. is the Sobel gradient operator, λ is the balance coefficient, is the calculated edge-aware loss value. This edge-aware loss function (14) forces the decoder to maintain the topological continuity of the nodule boundary at multiple scales.
[0098] The predicted mask finally output by the model is generated by fusing the predicted masks of each layer through the Sigmoid activation layer and its pixel values represent the probability distribution of the lesion (nodule) region. Therefore, this predicted mask It can be used to assist in nodule quantitative analysis in clinical diagnosis or as the input of an AI-assisted diagnosis system. Its advantages are as follows: ① By fusing the rough segmentation hints and image detail features through the CAGM module, it solves the problem of local gray-scale mutation caused by the acoustic shadow effect in ultrasound images; ② The edge-aware loss constrains the multi-scale boundary continuity, improving the detection rate of micro nodules (<3mm); ③ The dynamic routing mechanism combines point, box, and mask hints to adapt to the segmentation requirements of nodules with different morphologies (such as cystic, solid, and mixed).
[0099] The predicted mask finally output by the model The improvement compared to the rough segmentation result (rough mask M) is as follows: ① By dynamically fusing the global gray-scale statistical characteristics (from Otsu's method / Maximum Entropy method) and local texture patterns (from SAM) through the dual-path feature collaboration mechanism, it solves the problem of local gray-scale mutation caused by the acoustic shadow effect in ultrasound images; ② Using the spatial attention guidance of CAGM, while maintaining the overall positioning accuracy of the rough segmentation, it corrects the mis-segmentation of the weak edges (such as the transition area between cystic and solid nodules) by the threshold method; ③ Through the joint optimization of MTEM and EAL, it enhances the detection sensitivity of the model to micro calcifications (<3mm). Experiments show that the Dice coefficient of the improved SAM large model network architecture of this application on the thyroid nodule ultrasound dataset reaches 92.7%, an increase of 6.3% compared to the original SAM large model, and the inference speed meets the real-time requirement (45ms / frame).
[0100] In the process of model training and optimization, the application of the unsupervised loss function is one of the core links, which plays a crucial role in the model training and optimization stage. The principle of the unsupervised loss function is mainly based on evaluating the difference between the model output and the true annotation. The loss function automatically calculates the loss value by analyzing the internal relationship between the model output and the image features, thereby reflecting the gap between the model segmentation result and the real situation, providing a key basis for model optimization. The design of the unsupervised loss function usually considers the internal structure and distribution characteristics of the data.
[0101] In this application, a self-developed multi-modal contrastive edge-aware loss function (Multi-Modal Contrastive Edge-Aware Loss, MCEL) is proposed, and its core formula is:
[0102]
[0103] Among them, is the calculated multi-modal contrastive edge-aware loss value. is the predicted mask output by the l-th layer, H l and W l are respectively the height and width of; It is a pseudo-label generated by Gaussian blur and downsampling. It represents calculating the structural similarity between the predicted mask and the pseudo-label. is the Sobel gradient operator, λ1 and λ2 are two balancing coefficients. f(x) is the image feature extracted by the encoder for sample x, and x + is a data augmentation (such as rotation, elastic deformation, etc.) sample of the same lesion area. is a negative sample of different lesion or background areas, and N' is the number of negative samples. τ is the temperature coefficient, also known as the temperature hyperparameter. E x~X [ ] represents extracting the contrastive mutual information.
[0104] The MCEL function proposed in this application is directly related to the encoder weights, decoder weights, and temperature coefficient τ (if set as a learnable parameter) in the improved SAM large model, and the model performance is improved through an end-to-end joint optimization mechanism. Specifically, the encoder weights affect the calculation of the contrastive mutual information term through extracting image features The core objective of its optimization is to maximize the feature similarity between the enhanced sample x of the same nodule + and the anchor sample x while minimizing its similarity with the negative samples forcing the encoder to capture the discriminative patterns unique to nodules from unlabeled ultrasound images, such as the speckled texture of calcified lesions, the annular enhanced edge of cystic nodules, etc. The decoder weights participate in the optimization of the edge consistency term by generating multi-scale predicted masks The loss gradient is backpropagated to each upsampling layer of the decoder, forcing the predicted mask to be aligned with the coarse segmentation pseudo-label in the gradient domain and the structural domain to enhance the physical continuity and morphological consistency of the nodule boundary, such as the fine restoration of burrs and lobulated contours. The temperature coefficient τ, as an adjustable parameter, dynamically balances the intra-class compactness and inter-class separability in the feature space by controlling the similarity distribution of positive and negative sample pairs in contrastive learning. In addition, the hyperparameters λ1 and λ2, as the weight coefficients of the loss terms, determine the optimal values through grid search on the validation set during the training process (the default values are λ1 = 0.5 and λ2 = 1.0), which are used to coordinate the optimization intensity of local edge constraints and global semantic contrast, avoiding overfitting or underfitting caused by a single loss objective. During the backpropagation process, the gradient of the total loss acts on the convolutional layer and self-attention layer of the ViT-B encoder, the cross-layer feature fusion stage of the decoder, and the learnable τ (if enabled) simultaneously through the chain rule, realizing the synchronous update of all parameters. This design enables the model to: ① couple multi-granularity supervision signals, utilize the edge term to optimize the local pixel accuracy, and the contrastive term to enhance the global semantic distinguishability; ② adapt to the characteristics of ultrasound images through the gradient operator Suppress speckle noise interference and improve the detection rate of low-contrast lesions by combining contrastive learning; ③ Achieve efficient end-to-end training without staged pre-training or complex manual intervention, and complete the collaborative learning of feature extraction and segmentation optimization under a single loss framework. For example, in medical image segmentation, since the proportion of target pixels in an image is small, the positive-negative sample ratio is seriously imbalanced, which makes network training difficult. To solve this problem, the MCEL function of this application can be selected to reasonably optimize the network and focus on smaller targets.
[0105] The MCEL function of this application consists of an unsupervised edge consistency term and a contrastive mutual information maximization term. The former calculates the differences between the predicted mask and the coarse segmentation pseudo-label (generated by Gaussian blur and downsampling) in the multi-scale gradient domain ( For the Sobel operator) and structural similarity (SSIM), and forces the model to retain the physical continuity of nodule edges (such as burrs, lobulated contours). The latter maximizes the similarity between the data augmentation samples of the same nodule region and the encoder image features through a contrastive learning framework, while suppressing their correlation with the negative samples in the background region. This design maximizes the mutual information between the model output and the data distribution by implicitly modeling the joint distribution differences between nodules and the background - specifically manifested as the compactness of the same type of nodules and the separation of different regions in the feature space, so as to autonomously capture discriminative patterns such as the speckled texture of calcified lesions and the annular enhancement of cystic nodules. Compared with traditional unsupervised loss functions (such as Dice Loss based on pixel statistics or InfoNCE with a single contrast loss), the innovation of MCEL lies in the collaborative optimization mechanism that integrates edge continuity constraints, structural similarity alignment, and semantic contrastive learning. Experiments show that the MCEL function of this application can increase the segmentation recall rate of micro-nodules (<5mm) by 17.6% on the thyroid nodule dataset, and the Dice coefficient reaches 92.7%. Moreover, the MCEL function of this application does not rely on real annotation data, and only uses the statistical characteristics of the coarse segmentation results and the positive-negative sample pairs generated by data augmentation to guide the model to adaptively mine the deep semantic associations of ultrasound images in end-to-end training, solving the problems of blurred boundaries and missed detection of weak signals caused by positive-negative sample imbalance in traditional methods, and providing a differentiable and highly generalized unsupervised optimization paradigm for medical image segmentation.
[0106] In this application, the improved SAM large model is trained and optimized through an unsupervised loss function. During the training process, an interactive loop iteration method is adopted to continuously evaluate the performance of the SAM large model using the unsupervised loss function MCEL, and the parameters of the model are adjusted through the backpropagation algorithm. The core of this optimization strategy lies in continuously iterating and adjusting to gradually reduce the value of the loss function, thereby promoting the continuous improvement of the segmentation accuracy of the improved SAM large model. More importantly, this unsupervised optimization strategy not only improves the segmentation accuracy of the improved SAM large model but also significantly enhances its generalization ability. This means that the trained improved SAM large model can better adapt to and process more complex and diverse ultrasound image data, providing more reliable and accurate assistance for clinical diagnosis and treatment. Through continuous iterative optimization until the value of the loss function is minimized, a trained lesion area segmentation model is finally obtained for the precise segmentation of nodule targets in ultrasound images, contributing a new solution to the development of the field of medical artificial intelligence.
[0107] Step 6: Obtain the ultrasound image to be segmented and its prompt information and input them into the lesion area segmentation model to automatically segment the lesion area.
[0108] After the training of the lesion area segmentation model is completed, during actual use, for the static or dynamic ultrasound image currently taken by the patient, first obtain the static ultrasound image stored in the.jpg or.png format, or use the OpenCV library to perform frame splitting on the dynamic ultrasound image to convert each instantaneous image in the video stream into a separate frame, thereby obtaining the ultrasound image to be segmented of the patient.
[0109] Then obtain the prompt information of the ultrasound image to be segmented. At this time, there are two acquisition methods. One method is to perform optimal threshold calculation through automated threshold segmentation methods (Otsu method and maximum entropy method) after data collection and frame splitting, and extract the prompt information based on the segmented rough mask. The Otsu method and the maximum entropy method each have their own unique advantages and are applicable to different image feature scenarios. By using these two methods in combination, the adaptability and reliability of the rough segmentation can be improved, thereby realizing the preliminary segmentation of the foreground and background in the ultrasound image. Another way is to obtain the prompt information of the ultrasound image to be segmented based on user input. During the actual use stage, the user is allowed to manually pre-annotate point prompt information or box prompt information on the ultrasound image to be segmented using a self-made annotation tool, such as Figure 3 and Figure 4 shown; then, combined with the prompt information extracted from the rough mask, they are used as the model input together.
[0110] Next, the prompt word information obtained through threshold calculation and / or user input is input into the lesion area segmentation model for segmentation. The lesion area segmentation model is responsible for receiving the extracted prompt word information, including key features such as points, boxes, and masks, and based on this information, performs more refined segmentation on the ultrasound image. By learning from a large number of labeled ultrasound image data, the lesion area segmentation model can master the mapping relationship from the rough segmentation result to the precise segmentation result, and then capture key features such as the morphology, texture, and position of nodules in the image, realizing precise segmentation of nodule targets.
[0111] Input the ultrasound image to be segmented and its prompt word information into the lesion area segmentation model, and the predicted mask of the lesion area can be output. As the segmentation result, the position and range information of the nodule are marked in the image to be segmented. The user can use a self-made annotation tool to manually adjust and modify the marked position and range, such as Figure 5 shown. After the automatic annotation is completed, select the move and edit selected polygon icon in the UI (user interface), and use the mouse to reasonably stretch and fine-tune the boundary of the annotation. Long-press the left mouse button on the annotation to move the position of the annotation to achieve the purpose of correction. By adjusting the position and range of the predicted mask a finally determined lesion area is formed. This flexibility makes the implementation method of this application not only highly automated but also capable of being customized according to specific application scenarios, thus meeting the needs of clinical diagnosis.
[0112] The method of this application automatically calculates the optimal threshold for rough segmentation based on the Otsu method or the maximum entropy method to obtain foreground information. Through post-processing techniques such as opening and closing operations, prompt word information (points, boxes, masks, etc.) is extracted and passed to the improved SAM large model to achieve nodule target segmentation of ultrasound static images or dynamic videos. In addition, this application also designs an unsupervised loss function, and through interactive iterative optimization of the segmentation result of SAM until the loss function value is minimized, thereby achieving precise segmentation. The method of this application not only improves the automation degree of segmentation but also enhances the accuracy and efficiency of segmentation.
[0113] The following provides a specific implementation process of the method of this application, which is carried out according to the following steps S1 to S6.
[0114] S1: First, perform frame splitting on the collected dynamic ultrasound image data. Use the OpenCV library to decompose the continuous video stream into individual frame images, laying a foundation for subsequent processing and analysis. These frame images will be used for further threshold calculation and model training.
[0115] S2: After frame splitting, apply Otsu's method or the maximum entropy method to calculate the threshold for each frame of ultrasound image. According to the characteristics of the image, use an algorithm to determine the optimal threshold, calculate the optimal threshold for one of the images, and apply it to the remaining images to achieve the initial segmentation of the foreground and background. The calculated optimal threshold is stored for subsequent use.
[0116] S3: Next, train the improved SAM large model. During the training process, use a self-made annotation tool and combine the knowledge and experience of professional doctors or medical imaging experts to carefully annotate the ultrasound image data. These annotated data will be used as the input for model training to help the SAM large model learn the mapping relationship from the rough segmentation result to the accurate segmentation result.
[0117] S4: After the improved SAM large model is trained, package it as a lesion area segmentation model for subsequent use. During actual use, the user uses point prompt information or box prompt information to label and distinguish the relevant areas in the ultrasound image to be segmented. These point prompt information or box prompt information include the center point of the nodule or other key feature points, which provide important clues about the position of the nodule for the model. Through the combination of these points or boxes with the mask information, the improved SAM large model can accurately locate and segment the nodule area and automatically perform annotation.
[0118] S5: Based on the point or box prompt information, the self-made annotator is embedded with the lesion area segmentation model to automatically complete the segmentation task of the ultrasound image under the user's keyword prompt. The lesion area segmentation model extracts the multi-scale features of the image in real time through a pre-trained encoder, aligns the features with the position / bounding box / low-resolution mask encoding of the point / box / mask prompt in the feature space, and uses the cross-layer attention mechanism of the decoder to dynamically focus on the morphological features of the nodule area. During this process, the model is specifically optimized in combination with the physical characteristics of the ultrasound image: ① Enhance the capture ability of small lesions (<3mm) and spiculated boundaries through a multi-scale gradient perception module to avoid edge blurring caused by speckle noise; ② Adopt a dynamic threshold adjustment strategy to adaptively optimize the mask generation confidence according to the local gray distribution and suppress the over-segmentation phenomenon in the shadow artifact or low-contrast area; ③ Introduce contrast enhancement preprocessing to improve the distinguishability between the target and the background and ensure the guiding effectiveness of the point / box / mask prompt.
[0119] The essence of multi-scale gradient perception is the functional extension of the multi-scale texture enhancement module (MTEM) embedded in the first path of the encoder. It fuses shallow high-resolution features (such as the 56×56 detailed texture of F_1) and deep semantic features (such as the 7×7 global context of F_4) across layers. Based on the self-attention mechanism of the ViT-B encoder, it further introduces gradient direction constraints (extracting the edge response of the feature map through the Sobel operator), thereby enhancing the model's sensitivity to the punctate hyperecho and spiculated boundaries of microcalcifications (<3mm) in ultrasound images. The dynamic threshold adjustment strategy is integrated into the mask generation layer of the decoder. By analyzing the local grayscale histogram of the current feature map F”_l in real time (calculating the mean and variance with a 56×56 sliding window), it adaptively adjusts the threshold bias term before Sigmoid activation, suppressing over-segmentation caused by acoustic shadow artifacts (posterior echo attenuation) or low contrast (such as misclassifying normal tissue as a nodule). This strategy complements the prompt-based spatial attention in the cross-attention gating module (CAGM), optimizing the segmentation accuracy from two dimensions: data-driven and prior-guided. The contrast enhancement preprocessing, as the preprocessing of the first path input of the model, adopts the cascaded operation of limited contrast adaptive histogram equalization and anisotropic diffusion filtering to enhance the target-background contrast of the input ultrasound image. Its output is used as the input of the ViT-B encoder and undergoes channel attention weighting with the prompt encoding features input through the second path in the decoder, ensuring that the spatial guiding effect of the point / box / mask prompt information is not interfered by noise or uneven grayscale.
[0120] The lesion area segmentation model automatically completes the segmentation task of ultrasound images. The encoder of the lesion area segmentation model first extracts multi-level feature embeddings of the entire ultrasound image. At the same time, it converts the prompt information of the center point / keypoint / bounding box / mask into high-dimensional vectors through the spatial encoder and dynamically fuses them with the image features in the cross-modal attention layer of the decoder. This process forces the model to focus on the feature responses within the box area (such as microcalcification points inside the nodule and anechoic features in the cystic degeneration area) through the region-constrained attention mechanism, while suppressing the interference of background noise outside the box (such as blood vessel cross-sections and tissue artifacts). After successful automatic annotation, the model outputs a pixel-level accurate segmentation mask, obtaining an accurate segmentation result of the nodule area. This result can be directly used for clinical diagnosis or as a basis for further analysis.
[0121] S6: Although the accuracy of automatic annotation has been significantly improved, in some cases, manual adjustment by professionals may still be required to optimize the segmentation result. This embodiment allows users to fine-tune the segmentation boundary according to actual needs after the model's automatic annotation to ensure the accuracy and reliability of the final result.
[0122] In an exemplary embodiment, the present application further provides a computer device, which may be a server or a terminal. The computer device includes a processor, a memory, an input / output interface, and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements the automated segmentation method for the lesion area in the ultrasonic image.
[0123] In an exemplary embodiment, the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the automated segmentation method for the lesion area in the ultrasonic image.
[0124] In an exemplary embodiment, the present application further provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the automated segmentation method for the lesion area in the ultrasonic image.
[0125] Those of ordinary skill in the art can understand that all or part of the processes in the above-described embodiment methods can be completed by hardware related to computer program instructions. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the above-described method embodiments. Among them, any reference to a memory or other medium provided in the embodiments of the present application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0126] It should be noted that the information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data that have been authorized by the user or fully authorized by all parties. And the collection, use, and processing of relevant data need to comply with relevant regulations.
[0127] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered to be within the scope described in this specification.
[0128] In this article, specific examples are used to elaborate on the principles and implementation manners of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. At the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to the present application.
Claims
1. An automated segmentation method for lesion regions in ultrasonic images, characterized in that, It includes: Obtain the original ultrasound image taken of the patient's lesion site and perform preprocessing to obtain the preprocessed ultrasound image; Annotate the preprocessed ultrasound image, and store the annotated image and the ultrasound image in one-to-one correspondence to form a sample data set; Coarsely segment the foreground and background in the ultrasound image by an automated threshold segmentation method to obtain a binary mask of the foreground as the coarse mask; Convert the coarse mask into multi-modal prompt information; Use the sample data set and the multi-modal prompt information to train an improved SAM large model, and use it as a lesion area segmentation model after training; Obtain the ultrasound image to be segmented and its prompt information and input them into the lesion area segmentation model to automatically segment the lesion area.
2. The automated segmentation method for lesion regions in ultrasonic images according to claim 1, wherein The step of obtaining the original ultrasound image taken of the patient's lesion site and performing preprocessing to obtain the preprocessed ultrasound image specifically includes: Obtain the original ultrasound image taken of the patient's lesion site and stored in the.jpg or.png format, and perform cleaning and standardization operations on the original ultrasound image to obtain the preprocessed ultrasound image.
3. The automated segmentation method for lesion regions in ultrasonic images according to claim 1, wherein The step of coarsely segmenting the foreground and background in the ultrasound image by an automated threshold segmentation method to obtain a binary mask of the foreground as the coarse mask specifically includes: For ultrasound images with high contrast and significantly separated gray level distributions, use the Otsu method to determine the optimal threshold; For ultrasound images with more noise or complex gray level distributions, use the maximum entropy method to determine the optimal threshold; Based on the optimal threshold, coarsely segment the foreground and background in the ultrasound image to obtain a binary mask of the foreground as the coarse mask.
4. The automated segmentation method for lesion regions in ultrasonic images according to claim 3, wherein The step of converting the coarse mask into multi-modal prompt information specifically includes: Extract the geometric center point of the coarse mask as point prompt information, extract the minimum bounding rectangle of the coarse mask as box prompt information, and use the coarse mask itself as mask prompt information to jointly form multi-modal prompt information.
5. The automated segmentation method for lesion regions in ultrasonic images according to claim 4, characterized in that, The step of using the sample data set and the multi-modal prompt information to train an improved SAM large model and using it as a lesion area segmentation model after training specifically includes: Perform anisotropic filtering and contrast-limited histogram equalization processing on each ultrasound image in the sample data set to generate a preprocessed ultrasound image; Form a point coordinate matrix P from all the point prompt information extracted from this ultrasound image, form a set of bounding box tensors K from all the box prompt information, and form a set of low-resolution masks M from all the mask prompt information, and generate a set of prompt information H = {P, K, M} for this ultrasound image; Use the preprocessed ultrasound image as the first input to the improved SAM large model, use the corresponding extracted set of prompt information H = {P, K, M} as the second input to the improved SAM large model, and output a predicted mask after being processed by the improved SAM large model; Calculate the multi-modal contrast edge perception loss value of the improved SAM large model according to the prediction mask Based on Perform unsupervised training and optimization on the improved SAM large model, adjust the network parameters through the backpropagation algorithm, and obtain the improved SAM large model with the smallest as the lesion area segmentation model 6. The automated segmentation method for lesion regions in ultrasonic images according to claim 5, wherein The improved SAM large model specifically includes: a ViT-B encoder, a spatial encoder, a multi-scale texture enhancement module, a cross-attention gating module, a dynamic routing module, a progressive decoder, and a Sigmoid activation layer; The ViT-B encoder is used to extract multi-scale image features {F_l(x), l∈(1,2,...,L)} from the pre-processed ultrasound image x input from the first path of the improved SAM large model; where F_l(x) represents the image features extracted in the l-th layer; L is the number of layers; The spatial encoder is used to convert the set of prompt words H = {P, K, M} input from the second path of the improved SAM large model into high-dimensional embedding vectors, and respectively obtain the point prompt encoding E_p, the box prompt encoding E_k, and the mask encoding E_m; The multi-scale texture enhancement module is used to obtain the fused feature F'_l(x) by cross-scale feature fusion of the image feature F_l(x); The cross-attention gating module is used to generate an attention weight matrix α based on the fused feature F'_l(x) and the mask encoding E_m, and inject the weighted prompt word semantic information into the fused feature F'_l(x) based on the attention weight matrix β, and output the enhanced feature F”_l(x); The dynamic routing module is used to splice the point prompt encoding E_p and the box prompt encoding E_k with the enhanced feature F”_l(x) as the input of each stage of the progressive decoder; The progressive decoder is used to perform cascaded upsampling on the inputs of each stage and introduce an edge-aware loss at each stage Finally, a predicted mask is output through a Sigmoid activation layer 7. The automated segmentation method for lesion regions in ultrasonic images according to claim 6, characterized in that, Obtaining the ultrasound image to be segmented and its prompt word information and inputting them into the lesion area segmentation model to automatically segment the lesion area, specifically including: Obtaining the prompt word information of the ultrasound image to be segmented through an automated threshold segmentation method or based on user input; Input the ultrasound image to be segmented and its prompt word information into the lesion area segmentation model, and output the predicted mask of the lesion area Adjust the prediction mask in terms of its position and scope to form the finally determined lesion area.
8. A computer device, comprising: A memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the computer program to implement the automated segmentation method of the lesion area in the ultrasound image according to any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the automated segmentation method of the lesion area in the ultrasound image according to any one of claims 1 to 7.
10. A computer program product comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the automated segmentation method of the lesion area in the ultrasound image according to any one of claims 1 to 7.
Citation Information
Cited By
Airport apron dynamic scene target unsupervised segmentation method and system
CN120635468A
A method and system for unsupervised segmentation of dynamic scene targets on a ramp
CN120635468B
Anti-radiation DICE flip-flop based on dual modular redundancy and adaptive bias
CN120896570A
Multi-expert collaborative image segmentation method and system based on delay mechanism
CN121033415A
Focus area determination method and device, electronic equipment and storage medium
CN121074499A