An abdominal tumor precise segmentation method and system based on hybrid prior guidance
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-10
- Publication Date
- 2026-08-11
AI Technical Summary
然而,这些方法存在先验信息利用方式简单(如特征拼接)、未与网络主体结构深度交互、对特定器官形态变异适应性差、或依赖稀缺多模态数据等问题,导致先验引导的精准性和泛化能力不足
[0029] 1. Improved Segmentation Accuracy and Robustness. This invention effectively combines the local detail extraction capability of convolutional neural networks and the global relation modeling capability of Transformers through a hybrid encoder structure, overcoming the limitations of single architectures. It can effectively capture local details such as organ contours and tumor edges, as well as the long-distance dependencies between tumors and surrounding anatomical structures. The two work synergistically to improve the understanding of complex anatomical structures. Furthermore, this invention learns organ structure prototypes through an anatomical structure prior injection module, providing shape constraints for tumor localization. At the same time, it introduces a spatial location prior probability map to guide the network model to focus on high-incidence areas. This dual prior knowledge can effectively reduce false positive and false negative rates.
Smart Images

Figure CN122550951A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of medical image analysis, specifically relating to a method and system for precise segmentation of abdominal tumors based on hybrid prior guidance. Background Technology
[0002] The diagnosis of malignant tumors in abdominal organs, such as gallbladder cancer, pancreatic cancer, and cervical cancer, heavily relies on the accurate identification of tumor regions in computed tomography (CT) or magnetic resonance imaging (MRI) images. However, identifying abdominal organ tumors in CT or MRI images faces numerous challenges, such as small tumor size, grayscale similarity to surrounding normal organ tissues, indistinct boundaries, and the fact that lesions are often located near organ walls, exhibiting complex relationships with surrounding anatomical structures. Therefore, a precise segmentation method for abdominal tumors is needed to help physicians identify tumors and improve the quality of medical care.
[0003] Existing medical image analysis methods mainly fall into the following categories: 1. Methods based on Convolutional Neural Networks (CNNs), such as U-Net, ResUNet, and Attention U-Net. While these methods can capture local details, their global context modeling ability is weak, making it difficult to capture the long-distance dependencies between abdominal organ tumors and surrounding anatomical structures. This results in a lack of global consistency and is prone to annotations that contradict anatomical structures. 2. Methods based on Visual Transformers (ViTs), such as TransUNet and SwinUNet. These methods enhance global context modeling capabilities through self-attention mechanisms, but they are usually not designed for the specific anatomical morphology of abdominal organs and the spatial distribution patterns of tumors. For abdominal tumors with blurred boundaries and small volume, the segmentation accuracy is limited, and false positives or false negatives are easily generated. 3. Methods that incorporate prior knowledge. For example, some methods introduce positional priors through coordinate encoding, or incorporate knowledge from other modalities through multi-task learning, such as positron emission tomography (PET). However, these methods suffer from problems such as simple utilization of prior information (e.g., feature splicing), lack of deep interaction with the main network structure, poor adaptability to morphological variations of specific organs, or reliance on scarce multimodal data, resulting in insufficient accuracy and generalization ability of prior guidance.
[0004] In summary, existing technologies suffer from several drawbacks, including an imbalance between global and local information modeling, insufficient utilization of prior knowledge and inefficient fusion methods, inadequate ability to handle small lesions and fuzzy boundaries, and limited adaptability to the characteristics of medical imaging data. These shortcomings make it difficult to meet the high clinical standards required for precise segmentation of abdominal tumors. Summary of the Invention
[0005] The purpose of this invention is to provide a method and system for precise segmentation of abdominal tumors based on hybrid prior guidance. This method can explicitly and efficiently integrate prior knowledge of the anatomical structure of abdominal organs with prior knowledge of the spatial location of the tumor, and collaboratively model local details and global context to achieve precise segmentation of abdominal tumors, providing a reliable tool for clinical diagnosis and treatment planning.
[0006] To achieve the above-mentioned objectives, the present invention adopts the following technical solution:
[0007] In a first aspect, the present invention provides a method for precise segmentation of abdominal tumors based on hybrid prior guidance, comprising the following steps:
[0008] Abdominal medical images are fused with a prior probability map of spatial location and then input into a hybrid encoder. The hybrid encoder extracts local features through a convolutional neural network and then extracts global contextual features through a Transformer encoder to obtain encoded features.
[0009] The encoded features are input into the anatomical structure prior injection module, which generates a structural prior feature map by interacting with the encoded features through a trainable organ structure prototype and self-attention.
[0010] The structural prior feature map is input into the Transformer decoder, which progressively upsamples to restore resolution. Simultaneously, a masked cross-attention skip connection module dynamically fuses encoder and decoder features by combining the structural prior feature map and the foreground mask generated from the segmentation result. During training, the Transformer decoder combines edge guidance loss and structural prior supervision to optimize boundary and structural accuracy. The edge guidance loss is optimized by comparing the difference between the predicted segmentation boundary and the true boundary. The structural prior supervision is optimized by comparing the difference between the decoder output features and the structural prior feature map. The Transformer decoder output is then transformed and activated to obtain the binary segmentation result.
[0011] Furthermore, the hybrid encoder consists of a ConvNeXt-T network and a six-layer Transformer encoder; the ConvNeXt-T network is used to extract multi-scale local features, and the deepest features output by the ConvNeXt-T network are processed by block embedding and then input into the six-layer Transformer encoder to model global relationships through a self-attention mechanism.
[0012] Furthermore, the spatial location prior probability map is a two-dimensional normalized probability map generated based on the tumor annotation statistics of the training set, wherein high probability regions exceeding a preset threshold correspond to high-incidence locations of tumors; the spatial location prior probability map is stitched together with the abdominal medical image and input into the hybrid encoder, and downsampled to a size that matches the feature map of each layer, and used as an attention mask to be incorporated into the self-attention calculation of the Transformer.
[0013] Furthermore, the anatomical structure prior injection module includes:
[0014] Multiple trainable organ structure prototypes, each with dimensions consistent with the output feature dimensions of the hybrid encoder;
[0015] Multiple multi-head cross-attention layers are used. Each multi-head cross-attention layer uses the corresponding trainable organ structure prototype as the query and the output features of the hybrid encoder as the key and value to calculate attention weights and generate a structural prior feature map.
[0016] Furthermore, the masked cross-attention skip connection module includes:
[0017] A multi-head cross-attention layer is used to calculate attention weights by taking the current layer features of the decoder as the query and the corresponding layer features of the encoder as the key and value.
[0018] The foreground mask generation unit is used to combine the structural prior feature map and the coarse segmentation result output by the decoder to generate a binary mask;
[0019] The residual fusion unit is used to multiply the attention weights with the binary mask, constrain the attention to the target region, obtain the weighted encoder features, perform residual fusion with the current layer features of the decoder, and input the input to the next layer decoder.
[0020] Furthermore, the Transformer decoder includes four Transformer decoding units. During the training phase, edge guidance loss and structural prior supervision are introduced in the last two decoding units. The edge guidance loss is optimized by comparing the difference between the predicted segmentation boundary and the true boundary. The structural prior supervision is optimized by comparing the difference between the decoder output features and the structural prior feature map. The total loss during the training phase is a weighted sum of Dice loss, binary cross-entropy loss, edge loss, and structural prior supervision loss.
[0021] In a second aspect, the present invention provides a system for precise segmentation of abdominal tumors based on hybrid prior guidance, used to implement the method for precise segmentation of abdominal tumors based on hybrid prior guidance described in the first aspect, comprising:
[0022] The input module is used to acquire abdominal medical images and prior probability maps of spatial location;
[0023] The TAS-ViTNet network module is used for tumor region segmentation in abdominal medical images based on the TAS-ViTNet network model. The TAS-ViTNet network model includes a hybrid encoder, an anatomical structure prior injection module, a spatial location prior guidance module, a masked cross-attention skip connection module, and a Transformer decoder. The spatial location prior guidance module introduces a spatial location prior probability map, which is fused with the abdominal medical image and used as input to the hybrid encoder. The hybrid encoder extracts local features through a convolutional neural network and then extracts global contextual features through a Transformer encoder to obtain encoded features. The anatomical structure prior injection module performs self-attention between a trainable organ structure prototype and the encoded features. The process involves interaction to generate a structural prior feature map. This prior feature map serves as input to the Transformer decoder, which progressively upsamples to restore resolution. A mask cross-attention skip connection module dynamically fuses encoder and decoder features using a foreground mask generated from the structural prior feature map and the segmentation result. The Transformer decoder output is then transformed and activated to obtain a binary segmentation result. During training, the Transformer decoder combines edge guidance loss and structural prior supervision to optimize boundary and structural accuracy. The edge guidance loss is optimized by comparing the difference between the predicted segmentation boundary and the true boundary. The structural prior supervision is optimized by comparing the difference between the decoder output features and the structural prior feature map.
[0024] The output module is used to output the binary segmentation result.
[0025] Thirdly, the present invention provides a computer system including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, it implements the steps of the method for precise segmentation of abdominal tumors based on hybrid prior guidance described in the first aspect.
[0026] Fourthly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method for precise segmentation of abdominal tumors based on hybrid prior guidance described in the first aspect.
[0027] Fifthly, the present invention provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method for precise segmentation of abdominal tumors based on hybrid prior guidance as described in the first aspect.
[0028] Compared with the prior art, the present invention has the following significant advantages:
[0029] 1. Improved Segmentation Accuracy and Robustness. This invention effectively combines the local detail extraction capability of convolutional neural networks and the global relation modeling capability of Transformers through a hybrid encoder structure, overcoming the limitations of single architectures. It can effectively capture local details such as organ contours and tumor edges, as well as the long-distance dependencies between tumors and surrounding anatomical structures. The two work synergistically to improve the understanding of complex anatomical structures. Furthermore, this invention learns organ structure prototypes through an anatomical structure prior injection module, providing shape constraints for tumor localization. At the same time, it introduces a spatial location prior probability map to guide the network model to focus on high-incidence areas. This dual prior knowledge can effectively reduce false positive and false negative rates.
[0030] 2. Efficient Feature Fusion. This invention dynamically matches the semantics of encoder and decoder features through a masked cross-attention skip connection module, and combines foreground masking to suppress background interference, thereby enhancing the effectiveness of feature fusion and solving the semantic mismatch problem of traditional skip connections.
[0031] 3. Improved accuracy of small lesions and boundaries. This invention, through a supervised Transformer decoder combined with edge-guided loss and structural prior supervision, can effectively improve the detection rate of small lesions and the localization accuracy of fuzzy boundaries.
[0032] 4. Good adaptability to medical data. The ConvNeXt-T network preferred in this invention uses layer normalization that is robust to batch fluctuations, making it suitable for small sample medical data; its normalization method is consistent with that of Transformer, resulting in a better match for feature distribution and improved transfer learning performance. Attached Figure Description
[0033] Figure 1 The above is a flowchart of the method provided in the embodiments of the present invention.
[0034] Figure 2 This is a schematic diagram of the network model structure constructed in an embodiment of the present invention.
[0035] Figure 3 This is a schematic diagram illustrating a gallbladder cancer segmentation result as exemplified in an embodiment of the present invention.
[0036] Figure 4 This is a schematic diagram illustrating another gallbladder cancer segmentation result as exemplified in an embodiment of the present invention.
[0037] Figure 5 This is a schematic diagram illustrating a cervical cancer segmentation result as exemplified in an embodiment of the present invention.
[0038] Figure 6 This is a schematic diagram illustrating another cervical cancer segmentation result as exemplified in an embodiment of the present invention. Detailed Implementation
[0039] To make the above-mentioned objectives, technical features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0040] To facilitate understanding and explanation of the technical solutions of the embodiments of the present invention, the relevant terms will be explained below.
[0041] Abdominal tumors: refer to solid malignant tumors that occur in abdominal organs (such as the pancreas, stomach, liver, gallbladder, etc.). They are characterized by small size, indistinct borders, variable location, and similar gray scale to surrounding tissues. Clinical diagnosis relies heavily on precise segmentation of enhanced CT images for lesion detection and treatment planning.
[0042] Contrast-enhanced computed tomography (CT) refers to abdominal CT images obtained after intravenous injection of iodine contrast agent. It is used to enhance the contrast of the tumor and surrounding blood vessels and soft tissues, so as to more clearly observe the location and boundaries of the tumor.
[0043] TAS-ViTNet: This invention proposes "Tumor Anatomical Shape Prior-guided VisionTransformer Network," which combines the local feature extraction capabilities of convolutional neural networks (CNNs) with the global context modeling capabilities of visual Transformers. It also introduces organ structure priors and spatial location priors to improve the accuracy and stability of abdominal tumor segmentation.
[0044] Hybrid encoder: Composed of a pre-trained convolutional neural network (such as ConvNeXt-T) and a Transformer encoder, it is used to simultaneously capture local edge features of abdominal tumors and their long-range dependencies on surrounding anatomical structures, enabling collaborative modeling of local and global information.
[0045] Anatomical prior: This refers to the process of learning the typical shape features or prototypes of abdominal organs (such as liver, stomach, and pancreas) during network training, and injecting them into the segmentation process as anatomical constraints to improve the consistency between the segmentation results and the actual anatomical structure of the organs.
[0046] Spatial location prior: This refers to generating a two-dimensional normalized probability map based on the probability distribution of high-incidence locations of abdominal tumors in different organs or regions obtained from the training set statistics. This map is used to guide the model to focus on high-incidence areas of tumors and improve the accuracy of small lesion identification and localization.
[0047] Masked Cross-Attention Skip Connection: In the feature fusion stage, multi-head cross-attention calculation is performed using decoder features as queries and encoder features as keys. At the same time, foreground masks are used to constrain the attention distribution and dynamically suppress background interference, thereby achieving semantic matching and effective feature fusion.
[0048] Transformer Decoder: Employs a hierarchical decoder based on the Transformer structure, which maintains the flow of global contextual information while progressively restoring spatial resolution. It also combines edge-guided loss and structural prior supervision to enhance the accuracy of segmentation boundaries and anatomical structures.
[0049] Dice coefficient: A metric used to measure the degree of overlap between predicted segmentation and ground truth annotation; a higher value indicates better segmentation accuracy.
[0050] Edge-guided loss: By comparing the consistency between predicted segmentation edges and actual segmentation edges, the model is guided to learn tumor boundaries more accurately, improving the model's performance in cases of ambiguous boundaries.
[0051] The following describes a method for precise segmentation of abdominal tumors based on hybrid prior guidance, which relates to an embodiment of the present invention.
[0052] like Figure 1 As shown in the figure, an embodiment of the present invention discloses a method for precise segmentation of abdominal tumors based on hybrid prior guidance, which may include the following steps S1 to S4.
[0053] S1. The abdominal medical image is fused with the spatial location prior probability map and then input into the hybrid encoder. The hybrid encoder extracts local features through a convolutional neural network and then extracts global contextual features through a Transformer encoder to obtain the encoded features.
[0054] S2. Input the encoded features into the anatomical structure prior injection module. The anatomical structure prior injection module generates a structural prior feature map by interacting with the encoded features through a trainable organ structure prototype and self-attention.
[0055] S3. The structural prior feature map is input into the Transformer decoder. The Transformer decoder progressively upsamples to restore resolution. Simultaneously, the encoder and decoder features are dynamically fused through a masked cross-attention skip connection module, combining the structural prior feature map and the foreground mask generated from the segmentation results. During the training phase, the Transformer decoder combines edge guidance loss and structural prior supervision to optimize boundary and structural accuracy. The edge guidance loss is optimized by comparing the difference between the predicted segmentation boundary and the true boundary. The structural prior supervision is optimized by comparing the difference between the decoder output features and the structural prior feature map.
[0056] S4. The output of the Transformer decoder is transformed and activated through feature map to obtain the binary segmentation result;
[0057] In this embodiment, a hybrid encoder structure effectively combines the local detail extraction capability of convolutional neural networks with the global relational modeling capability of Transformers, overcoming the limitations of a single architecture. It effectively captures local details such as organ contours and tumor edges, as well as the long-distance dependencies between tumors and surrounding anatomical structures. The two work synergistically to enhance the understanding of complex anatomical structures. An anatomical structure prior injection module learns organ structure prototypes, providing shape constraints for tumor localization. Simultaneously, a spatial location prior probability map guides the network model to focus on high-incidence areas; this dual prior knowledge effectively reduces false positive and false negative rates. A masked cross-attention skip connection module dynamically matches the semantics of encoder and decoder features, combined with foreground masks to suppress background interference, enhancing the effectiveness of feature fusion and solving the semantic mismatch problem of traditional skip connections. A supervised Transformer decoder, combined with edge-guided loss (penalizing boundary differences) and structural prior supervision (constraining consistency with organ morphology), effectively improves the detection rate of small lesions and the localization accuracy of ambiguous boundaries.
[0058] In some possible implementations, in step S1, the hybrid encoder consists of a ConvNeXt-T network and a six-layer Transformer encoder; the ConvNeXt-T network is used to extract multi-scale local features, and the deepest features output by the ConvNeXt-T network are processed by block embedding and then input into the six-layer Transformer encoder to model global relationships through a self-attention mechanism.
[0059] In some possible implementations, in step S1, the spatial location prior probability map is a two-dimensional normalized probability map generated based on the tumor annotation statistics of the training set, wherein high probability regions exceeding a preset threshold correspond to high-incidence locations of tumors; the spatial location prior probability map is stitched together with the abdominal medical image and input into the hybrid encoder, and downsampled to a size that matches the feature map of each layer, and used as an attention mask to be incorporated into the self-attention calculation of the Transformer.
[0060] In some possible implementations, in step S2, the anatomical structure prior injection module includes:
[0061] Multiple trainable organ structure prototypes, each with dimensions consistent with the output feature dimensions of the hybrid encoder;
[0062] Multiple multi-head cross-attention layers are used. Each multi-head cross-attention layer uses the corresponding trainable organ structure prototype as the query and the output features of the hybrid encoder as the key and value to calculate attention weights and generate a structural prior feature map.
[0063] In some possible implementations, in step S3, the masked cross-attention skip connection module includes:
[0064] A multi-head cross-attention layer is used to calculate attention weights by taking the current layer features of the decoder as the query and the corresponding layer features of the encoder as the key and value.
[0065] The foreground mask generation unit is used to combine the structural prior feature map and the coarse segmentation result output by the decoder to generate a binary mask;
[0066] The residual fusion unit is used to multiply the attention weights with the binary mask, constrain the attention to the target region, obtain the weighted encoder features, perform residual fusion with the current layer features of the decoder, and input the input to the next layer decoder.
[0067] In some possible implementations, in step S3, the Transformer decoder includes four layers of Transformer decoding units. During the training phase, edge guidance loss and structural prior supervision are introduced in the last two layers of decoding units. The total loss during the training phase is a weighted sum of Dice loss, binary cross-entropy loss, edge loss, and structural prior supervision loss.
[0068] The following is combined Figure 2 The specific structure and workflow of the TAS-ViTNet network model constructed in this embodiment of the invention are illustrated by way of example. In this embodiment, TAS-ViTNet adopts an overall architecture of hybrid encoder-Transformer decoder-skip connection attention module-dual prior guidance. The shallow feature extractor in the hybrid encoder uses a pre-trained ConvNeXt-T network. Specifically:
[0069] 1. Hybrid encoder
[0070] Structure: A pre-trained ConvNeXt-T network (shallow feature extractor) and a 6-layer Transformer encoder.
[0071] Workflow: Input enhanced CT images (size 512×512) are processed by a spatial location prior guidance module (concatenated with a spatial location prior probability map) and then input into ConvNeXt-T. ConvNeXt-T outputs four levels of feature maps: C1 (256×256, 96 channels), C2 (128×128, 192 channels), C3 (64×64, 384 channels), and C4 (32×32, 768 channels), corresponding to local features at different scales. C4 undergoes patch embedding: the 32×32 feature map is divided into 16×16 non-overlapping patches (each patch is 2×2 in size), flattened into a 768-dimensional vector, forming a sequence of length 256. This sequence is input into a 6-layer Transformer encoder (8-head attention, 768 hidden layer dimension), which models global relationships through a self-attention mechanism, outputs the encoded sequence, and then converts it back into a 32×32×768 feature map. The C4, which has the highest semantic level, is fed into the Transformer encoder for global modeling. This method is suitable for learning the overall structure of organs and tissues and long-distance dependencies, while also controlling the amount of computation.
[0072] In this embodiment, during the decoding phase, C1, C2, C3, and C4 all participate in decoding through skip connections. During decoding at each layer, the decoder introduces encoder features of the corresponding scale through a cross-attention mechanism with mask constraints: shallow features (C1, C2) mainly supplement boundary and detail information; mid-level features (C3) provide region and shape-related information; and deep features (C4) provide high-level semantics and overall structural constraints.
[0073] 2. Anatomical Prior Injection Module (ASPM)
[0074] Structural components: 16 trainable organ structure prototypes (768 dimensions) and 16 multi-head cross-attention layers.
[0075] Workflow: Initialize 16 organ structure prototypes P1 to P16 (parameters are learnable), representing typical organ shape features. Each structure prototype is used as a query, and the sequence transformed from the C4 feature map output by the hybrid encoder is used as the key and value, inputting to the corresponding multi-head cross-attention layer to calculate attention weights. Based on the attention weights, a prior feature map (32×32×768) is generated. This feature map encodes organ morphological information and is used for subsequent decoding processes and constraints on skip connections.
[0076] In this embodiment, during model initialization, 16 organ structure prototypes are added to the network as learnable parameters (using a statistical feature-based initialization method). These prototypes do not contain any prior knowledge. During subsequent end-to-end training, the prototype parameters are continuously updated through backpropagation, with their gradients derived from the final segmentation loss and the constraint loss related to the structural priors. During training, these structural prototypes interact with the high-level features output by the hybrid encoder through attention, gradually learning stable structural patterns related to the anatomical morphology of abdominal tissues. In other words, organ structure priors are automatically formed during training in a data-driven manner.
[0077] It should be noted that the 16 trainable organ structural prototypes here are designed for the same target organ to be segmented (abdominal tissue organs). They can be understood as abstract representations of multiple typical structural patterns of the same organ under different spatial morphologies, scale variations, and imaging conditions. For example, because the morphology and surrounding structures of the gallbladder can vary significantly among different patients, at different scanning levels, and under different tumor invasion conditions, a single prototype is insufficient to fully describe these changes. Therefore, multiple structural prototypes are introduced to enhance expressive power.
[0078] The choice of 16 prototypes is primarily related to the following factors: 1) Organ morphological complexity and variability: Abdominal organs (such as the pancreas and gallbladder) exhibit certain non-rigid morphological changes in clinical practice, especially after tumor invasion, where shape, boundaries, and location can alter. Multiple prototypes can cover these common morphological changes, improving the robustness of structural priors. 2) Balance between model capacity and stability: Too few prototypes make it difficult to characterize sufficiently rich structural patterns; too many introduce redundant parameters, increasing training instability and the risk of overfitting. 16 is an empirical choice that balances structural expressiveness with training stability and computational overhead. 3) Compatibility with the Transformer attention mechanism: Prototypes participate in multi-head attention computation in the form of queries; a large number significantly increases attention computational complexity. With the current feature dimension and encoder depth settings, 16 prototypes can efficiently aggregate structural information. However, 16 is not a theoretically fixed value, but rather a hyperparameter related to the complexity of the target organ, the scale of the training data, and the model structure configuration. Without altering the core concept of this invention, this quantity can be adjusted according to specific application scenarios.
[0079] 3. Spatial Location Prior Guidance Module (SLPM)
[0080] Structural composition: A two-dimensional normalized probability map (512×512) generated based on tumor annotations in the training set.
[0081] Workflow: The coordinates of all abdominal organ tumor lesions in the training set are statistically analyzed to generate a two-dimensional probability map. High-incidence areas of abdominal organ tumors have high probability values (0.7-1.0), while other areas have low probability values (0-0.3), and the maps are normalized. This probability map is then concatenated with the original CT image (single-channel) as the second channel and input into the hybrid encoder, enabling the model to focus on high-probability areas during feature extraction. Simultaneously, the probability map is downsampled to a size matching the feature maps of each layer and used as an attention mask in the Transformer's self-attention calculation, suppressing the attention weights on low-probability areas.
[0082] 4. Masked Cross-Attention Skip Connection Module (MCASC)
[0083] Structural components: multi-head cross-attention layer, foreground mask generation unit, and residual fusion unit.
[0084] Workflow: In the i-th layer of the decoder, with the current feature of the decoder (H) i ) is the Query, and the encoder corresponds to the layer features (C) i The inputs (Key and Value) are used to calculate attention weights in the multi-head cross-attention layer. The foreground mask generation unit combines the prior structural feature map and the coarse segmentation result from the decoder output (after sigmoid activation) to generate a binary mask (target region as 1, background as 0). The residual fusion unit multiplies the attention weights by the foreground mask, constraining the attention to the target region to obtain weighted encoder features, which are then residually fused with the current decoder features (H...). i+1 =H i (+weighted features), input into the next layer decoder.
[0085] Specifically, in this embodiment, the coarse segmentation result output by the decoder refers to the intermediate prediction result generated by the decoder in the current or previous decoding layer. This coarse segmentation result is only used within the decoding stage to generate a foreground mask, which constrains subsequent feature fusion. The decoder is a process of layer-by-layer upsampling and feature reconstruction. In lower-resolution decoding layers, the model can obtain a preliminary segmentation prediction. This prediction result, after activation such as sigmoid, is used to generate a foreground / background binary mask. This mask is only used for attention weighting in the current decoding stage to limit cross-attention to focus primarily on potential target regions, thereby reducing interference from background regions.
[0086] The generation of the binary mask is completed within the decoding stage. The specific generation process can include the following steps: First, the decoder outputs a coarse segmentation prediction feature map at a certain decoding layer. After a 1×1 convolution and sigmoid activation, this feature map yields a foreground probability map with values ranging from [0,1], representing the confidence level of each pixel belonging to the target organ / tumor region. Second, this probability map is fused with the structural prior features output by the anatomical structure prior injection module (e.g., through element-wise weighting or concatenation followed by mapping to a single-channel probability space) to obtain a foreground probability response map with fused prior constraints, used to enhance the stability of target region discrimination. Subsequently, a thresholding operation is performed on the above probability response map to generate a binary mask. The specific rule is: when the probability value of a pixel is greater than or equal to a preset threshold T (e.g., T=0.5), the pixel is marked as foreground (value 1); when the probability value of a pixel is less than the threshold T, the pixel is marked as background (value 0). In some implementations, to avoid noise regions interfering with attention weights, simple morphological constraints can be introduced after binarization (such as removing connected regions with an area smaller than a set threshold) to ensure that the generated foreground mask has spatial continuity and anatomical rationality.
[0087] 5. Transformer Decoder
[0088] Structure consists of 4 layers of Transformer decoding units, bilinear interpolation upsampling layers, edge-guided loss, and structural prior supervision.
[0089] Workflow: Each decoding unit receives the output features from the previous layer, first improving the resolution through a bilinear interpolation upsampling layer (scale=2), and then reconstructing the features through a Transformer decoding layer (containing multi-head self-attention and a feedforward network). During the decoding stage, the ConvNeXt-T outputs four levels of feature maps C1, C2, C3, and C4, all participating in decoding through skip connections. During each decoding layer, the decoder introduces encoder features of the corresponding scale through a mask-constrained cross-attention mechanism. Shallow features C1 and C2 mainly supplement boundary and detail information; mid-level feature C3 provides region and shape-related information; and deep feature C4 provides high-level semantics and overall structural constraints. During the training stage, edge guidance loss and structural prior supervision are introduced in the last two decoding units. The edge guidance loss calculates the binary cross-entropy (BCE) loss between the true boundary (obtained by Canny edge detection on the true mask) and the predicted boundary (obtained by Canny edge detection on the predicted mask), guiding the network to focus on edge details. Structural prior supervision ensures that the output conforms to the anatomical morphology of the organ by calculating the mean squared error (MSE) loss between the predicted feature map and the structural prior feature map. Finally, the feature map is converted into a single-channel segmentation mask through 1×1 convolution, and the final segmentation result is obtained after sigmoid activation.
[0090] In this embodiment, the improvements to the decoder are as follows:
[0091] 1) The penultimate decoding unit (layer L-1)
[0092] a. Forward process (training and inference are consistent): This layer receives the decoded features H from the previous layer. L-2 First, the features are upsampled by 2x through bilinear interpolation and then input into the Transformer decoding layer. The features are then reconstructed through multi-head self-attention and a feedforward network to obtain the output features.
[0093] b. Additional supervision during the training phase (enabled only during training): This layer will be based on H L-1 An intermediate segmentation prediction is generated and introduced into the edge-guided loss to enhance the model's ability to perceive target boundary regions. Specifically, let the prediction mask for this layer be... The real mask is The predicted boundaries are obtained by using edge operators (such as Canny). and the true boundary The edge loss is defined as:
[0094]
[0095] BCE stands for Binary Cross-Entropy.
[0096] c. Inference stage: During inference, only the feature reconstruction result H of this layer is retained. L-1 No boundary is generated, and no loss is calculated.
[0097] 2) The last decoding unit (layer L)
[0098] a. Forward process (training and inference are consistent): This layer receives H... L-1 Similarly, it first performs 2x bilinear interpolation upsampling, then reconstructs features through a Transformer decoding layer, and finally obtains the final segmentation prediction through 1×1 convolution and sigmoid activation. .
[0099] b. Supervision constraints during training (enabled only during training): Two types of supervision are introduced simultaneously in this layer:
[0100] Main Segmentation Loss (Dice+BCE): ;in , These are the weighting coefficients. , , These represent the main split loss, Dice loss, and binary cross-entropy loss, respectively.
[0101] Structural Prior Supervision Loss: Let the structural prior feature map be S, and the corresponding structural features obtained from the predicted feature mapping be... The structural prior supervision loss is defined as: That is, to impose element-wise mean squared error (MSE) constraints on both, where This represents the L2 norm.
[0102] c. Reasoning Phase: Only output is performed during reasoning. It is binarized using a threshold (such as 0.5) without involving any loss calculation.
[0103] 3) Total loss function (training phase)
[0104] Considering all the above losses, the total loss function used in this embodiment during the training phase is:
[0105]
[0106] in , , , These are the Dice loss, binary cross-entropy loss, edge loss, and structural prior supervision loss, respectively. , , , These are the weighting coefficients for each loss term.
[0107] In this embodiment, structural priors constrain the relationship between the high-level predicted feature map output by the decoder and the structural prior feature map. The predicted feature map is obtained from the high-dimensional feature map output by the last (or penultimate) layer of the Transformer decoding unit. Specifically, the feature tensor output by the decoder undergoes a feature mapping (e.g., a 1×1 convolution or linear mapping) and is projected onto the same channel dimension and spatial resolution as the structural prior feature map, thus obtaining the predicted structural feature map used for structural constraints. This feature map retains continuous value form, representing the model's high-level semantic expression of organ structural morphology. The structural prior feature map is generated by the Anatomical Structure Prior Injection Module (ASPM). Specifically, the trainable organ structure prototype in ASPM serves as the Query, interacting with the high-level features (the C4 sequence encoded by the Transformer) output by the hybrid encoder through attention, outputting a structural prior feature map that integrates information from multiple typical organ morphologies. This feature map is retained during decoding and serves as a reference target for structural constraints. The prediction mask is a single-channel probability map obtained by passing the final output features of the decoder through 1×1 convolution and sigmoid activation, and can be further thresholded into a binary mask during training or inference. It's important to note that the prediction mask does not directly participate in the calculation of the structural prior MSE loss, but is mainly used for: calculating the main segmentation loss (Dice, BCE); and generating a foreground binary mask during the decoding stage to constrain the spatial range of cross-attention. Therefore, in structural prior supervision, the prediction feature map participating in MSE calculation comes from the high-level feature output of the decoder, obtained through linear mapping; the structural prior feature map serving as the supervision target comes from the ASPM module; and the prediction mask is only used for segmentation supervision and attention constraints, not as a direct input to the structural prior loss. In this way, structural prior supervision can guide the decoder to learn high-level structural expressions that conform to the corresponding abdominal tissue anatomical morphology without compromising the discriminativeness of the segmentation output.
[0108] In this embodiment, the hybrid encoder structure consists of a pre-trained ConvNeXt-T and a Transformer encoder, collaboratively capturing local details and global contextual information. The ConvNeXt-T's deep convolution and LayerNorm design enhance local feature extraction capabilities and adaptability to medical data. The anatomical structure prior injection module interacts with the encoder output features through self-attention using trainable organ structure prototypes, generating a structural prior feature map, which is then injected into the decoding process and skip connections, providing organ morphological constraints for accurate segmentation. The spatial location prior guidance module generates a two-dimensional normalized probability map based on tumor annotations in the training set, serving as an additional channel input or attention mask to guide the model to focus on tumor-prone areas, enhancing the capture of small lesions. The supervised Transformer decoder employs multi-layer decoding units to progressively restore resolution, with the last two layers introducing edge-guided loss and structural prior supervision to improve boundary localization accuracy and consistency between the segmentation results and anatomical morphology.
[0109] The following provides a practical example of the model training and inference process.
[0110] Training parameters: The optimizer uses AdamW (learning rate 1e-4), batch size 8, training epochs 100, and an early stopping strategy is adopted (the training stops when the Dice coefficient on the validation set decreases for 5 consecutive epochs, where the Dice coefficient is calculated by the ratio of the intersection and union of the predicted mask and the real mask).
[0111] Loss function: A multi-weighted joint loss function is used, where each loss term constrains the segmentation result from different perspectives, such as region overlap, pixel-level classification, boundary constraints, and anatomical structure consistency. The loss term includes Dice loss. Binary cross-entropy loss Edge loss and structural prior supervision loss Dice loss measures the overlap between the predicted segmentation result and the ground truth annotation in the overall region, effectively mitigating the problem of foreground / background class imbalance in medical images. Binary cross-entropy loss applies a foreground / background binary classification constraint to each pixel, improving pixel-level classification stability. Edge loss enhances the model's focus on the boundary regions of abdominal tissues and organs, improving the localization accuracy of the segmentation result at edges. Structural prior supervision loss constrains the predicted result to maintain consistency with the anatomical prior in high-level semantic structure, preventing segmentation results that do not conform to the anatomical morphology of organs. Combining the above losses, the total loss function used in this embodiment during the training phase is defined as: The loss weights are used to balance the contribution ratios of region consistency, pixel classification, boundary accuracy, and structural rationality. This weight configuration is determined under the premise of ensuring training stability and segmentation performance.
[0112] By introducing multiple complementary loss constraints, this invention not only focuses on the overall segmentation accuracy of the target abdominal tissue region, but also further enhances the consistency of boundary details and anatomical structures, thereby improving the robustness and clinical applicability of the model in complex medical imaging scenarios.
[0113] In actual operation, the model's inference process is as follows:
[0114] 1) Input and Preprocessing Stage: The input for the inference stage is a single enhanced CT image. The preprocessing flow is consistent with the training stage, specifically including: intensity normalization to map CT grayscale values to a preset range; resizing or cropping to ensure the input image size is uniformly 512×512; and loading the spatial location prior probability map corresponding to the CT image. Subsequently, the original enhanced CT image (single channel) and the spatial location prior probability map (single channel) are concatenated along the channel dimension to form a dual-channel input tensor, which serves as the input data for subsequent feature extraction.
[0115] 2) Hybrid Encoder Feature Extraction Stage: The concatenated dual-channel input first enters the ConvNeXt-T network in the hybrid encoder to extract multi-scale local features, resulting in four layers of feature maps C1, C2, C3, and C4. The highest-level feature C4 is further processed through block embedding and input into the Transformer encoder. A self-attention mechanism models global contextual relationships, outputting encoded high-level semantic features. This process achieves joint modeling of local details and global dependencies.
[0116] 3) Dual Prior Guidance Stage: During inference, the dual prior guidance mechanism is fully retained, including: Spatial Location Prior Guidance: The spatial location prior probability map not only participates in feature extraction as an input channel during the encoding stage, but is also downsampled and used as an attention mask during Transformer encoding to suppress responses in low-probability regions and strengthen attention to high-probability areas of the target. Anatomical Structure Prior Guidance: The Anatomical Structure Prior Injection Module (ASPM) takes the high-level features encoded by Transformer as input to generate a structural prior feature map. This prior feature is used to constrain feature fusion during the decoding stage and skip connection process, ensuring that the prediction results conform to the overall anatomical morphology of the target abdominal tissue.
[0117] 4) Decoding and Feature Fusion Stage: The decoder receives the encoder output and structural prior features, and restores the spatial resolution through progressive upsampling by multiple Transformer decoding units. During each decoding layer: encoder features at the corresponding scale are introduced through masked cross-attention skip connections; the attention range is constrained using the foreground mask generated in the decoding stage; and structural prior features are synchronously integrated into the feature fusion process. This stage only performs forward computation during inference and does not involve any loss or supervision operations.
[0118] 5) Output and Post-processing Stage: The feature map output from the last layer of the decoder is subjected to 1×1 convolution and sigmoid activation to obtain a single-channel segmentation probability map. Subsequently, the probability map is binarized with a threshold of 0.5 to output the final segmentation results of the target abdominal tissue organs and their tumors.
[0119] The effects and advantages of this invention will be verified through experiments below.
[0120] In this embodiment, all related experiments were conducted using the same abdominal organ tumor (gallbladder cancer) CT dataset and a unified training strategy to ensure the comparability of results. The comparative experimental results are shown in Tables 1 to 4. The ablation experimental results are shown in Tables 5 and 6.
[0121] The "internal test set" and "external test set" used in this experiment are both based on CT image data of gallbladder tumors from a single source, and do not include image data of other abdominal tumor diseases. The internal test set consists of CT images of approximately 350 gallbladder cancer patients from multiple authorized hospitals. This dataset is mainly used for model training and performance validation to ensure the segmentation accuracy and robustness of the model in multi-hospital scenarios. The external test set consists of CT images of approximately 50 gallbladder cancer patients from another authorized hospital, collected independently. This external dataset serves as a rigorous evaluation of the model's generalization ability, used to verify the applicability and stability of this method in cross-hospital and cross-center scenarios.
[0122] To objectively and comprehensively evaluate the advancement of TAS-ViTNet in gallbladder cancer segmentation, this experiment selected four representative deep learning models as benchmarks, covering the evolution path from classic architectures to cutting-edge large-scale models. First, this experiment selected classic convolutional neural network-based architectures, including UNet and ResUNet, as foundational work in medical image segmentation. These two models can provide a reference benchmark for evaluating the performance of basic convolutional operators in gallbladder local texture extraction. Second, addressing the limited receptive field of traditional CNNs, a series of enhanced architectures were introduced, including Nested-UNet, ResUNet++, Attention-UNet, and UNet3+, aiming to compare and analyze the degree of improvement in gallbladder lesion boundaries achieved solely through complex convolutional topologies or spatial attention without introducing a Transformer. Given that TAS-ViTNet's core employs a cascaded hybrid architecture, we further selected mainstream Transformer hybrid models from recent years for in-depth benchmarking, specifically including SwinUNet, TransUNet-2D, UCTransNet, and UDTransNet. These models allow us to verify the uniqueness and superiority of the CNN-Transformer cascaded logic and dual prior injection in TAS-ViTNet when handling the topological relationships of the gallbladder and its adjacent organs. Finally, this experiment also included highly competitive large-scale model benchmarks, namely nnU-Netv2 and MedSAM. The former, as a champion-level framework in the field of medical image segmentation, represents the current performance ceiling of supervised learning, while the latter is a representative of general-purpose large-scale medical image segmentation models on specific tasks. Through cross-sectional evaluation, we aim to demonstrate the performance improvement of customized designs for the specific anatomical logic of gallbladder cancer compared to general-purpose SOTA (State-Of-The-Art) models in the clinical vertical domain.
[0123] This experiment selected five metrics to comprehensively evaluate the segmentation results of the model. First, there are the Dice coefficient and the intersection-overlap ratio (IoU), based on overlap. These two metrics primarily measure the degree of overlap between two spatial regions, with values ranging from [0,1]. Values closer to 1 indicate better segmentation. The Dice coefficient is the most commonly used evaluation metric in medical segmentation; it is highly sensitive to the degree of overlap within regions. The Dice coefficient not only reflects the accuracy of segmentation but also helps balance the imbalance between positive and negative samples to some extent. The IoU, also known as the Jaccard index, is defined as the intersection of the predicted region and the true region divided by their union. Compared to Dice, IoU is more stringent in penalizing incorrect predictions and is often used to evaluate the model's accuracy in locating the overall contour of the target region. Furthermore, since the invasive boundaries of gallbladder cancer are often very complex, relying solely on region overlap is insufficient to capture subtle deviations at the lesion edges. Therefore, the surface distance metric is introduced to evaluate the fineness of boundary fitting. The Hausdorff distance (HD) measures the distance between the farthest points in two sets of points, reflecting the worst-case scenario of the segmentation results. Because the original high-resolution (HD) image is highly susceptible to outlier noise, the 95th percentile Hausdorff distance (HD95) is typically used in clinical evaluation. This metric calculates the maximum offset between the predicted boundary and the true boundary after excluding 5% extreme outliers. In gallbladder cancer CT image segmentation, a lower HD95 indicates higher spatial consistency in handling tumor invasion boundaries into the liver or intestine. Precision measures the proportion of regions predicted as lesions by the model that are actually lesions. High precision means a lower false diagnosis rate, helping to reduce the misclassification of normal liver tissue, bile, or other benign tissue as malignant tumors. Recall (also known as sensitivity) measures the model's ability to correctly identify all actual lesion regions. Due to the high malignancy and rapid progression of gallbladder cancer, maintaining a high level of recall is crucial, ensuring that as many lesion regions as possible are captured.
[0124] This experiment designed a systematic ablation experimental scheme to explore the significance of spatial location priors, anatomical structure constraints, and hybrid coding architecture in dealing with complex peritoneal environments.
[0125] First, addressing the challenge that gallbladder cancer lesions often exhibit a disjointed distribution or high adhesion to adjacent organs in enhanced CT images, making accurate global localization difficult using only local perception via convolution operators, a control group (without SLPM) was specifically designed. This group was observed to verify the module's effectiveness by checking whether the model would produce severe false positives due to grayscale interference from the liver margins or kidney regions after losing statistical spatial probability guidance. Second, considering the extremely distorted morphology and blurred boundaries of the gallbladder after tumor invasion, the anatomical structure prior injection module (ASPM) was further ablated. With explicit guidance removed from 16 learnable anatomical prototypes (without ASPM), the model was tested to verify whether data-driven segmentation could maintain overall consistency in the segmentation results even without a refined understanding of typical anatomical relationships of the gallbladder and surrounding tissues. This assessment evaluated the module's crucial role in simulating clinical physician reasoning and ensuring the rationality of anatomical segmentation in invasive gallbladder cancer. Furthermore, to verify the architectural advantages of TAS-ViTNet in feature extraction and fusion, ablation variants were set up for the multi-scale cross-attention skip connection module, the Transformer decoding branch, and the hybrid encoding architecture: by replacing the MCASC module with ordinary skip connections (without MCASC), the value of the attention mechanism in small lesion region recognition and detail capture was analyzed in depth; by degenerating the hybrid encoder into a pure convolutional structure (without the hybrid encoder), the irreplaceable role of the Transformer in capturing long-range dependencies was clearly observed; and by removing the Transformer branch at the decoding end (without the Transformer decoder), the gain brought by global context information in lesion detail delineation during the feature recovery stage was further evaluated.
[0126] Table 1. Evaluation results of gallbladder segmentation performance in internal test sets (mean and 95% confidence interval)
[0127]
[0128] In terms of five core metrics—Dice coefficient, intersection-over-union ratio (IoU), precision, recall, and Hausdorff distance—TAS-ViTNet achieved leading performance. Specifically, the model achieved a Dice coefficient of 0.899 (0.764-1.035) and an IoU of 0.847 (0.715-0.978), significantly outperforming the currently recognized medical benchmark model nnUNet-v2 (Dice=0.879) and the large-scale model MedSAM (Dice=0.881). Compared to traditional convolutional neural network architectures such as UNet (Dice=0.800), ResUNet (Dice=0.784), Nested-UNet (Dice=0.824), and Attention-UNet (Dice=0.822), this model achieved an improvement of approximately 7.5% to 11.5% in the Dice metric. In terms of recall, TAS-ViTNet achieved 0.903, outperforming most of the comparison models and only slightly lower than TransUNet-2D (0.965) and SwinUNet (0.960). However, the latter two performed poorly in terms of Dice coefficient and precision, especially SwinUNet, whose Dice was only 0.733, indicating that although it could cover the target area, it had obvious missegmentation problems. Of particular note is that TAS-ViTNet achieved an excellent score of 3.816 on the HD metric, which measures the accuracy of boundary prediction, far lower than nnUNet-v2 (10.883) and UNet3+ (97.760). This reflects that the model has a stronger ability to delineate anatomical contours when dealing with cases where the boundary between the gallbladder and adjacent tissues is blurred.
[0129] Table 2. Evaluation results of tumor segmentation performance on the internal test set (mean and 95% confidence interval)
[0130]
[0131] Experimental results show that the proposed TAS-ViTNet outperforms other models in all evaluation metrics, achieving a Dice coefficient of 0.856 (0.676-1.036) and an intersection-over-union ratio of 0.816 (0.644-0.988). This demonstrates stronger semantic recognition capabilities compared to the medical segmentation benchmark model nnUNet-v2 (Dice=0.791) and the pre-trained large model MedSAM (Dice=0.799). On the 95% HD metric, which measures the fit of lesion edges, TAS-ViTNet achieves a score of 6.672. In contrast, basic CNN models such as UNet (80.737) and ResUNet (95.014) show significant deviations on this metric, reflecting a clear risk of failure for traditional architectures when handling tumor regions with highly irregular shapes and extremely blurred boundaries. In terms of recall, TAS-ViTNet achieved 0.875, which is not only better than nnUNet-v2 (0.836), but also significantly higher than UNet3+ (0.640) and UCTransNet (0.626). This means that the model can more effectively capture small tumor infiltrates and reduce the possibility of missed diagnoses in clinical practice.
[0132] Table 3. Evaluation results of gallbladder segmentation performance of external test sets (mean and 95% confidence interval)
[0133]
[0134] In the gallbladder segmentation task targeting external test sets, due to the significant heterogeneity of cross-center data in terms of scanning equipment, contrast agent concentration, and slice thickness, the experimental results can more objectively reflect the generalization stability of the model. As shown in Table 3, the TAS-ViTNet proposed in this invention outperforms the comparison models on all core evaluation metrics, with a Dice coefficient of 0.833 (0.794-0.872) and an intersection-over-union ratio of 0.770 (0.728-0.812), leading the currently high-performing MedSAM (Dice=0.759) and nnUNet-v2 (Dice=0.744). In traditional CNN architectures, UCTransNet performs relatively well (Dice=0.726), while UNet3+ (Dice=0.241) and ResUNet++ (Dice=0.492) show significant performance degradation when facing heterogeneous external images. In terms of precision and recall, TAS-ViTNet achieved a good balance of 0.832 and 0.870, respectively. In contrast, although nnUNet-v2 (Recall=0.853) and SwinUNet (Recall=0.803) had higher recall, their lower precision reflected the presence of more artifacts and missegmentation on the external test set. Notably, TAS-ViTNet achieved a leading score of 8.046 on the 95% HD metric, lower than MedSAM (12.879) and nnUNet-v2 (16.400), while the basic UNet (134.291) and UNet3+ (243.968) suffered from significant geometric positional deviations due to their inability to effectively handle domain offsets.
[0135] Table 4. Evaluation results of tumor segmentation performance on the external test set (mean and 95% confidence interval)
[0136]
[0137] In the most challenging tumor segmentation experiment on the external test set, the performance of each model fluctuated to varying degrees due to the high heterogeneity of tumor lesion morphology and significant differences in cross-center image features. As shown in Table 4, the TAS-ViTNet proposed in this invention still exhibits strong generalization ability, with a Dice coefficient of 0.802 (0.774-0.830) and an intersection-over-union ratio of 0.767 (0.735-0.799), both significantly outperforming MedSAM (Dice=0.745) and nnUNet-v2 (Dice=0.733). However, when dealing with targets with extremely low contrast, such as tumors, traditional CNN models such as ResUNet (Dice=0.276) and ResUNet++ (Dice=0.120) almost fail on external datasets, while this model effectively resists the interference caused by domain shift through its global modeling capability. In terms of recall and precision, TAS-ViTNet achieved scores of 0.835 and 0.823, respectively, significantly reducing the false diagnosis rate while ensuring no missed diagnoses. In contrast, SwinUNet (Recall=0.505) and TransUNet-2D (Recall=0.444) showed a significant decrease in their ability to capture data on the outer set. On the boundary evaluation metric of 95%HD, TAS-ViTNet achieved a score of 30.675. Although this score was higher than the internal test set due to cross-center image quality fluctuations, it was still far superior to MedSAM (43.611) and nnUNet-v2 (46.286). Models such as UNet3+, on the other hand, experienced severe oversegmentation or undersegmentation, causing this metric to spike above 300.
[0138] Table 5. Results of internal test gallbladder segmentation and ablation experiments
[0139]
[0140] For gallbladder segmentation, the complete TAS-ViTNet model achieved a top Dice score of 0.8993 and an excellent boundary accuracy of 3.8155 (see Table 5). Ablation analysis showed that the ASPM module played a decisive role in this task. When ASPM was removed, the Dice coefficient was only 0.504, while the HD value surged to 204.567. This indicates that in gallbladder segmentation with relatively fixed anatomical structures, the spatial location awareness provided by this module is crucial for the model to quickly locate the anatomical target. Meanwhile, the synergistic effect of the SLPM and MCASC modules improved the Dice by approximately 14% and 10%, respectively, when handling the morphologically variable gallbladder, significantly enhancing the model's robustness to anatomical structures. Furthermore, the introduction of the Transformer decoder and hybrid encoder further optimized global long-range dependency modeling, reducing the HD distance from 35.963 to 3.815, achieving accurate characterization of edge details.
[0141] Table 6 Results of tumor segmentation and ablation experiments on the internal test set
[0142]
[0143] In the tumor segmentation task (see Table 6), the experimental data reflect the importance of each module in dealing with complex lesions. The SLPM module is particularly crucial; removing it caused the Dice coefficient to plummet from 0.855 to 0.589, while the HD index soared to 240.466. This indicates that SLPM, through spatial hierarchical prototype matching, provides the model with necessary global semantic constraints, enabling it to accurately distinguish lesions from the background in tumor regions with extremely low contrast. The absence of the MCASC module led to a decrease in Dice of approximately 11.27%, validating its effectiveness in extracting lesion heterogeneity features through multi-scale cross-attention. Furthermore, the removal of the ASPM module significantly increased the HD distance, demonstrating its supporting role in tumor boundary localization under the prior guidance of anatomical location.
[0144] Figure 3 and Figure 4 The results of gallbladder cancer segmentation are shown. Figure 5 and Figure 6 The results of cervical cancer segmentation are shown.
[0145] The following describes a precise abdominal tumor segmentation system based on hybrid prior guidance, which relates to an embodiment of the present invention.
[0146] This invention discloses a precise abdominal tumor segmentation system based on hybrid prior guidance, used to implement the precise abdominal tumor segmentation method based on hybrid prior guidance described in the first aspect. The system includes: an input module for acquiring abdominal medical images and a spatial location prior probability map; and a TAS-ViTNet network module for segmenting tumor regions in the abdominal medical images based on a TAS-ViTNet network model. The TAS-ViTNet network model includes a hybrid encoder, an anatomical structure prior injection module, a spatial location prior guidance module, a masked cross-attention skip connection module, and a Transformer decoder. The spatial location prior guidance module introduces the spatial location prior probability map, which is fused with the abdominal medical images and used as input to the hybrid encoder. The hybrid encoder extracts local features through a convolutional neural network and then extracts global contextual features through a Transformer encoder to obtain encoded features. The anatomical structure prior injection module generates a structural prior feature map through self-attention interaction between a trainable organ structure prototype and encoded features. This structural prior feature map serves as input to the Transformer decoder, which progressively upsamples to restore resolution. The mask cross-attention skip connection module dynamically fuses encoder and decoder features using a foreground mask generated from the structural prior feature map and the segmentation result. The Transformer decoder output is transformed and activated to obtain a binary segmentation result. During training, the Transformer decoder combines edge guidance loss and structural prior supervision to optimize boundary and structural accuracy. The edge guidance loss is optimized by comparing the difference between the predicted segmentation boundary and the true boundary. The structural prior supervision is optimized by comparing the difference between the decoder output features and the structural prior feature map. The output module outputs the binary segmentation result.
[0147] For details on the specific implementation of each module, please refer to the above-described embodiment of the method for precise segmentation of abdominal tumors based on hybrid prior guidance, which will not be repeated here.
[0148] This invention also discloses a computer system, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the steps of any of the aforementioned methods for precise segmentation of abdominal tumors based on hybrid prior guidance.
[0149] This invention also discloses a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of any of the aforementioned methods for precise segmentation of abdominal tumors based on hybrid prior guidance.
[0150] This invention also discloses a computer program product, comprising a computer program that, when executed by a processor, implements the steps of any of the aforementioned methods for precise abdominal tumor segmentation based on hybrid prior guidance. The program code for implementing the method of this invention can be written in any combination of one or more programming languages. This program code can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the program code causes the steps of the method of this invention to be implemented.
[0151] The abdominal tumor precision segmentation system, computer system, computer-readable storage medium, and computer program product based on hybrid prior guidance provided in this embodiment have the same beneficial effects as the abdominal tumor precision segmentation method based on hybrid prior guidance described above, and will not be repeated here.
[0152] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the systems or apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and relevant parts can be referred to the method section. Any aspects not described in detail in this invention are well-known techniques to those skilled in the art.
[0153] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for precise segmentation of abdominal tumors based on hybrid prior-guided, characterized in that, Includes the following steps: Abdominal medical images are fused with a prior probability map of spatial location and then input into a hybrid encoder. The hybrid encoder extracts local features through a convolutional neural network and then extracts global contextual features through a Transformer encoder to obtain encoded features. The encoded features are input into the anatomical structure prior injection module, which generates a structural prior feature map by interacting with the encoded features through a trainable organ structure prototype and self-attention. The structural prior feature map is input into the Transformer decoder, which progressively upsamples to restore resolution. Simultaneously, a masked cross-attention skip connection module dynamically fuses encoder and decoder features by combining the structural prior feature map and a foreground mask generated from the segmentation results. During training, the Transformer decoder combines edge guidance loss and structural prior supervision to optimize boundary and structural accuracy. The edge guidance loss is optimized by comparing the difference between the predicted segmentation boundary and the true boundary; the structural prior supervision is optimized by comparing the difference between the decoder output features and the structural prior feature map. The output of the Transformer decoder is transformed and activated through feature map to obtain the binary segmentation result.
2. The method of claim 1, wherein the method is based on a hybrid prior-guided abdominal tumor segmentation. The hybrid encoder consists of a ConvNeXt-T network and a six-layer Transformer encoder. The ConvNeXt-T network is used to extract multi-scale local features. The deepest features output by the ConvNeXt-T network are processed by block embedding and then input into the six-layer Transformer encoder to model global relationships through a self-attention mechanism.
3. The method for precise segmentation of abdominal tumors based on hybrid prior guidance according to claim 1, characterized in that, The spatial location prior probability map is a two-dimensional normalized probability map generated based on the tumor annotation statistics of the training set. High probability regions exceeding a preset threshold correspond to high-incidence locations of tumors. The spatial location prior probability map is stitched together with the abdominal medical image and input into the hybrid encoder. It is downsampled to a size that matches the feature map of each layer and used as an attention mask to be incorporated into the self-attention calculation of the Transformer.
4. The method for precise segmentation of abdominal tumors based on hybrid prior guidance according to claim 1, characterized in that, The anatomical structure prior injection module includes: Multiple trainable organ structure prototypes, each with dimensions consistent with the encoded feature dimensions; Multiple multi-head cross-attention layers are used. Each multi-head cross-attention layer uses the corresponding trainable organ structure prototype as the query and the encoded features as the key and value to calculate the attention weight and generate the structural prior feature map.
5. The method for precise segmentation of abdominal tumors based on hybrid prior guidance according to claim 1, characterized in that, The masked cross-attention skip connection module includes: A multi-head cross-attention layer is used to calculate attention weights by taking the current layer features of the decoder as the query and the corresponding layer features of the encoder as the key and value. The foreground mask generation unit is used to combine the structural prior feature map and the coarse segmentation result output by the decoder to generate a binary mask; The residual fusion unit is used to multiply the attention weights with the binary mask, constrain the attention to the target region, obtain the weighted encoder features, perform residual fusion with the current layer features of the decoder, and input the input to the next layer decoder.
6. The method for precise segmentation of abdominal tumors based on hybrid prior guidance according to claim 1, characterized in that, The Transformer decoder includes four Transformer decoding units. During the training phase, edge guidance loss and structural prior supervision are introduced in the last two decoding units. The total loss during the training phase is a weighted sum of Dice loss, binary cross-entropy loss, edge loss and structural prior supervision loss.
7. A system for precise segmentation of abdominal tumors based on hybrid prior guidance, used to implement the method for precise segmentation of abdominal tumors based on hybrid prior guidance according to any one of claims 1-6, characterized in that, include: The input module is used to acquire abdominal medical images and prior probability maps of spatial location; The TAS-ViTNet network module is used for tumor region segmentation in abdominal medical images based on the TAS-ViTNet network model. The TAS-ViTNet network model includes a hybrid encoder, an anatomical structure prior injection module, a spatial location prior guidance module, a masked cross-attention skip connection module, and a Transformer decoder. The spatial location prior guidance module introduces a spatial location prior probability map, which is fused with the abdominal medical image and used as input to the hybrid encoder. The hybrid encoder extracts local features through a convolutional neural network and then extracts global contextual features through a Transformer encoder to obtain encoded features. The anatomical structure prior injection module performs self-attention between a trainable organ structure prototype and the encoded features. The process involves interaction to generate a structural prior feature map. This prior feature map serves as input to the Transformer decoder, which progressively upsamples to restore resolution. A mask cross-attention skip connection module dynamically fuses encoder and decoder features using a foreground mask generated from the structural prior feature map and the segmentation result. The Transformer decoder output is then transformed and activated to obtain a binary segmentation result. During training, the Transformer decoder combines edge guidance loss and structural prior supervision to optimize boundary and structural accuracy. The edge guidance loss is optimized by comparing the difference between the predicted segmentation boundary and the true boundary. The structural prior supervision is optimized by comparing the difference between the decoder output features and the structural prior feature map. The output module is used to output the binary segmentation result.
8. A computer system comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the computer program is executed by the processor, it implements the steps of the method for precise segmentation of abdominal tumors based on hybrid prior guidance according to any one of claims 1-6.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the method for precise segmentation of abdominal tumors based on hybrid prior guidance according to any one of claims 1-6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the method for precise segmentation of abdominal tumors based on hybrid prior guidance according to any one of claims 1-6.