Medical image segmentation method and device based on three-flow prototype fusion
By integrating medical image segmentation methods through a three-stream prototype fusion network, the semantic-spatial alignment misalignment problem in multi-scale representation is solved, achieving more accurate boundary segmentation and structural consistency, and improving the robustness of the model.
Patent Information
- Application Number
- CN202611137885.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-29
- Publication Date
- 2026-11-20
AI Technical Summary
Existing medical image segmentation methods suffer from semantic-spatial alignment misalignment in multi-scale representation integration and lack explicit mechanisms to capture and utilize stable dataset-level structural patterns of anatomical structures, resulting in insufficient boundary accuracy and structural fidelity.
A medical image segmentation network based on three-stream prototype fusion is adopted. The high-resolution spatial features, deep semantic features and decoder feature streams of the encoder are integrated through the TPFM module. Combined with the global prototype memory and detail-semantic feature aligner, the directional interaction of multi-scale features and global structural consistency are achieved.
It improves the boundary accuracy and structural fidelity of medical image segmentation, enhances the robustness of the model under variation and neighborhood shift, and achieves more accurate semantic-spatial correspondence and structural consistency across images.
Smart Images

Figure CN123141833A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image segmentation technology, and in particular to a medical image segmentation method and apparatus based on three-stream prototype fusion. Background Technology
[0002] Accurate medical image segmentation is a fundamental problem in computer vision and plays a crucial role in modern clinical workflows. By delineating anatomical structures and pathological regions from imaging modalities such as MRI, CT, and ultrasound, segmentation algorithms enable quantitative analysis, supporting disease diagnosis, treatment planning, and longitudinal monitoring of patient conditions. As medical imaging continues to grow in scale and complexity, the need for automated segmentation systems that provide reliable and accurate predictions while minimizing the burden on clinicians is increasing.
[0003] Deep learning has greatly propelled the field, with the encoder-decoder architecture becoming the mainstream paradigm for intensive medical image analysis. In such frameworks, the encoder progressively extracts hierarchical semantic representations through spatial downsampling, while the decoder reconstructs high-resolution predictions by restoring spatial details and generating pixel-level labels. Among these methods, U-Net stands out as a classic architecture due to its effectiveness in various medical image segmentation tasks. Its approach of fusing shallow spatial information with high-level semantic features using skip connections has inspired numerous subsequent models. Building upon this foundation, recent research has introduced various architectural improvements to enhance representational capabilities. Attention mechanisms have been introduced to emphasize information-rich regions, Transformer-based modules have been used to capture long-range dependencies, and state-space models such as Mamba have recently been explored for efficient sequence modeling in visual tasks.
[0004] Despite these architectural innovations, a key limitation remains in the integration of multi-scale representations. Standard fusion strategies often rely on simple concatenation or linear addition to combine features from different depths. While computationally efficient, these operations treat feature aggregation as a static process, failing to explicitly address the inherent semantic differences between abstract deep contexts and fine-grained shallow spatial features. This semantic-spatial alignment misalignment often leads to a loss of boundary accuracy and structural fidelity, which is particularly detrimental in medical imaging, where subtle anatomical variations have significant clinical implications. Furthermore, most existing segmentation methods operate on a single image basis, ignoring the inherent, stable dataset-level structural patterns of medical anatomy. Anatomical structures exhibit consistent morphological regularities across different patient populations and acquisition protocols. However, current models lack explicit mechanisms to capture and utilize these prototypical representations, limiting their ability to maintain robust performance under representational variations and domain shifts. Therefore, constructing a unified framework that harmonizes efficient multi-scale fusion, precise detail-semantic alignment, and global structural prior integration remains an unresolved challenge. Summary of the Invention
[0005] To address the above problems, this invention proposes a medical image segmentation method and apparatus based on three-stream prototype fusion. The medical image segmentation network constructed by this method integrates high-resolution spatial features from the shallow layer of the encoder, semantically rich deep features from the deep layer of the encoder, and context-refined features propagated through the decoder through the TPFM module. It models the directional interaction between the semantic stream, spatial stream, and decoder feature stream, overcoming the limitations of the symmetric feature aggregation commonly used in traditional U-Net-style architectures.
[0006] On the one hand, the medical image segmentation method based on three-stream prototype fusion has the following specific steps:
[0007] S1. Construct and train a medical image segmentation network based on three-stream prototype fusion to obtain a trained medical image segmentation network; the medical image segmentation network includes five encoders, four PCD modules, four SFRM modules, three TPFM modules, an SBSM module, and a segmentation head;
[0008] The medical image input is sequentially processed by a first encoder, a second encoder, a third encoder, a fourth encoder, and a fifth encoder to extract features layer by layer. The output of the fifth encoder is enhanced semantically by the SBSM module and then output to the fourth PCD module. The outputs of the second, third, fourth, and fifth encoders are adaptively adjusted by an SFRM module to obtain the first, second, third, and fourth refined features, respectively. The third TPFM module performs spatial-semantic alignment feature fusion on the fourth, third, and fourth refined features and the output of the fourth PCD module, and outputs it to the third PCD module. The second TPFM module performs spatial-semantic alignment feature fusion on the third, second, and third refined features and the output of the third PCD module, and outputs it to the second PCD module. The first TPFM module performs spatial-semantic alignment feature fusion on the second, first, and second PCD modules and outputs it to the first PCD module. Each PCD module outputs multi-scale contextual refined features to the segmentation head to obtain the segmented medical image.
[0009] S2 uses a trained medical image segmentation network for medical image segmentation.
[0010] Preferably, the TPFM module uses a global prototype memory as a semantic prior, as follows:
[0011] ;
[0012] ;
[0013] ;
[0014] in, This represents the final fusion representation, which is the output of the TPFM module. This represents a convolution-batch normalization-activation layer; Indicates the features after splicing; This represents the output of the detail-semantic feature aligner, which aligns and fuses shallow and deep features from the encoder. Semantic features representing shallow high-resolution feature extraction; This indicates the retrieval results from the global prototype memory; The output of the PCD module is represented as the feature after being processed by a convolution-normalization-activation layer; This represents element-wise multiplication; This represents the features of the deep encoder's output after processing through convolution-normalization-activation layers and upsampling; This represents the features of the output of the shallow encoder after processing by the convolution-normalization-activation layer; Indicates splicing; This indicates upsampling.
[0015] Preferably, the detail-semantic feature aligner is as follows:
[0016] ;
[0017] ;
[0018] ;
[0019] ;
[0020] ;
[0021] ;
[0022] ;
[0023] ;
[0024] ;
[0025] in, Represents the rich semantic features of the deeper stages; This indicates a context-guided gating module; Represents high-resolution features of the shallow stage; express convolution; This indicates the blending characteristics after splicing; This indicates splicing along the channel dimension; Represents the calibrated semantic features; FCB represents the flow control block; Indicates detailed features after calibration; Indicates the channel recalibration unit; express and The fusion characteristics;
[0026] Indicates modulation characteristics; Represents a compact, hollow context module; This represents the characteristics after flow control weighting; Indicates flow control weights; This indicates the output of the DSFA module.
[0027] Preferably, the global prototype memory is specifically implemented as follows:
[0028] Instantiate the global prototype memory as a learnable matrix;
[0029] The query descriptor is extracted using global average pooling and non-linear projection, and is represented as follows:
[0030] ;
[0031] in, Indicates the query descriptor; Represents a Gaussian error linear unit; Indicates a convolutional layer; Indicates average pooling; Represents the intermediate feature map;
[0032] The attention weight matrix is calculated and the retrieval results are obtained from the global prototype memory, as follows:
[0033] ;
[0034] ;
[0035] in, Represents the attention weight matrix; Represents the Softmax function; Represents a learnable matrix; Indicates transpose; Indicates the scaling factor;
[0036] The global prototype memory is updated with momentum during training, as follows:
[0037] ;
[0038] in, This indicates assignment; The feature vector after pooling; This represents element-wise multiplication; Indicates the momentum coefficient; This represents the gating score.
[0039] Preferably, the SFRM module is specifically implemented as follows:
[0040] ;
[0041] ;
[0042] ;
[0043] in, This represents the refined feature map; Indicates a projection operation; Indicates the first The output characteristics of each encoder; Represents a spatial attention map; This represents the Sigmoid activation function; Indicates upsampling; Indicates global average pooling; This indicates the output of the SFRM module; This indicates element-wise multiplication.
[0044] Preferably, the segmentation head uses the ESHead segmentation head, specifically implemented as follows:
[0045] The semantic and spatial fusion features are obtained and represented as follows:
[0046] ;
[0047] ;
[0048] ;
[0049] ;
[0050] ;
[0051] in, This indicates a representation that retains high-frequency spatial information; This represents a convolution-batch normalization-activation layer; Indicates upsampling; This indicates the output characteristics of the second PCD module; This indicates the output characteristics of the first PCD module; This indicates splicing along the channel dimension; This represents the final output feature of the spatial branch; This represents a gradient-gated attention module; The final output feature representing the semantic branch; Represents a compact, hollow context module; This indicates a lightweight axial gating module; This indicates the output characteristics of the fourth PCD module; This indicates the output characteristics of the third PCD module; Represents a spatial modulation diagram; This represents the Sigmoid activation function; This represents a 1x1 convolution; It represents the fusion of semantics and space;
[0052] right Linear projection is performed to obtain the final segmentation logits, and the segmented image is obtained based on the segmentation logits.
[0053] Preferably, the lightweight axial gating is specifically expressed as:
[0054] ;
[0055] ;
[0056] ;
[0057] ;
[0058] in, This represents the feature after being enhanced by high-dimensional gating weighting; Gating functions representing the height direction; This represents average pooling that is squeezed only along the height direction; This represents a 1x1 convolution; Features enhanced by width-dimensional gated weighting; Gating functions in the width direction; This represents average pooling that squeezes only along the width direction; Indicates the characteristics after fusion; This represents a 1x1 convolution; This indicates splicing along the channel dimension; This indicates the output of a lightweight axially gated system.
[0059] Preferably, the gradient-gated spatial attention is specifically expressed as:
[0060] ;
[0061] ;
[0062] ;
[0063] in, This represents a rough spatial attention map; This represents a 7x7 convolution; Indicates average pooling; Represents the input feature map; Indicates max pooling; This indicates splicing along the channel dimension; Represents the gradient magnitude plot; express convolution; and They represent the Sobel operators respectively. The x and y coordinates; Represents the constants used for numerical stability; This represents the output of gradient-gated spatial attention; This represents element-wise multiplication; This represents the Sigmoid function.
[0064] Preferably, the PCD module is represented as follows:
[0065] ;
[0066] ;
[0067] ;
[0068] in, Indicates the first The actual pooling scale of each context branch; This indicates taking the maximum value; Indicates relative scale proportion; This indicates taking the minimum value; Indicates the feature map height; Indicates the width of the feature map; Represents a set of predefined relative scale proportions; Indicates the first Contextual features after processing each branch , express Quantity; Indicates upsampling; Indicates the use of actual pooling scale Perform global average pooling; Indicates the input feature map; This indicates the output characteristics of the PCD module; Indicates learnable parameters; Representation layer normalization; Indicates fused convolution; Indicates splicing.
[0069] On the other hand, the medical image segmentation device based on three-stream prototype fusion includes the following:
[0070] The medical image segmentation network construction and training module is used to construct and train a medical image segmentation network based on three-stream prototype fusion to obtain a trained medical image segmentation network. The medical image segmentation network includes five encoders, four PCD modules, four SFRM modules, three TPFM modules, an SBSM module, and a segmentation head.
[0071] The medical image input is sequentially processed by a first encoder, a second encoder, a third encoder, a fourth encoder, and a fifth encoder to extract features layer by layer. The output of the fifth encoder is enhanced semantically by the SBSM module and then output to the fourth PCD module. The outputs of the second, third, fourth, and fifth encoders are adaptively adjusted by an SFRM module to obtain the first, second, third, and fourth refined features, respectively. The third TPFM module performs spatial-semantic alignment feature fusion on the fourth, third, and fourth refined features and the output of the fourth PCD module, and outputs it to the third PCD module. The second TPFM module performs spatial-semantic alignment feature fusion on the third, second, and third refined features and the output of the third PCD module, and outputs it to the second PCD module. The first TPFM module performs spatial-semantic alignment feature fusion on the second, first, and second PCD modules and outputs it to the first PCD module. Each PCD module outputs multi-scale contextual refined features to the segmentation head to obtain the segmented medical image.
[0072] The medical image segmentation module is used to segment medical images using a trained medical image segmentation network.
[0073] Compared with the prior art, the present invention has the following beneficial effects:
[0074] (1) This invention constructs a medical image segmentation network based on three-stream prototype fusion by introducing the TPFM module, and models the directional interaction between semantic stream, spatial stream and decoder feature stream, overcoming the limitations of the symmetric feature aggregation commonly used in the traditional U-Net style architecture;
[0075] (2) This invention introduces a stage feature refinement module (SFRM) and a detail-semantic feature aligner (DSFA) to gradually coordinate multi-stage representations and dynamically recalibrate spatial features under semantic guidance, thereby achieving a more accurate semantic-spatial correspondence.
[0076] (3) This invention introduces a Global Prototype Memory Bank to capture semantic priors at the dataset level and guides multi-scale feature alignment through attention-based prototype retrieval, thereby improving structural consistency across images;
[0077] (4) The present invention designs a pyramid context decoder (PCD) for flexible multi-scale context modeling without using fixed pooling operations, and designs an efficient segmentation head (ESHead) to ensure structural consistency between spatial details and semantic information, so as to produce accurate and computationally efficient prediction results. Attached Figure Description
[0078] The present invention will now be described in further detail with reference to the accompanying drawings;
[0079] Figure 1 This is a flowchart of a medical image segmentation method based on three-stream prototype fusion according to an embodiment of the present invention;
[0080] Figure 2 This is a diagram of the three-stream prototype fusion network structure of the medical image segmentation method based on three-stream prototype fusion according to an embodiment of the present invention. Figure 3 This is the stage feature refinement module (SFRM) of the medical image segmentation method based on three-stream prototype fusion in this embodiment of the invention.
[0081] Figure 4 The pyramid context decoder (PCD) is a medical image segmentation method based on three-stream prototype fusion, as described in this embodiment of the invention.
[0082] Figure 5 The three-stream prototype fusion module (TPFM) is a medical image segmentation method based on three-stream prototype fusion according to an embodiment of the present invention.
[0083] Figure 6 This is the global prototype memory (GPB) for the medical image segmentation method based on three-stream prototype fusion in this embodiment of the invention.
[0084] Figure 7 This is a channel recalibration unit (CRUnit) for a medical image segmentation method based on three-stream prototype fusion, as described in an embodiment of the present invention.
[0085] Figure 8 This is an efficient segmentation head (ESHead) for a medical image segmentation method based on three-stream prototype fusion, as described in this embodiment of the invention.
[0086] Figure 9 This is a compact hollow context module (CACM) for a medical image segmentation method based on three-stream prototype fusion, as described in this embodiment of the invention. Figure 10 This is a schematic diagram of a lightweight axial gating (LAG) module for a medical image segmentation method based on three-stream prototype fusion according to an embodiment of the present invention.
[0087] Figure 11 This is a schematic diagram of the gradient-gated spatial attention (GGAM) module of the medical image segmentation method based on three-stream prototype fusion according to an embodiment of the present invention;
[0088] Figure 12 This is a schematic diagram of lung CT image segmentation based on the three-stream prototype fusion medical image segmentation method according to an embodiment of the present invention;
[0089] Figure 13This is a schematic diagram of breast tumor segmentation on the BUSI dataset using the medical image segmentation method based on three-stream prototype fusion, as described in an embodiment of the present invention.
[0090] Figure 14 This is a schematic diagram of cross-dataset tumor image segmentation using a medical image segmentation method based on three-stream prototype fusion, according to an embodiment of the present invention.
[0091] Figure 15 This is a model general capability evaluation diagram of the medical image segmentation method based on three-stream prototype fusion according to an embodiment of the present invention;
[0092] Figure 16 This is a structural block diagram of a medical image segmentation device based on three-stream prototype fusion according to an embodiment of the present invention. Detailed Implementation
[0093] The present invention will be further described below through specific embodiments.
[0094] like Figure 1 As shown, the medical image segmentation method based on three-stream prototype fusion has the following specific steps:
[0095] S1. Construct and train a medical image segmentation network based on three-stream prototype fusion to obtain a trained medical image segmentation network.
[0096] S2 uses a trained medical image segmentation network for medical image segmentation.
[0097] Figure 2 The overall architecture of the proposed Tri-Stream Prototype Fusion Network (TSPFusion) is presented. This framework follows the encoder-decoder paradigm while explicitly addressing a key limitation in multi-scale feature fusion and traditional U-Net-style designs: insufficient modeling of semantic heterogeneity and structural misalignment between multi-scale feature streams. Given an input image... A set of hierarchical feature maps is extracted using a lightweight MobileViT-v2 encoder. The spatial resolution of these feature maps decreases progressively while the semantic abstraction level increases progressively. These features are first normalized to a uniform channel dimension through a stage feature refinement module, which aims to adaptively recalibrate the channel responses while maintaining spatial resolution, thereby reducing the representation gap between stages.
[0098] In terms of skip connections, TSP Fusion abandons the pairwise skip fusion approach and instead performs a three-stream interaction at each stage. Specifically, it fuses three complementary feature sources: (i) a high-resolution stream carrying fine structural details, (ii) a downsampled semantic stream from deeper encoder stages, and (iii) a context-enhanced stream passed from the decoder layer. To enrich the global semantics before fusion, the deepest features are processed by the PyramidContext Decoder (PCD) module, which captures resolution-aware multi-scale context through dynamic pooling and residual normalization. The core fusion operation is implemented by the proposed Tri-StreamPrototype Fusion Module (TPFM). In addition to spatial and channel interactions between streams, each module integrates a global prototype memory that stores compact semantic prototypes updated online during training. Unlike typical attention mechanisms, these prototypes provide persistent global guidance, enabling the network to reuse stable semantic patterns across different decoder stages. The fusion process proceeds progressively from coarse to fine resolution, with adaptive context aggregation applied after each fusion stage to enhance downstream representations. Overall, TSPFasion introduces a structured, memory-enhanced fusion strategy that collectively addresses the issues of multi-scale semantic misalignment and insufficient global context within a unified and computationally efficient framework. Finally, the generated TPFM features are processed by an Efficient Segmentation Head (ESHead) to obtain the final segmentation map.
[0099] The medical image segmentation network comprises five encoders, four PCD modules, four SFRM modules, three TPFM modules, an SBSM module, and a segmentation head. The medical image input is sequentially processed by the first, second, third, fourth, and fifth encoders, which extract features layer by layer. The output of the fifth encoder undergoes semantic enhancement via the SBSM module before being output to the fourth PCD module. The outputs of the second, third, fourth, and fifth encoders are adaptively adjusted by an SFRM module to obtain the first, second, third, and fourth refined features, respectively. The third TPFM module performs spatial-semantic alignment feature fusion on the fourth, third, and fourth refined features and the output of the fourth PCD module, and outputs this feature to the third PCD module. The second TPFM module performs spatial-semantic alignment feature fusion on the third, second, and third refined features and the output of the third PCD module, and outputs this feature to the second PCD module. The first TPFM module performs spatial-semantic alignment feature fusion on the second, first, and second PCD modules, and outputs this feature to the first PCD module. Each PCD module outputs multi-scale contextual refined features to the segmentation head, resulting in the segmented medical image.
[0100] The Stage Feature Refinement Module (SFRM) is as follows:
[0101] Encoder features at different stages exhibit significant differences in channel dimension, spatial information, and semantic granularity. Directly fusing such heterogeneous features often leads to optimization instability and poor feature alignment, limitations observed in many encoder-decoder segmentation models. To mitigate this issue, a staged feature refinement module (SFRM) is introduced, which performs lightweight adaptive adjustments to encoder features before multi-scale fusion. Specifically, four SFRMs (i.e., ...) are applied to the features extracted from the deepest layer of the encoder. Figure 2 (S2, S3, S4, and S5 in the original text). Given an encoder feature map... SFRM first uses pointwise convolution to project it onto a uniform channel dimension. As shown in formula (1):
[0102] ;
[0103] SFRM does not rely solely on channel-level recalibration, but employs a spatially aware gating mechanism (see...). Figure 3 The global context is extracted through adaptive average pooling, transformed by shallow convolutional paths, and then upsampled bilinearly to restore the original resolution, as shown in Equation (2):
[0104] ;
[0105] in, Represents a series of spatial convolutions, Indicates bilinear upsampling. The output is a sigmoid function. The refined output is obtained through residual modulation. This design allows SFRM to selectively amplify the information-rich spatial response while preserving the original feature distribution through an identity shortcut. Compared to traditional compression-excitation mechanisms, SFRM incorporates spatial structure into the refining process, making it more suitable for dense prediction tasks where fine-grained localization is crucial. Importantly, SFRM is applied independently at each encoder stage, achieving stage-specific adaptive adjustment without introducing inter-stage dependencies.
[0106] The Pyramid Context Decoder (PCD) is as follows:
[0107] Capturing multi-scale contextual information is crucial for semantic segmentation, especially in medical images where there are significant differences in object size and anatomical structure across different datasets and imaging modalities. Classical methods address this by aggregating features using a fixed receptive field, such as dilated convolutions in ASPP or fixed-grid pooling in pyramid pooling modules (PPM). However, these designs rely on manually specified scales tied to absolute spatial resolution, limiting their adaptability to different input sizes and feature map resolutions.
[0108] To overcome this limitation, this method introduces a pyramid context decoder (PCD) module, which performs resolution-aware context aggregation using a pooling scale defined relative to the input feature size. Given an input feature map... PCD calculates a set of adaptive pooling resolutions:
[0109] ;
[0110] in, This represents a set of predefined relative scale ratios. Unlike fixed pooling grids, this formulation ensures that each context branch captures information with a consistent relative spatial extent across feature maps at different resolutions.
[0111] like Figure 4 As shown, for each scale Adaptive average pooling is applied, followed by bilinear upsampling to restore the original spatial resolution.
[0112] ;
[0113] The pooled features are concatenated and then... Convolutional processing is used to fuse data and balance information across scales. To stabilize the optimization and preserve the original feature representation, PCD applies feature normalization followed by residual injection, where... It is a learnable parameter, initialized to zero, which allows the network to gradually incorporate contextual information during training. Representation layer normalization.
[0114] The Tri-Stream Prototype Fusion Module (TPFM) is as follows:
[0115] Multi-scale feature fusion is a core challenge in designing efficient architectures for dense prediction tasks such as medical image segmentation. While skip connections help preserve spatial details and facilitate optimization, traditional fusion techniques (such as feature concatenation or summation) implicitly assume compatibility between feature streams that differ significantly in semantic abstraction, spatial detail, and noise characteristics. In practice, this assumption often fails, leading to a misalignment between fine-grained structural cues and high-level semantic representations.
[0116] Previous works have attempted to mitigate this problem through attention-based fusion or feature recalibration mechanisms. However, these methods primarily model local or pairwise interactions within a single image and do not explicitly leverage persistent dataset-level semantic regularities. Therefore, they may struggle to enforce consistent semantic alignment across different samples and decoding stages. To overcome these limitations, a three-stream prototype fusion module (TPFM) is introduced, such as... Figure 5 As shown, this module redefines multi-scale feature fusion as the alignment of spatial details and semantic information guided by a global prototype memory. TPFM does not treat fusion as a purely feedforward aggregation, but explicitly models the interaction between three complementary feature streams (semantic stream, structural stream, and context stream), while confining the fusion process to a set of learnable and reusable semantic prototypes.
[0117] make These represent the rich spatial feature map, the lateral skip connection feature map, and the decoder path feature map from the early encoder stage, respectively. The goal of TPFM is to learn a transformation function. As shown in formula (5):
[0118] ;
[0119] This function generates a refined representation aligned with the highest available spatial resolution. The main process of the proposed TPFM is described below.
[0120] Stream normalization and projection: Before interaction, each input stream is independently projected onto a dimension using stream-specific convolutional blocks. In the shared feature space, generate , , As shown in formula (6):
[0121] ;
[0122] Each of them It consists of a convolutional layer followed by a normalization and nonlinear activation function. To achieve joint processing, bilinear interpolation is used... and Adjust size to match spatial resolution, obtained and Shallow flow It serves as the primary carrier of spatial details and anchors the subsequent feature alignment process.
[0123] The Global Prototype Bank (GBB) is as follows:
[0124] To supplement feature fusion with dataset-level semantic priors, a Global Prototype Memory (GPB) is introduced. This lightweight external memory module stores representative feature prototypes shared across training samples. Unlike conventional attention or Transformer-based context modeling that only operate within a single image, GPB provides a persistent mechanism for aggregating and reusing stable semantic patterns across images. Figure 6 As shown, GPB is instantiated as a learnable matrix. ,Depend on Each dimension is The prototype slots are composed of [various elements]. Unlike the transient feature map in the standard attention mechanism, It persists throughout the training iterations, evolving into a compact dictionary that captures global semantic priors.
[0125] Prototype retrieval (reading). To enrich local features with global context, I adopted a content-based mechanism. Given an intermediate feature map... First, query descriptors are extracted using global average pooling (GAP) and non-linear projection. (Formula 7). This module retrieves relevant prototypes by calculating the similarity between the query and the memory slot:
[0126] ;
[0127] in, It is a Gaussian error linear unit (GELU). This indicates a convolutional layer.
[0128] ;
[0129] here, Indicates attention weights. This represents the retrieved prototype context. This global context is then broadcast via residual modulation and fused into local features, effectively injecting abstract knowledge to guide local predictions.
[0130] Momentum updates (writes) are performed. To ensure the prototype learns a stable and robust representation, an explicit momentum-based update strategy is employed. This prevents the memory module from overfitting to specific characteristics of the most recent mini-batch (catastrophic forgetting) or oscillating due to high variance. Specifically, a gating score is calculated via a projection of a sigmoid activation. This score measures the reliability of the current batch features used for memory updates:
[0131] ;
[0132] in, It is the feature vector after pooling. This indicates element-wise multiplication with broadcast. The momentum coefficient is used. This gated exponential moving average (EMA) mechanism ensures that only high-confidence features contribute to the prototype evolution, thus forming a noise-resistant global knowledge base.
[0133] The Detail-Semantic Feature Aligner (DSFA) is as follows:
[0134] High-resolution features preserve fine structural information but often lack semantic information, while deep features encode category-level context at the expense of spatial precision. Direct concatenation, employed in U-Net-based architectures, can lead to semantic leakage and inaccurate localization across target boundaries due to feature misalignment. To mitigate this issue, a detail is introduced – the Semantic Feature Aligner (DSFA), a two-stream module that explicitly generates semantic representations conditioned on boundary-aware structural cues before fusion.
[0135] make This indicates high-resolution or detail-preserving features from earlier encoder stages. This indicates semantically rich features from a deeper stage. (See figure) Figure 5As shown, DSFA processes two inputs through functionally different paths: a detailed stream that preserves the spatial structure and a semantic stream that enhances the context. ;
[0137] (10); among which, It is Convolutional FCB (Flow Control Block) is a flow control block. To adaptively control the influence of semantic information on spatial details, FCB employs an input-conditional gating mechanism. Global descriptors are extracted from the semantic path, and then aligned feature representations are obtained through asymmetric fusion. Semantic contributions dynamically adjust the degree to which high-level context reshapes the spatial representation. The Channel Recalibration Unit (CRUnit) is used as... Figure 7 As shown.
[0138] Subsequently, the aligned features are further refined through lightweight context aggregation and channel recalibration, and then injected back into the spatial path via residual connections, as shown in Equation (11):
[0139] ;
[0140] This formalization ensures that spatial fidelity is maintained while semantic information is selectively injected. As a result, the features generated by DSFA are both detail-aware and semantically aligned, enabling more stable and efficient fusion in subsequent decoding stages.
[0141] TPFM performs two complementary interactions using the aligned feature stream and the retrieved global context:
[0142] Dedicated details – semantic aligner Refine semantic features using high-resolution structural cues:
[0143] ;
[0144] Decoder modulation: achieved through element-wise multiplication. Lightweight interaction with the decoder stream ensures that semantic activation respects target boundaries and fine spatial structure, thereby emphasizing the spatial patterns consistently supported by both paths:
[0145] (13);
[0146] The final fusion representation is obtained by aggregating all information sources, followed by residual integration:
[0147] ;
[0148] in, This represents the result of global memory retrieval after broadcasting. Regularization is performed using a random depth operator. The final representation integrates local details, global semantics, and persistent priors in a unified and computationally efficient manner.
[0149] The Efficient Segmentation Head (ESHead) is as follows:
[0150] The design of the segmentation head is a crucial component of any efficient dense prediction model. Most existing architectures, such as [example architecture], primarily rely on direct upsampling of decoder features. While efficient, these designs treat multi-scale fusion as a roughly uniform aggregation process. In this method, an efficient segmentation head is introduced (see [example architecture]). Figure 8 ESHead is designed following two principles: (1) High-resolution features should primarily supervise structural details; (2) Deep features should model global contextual semantics. This design enables the decoder to enforce structural consistency while maintaining global contextual understanding. Given multi-scale feature representations from the Pyramid Context Decoder (PCD) A high-efficiency segmentation head (ESHead) was designed, as follows:
[0151] Spatial branching: Fine-grained structural cues are primarily encoded in high-resolution features. Therefore, using and Construct a focused path:
[0152] ;
[0153] in, Indicates upsampling, This indicates channel-level splicing. The resulting representation... High-frequency spatial information is preserved and further refined through a gradient-gated spatial attention module to emphasize edge-related responses.
[0154] Semantic branching. To capture target-level semantics, deeper features are utilized. and They encode richer contextual information, but have lower spatial resolution:
[0155] ;
[0156] in, This indicates a lightweight axial interaction module inspired by axial attention. This represents a compact hole context module used for multi-scale aggregation. Figure 9 The following is about... and Detailed explanation:
[0157] Lightweight Axial Gating (LAG). While self-attention mechanisms and variants of axial attention provide efficient global modeling capabilities, their repeated application across different stages of the decoder incurs high computational overhead. To address this, a lightweight axial gating (LAG) module is introduced, which propagates contextual information along the spatial axes. Let... This represents the input semantic feature map from the deep decoder stage.
[0158] like Figure 10 As shown, LAG decomposes the two-dimensional spatial context modeling into sequential one-dimensional operations along the height and width dimensions. First, the vertical and horizontal contexts are aggregated using depth-separable one-dimensional convolutions applied along the height and width axes, as shown in Equation (17):
[0159] ;
[0160] in, and express convolution. It is added to the input to preserve the original semantic representation and ensure that the optimization is stable, as follows:
[0161] ;
[0162] Gradient-Gated Spatial Attention Module (GGAM). Standard spatial attention mechanisms, such as those used in CBAM, typically rely on statistics of channel aggregation to generate a spatial importance map. While these intensity-based methods are effective in highlighting semantically salient regions, they often neglect high-frequency structural cues. To address this, the Gradient-Gated Spatial Attention (GGAM) module is introduced, such as... Figure 11 As shown, this module explicitly injects structural priors into the attention mechanism through fixed differential operators.
[0163] Given feature map GGAM computes attention along the channel dimension. These results are then concatenated and passed through a large kernel convolution. The process is performed to generate a rough spatial attention map, as shown in formula (19):
[0164] ;
[0165] To explicitly focus on structural boundaries, a gradient-aware branch is introduced. This branch uses a fixed Sobel operator initialized to detect horizontal and vertical edges. Calculate the spatial gradient of the average pooling feature. Gradient magnitude plot. The calculation is as follows:
[0166] ;
[0167] in, It is a small constant used for numerical stability. It is Convolution is used to project the gradient magnitude into the attention space. Then, the two branches are combined so that the gradient cues can modulate spatial attention and suppress background noise, as shown in Equation (21):
[0168] ;
[0169] in, This refers to the Sigmoid function.
[0170] The integration of LAG and GGAM modules enhances long-distance dependency modeling capabilities while maintaining the computational efficiency of ESHear. Subsequently, an interactive mechanism is applied to generate a spatial modulation map, which adaptively recalibrates semantic activation, as shown in Equation (22):
[0171] ;
[0172] in, This represents element-wise multiplication. For the Sigmoid function, It is convolution.
[0173] Finally, the refined semantic features are fused with the spatially enhanced representation:
[0174] ;
[0175] in, This represents the spatial features refined by attention. The final segmentation logits are obtained by analyzing... Obtained by linear projection.
[0176] Semantic Bottleneck Smoothing Module (SBSM).
[0177] In multi-scale feature decoding, the deeper stages with lower spatial resolution encode rich contextual semantic information. However, these deepest features often retain high-frequency noise inherited from the encoder backbone, which can interfere with the decoder's ability to recover fine spatial details. To address this issue, a lightweight semantic bottleneck is introduced before context aggregation. Specifically, a 3×3 average pooling with a stride of 1 is used as a low-pass filter, performing a pure smoothing operation without any spatial downsampling, followed by a 1×1 channel projection and ReLU activation. This produces a clean semantic prior that suppresses encoder artifacts while maintaining the full resolution of the deepest layers, providing a stable foundation for the subsequent multi-scale context aggregation decoder.
[0178] The method was verified through experiments.
[0179] A comprehensive experimental evaluation of the proposed TSP Fusion framework was conducted. The effectiveness, robustness, and generalization ability of the framework were assessed across multiple medical image segmentation tasks involving heterogeneous imaging modalities and acquisition settings. In addition to standard single-dataset evaluations, cross-dataset testing was emphasized to verify the model's robustness, which is crucial for real-world clinical deployment.
[0180] Experiments were conducted on four publicly available medical image segmentation datasets, covering two imaging modalities: ultrasound and computed tomography (CT). This evaluation comprehensively assesses modality-specific performance as well as cross-data generalization ability.
[0181] COVID-19 Lung Infection Dataset. This dataset, designed for COVID-19 infection segmentation in chest CT images, follows a dataset construction strategy introduced in the literature. It was collected from two publicly available sources, with axial slices uniformly sampled. The final dataset contains 1,277 CT slices with pixel-level infection annotations. The collected data exhibits significant variability in infection size, opacity patterns, and imaging conditions, making this task particularly challenging and well-suited for evaluating robustness.
[0182] Lung CT Dataset. This dataset uses a publicly available, curated selection of CT slices hosted on Kaggle. It integrates diverse scan images from multiple sources, including the LUNA16 challenge and other public repositories. The dataset contains 2,534 axial slices with an original in-plane resolution of [resolution missing]. Pixels. To standardize the input and facilitate efficient real-time inference, all images are resampled and resized using bilinear interpolation. Pixels. A strict patient-level partitioning is employed, dividing the data into 70% for training and 30% for testing. This approach prevents patient-level information leakage and ensures a robust and fair evaluation of the model's generalization ability.
[0183] The Breast Ultrasound Segmentation Dataset (BUSI) was used. Breast ultrasound imaging has become a widely adopted tumor screening modality due to its safety and accessibility. The proposed method was evaluated on the BUSI dataset, which contains 780 images acquired from 600 patients. This dataset covers three diagnostic categories: 133 normal cases, 437 benign lesions, and 210 malignant tumors. Common experimental protocols in breast ultrasound segmentation were followed.
[0184] The STU dataset was also used to evaluate the generalization ability across datasets. This dataset contains 42 breast ultrasound images acquired under different imaging conditions. No training or fine-tuning was performed on this dataset. Due to its limited size and distribution shift relative to BUSI, STU serves as a challenging benchmark for evaluating robustness in scenarios with low data volume and domain mismatch.
[0185] All experiments were conducted using the PyTorch framework on an NVIDIA RTX 2080 Ti GPU. To ensure rigorous comparability, all experiments were performed in a uniform environment. Input images for all datasets were resized to... The spatial resolution is determined and normalized using standard protocols. Network optimization employs... Optimizer, initial learning rate The weight decays to These hyperparameters were kept constant across all proposed models and baseline models to isolate architectural contributions from optimization discrepancies. All training processes used a batch size of 8. All models were trained for 100 epochs on all datasets.
[0186] To enhance the model's generalization ability and robustness to changes, a comprehensive data augmentation process was applied. Geometric transformations included random horizontal and vertical flipping. Rotation within the range and from The isotropic scaling factor is obtained through uniform sampling. Furthermore, it is adjusted by random brightness and gamma (ranging from...). Introduce perturbations of varying intensity levels, while randomly applying Gaussian noise ( Gaussian blur is used to simulate the acquisition of artifacts.
[0187] To comprehensively evaluate the segmentation performance and generalization ability of the proposed TSPxuion, extensive experiments were conducted on four challenging publicly available medical imaging datasets: the COVID-19 Lung CT Scan Dataset, the COVID-19 Infection Segmentation Dataset (COVID19-Seg), the Breast Ultrasound Image (BUSI) Dataset, and the STU Dataset. These datasets cover different imaging modalities (CT and ultrasound) and diverse segmentation targets. Quantitative evaluations were reported using standard metrics, including Dice similarity coefficient (DSC), intersection-over-union ratio (IoU), precision, recall, and mean absolute error (MAE), while computational efficiency was assessed in conjunction with the number of model parameters.
[0188] Comparison on a COVID-19 lung CT dataset.
[0189] The proposed TSPgusion was evaluated on a COVID-19 lung CT segmentation benchmark, a dataset containing pixel-level annotations of infected lung regions from CT scans. This dataset presents significant challenges due to the heterogeneous appearance of infection patterns, diffuse lesion boundaries, and variable lesion scales. Table 1 reports a quantitative comparison of the proposed TSPgusion with a range of representative segmentation models, including CNN-based architectures, attention-enhanced variants, and recent Transformer-based methods. As shown in Table 1, the proposed TSPgusion consistently achieves state-of-the-art performance across all evaluation metrics. In particular, TSPgusion achieves a Dice similarity coefficient (DSC) of 97.76%, surpassing the previous best-performing model M²SNet (97.33%) and robust Transformer-based baseline models such as TransUNet and UNETR. The proposed method also achieves the highest precision (98.38%) and recall (97.77%), demonstrating its ability to accurately capture infected regions while maintaining robust boundary localization. Furthermore, TSP Fusion achieved the lowest mean absolute error (0.011), indicating that it has more accurate pixel-level prediction capabilities and less segmentation noise.
[0190] Table 1: Quantitative comparison of different segmentation methods on the COVID-19 lung CT segmentation benchmark dataset.
[0191]
[0192] A key observation from these results is that TSPgusion achieves superior segmentation accuracy while maintaining a relatively compact architecture. Compared to Transformer-based models (such as UNETR, with 94.92M parameters; TransUNet, with 48.17M parameters), the proposed model requires only 5.92M parameters while achieving higher performance across all metrics. This highlights the effectiveness of the proposed three-stream fusion strategy in capturing global contextual cues and fine-grained spatial structure without relying on large model capacity. Overall, these results demonstrate that TSPgusion offers a good balance between representational power and computational efficiency, enabling accurate and robust segmentation of COVID-19 infection regions in lung CT images. (See the diagram for a lung CT image segmentation illustration.) Figure 12 As shown.
[0193] Comparison on the COVID19-Seg scan dataset.
[0194] To evaluate the effectiveness of the proposed method in depicting infected areas, experiments were conducted on the COVID19-Seg lung CT infection segmentation benchmark. This dataset contains chest CT scans with pixel-level annotations of infected areas, presenting a challenging test due to the irregular shape, varying scale, and diffuse appearance of COVID-19 lesions. Table 2 reports a quantitative comparison of the proposed TSPxuion with a range of representative segmentation methods, including traditional encoder-decoder architectures, attention-enhanced models, Transformer-based methods, and recent lightweight designs. Evaluation metrics include Dice similarity coefficient (DSC), precision, recall, structural metric (Sα), and mean absolute error (MAE). Furthermore, the number of model parameters is reported to assess computational efficiency.
[0195] Table 2: Quantitative comparison of different segmentation methods on the COVID19-Seg scan benchmark.
[0196]
[0197] The results show that TSPFusion achieves the best overall performance across most evaluation metrics. Specifically, the proposed method achieves a DSC score of 81.76%, significantly outperforming the previous best-performing method, M²SNet (79.53%). TSPFusion also achieves the highest precision (82.60%) and recall (85.94%), demonstrating its ability to effectively capture infected regions while maintaining accurate boundary localization. Furthermore, the method achieves the lowest MAE value (0.005), indicating more accurate pixel-level predictions and fewer segmentation errors.
[0198] Another noteworthy observation is the balance between segmentation accuracy and model efficiency. While Transformer-based models such as TransUNet and UNETR rely on large model sizes (48.17M and 94.92M parameters, respectively), TSPFusion achieves superior segmentation performance with only 5.92M parameters. Compared to other lightweight methods (such as Rolling-UNet, 1.78M; LiteSegMamba, 3.66M), the proposed method maintains significantly higher segmentation accuracy while keeping the model size compact. These results demonstrate that TSPFusion effectively captures global contextual information and fine-grained infection boundaries, enabling robust COVID-19 lesion segmentation in chest CT images. Consistent improvements across multiple evaluation metrics highlight the advantages of the proposed architecture in balancing representational power and computational efficiency.
[0199] Comparison on the BUSI dataset.
[0200] To evaluate the effectiveness of the proposed method in breast tumor segmentation, experiments were conducted on the BUSI (Breast Ultrasound Images) dataset. Breast ultrasound images typically exhibit low contrast, speckle noise, and irregular tumor boundaries, making accurate lesion segmentation particularly challenging. Table 3 reports a quantitative comparison of the proposed TSPxuion with several representative segmentation methods, including classic encoder-decoder networks, attention-based models, Transformer-based architectures, and recent lightweight segmentation frameworks. Evaluation metrics included mean Dice coefficient (mDice), mean intersection-over-union ratio (mIoU), precision, recall, accuracy, and mean absolute error (MAE), while computational efficiency was assessed in conjunction with the number of model parameters.
[0201] Table 3: Quantitative evaluation on the BUSI dataset.
[0202]
[0203] The best and second-best performance are highlighted in red and blue, respectively.
[0204] As shown in Table 3, the proposed TSPgusion achieves state-of-the-art overall performance on the BUSI dataset. Specifically, TSPgusion achieves an mDice score of 82.66% and an mIoU of 74.05%, which are 2.25% and 1.53% higher than the previous best-performing method, M²SNet, respectively. Furthermore, TSPgusion achieves the highest recall (92.64%), demonstrating strong lesion region detection capabilities while minimizing missed tumor regions. The model also achieves a competitive precision (92.73%) and maintains a low MAE of 0.016, showcasing accurate boundary delineation and reduced pixel-level prediction error.
[0205] Another noteworthy observation is the good balance between segmentation accuracy and model complexity. While Transformer-based models such as TransUNet and UNETR contain a large number of parameters (48.17M and 94.92M, respectively), the proposed TSPFasion achieves superior segmentation performance with only 5.92M parameters. Compared to lightweight methods (such as Rolling-UNet, 1.78M; BATFormer, 2.07M), TSPFasion provides significantly higher segmentation accuracy while maintaining a relatively compact model size. Figure 7 The results of the qualitative comparison are presented. For example... Figure 13 As shown, due to the complex texture patterns and noise present in ultrasound images, several baseline methods struggle to accurately depict tumor boundaries or produce incomplete segmentation. In contrast, the proposed TSP Fusion generates a more complete and accurate segmentation mask, particularly in challenging cases with irregular tumor shapes or low contrast.
[0206] Perform cross-dataset generalization.
[0207] To further evaluate the robustness and generalization ability of the proposed method, cross-dataset experiments were conducted, where the model was trained on the BUSI dataset and then evaluated directly on the STU dataset without any additional fine-tuning. This setting introduces differences in ultrasound acquisition protocol, image quality, and tumor appearance, making it a challenging benchmark for evaluating the model's generalization ability. As shown in Table 4, the proposed TSPgusion achieved the best overall performance on most evaluation metrics. In particular, TSPgusion achieved an 88.16% mDice score and a 79.89% mIoU, which are 0.18% and 1.13% higher than the second-best method, Rolling-UNet, respectively. Furthermore, the proposed model achieved the highest precision (86.78%), recall (91.80%), and accuracy (97.59%), demonstrating its strong ability to accurately detect lesion regions while maintaining reliable boundary localization under cross-dataset conditions. TSPFusion also achieved the lowest MAE value of 0.025, indicating that it has more accurate pixel-level prediction.
[0208] Table 4: Quantitative evaluation of generalization across datasets (trained on the BUSI dataset, tested on the STU dataset). Best and second-best performance are highlighted in red and blue, respectively.
[0209]
[0210] Figure 14 Qualitative comparison results are presented. Due to data distribution shifts between the BUSI and STU datasets, several baseline methods produced incomplete segmentation or inaccurate tumor boundaries. In contrast, the proposed TSPxuion generated more consistent and accurate lesion masks, particularly in challenging cases with low-contrast or irregular tumor shapes; the model's general capability assessment is shown in the figure below. Figure 15 As shown in the figure. These results demonstrate that the proposed architecture can effectively capture domain-invariant representations, thereby achieving stronger robustness and generalization ability on different ultrasound datasets.
[0211] To conduct ablation studies.
[0212] To evaluate the contribution of each component in the proposed architecture, an ablation study was conducted on a lung CT segmentation dataset using MobileViTV2 as the baseline backbone network. As shown in Table 5, the baseline model achieved a DSC of 92.52%, serving as a reference point for subsequent improvements. The introduction of the Stage Feature Refinement Module (SFRM) brought a significant performance improvement, increasing the DSC from 92.52% to 93.40%, while also improving recall and structural similarity (Sα). This demonstrates that SFRM can effectively refine intermediate feature representations and improve semantic consistency.
[0213] When the three-stream prototype fusion module (TPFM) is introduced, the DSC is further improved to 95.15%, demonstrating the effectiveness of prototype-guided feature interactions in capturing global contextual cues and enhancing segmentation robustness. Adding the pyramid context decoder (PCD) brings another substantial performance improvement, raising the DSC to 96.75%. This indicates that multi-scale context aggregation plays a crucial role in accurately depicting lung structures and infected areas. Finally, integrating the efficient segmentation head (ESHead) forms the complete TSPxusion model, achieving the best performance with a DSC of 97.76%, and consistent improvements in precision, recall, and Sα. Overall, the progressive improvements observed in Table 5 demonstrate that each component contributes complementary strengths, and their combination forms a robust and efficient segmentation framework.
[0214] Table 5: Performance of the proposed modules used to build TSP Fusion on the Lung CT dataset.
[0215]
[0216] Perform computational efficiency analysis.
[0217] To further evaluate the efficiency of the proposed method, TSPxuion was compared with several competitive models in terms of segmentation accuracy, including UNETR, M²SNet, and STCNet. The comparison focused on computational complexity and runtime performance, including parameter count, FLOPs, inference speed (FPS), memory consumption, and inference time. All experiments were performed on an NVIDIA RTX 2080 Ti GPU.
[0218] As shown in Table 6, TSP Fusion achieves the optimal balance between computational efficiency and runtime performance. Specifically, the proposed model requires only 5.92M parameters and 3.37G FLOPs, significantly lower than UNETR (94.92M parameters and 69.7G FLOPs), STCNet (52.81M parameters and 29.7G FLOPs), and M²SNet (27.7M parameters and 9.26G FLOPs). Furthermore, TSP Fusion exhibits the lowest memory consumption (53.18 MB) and fast inference speed (71.65 FPS) while maintaining a competitive inference time (15.96 ms).
[0219] Table 6: A comprehensive comparison of UNETR, M²SNet, STCNet, and the proposed TSPFusion. The FLOPs (floating-point operations) and parameter counts of each method are listed. The best and worst results are shown in red and blue, respectively.
[0220]
[0221] In summary, this paper proposes a novel framework for medical image segmentation: the Three-Stream Prototype Fusion Network (TSPFusion). This framework addresses the limitations of traditional encoder-decoder architectures through structured multi-stream feature interactions and prototype-guided representation learning. The proposed architecture integrates semantic, spatial, and decoder streams into a unified fusion mechanism, achieving more efficient alignment between high-level contextual representations and fine-grained spatial details. By introducing global prototype guidance and adaptive feature refinement, the model captures stable anatomical priors while maintaining accurate boundary localization. Extensive experiments on multiple medical image segmentation benchmarks demonstrate that the proposed method consistently outperforms various state-of-the-art CNN-based, Transformer-based, and hybrid methods. Besides improving segmentation accuracy, TSPFusion achieves a good balance between performance and computational efficiency, making it suitable for practical clinical applications. Furthermore, cross-dataset evaluation highlights the robustness of the proposed method under domain shifts. This method demonstrates that explicit modeling of structured interactions between complementary feature streams, combined with prototype-driven context guidance, provides an effective paradigm for improving dense medical image prediction.
[0222] like Figure 16 As shown, the present invention also discloses a medical image segmentation device based on three-stream prototype fusion, comprising:
[0223] The medical image segmentation network construction and training module 1601 is used to construct and train a medical image segmentation network based on three-stream prototype fusion to obtain a trained medical image segmentation network; the medical image segmentation network includes five encoders, four PCD modules, four SFRM modules, three TPFM modules, an SBSM module, and a segmentation head;
[0224] The medical image input is sequentially processed by a first encoder, a second encoder, a third encoder, a fourth encoder, and a fifth encoder to extract features layer by layer. The output of the fifth encoder is enhanced semantically by the SBSM module and then output to the fourth PCD module. The outputs of the second, third, fourth, and fifth encoders are adaptively adjusted by an SFRM module to obtain the first, second, third, and fourth refined features, respectively. The third TPFM module performs spatial-semantic alignment feature fusion on the fourth, third, and fourth refined features and the output of the fourth PCD module, and outputs it to the third PCD module. The second TPFM module performs spatial-semantic alignment feature fusion on the third, second, and third refined features and the output of the third PCD module, and outputs it to the second PCD module. The first TPFM module performs spatial-semantic alignment feature fusion on the second, first, and second PCD modules and outputs it to the first PCD module. Each PCD module outputs multi-scale contextual refined features to the segmentation head to obtain the segmented medical image.
[0225] The medical image segmentation module 1602 is used to segment medical images using a trained medical image segmentation network.
[0226] The specific implementation of the medical image segmentation device based on three-stream prototype fusion is the same as that of the medical image segmentation method based on three-stream prototype fusion, and will not be described again in this embodiment.
[0227] The above are merely specific embodiments of the present invention, but the design concept of the present invention is not limited thereto. Any non-substantial modifications made to the present invention using this concept shall be considered as infringing upon the protection scope of the present invention.
Claims
1. A medical image segmentation method based on three-stream prototype fusion, characterized in that, Includes the following steps: S1. Construct and train a medical image segmentation network based on three-stream prototype fusion to obtain a trained medical image segmentation network; the medical image segmentation network includes five encoders, four PCD modules, four SFRM modules, three TPFM modules, an SBSM module, and a segmentation head; The medical image input is sequentially connected to the first encoder, second encoder, third encoder, fourth encoder and fifth encoder to extract features layer by layer. The output of the fifth encoder is then processed by the SBSM module to perform auxiliary semantic enhancement before being output to the fourth PCD module. The outputs of the second, third, fourth, and fifth encoders are adaptively adjusted by an SFRM module to obtain the first, second, third, and fourth refined features; The third TPFM module performs spatial-semantic aligned feature fusion on the outputs of the fourth refined feature, the third refined feature, and the fourth PCD module, and outputs it to the third PCD module. The second TPFM module performs spatial-semantic aligned feature fusion on the third refined feature, the second refined feature, and the output of the third PCD module, and outputs it to the second PCD module; The first TPFM module fuses the second refined features, the first refined features, and the output space-semantic aligned features of the second PCD module, and outputs them to the first PCD module; each PCD module outputs multi-scale contextual refined features to the segmentation head to obtain the segmented medical image; S2 uses a trained medical image segmentation network for medical image segmentation.
2. The medical image segmentation method based on three-stream prototype fusion according to claim 1, characterized in that, The TPFM module uses a global prototype memory as a semantic prior, as detailed below: ; ; ; in, This represents the final fusion representation, which is the output of the TPFM module. This represents a convolution-batch normalization-activation layer; Indicates the features after splicing; This represents the output of the detail-semantic feature aligner, which aligns and fuses shallow and deep features from the encoder. Semantic features representing shallow high-resolution feature extraction; This indicates the retrieval results from the global prototype memory; The output of the PCD module is represented as the feature after being processed by a convolution-normalization-activation layer; This represents element-wise multiplication; This represents the features of the deep encoder's output after processing through convolution-normalization-activation layers and upsampling; This represents the features of the output of the shallow encoder after processing by the convolution-normalization-activation layer; Indicates splicing; This indicates upsampling.
3. The medical image segmentation method based on three-stream prototype fusion according to claim 2, characterized in that, The details – the semantic feature aligner – are as follows: ; ; ; ; ; ; ; ; ; in, Represents the rich semantic features of the deeper stages; This indicates a context-guided gating module; Represents high-resolution features of the shallow stage; express convolution; This indicates the blending characteristics after splicing; This indicates splicing along the channel dimension; Represents the calibrated semantic features; FCB represents the flow control block; Indicates detailed features after calibration; Indicates the channel recalibration unit; express and The fusion characteristics; Indicates modulation characteristics; Represents a compact, hollow context module; This represents the characteristics after flow control weighting; Indicates flow control weights; This indicates the output of the DSFA module.
4. The medical image segmentation method based on three-stream prototype fusion according to claim 2, characterized in that, The global prototype memory is specifically implemented as follows: Instantiate the global prototype memory as a learnable matrix; The query descriptor is extracted using global average pooling and non-linear projection, and is represented as follows: ; in, Indicates the query descriptor; Represents a Gaussian error linear unit; Indicates a convolutional layer; Indicates average pooling; Represents the intermediate feature map; The attention weight matrix is calculated and the retrieval results are obtained from the global prototype memory, as follows: ; ; in, Represents the attention weight matrix; Represents the Softmax function; Represents a learnable matrix; Indicates transpose; Indicates the scaling factor; The global prototype memory is updated with momentum during training, as follows: ; in, This indicates assignment; The feature vector after pooling; This represents element-wise multiplication; Indicates the momentum coefficient; This represents the gating score.
5. The medical image segmentation method based on three-stream prototype fusion according to claim 1, characterized in that, The SFRM module is specifically implemented as follows: ; ; ; in, This represents the refined feature map; Indicates a projection operation; Indicates the first The output characteristics of each encoder; Represents a spatial attention map; This represents the Sigmoid activation function; Indicates upsampling; Indicates global average pooling; This indicates the output of the SFRM module; This indicates element-wise multiplication.
6. The medical image segmentation method based on three-stream prototype fusion according to claim 1, characterized in that, The segmentation head uses the ESHead segmentation head, specifically implemented as follows: The semantic and spatial fusion features are obtained and represented as follows: ; ; ; ; ; in, This indicates a representation that retains high-frequency spatial information; This represents a convolution-batch normalization-activation layer; Indicates upsampling; This indicates the output characteristics of the second PCD module; This indicates the output characteristics of the first PCD module; This indicates splicing along the channel dimension; This represents the final output feature of the spatial branch; This represents a gradient-gated attention module; The final output feature representing the semantic branch; Represents a compact, hollow context module; This indicates a lightweight axial gating module; This indicates the output characteristics of the fourth PCD module; This indicates the output characteristics of the third PCD module; Represents a spatial modulation diagram; This represents the Sigmoid activation function; This represents a 1x1 convolution; It represents the fusion of semantics and space; right Linear projection is performed to obtain the final segmentation logits, and the segmented image is obtained based on the segmentation logits.
7. The medical image segmentation method based on three-stream prototype fusion according to claim 6, characterized in that, The lightweight axial gating is specifically referred to as: ; ; ; ; in, This represents the feature after being enhanced by high-dimensional gating weighting; Gating function representing the height direction; This represents average pooling that is squeezed only along the height direction; This represents a 1x1 convolution; Features enhanced by width-dimensional gated weighting; Gating functions in the width direction; This represents average pooling that squeezes only along the width direction; Indicates the characteristics after fusion; This represents a 1x1 convolution; This indicates splicing along the channel dimension; This indicates the output of a lightweight axially gated system.
8. The medical image segmentation method based on three-stream prototype fusion according to claim 6, characterized in that, The gradient-gated spatial attention is specifically represented as follows: ; ; ; in, This represents a rough spatial attention map; This represents a 7x7 convolution; Indicates average pooling; Represents the input feature map; This indicates max pooling; This indicates splicing along the channel dimension; Represents the gradient magnitude plot; express convolution; and They represent the Sobel operators respectively. The x and y coordinates; Represents the constants used for numerical stability; This represents the output of gradient-gated spatial attention; This represents element-wise multiplication; This represents the Sigmoid function.
9. The medical image segmentation method based on three-stream prototype fusion according to claim 1, characterized in that, The PCD module is represented as follows: ; ; ; in, Indicates the first The actual pooling scale of each context branch; This indicates taking the maximum value; Indicates relative scale proportion; This indicates taking the minimum value; Indicates the feature map height; Indicates the width of the feature map; Represents a set of predefined relative scale proportions; Indicates the first Contextual features after processing each branch , express Quantity; Indicates upsampling; Indicates the use of actual pooling scale Perform global average pooling; Indicates the input feature map; This indicates the output characteristics of the PCD module; Indicates learnable parameters; Representation layer normalization; Indicates fused convolution; Indicates splicing.
10. A medical image segmentation device based on three-stream prototype fusion, characterized in that, Including the following: The medical image segmentation network construction and training module is used to construct and train a medical image segmentation network based on three-stream prototype fusion to obtain a trained medical image segmentation network. The medical image segmentation network includes five encoders, four PCD modules, four SFRM modules, three TPFM modules, an SBSM module, and a segmentation head. The medical image input is sequentially connected to the first encoder, second encoder, third encoder, fourth encoder and fifth encoder to extract features layer by layer. The output of the fifth encoder is then processed by the SBSM module to perform auxiliary semantic enhancement before being output to the fourth PCD module. The outputs of the second, third, fourth, and fifth encoders are adaptively adjusted by an SFRM module to obtain the first, second, third, and fourth refined features; The third TPFM module performs spatial-semantic aligned feature fusion on the outputs of the fourth refined feature, the third refined feature, and the fourth PCD module, and outputs it to the third PCD module. The second TPFM module performs spatial-semantic aligned feature fusion on the third refined feature, the second refined feature, and the output of the third PCD module, and outputs it to the second PCD module; The first TPFM module fuses the second refined features, the first refined features, and the output space-semantic aligned features of the second PCD module, and outputs them to the first PCD module; each PCD module outputs multi-scale contextual refined features to the segmentation head to obtain the segmented medical image; The medical image segmentation module is used to segment medical images using a trained medical image segmentation network.
