Intestinal ultrasound image segmentation method, system and equipment based on AI analysis and medium
By combining the prior guidance and adaptive clarity prediction module with the self-attention and cross-attention mechanisms, the problem of accurate segmentation of each layer of substructures in intestinal ultrasound images is solved, and high-precision and robust intestinal ultrasound image segmentation is achieved.
Patent Information
- Application Number
- CN202510665457.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-22
- Publication Date
- 2025-09-05
AI Technical Summary
Existing technologies have difficulty accurately segmenting the various layers of intestinal substructures in intestinal ultrasound images, especially in inflammatory bowel disease. Traditional algorithms and existing networks can only segment the entire intestinal wall but cannot finely segment the various layers of intestinal substructures.
A priori-guided substructure segmentation module is used to narrow the search space, and an adaptive clarity prediction module is used to determine whether to output the substructure mask. The self-attention mechanism and cross-attention mechanism are combined to extract key features, and an adaptive loss function is used for training.
The accuracy and robustness of intestinal ultrasound image segmentation are improved, and it can maintain high adaptability in complex and unclear images, significantly improving the segmentation accuracy of intestinal substructures at each layer.
Smart Images

Figure CN120599253A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a method, system, device and medium for intestinal ultrasound image segmentation based on AI analysis. Background Art
[0002] Accurate segmentation of the intestinal wall and its substructures is an essential step in AI-assisted diagnosis using intestinal ultrasound. For example, in inflammatory bowel diseases (such as Crohn's disease and ulcerative colitis), the intestinal wall often thickens. By accurately segmenting the different layers of the intestinal wall, the thickness of each layer can be precisely measured, providing objective evidence for disease diagnosis, condition assessment, and monitoring of treatment effectiveness.
[0003] Existing techniques for segmenting intestinal ultrasound images, such as those that rely on traditional algorithms for region growing or transfer learning using existing networks such as UNet and ResNet, can only segment the entire intestinal wall, but cannot precisely segment the intestinal substructures at each layer. For example, the patent publication number is CN 118762039 A, entitled "An Invention of a Semi-Supervised Segmentation Method, System, Device, and Medium for Intestinal Ultrasound Images." The method includes: using unlabeled intestinal ultrasound images and true labeled intestinal ultrasound images to perform two-stage training on a large medical model to obtain pseudo-labels; adding noise perturbations to the intestinal ultrasound images to form noisy labeled data with the pseudo-labels; training a Mean-Teacher model using the noisy labeled data and the true labeled intestinal ultrasound images; and using the trained Mean-Teacher model to predict pixel-level labels for the intestinal ultrasound images, thereby obtaining intestinal ultrasound image segmentation results.
[0004] Therefore, developing an intestinal ultrasound image processing method that can accurately segment the intestinal substructures at each layer is one of the important issues that need to be solved at present. Summary of the Invention
[0005] In view of the above-mentioned problems existing in the prior art, the purpose of the present invention is to provide an intestinal ultrasound image processing method based on AI analysis that can accurately segment the intestinal substructures of each layer.
[0006] Another object of the present application is to provide an intestinal ultrasound image segmentation system.
[0007] To solve the above problems, the present invention adopts the following technical solution: The present invention provides an intestinal ultrasound image segmentation method based on AI analysis. The method is implemented by setting a priori-guided substructure segmentation module to narrow the search range of the substructure segmentation image, and determining whether to output the substructure mask through an adaptive clarity prediction module. Specifically, the method includes:
[0008] Step 1: Obtain an ultrasound image dataset, perform image preprocessing on the ultrasound image dataset, and retain the effective image area for intestinal recognition;
[0009] Step 2: Encode the image through a multi-scale extractor to extract feature maps of the image at different scales;
[0010] Step 3: Whole intestinal wall segmentation: Based on the extracted image features, feature maps of different scales are fused and masks of two categories, intestinal wall and background, are output respectively to distinguish the location of the intestinal wall;
[0011] Step 4: Prior-guided intestinal substructure segmentation: Multiply the whole intestinal wall segmentation mask at any scale with the feature map of the corresponding scale to obtain the intestinal image feature region; extract key features related to intestinal substructure segmentation through a cross-attention mechanism; extract the internal feature relationships of intestinal substructures through a self-attention mechanism; based on these feature relationships, connect the fully connected network branches, with the first branch outputting the segmentation mask of each intestinal substructure, and the second branch outputting the clarity result of each substructure;
[0012] Step 5: Repeat step 4 for feature maps at different scales to generate intestinal substructure segmentation masks and corresponding clarity results.
[0013] In some embodiments, the a priori-guided intestinal substructure segmentation described in step 4 specifically includes the steps of:
[0014] S41, extracting image feature regions, multiplying the whole intestinal wall segmentation mask at any scale with the feature map at the corresponding scale to obtain an intestinal image feature region, wherein the intestinal image feature region highlights the intestinal substructure of interest;
[0015] S42, combining the intestinal image feature region with the sinusoidal position coding to assign unique position coding information to each position in the feature map;
[0016] S43, inputting the intestinal image feature region with the positional encoding as a key (key, K) and a value (value, V), and inputting a segmentation query token (query token) as a query (query, Q); matching the query token with discriminative related information of the corresponding substructure in the intestinal feature map through a cross-attention mechanism, and extracting key features related to substructure segmentation; thereby extracting the most critical features for substructure segmentation from the intestinal image feature region;
[0017] S44, the key features of step 43 are passed through the self-attention layer to obtain the internal feature relationship of the intestinal substructure;
[0018] S45. Dynamically select a branch path according to the input feature relationship data, wherein the first branch is used to output the segmentation mask result of the intestinal substructure; and the second branch is used to output the clarity result of the intestinal substructure.
[0019] In some embodiments, the prior-guided substructure segmentation specifically provides a priori regions for substructure segmentation through positioning results of the entire intestinal wall, thereby narrowing the substructure segmentation search space.
[0020] In some embodiments, step S44 obtains the internal feature relationship of the intestinal substructure through the self-attention layer, specifically adaptively determining whether to output the mask of the intestinal substructure based on the clarity of the intestinal substructure image features.
[0021] In some embodiments, the training process is specifically as follows:
[0022] The loss function is ,in, Represents the loss of the whole intestinal wall segmentation task. This loss function is used to measure the model's prediction accuracy for the intestinal wall area. Represents the loss of the intestinal substructure segmentation task; this loss function is used to evaluate the segmentation effect of the model on the substructures inside the intestine; The loss function represents the clarity of the substructure. For images with substructure annotations, they are considered clear and labeled as 1; for images without substructure annotations, they are considered unclear and labeled as 0.
[0023] During the training process, the parameter λ is introduced to adjust the substructure segmentation loss contribution.
[0024] Another object of the present application is to provide an intestinal ultrasound image segmentation system based on AI analysis, the system comprising:
[0025] The image preprocessing module performs image preprocessing on the ultrasound image dataset and retains the effective image area for intestinal recognition;
[0026] The whole intestinal wall positioning and segmentation module encodes the image through a multi-scale extractor, extracts feature maps of the image at different scales, fuses the feature maps at different scales based on the extracted image features, and outputs masks for the intestinal wall and background categories respectively, which are used to distinguish the location of the intestinal wall;
[0027] The prior-guided substructure segmentation module multiplies the whole intestinal wall segmentation mask at any scale with the feature map of the corresponding scale to obtain the characteristic region of the intestinal image. The cross-attention mechanism is used to extract key features related to intestinal substructure segmentation. The self-attention mechanism is used to extract the internal feature relationships of the intestinal substructures. Based on these feature relationships, the fully connected network branches are connected. The first branch outputs the segmentation mask of each intestinal substructure, and the second branch outputs the clarity result of each substructure.
[0028] The adaptive clarity prediction module adaptively decides whether to output the substructure mask according to the clarity of the image.
[0029] An electronic device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for segmenting intestinal ultrasound images as described in any one of claims 1 to 5 is implemented.
[0030] A computer-readable storage medium stores a computer program, wherein the computer program enables a computer to execute the intestinal ultrasound image segmentation method according to any one of claims 1 to 5.
[0031] Compared with the prior art, the beneficial technical effects of the present invention are:
[0032] 1. The present invention provides a substructure segmentation method with prior guidance. This method introduces a priori guidance mechanism and uses the positioning results of the entire intestinal wall to provide a possible priori region for substructure segmentation, effectively narrowing the search space for substructure segmentation and improving segmentation accuracy.
[0033] 2. This application provides an adaptive clarity prediction method. In some images, where substructures are unclear and it is difficult to segment precise boundaries, this method adaptively determines whether to output a substructure mask based on the image clarity, thereby avoiding segmentation errors caused by low-quality images and improving image segmentation accuracy.
[0034] 3. This application provides an adaptive loss function. When the substructure is clear, the loss function will impose a penalty on the substructure segmentation; when the substructure is unclear, this part of the loss will be automatically ignored, making the model more robust.
[0035] 4. The intestinal ultrasound image segmentation method based on AI analysis provided in this application has significant advantages in the field of intestinal ultrasound image segmentation. It not only improves the segmentation accuracy, but also improves the adaptability of the model in processing complex and unclear images. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 It is a flowchart of ultrasound image segmentation;
[0037] Figure 2 It is a structural diagram of the substructure segmentation model guided by the prior;
[0038] Figure 3 It is a flowchart of the a priori-guided substructure segmentation;
[0039] Figure 4 It is a schematic diagram of a multi-scale feature extractor encoding an image;
[0040] Figure 5 This is the whole intestinal wall positioning map provided by the embodiment of the present application;
[0041] Figure 6 It is a substructure segmentation diagram provided in an embodiment of the present application;
[0042] Figure 7 This is a clarity prediction diagram provided in an embodiment of the present application. DETAILED DESCRIPTION
[0043] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings herein can be arranged and designed in various different configurations.
[0044] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention as claimed, but rather merely represents selected embodiments of the present invention. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without creative effort shall fall within the scope of protection of the present invention.
[0045] It should be noted that similar reference numerals and letters represent similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined or explained in subsequent drawings. In addition, the terms "first," "second," etc. are used only to distinguish the descriptions and are not to be understood as indicating or implying relative importance.
[0046] In the description of the embodiments of the present invention, it should be noted that the terms "inside", "outside", "upper", etc. indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, or are the orientations or positional relationships in which the inventive product is usually placed when in use. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, they cannot be understood as limitations on the present invention.
[0047] Example
[0048] See also Figure 1-Figure 4 The present application provides a method for segmenting intestinal ultrasound images based on AI analysis. The method is implemented by setting a priori-guided substructure segmentation module to narrow the search range of the substructure segmentation image, and determining whether to output the substructure mask through an adaptive clarity prediction module. Specifically, the method includes:
[0049] Step 1: Obtain an ultrasound image dataset, perform image preprocessing on the ultrasound image dataset, and retain the effective image area for intestinal recognition;
[0050] Step 2: Encode the image using a multi-scale extractor to extract feature maps at different scales. For example, the encoder using the UNet network structure effectively captures the multi-scale information in ultrasound images. Taking the average image size of 640×768 as the input image size, the encoder extracts a total of 7 feature maps of different sizes from 640×768 to 10×12, as shown in the following example: Figure 4 These feature maps contain spatial information of different scales, providing a rich feature basis for subsequent segmentation tasks.
[0051] Step 3: Whole intestinal wall segmentation: Based on the extracted image features, feature maps of different scales are fused and masks of two categories, intestinal wall and background, are output respectively to distinguish the location of the intestinal wall;
[0052] In some preferred embodiments, the UNet decoder, combined with skip connections, fuses feature maps of different scales to accurately predict the intestinal wall location. This step outputs two masks, one for the intestinal wall and the other for the background, achieving precise segmentation of the entire intestinal wall. This process effectively identifies the intestinal wall location even in complex backgrounds, laying the foundation for subsequent detailed segmentation.
[0053] Step 4: Prior-guided intestinal substructure segmentation: Multiply the whole intestinal wall segmentation mask at any scale with the feature map of the corresponding scale to obtain the intestinal image feature region; extract key features related to intestinal substructure segmentation through a cross-attention mechanism; extract the internal feature relationships of intestinal substructures through a self-attention mechanism; based on these feature relationships, connect the fully connected network branches, with the first branch outputting the segmentation mask of each intestinal substructure, and the second branch outputting the clarity result of each substructure;
[0054] Step 5: Repeat step 4 for feature maps at different scales to generate intestinal substructure segmentation masks and corresponding clarity results.
[0055] In some embodiments, the prior-guided intestinal substructure segmentation described in step 4 specifically includes the following steps: S41, image feature region extraction, multiplying the whole intestinal wall segmentation mask of any scale with the feature map of the corresponding scale to obtain the intestinal image feature region, the intestinal image feature region highlights the intestinal substructure of interest and effectively reduces the background noise interference; S42, combining the intestinal image feature region with sinusoidal position coding to assign unique position coding information to each position in the feature map; the sinusoidal position coding assigns unique position information to each position in the feature map, so that the model can better understand the spatial relationship during processing; S43, using the intestinal image feature region with position coding as key (key, K) and value (value, V) input to segment the query token (query token) as query (Q) input; through the cross-attention mechanism, the query token is matched with important information in the intestinal feature map to extract key features related to substructure segmentation; S44, the key features of step 43 are used to obtain the internal feature relationship of the intestinal substructure through the self-attention layer; S45, the branch path is dynamically selected according to the input feature relationship data, and the first branch is used to output the segmentation mask result of the intestinal substructure; the second branch is used to output the clarity result of the intestinal sub-substructure.
[0056] In some embodiments, the prior-guided substructure segmentation specifically provides a priori regions for substructure segmentation through positioning results of the entire intestinal wall, thereby narrowing the substructure segmentation search space.
[0057] In some embodiments, step S44 is to obtain the internal feature relationship of the intestinal substructure through the self-attention layer, specifically to adaptively determine whether to output the mask of the intestinal substructure based on the clarity of the image features.
[0058] In some embodiments, the training process is specifically as follows:
[0059] The loss function is ,in, Represents the loss of the whole intestinal wall segmentation task. This loss function is used to measure the model's prediction accuracy for the intestinal wall area. Represents the loss of the intestinal substructure segmentation task; this loss function is used to evaluate the segmentation effect of the model on the substructures inside the intestine; The loss function represents the clarity of the substructure. For images with substructure annotations, they are considered clear and labeled as 1; for images without substructure annotations, they are considered unclear and labeled as 0.
[0060] During the training process, the parameter λ is introduced to adjust the substructure segmentation loss contribution.
[0061] An intestinal ultrasound image segmentation system based on AI analysis, the system comprising:
[0062] The image preprocessing module performs image preprocessing on the ultrasound image dataset and retains the effective image area for intestinal recognition;
[0063] The whole intestinal wall positioning and segmentation module encodes the image through a multi-scale extractor, extracts feature maps of the image at different scales, fuses the feature maps at different scales based on the extracted image features, and outputs masks for the intestinal wall and background categories respectively, which are used to distinguish the location of the intestinal wall;
[0064] The prior-guided substructure segmentation module multiplies the whole intestinal wall segmentation mask at any scale with the feature map of the corresponding scale to obtain the characteristic region of the intestinal image. The cross-attention mechanism is used to extract key features related to intestinal substructure segmentation. The self-attention mechanism is used to extract the internal feature relationships of the intestinal substructures. Based on these feature relationships, the fully connected network branches are connected. The first branch outputs the segmentation mask of each intestinal substructure, and the second branch outputs the clarity result of each substructure.
[0065] The adaptive clarity prediction module adaptively decides whether to output the substructure mask according to the clarity of the image.
[0066] like Figure 5-7 As shown, in order to verify the effectiveness of the intestinal ultrasound image processing method proposed in this invention in accurately segmenting the substructures of each layer of the intestinal wall, this application conducted experiments on an actual intestinal ultrasound image dataset. The details are as follows:
[0067] S1. Dataset, specifically a dataset of intestinal ultrasound images in both transverse and longitudinal sections. This dataset has been selected to include samples with detailed annotations of at least one intestinal wall substructure (including the muscularis propria, submucosa, and submucosal muscularis) by experienced experts. This data set is rationally divided into a training set for model learning and a validation set for independent evaluation of model performance. The amount of data used in this embodiment is sufficient to support the training and validation of the deep learning model, ensuring the reliability of the evaluation results.
[0068] S2. Experimental setup. During the training of the model described in this application, an optimization objective combining the Dice loss function and the cross entropy loss function was adopted for the segmentation loss, and the cross entropy loss function was adopted for the clarity loss to ensure that the model can accurately locate and segment the boundaries of each substructure.
[0069] In some preferred embodiments, in order to enhance the adaptability and generalization ability of the model to changes in different image features, a variety of data augmentation strategies are introduced during the training process, such as random scaling, translation, and flipping.
[0070] The training process is performed on a hardware platform with sufficient computing power, and the parameters are updated using the SGD optimization algorithm. The model training is iterated until the performance converges on the validation set.
[0071] S3. Performance evaluation: After training, the model described in this application is evaluated on an independent validation set. In some preferred embodiments, the Dice coefficient is used as a key indicator to measure the segmentation accuracy of the model.
[0072] Experimental results show that the intestinal ultrasound image processing method proposed in this invention can effectively identify and segment the main substructures of the intestinal ultrasound image, such as the muscularis propria, submucosa and submucosal muscularis.
[0073] Example 3
[0074] An electronic device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for segmenting intestinal ultrasound images as described in any one of claims 1 to 5 is implemented.
[0075] Example 4
[0076] A computer-readable storage medium stores a computer program, wherein the computer program enables a computer to execute the intestinal ultrasound image segmentation method according to any one of claims 1 to 5.
[0077] Finally, it is necessary to point out here that the above is only a preferred specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by any technician familiar with the present invention within the technical scope disclosed by the present invention should be covered within the scope of protection of the present invention.
Claims
1. A method for segmenting intestinal ultrasound images based on AI analysis, characterized in that: The method is implemented by setting a priori-guided substructure segmentation module to narrow the search range of the substructure segmentation image, and determining whether to output the substructure mask through an adaptive clarity prediction module, and specifically includes: Step 1: Obtain an ultrasound image dataset, perform image preprocessing on the ultrasound image dataset, and retain the effective image area for intestinal recognition; Step 2: Encode the image through a multi-scale extractor to extract feature maps of the image at different scales; Step 3: Whole intestinal wall segmentation: Based on the extracted image features, feature maps of different scales are fused and masks of two categories, intestinal wall and background, are output respectively to distinguish the location of the intestinal wall; Step 4: Prior-guided intestinal substructure segmentation: Multiply the whole intestinal wall segmentation mask at any scale with the feature map of the corresponding scale to obtain the intestinal image feature region; extract key features related to intestinal substructure segmentation through a cross-attention mechanism; extract the internal feature relationships of intestinal substructures through a self-attention mechanism; based on these feature relationships, connect the fully connected network branches, with the first branch outputting the segmentation mask of each intestinal substructure, and the second branch outputting the clarity result of each substructure; Step 5: Repeat step 4 for feature maps at different scales to generate intestinal substructure segmentation masks and corresponding clarity results.
2. The intestinal ultrasound image segmentation method based on AI analysis according to claim 1, characterized in that: The prior-guided intestinal substructure segmentation described in step 4 specifically includes the following steps:
41. Image feature region extraction: multiply the whole intestinal wall segmentation mask at any scale by the feature map of the corresponding scale to obtain the intestinal image feature region, which highlights the intestinal substructure of interest; 42. Combining the intestinal image feature region with the sinusoidal position coding to assign unique position coding information to each position in the feature map; 43. Input the position-encoded intestinal image feature region as the key (K) and value (V), and the segmentation query token (query token) as the query (Q). Through the cross-attention mechanism, match the query token with the discriminative information of the corresponding substructure in the intestinal feature map to extract key features related to substructure segmentation.
44. The key features of step 43 are passed through the self-attention layer to obtain the internal feature relationship of the intestinal substructure; 45. Dynamically select the branch path according to the input feature relationship data. The first branch is used to output the segmentation mask result of the intestinal substructure; the second branch is used to output the clarity result of the intestinal substructure.
3. The intestinal ultrasound image segmentation method based on AI analysis according to claim 1, characterized in that: The prior-guided substructure segmentation specifically provides a priori regions for substructure segmentation through the positioning results of the entire intestinal wall, thereby narrowing the substructure segmentation search space.
4. The intestinal ultrasound image segmentation method based on AI analysis according to claim 2, characterized in that: Step S44 is to obtain the internal feature relationship of the intestinal substructure through the self-attention layer, specifically to adaptively determine whether to output the mask of the intestinal substructure based on the clarity of the internal image features of the intestinal substructure.
5. The method for segmenting intestinal ultrasound images based on AI analysis according to claim 4, characterized in that: The training process is specifically as follows: The loss function is ,in, Represents the loss of the whole intestinal wall segmentation task. This loss function is used to measure the model's prediction accuracy for the intestinal wall area. Represents the loss of the intestinal substructure segmentation task; this loss function is used to evaluate the segmentation effect of the model on the substructures inside the intestine; The loss function represents the clarity of the substructure. For images with substructure annotations, they are considered clear and labeled as 1; for images without substructure annotations, they are considered unclear and labeled as 0. During the training process, the parameter λ is introduced to adjust the substructure segmentation loss contribution.
6. An intestinal ultrasound image processing system based on AI analysis, characterized in that: The system comprises: The image preprocessing module performs image preprocessing on the ultrasound image dataset and retains the effective image area for intestinal recognition; The whole intestinal wall positioning and segmentation module encodes the image through a multi-scale extractor, extracts feature maps of the image at different scales, fuses the feature maps at different scales based on the extracted image features, and outputs masks for the intestinal wall and background categories respectively, which are used to distinguish the location of the intestinal wall; The prior-guided substructure segmentation module multiplies the whole intestinal wall segmentation mask at any scale with the feature map of the corresponding scale to obtain the characteristic region of the intestinal image. The cross-attention mechanism is used to extract key features related to intestinal substructure segmentation. The self-attention mechanism is used to extract the internal feature relationships of the intestinal substructures. Based on these feature relationships, the fully connected network branches are connected. The first branch outputs the segmentation mask of each intestinal substructure, and the second branch outputs the clarity result of each substructure. The adaptive clarity prediction module adaptively decides whether to output the substructure mask according to the clarity of the image.
7. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for segmenting intestinal ultrasound images according to any one of claims 1 to 5 is implemented.
8. A computer-readable storage medium storing a computer program, characterized in that: The computer program enables a computer to execute the intestinal ultrasound image segmentation method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Intestinal ultrasound image semi-supervised segmentation method, system, equipment and medium
CN118762039A