Pulmonary embolism segmentation method based on structure context enhancement and edge guidance
By constructing a pulmonary embolism segmentation method based on structural context enhancement and edge guidance, and utilizing the PVTv2 feature extraction framework and the focus Tversky loss function, the accuracy and stability issues of pulmonary embolism segmentation in CTPA images are solved, achieving fine segmentation of pulmonary embolism.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XUZHOU MEDICAL UNIVERSITY
- Filing Date
- 2026-01-20
- Publication Date
- 2026-05-01
Smart Images

Figure CN121962604A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical image processing technology, and more particularly to a pulmonary embolism segmentation method based on structural context enhancement and edge guidance. Background Technology
[0002] Pulmonary embolism (PE) is a life-threatening acute chest disease, and accurate segmentation of PE in CT PA (CT Pulmonary Angiography) images is a crucial step in clinical diagnosis and risk assessment. CT Pulmonary Angiography (CTPA), as the gold standard for clinical diagnosis of PE, can clearly show the morphology of the pulmonary arteries and the location of the embolus. However, accurate segmentation of PE lesions in CTPA images still faces many challenges.
[0003] First, due to the complex structure of the pulmonary artery, the high similarity between the vessel lumen and the embolus in appearance, and the fact that small emboli often exhibit blurred boundaries and low contrast, achieving accurate and stable PE segmentation is quite challenging.
[0004] Currently, pulmonary embolism in CTPA images typically presents as a low-density filling defect within the pulmonary artery lumen. Its grayscale distribution is similar to that of the surrounding contrast-filled vascular lumen, and in distal branches, it often exhibits imaging characteristics such as small size, irregular shape, and discontinuous boundaries. Existing segmentation methods are prone to missed or false detections when handling these complex situations, failing to meet the stringent clinical requirements for segmentation accuracy and stability.
[0005] No effective solutions have yet been proposed to address the problems in the relevant technologies. Summary of the Invention
[0006] In view of this, the present invention provides a pulmonary embolism segmentation method based on structural context enhancement and edge guidance to solve the aforementioned problems.
[0007] To solve the above problems, the specific technical solution adopted by the present invention is as follows:
[0008] A pulmonary embolism segmentation method based on structural context enhancement and edge guidance includes the following steps:
[0009] S1. Obtain medical image samples containing target region annotations, and preprocess the medical image samples based on an image reconstruction preprocessing mechanism with structural consistency constraints to obtain a sample dataset.
[0010] S2. Using PVTv2 as the feature extraction framework, a pulmonary embolism segmentation network model is constructed, which includes a structured context enhancement module, a structure-guided modulation module, an edge-guided feature fusion module, and a decoder. The pulmonary embolism segmentation network model is trained based on the sample dataset and the focal Tversky loss function weighted by pixel and pixel neighborhood differences, and the trained pulmonary embolism segmentation network model is obtained.
[0011] S3. Based on the trained pulmonary embolism segmentation network model, the medical images to be segmented in real time are processed for pulmonary embolism segmentation to obtain pulmonary embolism segmentation maps with clear boundaries and complete structure.
[0012] Preferably, the step of obtaining medical image samples containing target region annotations and preprocessing the medical image samples based on an image reconstruction preprocessing mechanism with structural consistency constraints to obtain a sample dataset includes the following steps:
[0013] S11. Obtain medical image samples containing target region annotations, and sequentially perform image size unification, intensity normalization, and data format conversion to obtain standardized images;
[0014] S12. Divide the standardized image into several local regions of fixed size and overlapping each other, and use each local region as a structural unit.
[0015] S13. Calculate the average strength value, principal gradient direction, and edge response intensity of each structural element;
[0016] S14. For each structural unit, select several neighboring structural units in its spatial neighborhood, and calculate the weighted results of the principal gradient direction difference, edge response similarity and spatial distance between each structural unit and its several neighboring structural units to determine the association weight between each structural unit and its neighboring structural units.
[0017] S15. Based on the association weight between each structural unit and its neighboring structural units, all structural units are updated simultaneously. During each update, the strength value of the current structural unit is fused with the weighted average strength of its neighboring structural units to obtain the update result of each structural unit.
[0018] S16. Map the update results of each structural unit back to the original position in the standardized image to form a reconstructed image with continuous structure and clear boundaries, thereby obtaining the sample dataset.
[0019] Preferably, the step of constructing a pulmonary embolism segmentation network model using PVTv2 as the feature extraction framework, comprising a structured context enhancement module, a structure-guided modulation module, an edge-guided feature fusion module, and a decoder, and training the pulmonary embolism segmentation network model based on a sample dataset and a focus Tversky loss function weighted by pixel and pixel neighborhood differences, to obtain the trained pulmonary embolism segmentation network model includes the following steps:
[0020] S21. Using PVTv2 as the feature extraction framework, and combining it with the structured context enhancement module, structure-guided modulation module, edge-guided feature fusion module and decoder, a pulmonary embolism segmentation network model is constructed.
[0021] S22. Input the sample dataset into the pulmonary embolism segmentation network model. The pulmonary embolism segmentation network model sequentially performs feature extraction, structural information enhancement, feature modulation, and decoding reconstruction processes, and outputs the corresponding segmentation results.
[0022] S23. Compare the segmentation results with the preset manual annotations, and construct a focal Tversky loss function based on pixel and pixel neighborhood difference weighting according to the difference comparison results.
[0023] S24. Based on the focal Tversky loss function weighted by the differences between pixels and their neighborhoods, the parameters of the pulmonary embolism segmentation network model are iteratively updated through backpropagation to obtain the trained pulmonary embolism segmentation network model.
[0024] Preferably, the step of inputting the sample dataset into the pulmonary embolism segmentation network model, in which the pulmonary embolism segmentation network model sequentially performs feature extraction, structural information enhancement, feature modulation, and decoding reconstruction processes, and outputs the corresponding segmentation result includes the following steps:
[0025] S221. Using the feature extraction backbone network in the pulmonary embolism segmentation network model, multi-scale feature encoding is performed on the reconstructed images in the sample dataset. By obtaining the overall vascular structure information and local detail features in the reconstructed images, the multi-scale feature map is obtained through encoding.
[0026] S222. Input the multi-scale feature map into the structured context enhancement module. By performing structure-sensitive feature enhancement processing on the multi-scale features and combining global average aggregation and global maximum aggregation processing, enhanced features containing regional context relationships are generated.
[0027] S223. The enhanced features are input into the structure-guided modulation module, and a dual-branch structure-guided attention mechanism is constructed to generate joint structure attention features;
[0028] S224. Input the joint structural attention features into the edge-guided feature fusion module, and perform structural modulation and alignment processing on the structural awareness features through the edge-guided modulation mechanism. Combine the coarse segmentation localization map output by the decoder and generate the segmentation result through fusion processing.
[0029] Preferably, the step of inputting multi-scale features into the structured context enhancement module, performing structure-sensitive feature enhancement processing on the multi-scale features, and combining global average aggregation and global maximum aggregation processing to generate enhanced features containing regional contextual relationships includes the following steps:
[0030] S2221. After inputting the multi-scale features into the structured context enhancement module, the multi-scale feature map is subjected to structure-sensitive feature enhancement processing based on one of the branches of the structured context enhancement module, and convolutional features are generated by combining global average aggregation and global maximum aggregation processing.
[0031] S2222, The dynamic sampling mechanism based on offset prediction utilizes another branch of the structured context enhancement module to perform convolution operations on multi-scale feature maps to predict the corresponding offset, and adjusts the regular sampling position of the standard convolution according to the offset to obtain spatial features for improving the representation quality.
[0032] S2223. The convolutional features and spatial features are fused to obtain enhanced features that include the contextual relationships of the region.
[0033] Preferably, after inputting the multi-scale features into the structured context enhancement module, the multi-scale feature map is subjected to structure-sensitive feature enhancement processing based on one of the branches of the structured context enhancement module, and combined with global average aggregation and global maximum aggregation processing to generate convolutional features, including the following steps:
[0034] S22211. Using one of the branches of the structured context enhancement module, the multi-scale feature map is divided into several regions;
[0035] S22212. For each region, by statistically analyzing the voxel intensity distribution within each region, calculate the local intensity offset and the contrast relationship between the voxel intensity distribution within each region and the reference region of the adjacent vascular lumen, and identify and mark abnormal regions with low contrast filling.
[0036] S22213. Perform spatial continuity analysis of grayscale changes in abnormal areas, and combine the morphological response distribution of local areas to classify morphological anomalies in areas where the contour direction is irregularly deflected or where the local morphological contraction is abnormal, and obtain the classification results.
[0037] S22214. Based on the classification results, use a preset feature enhancement strategy to perform feature enhancement processing on different regions;
[0038] S22215. For each region that has undergone feature enhancement, perform global average aggregation and global maximum aggregation operations respectively, and fuse the results of global average aggregation and global maximum aggregation to obtain a region description vector that characterizes the overall lesion features and local significant abnormalities of the region.
[0039] S22216. All region description vectors are concatenated according to the predefined anatomical or spatial index order to form a region description matrix. Combined with the preset shared weight mapping unit, linear transformation combined with nonlinear activation and normalization operations are used to adaptively generate weight coefficients for each region.
[0040] S22217. The weight coefficients are combined with the softmax normalized and predefined basic kernels to obtain the convolutional features.
[0041] Preferably, the step of inputting the enhanced features into the structure-guided modulation module and generating joint structure attention features by constructing a dual-branch structure-guided attention mechanism includes the following steps:
[0042] S2231. After inputting the enhanced features into the structure-guided modulation module, channel-wise convolution in the channel direction is used to perform single-channel convolution processing on the enhanced features in the spatial range to obtain a preliminary spatial smooth response.
[0043] S2232. Linearly combine the preliminary spatial smoothing responses of each channel through pointwise convolution to integrate cross-channel correlations and generate the final smooth feature map.
[0044] S2233. Use depthwise separable convolution to smooth the final smooth feature map to obtain smooth features;
[0045] S2234. Use learnable deep edge convolution to model the spatial gradient of smooth features to obtain local edge enhancement features;
[0046] S2235. Based on local edge enhancement features, a structure-guided attention mechanism including channel attention branches and spatial attention branches is constructed, and channel modulation factors and spatial attention maps are generated.
[0047] S2236. The modulation factor and spatial attention map are fused to obtain a joint structural attention feature used to guide subsequent feature modulation.
[0048] Preferably, the step of constructing a structure-guided attention mechanism based on local edge enhancement features, including channel attention branches and spatial attention branches, and generating channel modulation factors and spatial attention maps includes the following steps:
[0049] S22351. Construct channel attention branch and spatial attention branch respectively using local edge enhancement features;
[0050] S22352, the channel attention branch adopts a squeeze-excitation mechanism, which generates channel descriptors through global average pooling and combines a preset two-layer fully connected mapping with a non-linear activation function to generate channel modulation factors;
[0051] S22353. The spatial attention branch extracts global position information through channel compression and generates a spatial attention map using a preset lightweight convolution.
[0052] Preferably, the step of inputting the joint structural attention features into the edge-guided feature fusion module, and performing structural modulation and alignment processing on the structural awareness features through the edge-guided modulation mechanism, and generating the segmentation result by combining the coarse segmentation localization map output by the decoder through fusion processing includes the following steps:
[0053] S2241. Based on the edge-guided feature map generated in advance through structural branches, and combined with the edge-guided modulation mechanism, structural alignment processing is performed on the joint structural attention features;
[0054] S2242. Based on the edge guidance weights and combined with the batch normalization layer, the joint structural attention features after structural alignment are fused to obtain fused features.
[0055] S2243. Using the coarse segmentation localization map pre-generated by the decoder, the feature scale is adjusted to the current feature scale by bilinear interpolation, and affine modulation is performed on the fused features to output the final segmentation result.
[0056] Preferably, the focal Tversky loss function weighted by pixel and its neighborhood difference includes a weighted focal Tversky loss function and a weighted cross-union ratio loss function.
[0057] The beneficial effects of this invention are as follows:
[0058] This invention constructs a structured context enhancement module, which extracts rich and structure-related semantic features from a more flexible receptive field through the synergistic effect of dynamic region modeling and deformable convolution. A structure-guided modulation module is introduced between shallow and deep features to enhance boundary information and suppress background interference. Fine-grained boundary enhancement is achieved by leveraging structural response and joint attention mechanisms. Through the edge-guided feature fusion module, edge priors can be introduced in the multi-scale feature interaction process to obtain a more continuous and structurally consistent tether region representation. It can effectively address the challenges of large scale variations, blurred boundaries, and easily confused structures, and obtain fine and stable segmentation results. Attached Figure Description
[0059] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly described below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings:
[0060] Figure 1 This is a flowchart of a pulmonary embolism segmentation method based on structural context enhancement and edge guidance according to an embodiment of the present invention;
[0061] Figure 2 This is a schematic diagram of the network structure of the pulmonary embolism segmentation network in the pulmonary embolism segmentation method based on structural context enhancement and edge guidance according to an embodiment of the present invention;
[0062] Figure 3 This is a pulmonary embolism lesion segmentation result image of five samples in the XMU-PE dataset in the pulmonary embolism segmentation method based on structural context enhancement and edge guidance according to an embodiment of the present invention;
[0063] Figure 4 This is a pulmonary embolism lesion segmentation result image of five samples in the FUMPE dataset in the pulmonary embolism segmentation method based on structural context enhancement and edge guidance according to an embodiment of the present invention;
[0064] Figure 5 This is a schematic diagram of a pulmonary embolism segmentation system based on structural context enhancement and edge guidance according to an embodiment of the present invention.
[0065] In the picture:
[0066] 1. Dataset acquisition unit; 2. Model building and training unit; 3. Image segmentation unit. Detailed Implementation
[0067] To enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this application.
[0068] According to embodiments of the present invention, a pulmonary embolism segmentation method based on structural context enhancement and edge guidance is provided.
[0069] like Figure 2As shown in the figure (Patch Emb represents block embedding, and Encoder represents encoder), this is a segmentation processing framework that combines structural and boundary information. The framework uses PVTv2 as the feature extraction backbone network to perform multi-scale feature encoding on the input CTPA image to obtain overall vascular structural information and local detail features. The encoded multi-scale features are then input into the structured context enhancement module. By modeling the feature response within a local region and combining deformation convolution to adaptively perceive the morphology of vascular tortuosity, bifurcation, and intraluminal filling defects, enhanced features containing regional context relationships are generated to characterize embolism regions of different scales and morphologies. Based on this, the structure-guided modulation module receives the shallow high-resolution features from the backbone network and uses the response information in the deep features that reflects the overall vascular structure and spatial distribution of embolism to modulate the shallow features. This ensures that the shallow features maintain the details of the vascular wall and local grayscale changes while remaining consistent with the vascular structural orientation and embolism location reflected by the deep features. Subsequently, the modulated features are fused using an edge-guided feature fusion module. This module introduces an edge-response-based weighted modulation mechanism, assigning higher weights to the vessel wall boundary and the junction between the embolism and the vessel lumen. This highlights the embolism edge region and suppresses uniformly bright areas within the vessel lumen during feature fusion. Finally, the fused multi-scale features are fed into the decoder. The decoder employs a layer-by-layer upsampling reconstruction strategy: first, deep low-resolution features are upsampled to align spatially with high-resolution features in adjacent layers; then, the upsampled features are aligned and stitched or weighted with the fused features at the corresponding scale, further refining the local structure through convolutional units; this process is repeated to ensure that spatial information remains consistent with prior structural information while being restored layer by layer, thereby gradually restoring the fine spatial boundaries of the embolism region and ultimately outputting a segmentation map with clear boundaries and a complete structure.
[0070] The present invention will now be further described in conjunction with the accompanying drawings and specific embodiments, such as... Figure 1 As shown, according to a first embodiment of the present invention, a pulmonary embolism segmentation method based on structural context enhancement and edge guidance is provided, comprising the following steps:
[0071] S1. Obtain medical image samples containing target region annotations, and preprocess the medical image samples based on an image reconstruction preprocessing mechanism with structural consistency constraints to obtain a sample dataset.
[0072] In a preferred embodiment, the steps of obtaining medical image samples containing target region annotations and preprocessing the medical image samples based on an image reconstruction preprocessing mechanism with structural consistency constraints to obtain a sample dataset include the following steps:
[0073] S11. Obtain medical image samples containing target region annotations, and sequentially perform image size unification, intensity normalization, and data format conversion to obtain standardized images;
[0074] S12. Divide the standardized image into several local regions of fixed size and overlapping each other, and use each local region as a structural unit.
[0075] S13. Calculate the average strength value, principal gradient direction, and edge response intensity of each structural element;
[0076] S14. For each structural unit, select several neighboring structural units in its spatial neighborhood, and calculate the weighted results of the principal gradient direction difference, edge response similarity and spatial distance between each structural unit and its several neighboring structural units to determine the association weight between each structural unit and its neighboring structural units.
[0077] Specifically, when calculating the weighted results of principal gradient direction difference, edge response similarity, and spatial distance to determine the association weight between each structural unit and its adjacent structural units, for each structural unit, its principal gradient direction vector is extracted, and the angle difference between it and the principal gradient direction of each adjacent structural unit is calculated. Cosine similarity or angle difference is used as a measure of gradient direction difference. A predefined edge response function is used to extract edge intensity values, and the edge response similarity between structural units and their adjacent units is calculated. Then, based on the spatial distance between structural units, a Gaussian weighting function is used to weight the gradient direction difference and edge response similarity. Finally, the weighted gradient direction difference, edge response similarity, and spatial distance are combined to calculate the association weight between each pair of structural units.
[0078] S15. Based on the association weight between each structural unit and its neighboring structural units, all structural units are updated simultaneously. During each update, the strength value of the current structural unit is fused with the weighted average strength of its neighboring structural units to obtain the update result of each structural unit.
[0079] S16. Map the update results of each structural unit back to the original position in the standardized image to form a reconstructed image with continuous structure and clear boundaries, thereby obtaining the sample dataset.
[0080] S2. Using PVTv2 as the feature extraction framework, a pulmonary embolism segmentation network model is constructed, which includes a structured context enhancement module, a structure-guided modulation module, an edge-guided feature fusion module, and a decoder. The pulmonary embolism segmentation network model is trained based on the sample dataset and the focal Tversky loss function weighted by pixel and pixel neighborhood differences, and the trained pulmonary embolism segmentation network model is obtained.
[0081] In a preferred embodiment, the step of constructing a pulmonary embolism segmentation network model using PVTv2 as the feature extraction framework, comprising a structured context enhancement module, a structure-guided modulation module, an edge-guided feature fusion module, and a decoder, and training the pulmonary embolism segmentation network model based on a sample dataset and a focus Tversky loss function weighted by pixel and pixel neighborhood differences, to obtain the trained pulmonary embolism segmentation network model includes the following steps:
[0082] S21. Using PVTv2 as the feature extraction framework, and combining it with the structured context enhancement module, structure-guided modulation module, edge-guided feature fusion module and decoder, a pulmonary embolism segmentation network model is constructed.
[0083] S22. Input the sample dataset into the pulmonary embolism segmentation network model. The pulmonary embolism segmentation network model sequentially performs feature extraction, structural information enhancement, feature modulation, and decoding reconstruction processes, and outputs the corresponding segmentation results.
[0084] In a preferred embodiment, the step of inputting the sample dataset into the pulmonary embolism segmentation network model, wherein the pulmonary embolism segmentation network model sequentially performs feature extraction, structural information enhancement, feature modulation, and decoding reconstruction processes, and outputs the corresponding segmentation result includes the following steps:
[0085] S221. Using the feature extraction backbone network in the pulmonary embolism segmentation network model, multi-scale feature encoding is performed on the reconstructed images in the sample dataset. By obtaining the overall vascular structure information and local detail features in the reconstructed images, the multi-scale feature map is obtained through encoding.
[0086] S222. Input the multi-scale feature map into the structured context enhancement module. By performing structure-sensitive feature enhancement processing on the multi-scale features and combining global average aggregation and global maximum aggregation processing, enhanced features containing regional context relationships are generated.
[0087] It should be noted that, in order to overcome the expression bottleneck of traditional multi-scale feature fusion, this invention proposes a Structured Context Enhancement (SCE) module with dynamic adaptive capabilities. This SCE module achieves accurate capture of diverse morphologies and edge details of pulmonary embolism lesions by fusing a morphological rheology adjustment branch, a branch response confidence mapping branch, and an interactive semantic-structural coupling branch. The morphological rheology adjustment branch combines parameterized morphological transformation operators with deep convolutional units to achieve continuous rheological correction for local boundary breaks and morphological irregularities, ensuring the structural coherence of the lesion. The branch response confidence mapping branch dynamically constructs a confidence distribution map based on multi-scale confidence assessment and performs spatial and channel weighted recalibration of different branch features, thereby improving the sensitivity to small and low-contrast lesions. The interactive semantic-structural coupling branch achieves bidirectional deep fusion of semantic information and structural priors through the design of interactively coupled convolutional units, strengthens cross-scale semantic structure synchronous optimization, and enhances the robust expression of pulmonary embolisms with blurred edges and diverse morphologies. The three mechanisms promote each other under the collaborative adaptive fusion strategy, significantly breaking through the limitations of single-path expression and achieving high-precision restoration of lesion boundaries and details under complex medical image conditions.
[0088] Specifically, a context modeling mechanism based on region partitioning and dynamic kernel generation is proposed in one branch of the structural context enhancement module. Given the input feature map F K Subsequently, this branch first divides the model into N regions (N=8 in this method) to integrate contextual information from different regions and enhance semantic representation capabilities across multi-scale receptive fields. Before spatially aggregating the features of each anatomical region, structurally sensitive feature enhancement processing is first performed within each region to improve the model's ability to perceive typical imaging manifestations of pulmonary embolism lesions.
[0089] Specifically, this enhancement process focuses on constructing a hierarchical recognition and response mechanism based on the various abnormal imaging patterns of pulmonary embolism in CTPA images. Statistical analysis of voxel intensity distribution within the region is performed. By calculating local intensity shifts and the contrast between the voxel intensity distribution within each region and the reference region of adjacent vascular cavities, suspected low-contrast filling abnormalities are initially marked. Further analysis of the spatial continuity of grayscale changes within these marked regions is conducted. By detecting intensity abrupt breakpoints along the vessel diameter within the lumen, the types of regions where intraluminal structural interruptions may exist are identified. Simultaneously, combined with the morphological response distribution of local regions, regions with irregular contour deviations or abnormal local morphological contraction are classified as morphological abnormalities.
[0090] Furthermore, after completing the above classification and discrimination, corresponding feature enhancement strategies are triggered for different categories of regions, enabling different types of abnormal imaging patterns to obtain differentiated responses in subsequent feature expressions. This ensures that pulmonary embolism-related regions are stably distinguished from normal vascular cavities in the feature space, providing a reliable basis for subsequent region aggregation and weight modeling. On the other hand, frequency domain or local context modulation operations are introduced within the region to enhance the response to texture changes and local structural abnormalities of small, scattered, or low-contrast embolic foci, thereby reducing the interference of noise, differences in imaging conditions, and changes in vascular course on feature expression. After completing the feature enhancement within the region, global average aggregation and global maximum aggregation operations are performed on each region. Global average aggregation is used to characterize the overall distribution characteristics of embolism-related image signals within the region, while global maximum aggregation is used to capture the most significant local abnormal responses to reflect potentially high-risk or well-defined embolic regions. Subsequently, the results of the two types of aggregation are fused to form a region description vector that can simultaneously characterize the overall lesion features and significant local abnormalities of the region. All region description vectors are concatenated according to a predefined anatomical or spatial index order to form a region description matrix, which is then input into a shared weight mapping unit for unified processing. This mapping unit adaptively generates weight coefficients α for each region through a combination of linear transformation, nonlinear activation, and normalization operations. n And after softmax normalization and predefined basic kernel W n The weighted combination is then performed, followed by calculation to obtain the convolutional feature F of that branch. region This process can be represented as:
[0091] ;
[0092] In the formula, Indicates multiplication operation, This represents the convolution operation.
[0093] In parallel with this, another branch proposes a dynamic sampling mechanism based on offset prediction. This branch first performs a convolution operation on the input feature map to predict the corresponding offset. Specifically, it uses the input features to generate an offset vector Δp for the input convolutional layer, with the same number of sampling points as the standard convolution. n This convolutional layer automatically captures local structural changes, deformation trends, and boundary uncertainties in the lesion region through learned parameters. The offset prediction process includes the following steps: performing convolution on the input features to extract local contextual information and obtaining an intermediate response map; obtaining the predicted offset values of each sampling point in the horizontal and vertical directions through linear mapping of the output channels of this convolutional layer; combining the offset values of all sampling points into a complete offset matrix. Based on the predicted offsets, the regular sampling positions p of the standard convolution are then... n Adjust to p n +Δpn This enables the convolution kernel to adapt to the non-rigid deformation and fuzzy boundaries of pulmonary embolism lesions, ultimately outputting spatial features F to improve the quality of representation. spatial This process can be represented as:
[0094] ;
[0095] Subsequently, the SCE module obtains the two branch features F region With F spatial Then they are fused. First, they are concatenated along the channel dimension, and feature interaction is performed through convolution. At the same time, to maintain feature consistency and stability, F... K The process of performing residual mapping and finally adding it to the obtained features to obtain the output can be represented as follows:
[0096] ;
[0097] Among them, S k , k∈{1,2,3,4} represents the features output by the SCE module, i.e., enhanced features containing regional context relationships, ReLU(·) represents the activation function, BN(·) represents the batch normalization operation, Concat(·, ·) represents the channel concatenation operation, Conv 3×3 For a standard 3x3 convolution, Conv 3×3 It is a 1*1 convolution.
[0098] The proposed SCE module significantly improves the model's ability to model complex lesion morphologies, especially when dealing with regions with blurred edges, and maintains good adaptability to small target boundaries in the pulmonary embolism segmentation task.
[0099] In a preferred embodiment, the step of inputting multi-scale features into the structured context enhancement module, performing structure-sensitive feature enhancement processing on the multi-scale features, and combining global average aggregation and global maximum aggregation processing to generate enhanced features containing regional contextual relationships includes the following steps:
[0100] S2221. After inputting the multi-scale features into the structured context enhancement module, the multi-scale feature map is subjected to structure-sensitive feature enhancement processing based on one of the branches of the structured context enhancement module, and convolutional features are generated by combining global average aggregation and global maximum aggregation processing.
[0101] In a preferred embodiment, after inputting the multi-scale features into the structured context enhancement module, the multi-scale feature map is subjected to structure-sensitive feature enhancement processing based on one of the branches of the structured context enhancement module, and combined with global average aggregation and global maximum aggregation processing to generate convolutional features, including the following steps:
[0102] S22211. Using one of the branches of the structured context enhancement module, the multi-scale feature map is divided into several regions;
[0103] S22212. For each region, by statistically analyzing the voxel intensity distribution within each region, calculate the local intensity offset and the contrast relationship between the voxel intensity distribution within each region and the reference region of the adjacent vascular lumen, and identify and mark abnormal regions with low contrast filling.
[0104] S22213. Perform spatial continuity analysis of grayscale changes in abnormal areas, and combine the morphological response distribution of local areas to classify morphological anomalies in areas where the contour direction is irregularly deflected or where the local morphological contraction is abnormal, and obtain the classification results.
[0105] S22214. Based on the classification results, use a preset feature enhancement strategy to perform feature enhancement processing on different regions;
[0106] S22215. For each region that has undergone feature enhancement, perform global average aggregation and global maximum aggregation operations respectively, and fuse the results of global average aggregation and global maximum aggregation to obtain a region description vector that characterizes the overall lesion features and local significant abnormalities of the region.
[0107] S22216. All region description vectors are concatenated according to the predefined anatomical or spatial index order to form a region description matrix. Combined with the preset shared weight mapping unit, linear transformation combined with nonlinear activation and normalization operations are used to adaptively generate weight coefficients for each region.
[0108] S22217. The weight coefficients are combined with the softmax normalized and predefined basic kernels to obtain the convolutional features.
[0109] S2222, The dynamic sampling mechanism based on offset prediction utilizes another branch of the structured context enhancement module to perform convolution operations on multi-scale feature maps to predict the corresponding offset, and adjusts the regular sampling position of the standard convolution according to the offset to obtain spatial features for improving the representation quality.
[0110] S2223. The convolutional features and spatial features are fused to obtain enhanced features that include the contextual relationships of the region.
[0111] S223. The enhanced features are input into the structure-guided modulation module, and a dual-branch structure-guided attention mechanism is constructed to generate joint structure attention features;
[0112] It should be noted that medical images commonly suffer from blurred boundaries and insufficient detail representation, especially in structurally complex regions such as small-scale pulmonary embolisms, complex vascular junctions, or pulmonary artery branches. Therefore, to alleviate this problem, a Structure-Guided Modulation (SGM) module is proposed. This module first explicitly decodes structural boundary information from the input features, and then uses this information to perform global and local co-modulation of the original features through an attention mechanism, thereby reconstructing a feature representation with clear structure and enhanced detail.
[0113] Specifically, the SGM module outputs the SCE module from the previous module. k As input, Gaussian smoothing is achieved through depthwise separable convolution. First, channel-wise convolution along the channel direction is used to perform spatial-range single-channel convolution processing on the input features. Each channel independently applies a convolution kernel with an approximately Gaussian distribution to obtain an initial spatial smoothing response. Then, pointwise convolution is used to linearly combine the smoothing responses of each channel to integrate cross-channel correlations and generate the final smooth feature map. Finally, this depthwise separable structure can significantly reduce computation while maintaining Gaussian smoothing effects and effectively avoid excessive removal of structural details. It suppresses high-frequency noise while preserving the main structural outline, resulting in smooth features. Next, SGM uses a set of learnable deep edge convolution pairs to model spatial gradients, thereby obtaining the local edge enhancement feature F. enhance This process can be represented as:
[0114] ;
[0115] Among them, Conv k This represents the k-th edge convolution kernel.
[0116] Subsequently, based on F enhance A structure-guided attention mechanism is constructed, comprising two branches: channel and spatial. The channel attention branch employs a Squeeze-and-Excitation (SE) mechanism, generating channel descriptors through global average pooling, followed by two fully connected layers and a nonlinear activation function to generate the channel modulation factor A. c This enhances the response to structure-sensitive channels. The spatial attention branch extracts global location information through channel compression and generates a spatial attention map A using lightweight 3×3 convolutions. s This process can be represented as:
[0117] ;
[0118] ;
[0119] Where W1 and W2 represent the weight matrices of the two fully connected layers. The expression represents the Sigmoid activation function, GAP(·) represents global average pooling, and AvgPool(·) and MaxPool(·) represent average pooling and max pooling, respectively.
[0120] The fusion of these two elements forms a joint attention structure used to guide subsequent feature modulation. This process can be represented as:
[0121] ;
[0122] In the formula, G k k∈{1,2,3,4} represents the enhanced output features of the SGM module, and α represents the learnable modulation coefficient. This represents element-wise multiplication. This structure implements a modulation mechanism centered on structural priors, enabling the network to strengthen local boundaries and improve detail integrity while maintaining global semantic consistency, providing more discriminative and structurally sensitive feature representations for subsequent EGFF modules.
[0123] In a preferred embodiment, the step of inputting the enhanced features into the structure-guided modulation module and generating joint structure attention features by constructing a dual-branch structure-guided attention mechanism includes the following steps:
[0124] S2231. After inputting the enhanced features into the structure-guided modulation module, channel-wise convolution in the channel direction is used to perform single-channel convolution processing on the enhanced features in the spatial range to obtain a preliminary spatial smooth response.
[0125] S2232. Linearly combine the preliminary spatial smoothing responses of each channel through pointwise convolution to integrate cross-channel correlations and generate the final smooth feature map.
[0126] S2233. Use depthwise separable convolution to smooth the final smooth feature map to obtain smooth features;
[0127] S2234. Use learnable deep edge convolution to model the spatial gradient of smooth features to obtain local edge enhancement features;
[0128] S2235. Based on local edge enhancement features, a structure-guided attention mechanism including channel attention branches and spatial attention branches is constructed, and channel modulation factors and spatial attention maps are generated.
[0129] As a preferred embodiment, the step of constructing a structure-guided attention mechanism based on local edge enhancement features, including channel attention branches and spatial attention branches, and generating channel modulation factors and spatial attention maps, includes the following steps:
[0130] S22351. Construct channel attention branch and spatial attention branch respectively using local edge enhancement features;
[0131] S22352, the channel attention branch adopts a squeeze-excitation mechanism, which generates channel descriptors through global average pooling and combines a preset two-layer fully connected mapping with a non-linear activation function to generate channel modulation factors;
[0132] S22353. The spatial attention branch extracts global position information through channel compression and generates a spatial attention map using a preset lightweight convolution.
[0133] S2236. The modulation factor and spatial attention map are fused to obtain a joint structural attention feature used to guide subsequent feature modulation.
[0134] S224. Input the joint structural attention features into the edge-guided feature fusion module, and perform structural modulation and alignment processing on the structural awareness features through the edge-guided modulation mechanism. Combine the coarse segmentation localization map output by the decoder and generate the segmentation result through fusion processing.
[0135] It is important to note that feature fusion plays a crucial role in image segmentation tasks, especially when there are semantic and scale differences between deep and shallow features. Traditional methods typically fuse encoder and decoder features through channel concatenation or element-wise addition, but they neglect their semantic and structural differences, limiting the fusion effect. Therefore, this paper designs an Edge-Guided Feature Fusion (EGFF) module, which, while fully considering feature complementarity, introduces edge information to guide the fusion, thereby enhancing the structural expressiveness and boundary awareness of the fused features.
[0136] Specifically, when performing feature fusion, the k-th level (k∈{1,2,3}) EGFF module does not directly output features (denoted as E) to the next level EGFF module. k+1 ) and the current level SGM module (denoted as G) k Instead of simply concatenating the extracted structure-aware features, this paper first introduces a feature modulation and alignment process based on edge information to enhance the complementarity of features from different sources at the semantic and structural levels. First, the edge-guided feature map generated by the structural branches is used to weight and label the features from the next level. Specifically, the edge-guided feature map generates an edge response weight matrix through a set of convolution operations and nonlinear activation functions. This weight matrix represents the intensity of structural abrupt changes at different locations in the spatial dimension. By performing element-wise multiplication of this weight matrix with the next-level feature map, the feature responses near lesion boundaries, vascular wall interruption regions, and areas of abrupt morphological changes are adaptively amplified, thereby enhancing the model's sensitivity to edge structures and slender morphological features.
[0137] Meanwhile, to reduce the inconsistency in spatial resolution and feature distribution between the current-level structural perception features and the higher-level semantic features, structural alignment processing is performed on the current-level structural perception features. This structural alignment processing includes: based on the offset field generated by edge-guided information, introducing an edge-guided deformable convolutional module to resample the current-level features, adaptively shifting their sampling positions towards the structural boundaries and lesion contour regions, thereby achieving spatial alignment with the higher-level semantic features.
[0138] Furthermore, at the channel dimension, a channel reshaping module is set up to perform channel correlation modeling on the structure-aware features. The channel weights are dynamically adjusted according to the contribution of different channels to edge and structural information to suppress redundant background features and highlight discriminative features related to pulmonary embolism structures. Through the synergistic effect of the above weighted calibration and spatial alignment, accurate alignment and effective fusion of multi-scale features at the structural level are achieved.
[0139] After the modulation and alignment are completed, a selective splicing method is used to fuse the two types of features. This involves adaptively combining features from different channels or spatial locations based on edge-guided weights, rather than equal-weight splicing, thus forming a fused feature representation that synergistically enhances structural awareness and semantic information. The spliced result is then input into a multi-scale convolutional module. This module combines a standard 3×3 convolution with a dilated convolution with a dilation rate of 3. Through parallel processing, it captures contextual information under different receptive fields. This branch contains two parallel convolutions: Branch 1 uses a standard 3×3 convolution with a dilation rate of 1. This branch has a smaller receptive field and focuses on capturing local details, edges, and fine-grained structural information. Branch 2 uses a 3×3 dilated convolution layer with a dilation rate of 3. This branch has a larger receptive field without increasing the number of parameters and focuses on capturing broader regional context and semantic association information. To stabilize training and preserve the original information flow of the input features, a residual connection is introduced, connecting the multi-scale contextual features with the two original input features E. k+1 and G k Each element is added individually. The resulting features are then processed through a batch normalization layer.
[0140] Meanwhile, the coarse segmentation localization map M generated by the decoder is adjusted to the current feature scale through bilinear interpolation, and then enhanced in spatial detail by an edge preprocessing network. The coarse localization map used in this edge-guided feature fusion module is obtained by the decoder through stepwise reasoning from the high-dimensional semantic features output by the backbone network and the multi-scale enhancement module. Specifically, the decoder takes deep semantic features at each scale as input and processes them sequentially in reverse path from high semantic low resolution to low semantic high resolution. At each level, upsampling and feature integration operations are performed to generate a feature map with preliminary localization capability for the target region. Subsequently, class mapping and spatial compression are achieved through one or more convolutional layers to obtain a low-resolution prediction map representing the rough location, morphological range, and general structural outline of the pulmonary embolism region. This prediction map serves as the coarse segmentation localization map. This coarse localization map is mainly used to provide prior structural information for subsequent edge modulation, without requiring precise boundary details. The enhanced edge map extracts features through a shared multilayer perceptron, and then generates modulation parameters γ and β through two independent convolutional layers. These two parameters are then used for affine modulation of the normalized fused features. Finally, structural information is injected into the fused features through an edge-guided modulation mechanism, a process that can be represented as:
[0141] ;
[0142] In the formula, MultiScaleConv represents a multi-scale convolutional module, and ⊕ represents element-wise addition. For the last EGFF module (i.e., k=4), the input of its next-level module is replaced with the output feature G4 of the 4th SGM module.
[0143] Through this design, the EGFF module can effectively integrate multi-scale features and enhance the response to embolic boundary regions under the guidance of edge priors, significantly improving the model's segmentation accuracy for multi-scale lesions.
[0144] In a preferred embodiment, the step of inputting the joint structural attention features into the edge-guided feature fusion module, and performing structural modulation and alignment processing on the structural awareness features through the edge-guided modulation mechanism, and generating the segmentation result by combining the coarse segmentation localization map output by the decoder through fusion processing includes the following steps:
[0145] S2241. Based on the edge-guided feature map generated in advance through structural branches, and combined with the edge-guided modulation mechanism, structural alignment processing is performed on the joint structural attention features;
[0146] S2242. Based on the edge guidance weights and combined with the batch normalization layer, the joint structural attention features after structural alignment are fused to obtain fused features.
[0147] S2243. Using the coarse segmentation localization map pre-generated by the decoder, the feature scale is adjusted to the current feature scale by bilinear interpolation, and affine modulation is performed on the fused features to output the final segmentation result.
[0148] S23. Compare the segmentation results with the preset manual annotations, and construct a focal Tversky loss function based on pixel and pixel neighborhood difference weighting according to the difference comparison results.
[0149] It should be noted that in binary classification tasks for medical image segmentation, lesion regions often constitute a very small area, leading to a severe imbalance between positive and negative samples. Traditional binary cross-entropy (BCE) loss is insufficient to effectively focus on small target regions. Therefore, this invention employs a weighted focal Tversky loss based on pixel and neighborhood differences. This loss function effectively enhances the model's ability to identify difficult-to-classify regions by adjusting the weights of false positives and false negatives. Simultaneously, to strengthen the global constraint on the overall structure of the lesion and alleviate boundary blurring and fragmentation, a weighted IoU loss is further introduced. This loss, calculated based on weights designed according to local pixel differences, places greater emphasis on edge and morphological integrity.
[0150] In summary, the comprehensive loss function is defined as follows:
[0151] ;
[0152] Among them, L WFT and L WIOU represents the weighted focal Tversky loss and the weighted IoU loss, respectively.
[0153] The model proposed in this invention comprises five supervised outputs: a coarse localization map M and four stage prediction maps R1, R2, R3, and R4. The overall training loss is defined as:
[0154] ;
[0155] The coarse localization map is supervised using standard binary cross-entropy loss, while the four-stage prediction map is trained using the aforementioned comprehensive loss function. P represents the corresponding true segmentation mask.
[0156] Specifically, the loss function simultaneously constrains the consistency of segmented regions and boundary positions, enabling the pulmonary embolism segmentation network model to consider both overall segmentation performance and local structural information during training. Based on this loss function, backpropagation is used to iteratively update the model parameters. During training, supervisory constraints are applied to the output results at different scales or levels in the pulmonary embolism segmentation network model, allowing multi-layer features to participate in training optimization simultaneously. This improves the pulmonary embolism segmentation network model's ability to represent targets at different scales and reduces the neglect of small-scale targets and regions with blurred boundaries.
[0157] S24. Based on the focal Tversky loss function weighted by the differences between pixels and their neighborhoods, the parameters of the pulmonary embolism segmentation network model are iteratively updated through backpropagation to obtain the trained pulmonary embolism segmentation network model.
[0158] Specifically, after the pulmonary embolism segmentation network model is constructed, SSPNet (pulmonary embolism segmentation network model) is trained. During training, medical image samples containing target region annotations are acquired, and the medical images are preprocessed. Preprocessing includes image size unification, intensity normalization, and data format conversion to reduce data differences caused by different devices and scanning conditions. Simultaneously, an image reconstruction-based preprocessing mechanism based on structural consistency constraints is introduced to reduce the interference of different imaging conditions and noise distributions on the subsequent feature learning process. Specifically, the input CTPA image is divided into several fixed-size, overlapping local regions, each corresponding to a structural unit. Three quantities are calculated for each structural unit: the average intensity value within the region, the principal gradient direction, and the edge response intensity. For each structural unit, several neighboring structural units are selected in its spatial neighborhood, and the association weight between it and its neighboring structural units is determined based on the weighted results of principal gradient direction differences, edge response similarity, and spatial distance. Based on this, all structural units are simultaneously updated jointly. During each update, the intensity value of the current structural unit is fused with the weighted average intensity of its neighboring structural units. This ensures that adjacent regions located within the same vascular cavity or embolism structure exhibit consistent intensity variations and edge positions, while regions located on different structures remain distinct. After multiple iterations of joint updates, the updated results of each structural unit are mapped back to their original image positions, resulting in a reconstructed image with continuous structure and clear boundaries. This reduces random noise and local imaging differences while maintaining the stability of the vascular cavity orientation and embolism edge morphology. The preprocessed medical image is input into SSPNet, where the model sequentially performs feature extraction, structural information enhancement, feature modulation, and decoding reconstruction, outputting the corresponding segmentation results. Based on the difference between the output of the pulmonary embolism segmentation network model and the manually labeled results, a loss function is constructed for training and used as the basis for updating the parameters of the pulmonary embolism segmentation network model.
[0159] In a preferred embodiment, the focal Tversky loss function based on pixel and neighborhood difference weighting includes a weighted focal Tversky loss function and a weighted cross-union ratio loss function.
[0160] S3. Based on the trained pulmonary embolism segmentation network model, the medical images to be segmented in real time are processed for pulmonary embolism segmentation to obtain pulmonary embolism segmentation maps with clear boundaries and complete structure.
[0161] Furthermore, to better understand the above technical solution, the solution proposed in this invention has been verified as follows:
[0162] (1) To verify the effectiveness of the above-mentioned pulmonary embolism segmentation network model, this invention evaluated it on two datasets: XMU-PE and FUMPE. XMU-PE is a self-built private clinical dataset containing CTPA images of 142 patients with pulmonary embolism, used for model training and primary testing experiments. This invention retrospectively collected data from suspected pulmonary embolism patients who underwent CTPA examinations at a medical university-affiliated hospital from March 2022 to January 2023. Cases with a pulmonary artery CT attenuation value <200 HU or indicative of chronic pulmonary embolism were excluded; only supine scans were included. Scans were performed using three CT scanners from Siemens, GE, and Philips, ranging from the thoracic inlet to the lung base, employing intelligent contrast tracking technology (trigger point: pulmonary trunk, threshold 50 HU, delay 2 s). The contrast agent was 350 mg / ml Ioversol, injected via the right elbow vein under high pressure; the dose and rate were adjusted according to clinical needs. Common parameters for CT image acquisition are: slice thickness 1.0 mm (adjustable within the range of 1.0–2.0 mm), slice spacing 0.5 mm (adjustable within the range of 0.5–1.0 mm), and tube voltage 100 kV (adjustable within the range of 80–120 kV). All data are anonymized and exported in DICOM format. Images were annotated layer by layer in 3D Slicer 5.4.0 by two radiologists with three years of experience, and reviewed by a physician with seven years of experience. The annotation range covers the slice from the first appearance of PE to its complete disappearance; slices without PE within this range are considered negative samples. All CTPA images have a uniform window width / window level of 700 / 100 and are min-max normalized to [0,1].
[0163] FUMPE is a publicly available dataset containing 3D CTPA images of 35 patients, totaling 8,792 slices. Each image was segmented and annotated by two experienced radiologists to identify the pulmonary embolism region. The segmentation mask provided by FUMPE was used to generate slice-level annotations, and slices with non-zero mask values were selected as PE-positive samples. This invention uses the FUMPE dataset along with the XMU-PE dataset during the training phase to increase the sample size and generalization ability of the model. The data preprocessing steps are consistent with those for the XMU-PE dataset.
[0164] To comprehensively evaluate the performance of the pulmonary embolism segmentation network model in pulmonary embolism image segmentation, three basic metrics were primarily used: Mean Intersection over Union (mIoU), Mean Dice (mDice), and F2-Score. Furthermore, to further analyze the model's performance in boundary preservation, structural alignment, and region awareness, four widely used evaluation metrics were introduced: Structural Similarity (S-Measure, S...). α This focuses on the structural similarity of the target foreground at the region and object levels, using the mean E-Measure. The weighted F-measure measures the average structural similarity between the segmentation result and the true segmentation. Precision and recall are weighted averages, taking both into account to evaluate the overall performance of segmentation. Mean Absolute Error (MAE) measures the average distance between the predicted boundary location and the true boundary location.
[0165] This invention is implemented based on the PyTorch framework and trained on an NVIDIA RTX A6000 GPU. Specifically, during training, the Adam optimizer is used to optimize the network parameters, with an initial learning rate set to 8×10⁻⁶. -5 A 10-fold weight decay was applied after the 50th epoch to improve training stability and convergence speed. Additionally, a weight decay of 0.1 was introduced to mitigate overfitting. The model was trained over a total of 100 epochs with a batch size of 8. The testing phase followed the same procedures as the training phase.
[0166] (2) To demonstrate the effectiveness of the proposed method, a set of comparative experiments were designed, comparing UNet, UNet++, AttUNet, DeepLabv3+, SwinUNet, DCSAU-Net, ConSeg, Zig-RiR, and Co-Seg++. For fair comparison, all methods used the official code provided in the original paper and were tested under the same hardware environment and data preprocessing procedures to ensure comparability of the results.
[0167] As shown in Tables 1 and 2, the method of this invention achieved the best results on all seven major evaluation metrics on both the self-built XMU-PE clinical dataset and the publicly available FUMPE dataset. In the XMU-PE dataset, compared to the second-best Co-Seg++, the proposed method improved mDice by 0.83%, mIoU by 2.11%, F2-score by 1.59%, S-measure by 1.52%, wF-measure by 1.84%, and meanE-measure by 2.80%, while reducing MAE by 0.00047. Compared to the third-best Zig-RiR, the improvement was even more significant, with mDice improved by 1.50%, mIoU by 2.88%, F2-score by 1.90%, S-measure by 2.33%, wF-measure by 2.47%, meanE-measure by 1.64%, and MAE decreased by 0.00066.
[0168] In the FUMPE dataset, compared to the second-best Co-Seg++, the method of this invention improves mDice by 0.39%, mIoU by 0.22%, F2-score by 0.03%, S-measure by 0.54%, wF-measure by 0.06%, and meanE-measure by 0.34%, while reducing MAE by 0.00014. Compared to the third-best Zig-RiR, the improvements are 0.44% in mDice, 0.48% in mIoU, 0.24% in F2-score, 0.78% in S-measure, 0.22% in wF-measure, and 0.92% in meanE-measure, while reducing MAE by 0.00012.
[0169] In summary, our proposed method maintains stable and leading performance across various data distributions, demonstrating high versatility and practical value compared to existing methods in key metrics. Specifically, on the representative datasets XMU-PE and FUMPE, the model achieves significant improvements over state-of-the-art methods in core metrics such as mDice, mIoU, and F2-score, indicating superior overall segmentation accuracy. The improvements are even more pronounced in structural evaluation metrics such as S-measure, wF-measure, and mean E-measure, further validating the model's reliability in regional consistency and structure preservation. Furthermore, the continuous decrease in MAE demonstrates the model's strong ability to reduce false positives and false negatives. These consistent superior performances across these data levels fully demonstrate that our method is not only effective in a single scenario but also possesses the potential for cross-scenario transfer and generalization.
[0170] Table 1. Quantitative comparison of SSPNet with other state-of-the-art methods on XMU-PE
[0171] Table 2 Quantitative comparison of SSPNet with other state-of-the-art methods on FUMPE
[0172] (3) In order to more intuitively show the segmentation effect of the model, the segmentation results of each model on the XMU-PE and FUMPE datasets were visualized. Figure 3 and Figure 4 Visualization results are presented on the XMU-PE and FUMPE datasets. The results show significant differences between the different methods in the detection rate of pulmonary embolism lesions, lesion coverage, and differentiation from adjacent anatomical structures.
[0173] Visualization Analysis Figure 3 The presentation compares the segmentation results of the Proposed method with several mainstream models on the XMU-PE dataset. The images show that pulmonary embolism lesions in the XMU-PE dataset are generally small, with densities close to adjacent blood vessels, blurred boundaries, and low background contrast. This makes it easy for models to misclassify pulmonary embolisms as intravascular structures or noise artifacts. Overall, the Proposed method's segmentation results are highly consistent with the ground truth annotations and outperform other methods in various complex scenarios. Figure 3The first and second rows show pulmonary embolisms that are small in size or close to the vessel wall. These lesions are easily missed due to their indistinct boundaries and low contrast. Traditional methods such as UNet and UNet++ often only capture localized areas, while recent models like Zig-RiR and DCSAU-Net are overly conservative, only outlining the lesion core and resulting in missing boundaries. In contrast, the Proposed method can fully recover the lesion extent, avoiding misclassification of adjacent vessel cavities as embolisms. Figure 3 Lines 3 and 4 in the image show multiple small emboli and cord-like emboli running along the vessel. Traditional methods often result in discontinuous segmentation or rough boundaries in such cases. Methods such as Co-Seg++ and ConDSeg often miss some branches or only preserve the local main trunk. In contrast, the Proposed method can accurately capture multiple small lesions while maintaining the integrity of the cord-like structure. Figure 3 The fifth row shows large, irregularly shaped emboli. While traditional methods can cover the main area, boundary distortion is significant, and some models miss lobulated or terminal lesions. The Proposed method, however, can accurately depict the complex boundaries of the lesions, maintaining consistency with the real-world annotations. Overall, the Proposed method demonstrates stronger robustness and segmentation accuracy across pulmonary embolisms of different sizes, shapes, and locations.
[0174] Figure 4 This section presents a visual comparison of different methods on the FUMPE dataset. It can be seen that pulmonary embolisms in this dataset are generally irregular in shape and often accompanied by vascular artifacts or background structures of similar density. Figure 4 The cases in rows 1 and 2 are single small emboli. Traditional UNet and its variants (UNet++, AttUNet) often struggle to distinguish the target from the vascular lumen, resulting in numerous missed detections. While newer methods such as Zig-RiR and DCSAU-Net can detect some lesions, their boundaries are blurred and they are prone to generating spurious responses in surrounding structures. In contrast, the Proposed method not only accurately locates the lesions but also maintains a morphology consistent with the actual annotations, with almost no significant missed detections. Figure 4 Lines 3 and 4 in the figure show the case of multiple small emboli. Methods such as Co-Seg++, ConDSeg, and SwinUNet usually miss some branches and only capture the main lesion, while the Proposed method can identify multiple small targets at the same time, avoid missegmentation of the vessel wall or other interfering structures, and show higher sensitivity. Figure 4 The case in row 5 is an isolated, tiny lesion. Most contrastive models completely missed it due to oversmoothing, producing only a few spurious predictions in the background. However, the Proposed method was still able to accurately detect this tiny embolism. Overall, on this dataset, the Proposed method demonstrates superior robustness and generalization ability, effectively overcoming problems such as difficulty in distinguishing small targets, blurred boundaries, and artifact interference.
[0175] In summary, even with differences in image quality across different datasets, the Proposed method can still restore the irregular boundaries of lesions and maintain consistency with the ground truth annotations. This demonstrates that the proposed method has stronger robustness and clinical application potential in the segmentation of small-volume, complex-shaped, and wall-attached pulmonary embolisms.
[0176] (4) To verify the effectiveness of the three modules proposed in this invention, a set of module ablation experiments were designed under a unified training strategy. Using a network without any enhancement modules as the baseline, the Structure Guiding Module (SGM), Edge Guiding Fusion Module (EGFF), and Structured Context Enhancement Module (SCE) were introduced respectively, and different combination configurations and the joint configuration of the three modules (Proposed) were tested.
[0177] Experimental results show that the baseline model performs relatively poorly on metrics such as mDice, mIoU, and F2-score, especially in identifying small, poorly defined pulmonary embolism lesions. To verify the independent effectiveness of each module, SGM, EGFF, and SCE modules were added separately to the baseline model for further experiments. As shown in Table 3, the addition of the SGM module significantly enhanced the utilization of structural information in the model, resulting in improved performance in the boundary region. mDice, mIoU, and F2-score increased by 1.18%, 1.45%, and 0.63%, respectively, while S-measure, wF, and meanEm increased by 0.72%, 0.30%, and 0.81%, respectively, and MAE decreased by 0.00012. After introducing the EGFF module separately, the model achieved significant improvements in multiple evaluation metrics. Specifically, mDice, mIoU, and F2-score increased by 1.85%, 2.12%, and 1.00%, respectively, while S-measure, wF, and meanEm increased by 0.94%, 0.61%, and 1.25%, respectively, and MAE decreased by 0.00018. This is mainly due to the effective fusion of multi-scale edge information by the EGFF module, which enabled the model to better maintain the integrity and detail of the target boundary. Similarly, after introducing the SCE module, mDice, mIoU, and F2-score further improved by 2.04%, 2.50%, and 1.70%, respectively, while S-measure, wF, and meanEm improved by 1.79%, 1.19%, and 1.82%, respectively, and MAE decreased by 0.00022. This indicates that the SCE module effectively enhances the model's ability to locate and identify small lesions by strengthening the modeling of contextual semantic information.
[0178] The combined experiments showed that the modules exhibited good complementarity. The SGM+EGFF combination enhanced the accuracy of edge localization, improving mDice from 0.7737 to 0.7998 (a 2.61% improvement), mIoU from 0.6620 to 0.6935 (a 3.15% improvement), F2-score from 0.7650 to 0.7872 (a 2.22% improvement), S-measure from 0.7911 to 0.8132 (a 2.21% improvement), and wF from 0.7651 to 0.780. 5 (an improvement of 1.54%), meanEm increased from 0.9102 to 0.9315 (an improvement of 2.13%), and MAE decreased from 0.00230 to 0.00201 (a decrease of 0.00029); the combination of SGM+SCE effectively balanced boundary continuity and regional semantic consistency, with mDice increasing from 0.7737 to 0.8031 (an improvement of 2.94%), mIoU increasing from 0.6620 to 0.6980 (an improvement of 3.60%), and F2-score increasing from 0.7650 to 0.7940 (an improvement of 1.54%). The S-measure improved from 0.7911 to 0.8210 (an improvement of 2.99%), wF improved from 0.7651 to 0.7873 (an improvement of 2.22%), meanEm improved from 0.9102 to 0.9371 (an improvement of 2.69%), and MAE decreased from 0.00230 to 0.00198 (a decrease of 0.00032). The SCE+EGFF combination significantly improved structural integrity and detail reproduction, with mDice improving from 0.7737 to 0.8122 (an improvement of 3.85%). The mIoU increased from 0.6620 to 0.7070 (an improvement of 4.50%), the F2-score increased from 0.7650 to 0.8011 (an improvement of 3.61%), the S-measure increased from 0.7911 to 0.8261 (an improvement of 3.50%), the wF increased from 0.7651 to 0.7886 (an improvement of 2.35%), the meanEm increased from 0.9102 to 0.9400 (an improvement of 2.98%), and the MAE decreased from 0.00230 to 0.00188 (a decrease of 0.00042).
[0179] Ultimately, when the three modules were used in combination, all metrics reached optimal levels. Significant improvements were achieved not only in core accuracy metrics such as mDice, mIoU, and F2-score, but also in structure-aware metrics such as S-measure, wF, and meanEm. MAE was reduced to its lowest value, demonstrating a comprehensive breakthrough in overall model performance. This fully illustrates that EGFF, SCE, and SGM are not simply functionally superimposed, but rather form an effective complementarity and synergy.
[0180] Table 3 shows the ablation experiments of the proposed SSPNet on the XMU-PE dataset.
[0181] like Figure 5 As shown, according to a second embodiment of the present invention, a pulmonary embolism segmentation system based on structural context enhancement and edge guidance is provided, the system comprising:
[0182] Dataset acquisition unit 1 is used to acquire medical image samples containing target region annotations, and preprocess the medical image samples based on an image reconstruction preprocessing mechanism with structural consistency constraints to obtain a sample dataset.
[0183] Model building training unit 2 is used to build a pulmonary embolism segmentation network model with PVTv2 as the feature extraction framework, which includes a structured context enhancement module, a structure-guided modulation module, an edge-guided feature fusion module and a decoder. The pulmonary embolism segmentation network model is trained based on the sample dataset and the focus Tversky loss function based on pixel and pixel neighborhood differences, and the trained pulmonary embolism segmentation network model is obtained.
[0184] Image segmentation unit 3 is used to perform pulmonary embolism segmentation processing on medical images to be segmented in real time based on the trained pulmonary embolism segmentation network model, so as to obtain a pulmonary embolism segmentation map with clear boundaries and complete structure.
[0185] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, etc.) containing computer-usable program code.
[0186] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A pulmonary embolism segmentation method based on structural context enhancement and edge guidance, characterized in that, Includes the following steps: S1. Obtain medical image samples containing target region annotations, and preprocess the medical image samples based on an image reconstruction preprocessing mechanism with structural consistency constraints to obtain a sample dataset. S2. Using PVTv2 as the feature extraction framework, a pulmonary embolism segmentation network model is constructed, which includes a structured context enhancement module, a structure-guided modulation module, an edge-guided feature fusion module, and a decoder. The pulmonary embolism segmentation network model is trained based on the sample dataset and the focal Tversky loss function weighted by pixel and pixel neighborhood differences, and the trained pulmonary embolism segmentation network model is obtained. S3. Based on the trained pulmonary embolism segmentation network model, the medical images to be segmented in real time are processed for pulmonary embolism segmentation to obtain pulmonary embolism segmentation maps with clear boundaries and complete structure.
2. The pulmonary embolism segmentation method based on structural context enhancement and edge guidance according to claim 1, characterized in that, The process of obtaining medical image samples containing target region annotations and preprocessing them using an image reconstruction preprocessing mechanism based on structural consistency constraints to obtain a sample dataset includes the following steps: S11. Obtain medical image samples containing target region annotations, and sequentially perform image size unification, intensity normalization, and data format conversion to obtain standardized images; S12. Divide the standardized image into several local regions of fixed size and overlapping each other, and use each local region as a structural unit. S13. Calculate the average strength value, principal gradient direction, and edge response intensity of each structural element; S14. For each structural unit, select several neighboring structural units in its spatial neighborhood, and calculate the weighted results of the principal gradient direction difference, edge response similarity and spatial distance between each structural unit and its several neighboring structural units to determine the association weight between each structural unit and its neighboring structural units. S15. Based on the association weight between each structural unit and its neighboring structural units, all structural units are updated simultaneously. During each update, the strength value of the current structural unit is fused with the weighted average strength of its neighboring structural units to obtain the update result of each structural unit. S16. Map the update results of each structural unit back to the original position in the standardized image to form a reconstructed image with continuous structure and clear boundaries, thereby obtaining the sample dataset.
3. The pulmonary embolism segmentation method based on structural context enhancement and edge guidance according to claim 1, characterized in that, The process involves using PVTv2 as the feature extraction framework to construct a pulmonary embolism segmentation network model that includes a structured context enhancement module, a structure-guided modulation module, an edge-guided feature fusion module, and a decoder. The model is then trained using a sample dataset and a focus-based Tversky loss function weighted by pixel and pixel neighborhood differences. The resulting trained pulmonary embolism segmentation network model includes the following steps: S21. Using PVTv2 as the feature extraction framework, and combining it with the structured context enhancement module, structure-guided modulation module, edge-guided feature fusion module and decoder, a pulmonary embolism segmentation network model is constructed. S22. Input the sample dataset into the pulmonary embolism segmentation network model. The pulmonary embolism segmentation network model sequentially performs feature extraction, structural information enhancement, feature modulation, and decoding reconstruction processes, and outputs the corresponding segmentation results. S23. Compare the segmentation results with the preset manual annotations, and construct a focal Tversky loss function based on pixel and pixel neighborhood difference weighting according to the difference comparison results. S24. Based on the focal Tversky loss function weighted by the differences between pixels and their neighborhoods, the parameters of the pulmonary embolism segmentation network model are iteratively updated through backpropagation to obtain the trained pulmonary embolism segmentation network model.
4. The pulmonary embolism segmentation method based on structural context enhancement and edge guidance according to claim 3, characterized in that, The process of inputting the sample dataset into the pulmonary embolism segmentation network model, where the model sequentially performs feature extraction, structural information enhancement, feature modulation, and decoding reconstruction, and outputs the corresponding segmentation result includes the following steps: S221. Using the feature extraction backbone network in the pulmonary embolism segmentation network model, multi-scale feature encoding is performed on the reconstructed images in the sample dataset. By obtaining the overall vascular structure information and local detail features in the reconstructed images, the multi-scale feature map is obtained through encoding. S222. Input the multi-scale feature map into the structured context enhancement module. By performing structure-sensitive feature enhancement processing on the multi-scale features and combining global average aggregation and global maximum aggregation processing, enhanced features containing regional context relationships are generated. S223. The enhanced features are input into the structure-guided modulation module, and a dual-branch structure-guided attention mechanism is constructed to generate joint structure attention features; S224. Input the joint structural attention features into the edge-guided feature fusion module, and perform structural modulation and alignment processing on the structural awareness features through the edge-guided modulation mechanism. Combine the coarse segmentation localization map output by the decoder and generate the segmentation result through fusion processing.
5. The pulmonary embolism segmentation method based on structural context enhancement and edge guidance according to claim 4, characterized in that, The process of inputting multi-scale features into the structured context enhancement module, performing structure-sensitive feature enhancement on the multi-scale features, and combining global average aggregation and global maximum aggregation to generate enhanced features containing regional contextual relationships includes the following steps: S2221. After inputting the multi-scale features into the structured context enhancement module, the multi-scale feature map is subjected to structure-sensitive feature enhancement processing based on one of the branches of the structured context enhancement module, and convolutional features are generated by combining global average aggregation and global maximum aggregation processing. S2222, The dynamic sampling mechanism based on offset prediction utilizes another branch of the structured context enhancement module to perform convolution operations on multi-scale feature maps to predict the corresponding offset, and adjusts the regular sampling position of the standard convolution according to the offset to obtain spatial features for improving the representation quality. S2223. The convolutional features and spatial features are fused to obtain enhanced features that include the contextual relationships of the region.
6. The pulmonary embolism segmentation method based on structural context enhancement and edge guidance according to claim 5, characterized in that, After inputting multi-scale features into the structured context enhancement module, the multi-scale feature map is subjected to structure-sensitive feature enhancement processing based on one of the branches of the structured context enhancement module. Combined with global average aggregation and global maximum aggregation processing, convolutional features are generated through the following steps: S22211. Using one of the branches of the structured context enhancement module, the multi-scale feature map is divided into several regions; S22212. For each region, by statistically analyzing the voxel intensity distribution within each region, calculate the local intensity offset and the contrast relationship between the voxel intensity distribution within each region and the reference region of the adjacent vascular lumen, and identify and mark abnormal regions with low contrast filling. S22213. Perform spatial continuity analysis of grayscale changes in abnormal areas, and combine the morphological response distribution of local areas to classify morphological anomalies in areas where the contour direction is irregularly deflected or where the local morphological contraction is abnormal, and obtain the classification results. S22214. Based on the classification results, use a preset feature enhancement strategy to perform feature enhancement processing on different regions; S22215. For each region that has undergone feature enhancement, perform global average aggregation and global maximum aggregation operations respectively, and fuse the results of global average aggregation and global maximum aggregation to obtain a region description vector that characterizes the overall lesion features and local significant abnormalities of the region. S22216. All region description vectors are concatenated according to the predefined anatomical or spatial index order to form a region description matrix. Combined with the preset shared weight mapping unit, linear transformation combined with nonlinear activation and normalization operations are used to adaptively generate weight coefficients for each region. S22217. The weight coefficients are combined with the softmax normalized and predefined basic kernels to obtain the convolutional features.
7. The pulmonary embolism segmentation method based on structural context enhancement and edge guidance according to claim 4, characterized in that, The step of inputting enhanced features into the structure-guided modulation module and generating joint structure attention features by constructing a dual-branch structure-guided attention mechanism includes the following steps: S2231. After inputting the enhanced features into the structure-guided modulation module, channel-wise convolution in the channel direction is used to perform single-channel convolution processing on the enhanced features in the spatial range to obtain a preliminary spatial smooth response. S2232. Linearly combine the preliminary spatial smoothing responses of each channel through pointwise convolution to integrate cross-channel correlations and generate the final smooth feature map. S2233. Use depthwise separable convolution to smooth the final smooth feature map to obtain smooth features; S2234. Use learnable deep edge convolution to model the spatial gradient of smooth features to obtain local edge enhancement features; S2235. Based on local edge enhancement features, a structure-guided attention mechanism including channel attention branches and spatial attention branches is constructed, and channel modulation factors and spatial attention maps are generated. S2236. The modulation factor and spatial attention map are fused to obtain a joint structural attention feature used to guide subsequent feature modulation.
8. The pulmonary embolism segmentation method based on structural context enhancement and edge guidance according to claim 7, characterized in that, The construction of a structure-guided attention mechanism based on local edge enhancement features, including channel attention branches and spatial attention branches, and the generation of channel modulation factors and spatial attention maps, includes the following steps: S22351. Construct channel attention branch and spatial attention branch respectively using local edge enhancement features; S22352, the channel attention branch adopts a squeeze-excitation mechanism, which generates channel descriptors through global average pooling and combines a preset two-layer fully connected mapping with a non-linear activation function to generate channel modulation factors; S22353. The spatial attention branch extracts global position information through channel compression and generates a spatial attention map using a preset lightweight convolution.
9. The pulmonary embolism segmentation method based on structural context enhancement and edge guidance according to claim 4, characterized in that, The process of inputting joint structural attention features into the edge-guided feature fusion module, performing structural modulation and alignment processing on the structural awareness features through an edge-guided modulation mechanism, and generating a segmentation result by combining the coarse segmentation localization map output by the decoder through fusion processing includes the following steps: S2241. Based on the edge-guided feature map generated in advance through structural branches, and combined with the edge-guided modulation mechanism, structural alignment processing is performed on the joint structural attention features; S2242. Based on the edge guidance weights and combined with the batch normalization layer, the joint structural attention features after structural alignment are fused to obtain fused features. S2243. Using the coarse segmentation localization map pre-generated by the decoder, the feature scale is adjusted to the current feature scale by bilinear interpolation, and affine modulation is performed on the fused features to output the final segmentation result.
10. The pulmonary embolism segmentation method based on structural context enhancement and edge guidance according to claim 2, characterized in that, The focal Tversky loss function, which is weighted based on pixel and neighborhood differences, includes a weighted focal Tversky loss function and a weighted cross-union ratio (CUI) loss function.