Medical image segmentation method based on laplacian pyramid and dynamic transformer

By combining the Laplacian pyramid and dynamic Transformer, this method addresses the insufficient segmentation accuracy of existing medical image segmentation methods under multi-scale lesion morphology and complex tissue structures, achieving medical image segmentation with clear boundaries and coherent regions, thus improving the model's adaptability and segmentation accuracy.

CN120471940BActive Publication Date: 2026-03-31盐城市第三人民医院
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing medical image segmentation methods struggle to capture global semantic relationships while preserving detailed information when dealing with multi-scale lesion morphology, variable tissue structures, and noise interference. This results in unclear boundaries and inaccurate localization. Furthermore, traditional Transformer modules are difficult to dynamically adjust feature ratios, limiting the model's adaptability and segmentation accuracy in complex image scenarios.

Method used

We employ a method combining Laplacian pyramid and dynamic Transformer to generate medical image segmentation results with clear boundaries and coherent regions through multi-scale decomposition, saliency response map guidance, and dynamic attention mechanism. This includes multi-scale decomposition using Laplacian pyramid, feature fusion and decoding processing using dynamic Transformer module, and morphological operations and edge repair to improve segmentation performance.

Benefits of technology

It significantly improves the accuracy and robustness of medical image segmentation models, enabling them to adapt to complex medical image structures and generate segmentation results with clear boundaries and coherent regions. It is suitable for processing images with blurred tumor boundaries and densely overlapping tissues, thus improving the practicality of clinical applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120471940B_ABST
    Figure CN120471940B_ABST
Patent Text Reader

Abstract

The application discloses a medical image segmentation method based on Laplacian pyramid and dynamic Transformer, S1. Form a preprocessed medical image; S2. The preprocessed medical image is decomposed into a plurality of image sublayers of different scales; S3. Corresponding multi-scale feature representation is generated; S4. The multi-scale feature representation is input into the dynamic Transformer module to generate the fused global feature representation; S5. The fused global feature representation is subjected to decoding processing to generate a preliminary segmentation map, and a post-processing algorithm is applied to the preliminary segmentation map to perform morphological operation, edge repair and noise removal, and obtain a medical image segmentation result with clear boundaries and coherent regions. The application generates a medical image segmentation result with clear boundaries, coherent regions and accurate semantics, and improves the practicability of the model in clinical application, and has obvious advantages in processing images with blurred tumor boundaries and densely overlapped tissues.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical technology, and in particular to a medical image segmentation method based on Laplacian pyramid and dynamic Transformer. Background Technology

[0002] With the development of medical artificial intelligence and computer vision technology, medical image segmentation has gradually become a core component in key tasks such as assisted diagnosis, preoperative planning, and lesion monitoring. The goal of medical image segmentation is to accurately separate different tissue structures, lesion regions, and functional regions in various medical images such as CT, MRI, and ultrasound, thereby providing accurate spatial localization and contour description for downstream analysis and decision-making. Currently, the mainstream methods for medical image segmentation mostly adopt structures based on deep convolutional neural networks, including U-Net and ResNet, to achieve semantic segmentation of images through end-to-end training. However, due to the characteristics of medical images, such as multi-scale lesion morphology, variable tissue structures, and noise interference, traditional methods still have significant shortcomings in processing image details and co-modeling global information.

[0003] Specifically, existing convolution-based image segmentation models mostly rely on fixed receptive fields for local feature extraction, making it difficult to capture global semantic relationships while preserving detailed information. When segmenting small lesions, areas with blurred edges, or complex tissue structures, problems such as unclear boundaries, inaccurate localization, and missed lesions often occur. Some studies have introduced multi-scale inputs or feature pyramid structures to alleviate this problem, but they lack adaptive mechanisms in the feature fusion stage and cannot dynamically adjust the contribution ratio of features at each scale according to the image content. In addition, in recent years, the Transformer structure has been introduced into medical image segmentation to enhance the global modeling ability of the model. However, existing Transformer modules mostly use static parameter mapping, making it difficult to achieve dynamic feature adjustment for the heterogeneity of lesion regions in the image, thus limiting the adaptability and segmentation accuracy of the model in complex image scenarios.

[0004] Therefore, there is an urgent need for a segmentation method that can integrate multi-scale detailed information, has a dynamic adaptive mechanism, and adapts to the complexity of medical image structures, in order to improve the accuracy, robustness, and clinical applicability of segmentation models. Summary of the Invention

[0005] One objective of this invention is to propose a medical image segmentation method based on Laplacian pyramid and dynamic Transformer. This invention generates medical image segmentation results with clear boundaries, coherent regions, and accurate semantics. The improved structure enhances the practicality of the model in clinical applications and has significant advantages in processing images with blurred tumor boundaries and densely overlapping tissues.

[0006] A medical image segmentation method based on Laplacian pyramid and dynamic Transformer according to an embodiment of the present invention includes the following steps:

[0007] S1. Acquire the input medical image, perform preprocessing on the medical image, and form a preprocessed medical image;

[0008] S2. Use the Laplacian pyramid to perform multi-scale decomposition on the preprocessed medical image, decomposing the preprocessed medical image into multiple image sub-layers of different scales;

[0009] S3. Extract features from each sub-layer of the image at each scale, and use a convolutional neural network to encode the local features of each sub-layer of the image at each scale to generate the corresponding multi-scale feature representation;

[0010] S4. Input the multi-scale feature representation into the dynamic Transformer module, and dynamically weight and fuse the features at each scale through a self-attention mechanism to generate the fused global feature representation;

[0011] S5. Decode the fused global feature representation and use upsampling, deconvolution and skip connection techniques to restore the fused global feature representation to the same spatial resolution as the original medical image, generate a preliminary segmentation map, and apply post-processing algorithms to the preliminary segmentation map to perform morphological operations, edge repair and noise removal to obtain a medical image segmentation result with clear boundaries and regional coherence.

[0012] Optionally, the medical image is a CT image, an MRI image, or an ultrasound image.

[0013] Optionally, S1 includes the following steps:

[0014] S11. Obtain the input medical image data I raw Medical image data I raw This is a raw medical image matrix with a two-dimensional or three-dimensional structure, containing multiple grayscale pixel value distributions, used to characterize the difference in medical image intensity between lesion areas and normal tissues.

[0015] I raw ={i x,y |i x,y ∈[0,I max ], x∈[1,H], y∈[1,W]};

[0016] Among them, i x,y This represents the pixel grayscale value at position (x, y), where H and W represent the height and width of the medical image, respectively, and I... max This represents the maximum grayscale value supported by the medical imaging system.

[0017] S12. Apply Gaussian filtering to medical image data I raw The gray value of each pixel in the image is weighted and averaged with its neighboring pixels. The filtering weights are calculated based on a two-dimensional Gaussian distribution function to obtain a noise-suppressed medical image.

[0018] S13. Standardize the gray values ​​of all pixels in the noise-suppressed medical image according to the difference between the minimum and maximum gray values, and convert it into a normalized medical image in the interval [0,1].

[0019] S14. Using a linear grayscale transformation method, the grayscale value of each pixel in the normalized medical image is increased by combining proportional scaling and constant offset to enhance the overall brightness and contrast of the medical image, resulting in a contrast-enhanced medical image I. pre Medical images with enhanced contrast I pre Used to improve the visibility of the boundary between lesion areas and background tissue in medical images.

[0020] Optionally, S2 includes the following steps:

[0021] S21. Medical image I with enhanced contrast pre A multi-scale Gaussian medical image sequence {G0, G1, ..., G...} is constructed using the initial input medical image. N}, where G0 = I pre For each scale of the Gaussian pyramid image G k By integrating the local edge gradient responses of medical images through guided Gaussian convolution for smoothing and downsampling, a next-level multi-scale Gaussian medical image G is generated. k+1 :

[0022]

[0023] Where ω(u,v) is the normalized two-dimensional Gaussian kernel, r represents the radius used for the Gaussian convolution kernel, and u and υ represent the offsets of the Gaussian convolution kernel in the horizontal and vertical directions, respectively. k For the image of the k-th level Gaussian pyramid, G k+1 (x,y) represents the pixel value at spatial location (x,y) in the Gaussian pyramid image at layer (k+1), λ is the edge enhancement factor, and E k (x,y) represents the edge gradient response intensity at pixel location (x,y) in a medical image at the current scale k:

[0024]

[0025] in, and The first-order gradient of medical images in the horizontal and vertical directions is used to highlight the gray-scale interface between the lesion edge and normal tissue.

[0026] S22. For each scale of the Gaussian pyramid image G k Upsampled medical images Up(G) k+1 A significance-guided difference operation was performed to obtain the high-frequency Laplacian medical image sublayer L. k The saliency-guided difference operation process involves fusing the saliency response map S of medical images. k Perform weight readjustment:

[0027] L k (x,y)=G k (x,y)-S k (x,y)·Up(G k+1 (x,y);

[0028] Significance response diagram S k (x,y)∈[0,1] represents the importance of the region at position (x,y) to the overall segmentation target. The saliency response is calculated by combining the lesion morphology, texture abnormalities, and structural asymmetry features in the medical image. It is used to enhance the layer response of the lesion region and suppress the influence of the background region.

[0029] S23. Repeat steps S21 and S22 to construct a complete multi-scale Laplacian pyramid medical image set.

[0030]

[0031] Among them, L N-1 For the (N-1)th high-frequency Laplacian medical image sublayer, G N This is the lowest-level Gaussian medical image.

[0032] Optionally, S3 includes the following steps:

[0033] S31. Medical image set of multi-scale Laplacian pyramid Each scale medical image sublayer L k and the lowest level global medical image G N Feature encoding is performed separately, using a scale-shared convolutional coding module F. conv Extract the local feature response of each medical image sublayer to obtain the initial encoded feature map F at each scale. k :

[0034]

[0035] Among them, F k(x,y) represents the feature response value of the initial encoded feature map at position (x,y) at scale k. C represents the k-th Laplacian medical image sublayer or the bottom-most global medical image of input medical image channel i. in Input the number of channels. The weight parameters b represent the weights of the scale k convolution kernel at position (u,v) in channel i. k σ represents the bias term, σ denotes the nonlinear activation function, and the kernel size is (2r+1)×(2r+1);

[0036] S32. Convert the initial encoded feature map F at each scale. k Its corresponding medical image saliency response map S k Perform pixel-wise weighted fusion to generate saliency-enhanced feature maps. Significance Enhancement Feature Map The augmentation value for each pixel in the initial encoded feature map F is the value of that pixel in the initial encoded feature map F. k The original values ​​and their corresponding positions in the medical image saliency response map S k The sum of the products of the response values ​​in the feature map, plus the scaled-down result of the original values, is used to enhance the response intensity of the lesion region in the feature map:

[0037]

[0038] Where γ is the significance enhancement coefficient, used to control the degree of enhancement of the characteristic response of the lesion area, and S k (x,y)∈[0,1] represents the saliency response value at pixel position (x,y) at scale k, which is used to highlight the lesion contour, edge abnormalities and texture discontinuities in medical images.

[0039] S33. Significance Enhancement Feature Maps at All Scales Dimensional unification and structural adjustment are performed. Through channel transformation and spatial alignment operations, feature maps of different scales are uniformly adjusted to a preset uniform resolution (H′, W′) and uniform number of channels C′, forming a standardized multi-scale feature representation set F. multi :

[0040]

[0041] Where φ(·) represents the composite transformation operation of upsampling, channel mapping, and feature normalization, H k With W k Let C be the spatial dimension of the original scale k. k Here, (H′, W′, C′) represents the number of channels, and (H′, W′, C′) represents the target spatial dimension and number of channels for uniform alignment.

[0042] Optionally, S4 includes the following steps:

[0043] S41. Input the standardized multi-scale feature representation set into the dynamic Transformer module, and then input the saliency enhancement feature map at each scale. The input feature sequence is flattened into a two-dimensional sequence representation. Where H′·W′ is the sequence length, and C′ is the channel dimension at each position;

[0044] S42. The image content-driven dynamic parameter generation module generates input feature sequences X for each scale. k Encoding processing is performed first on the input feature sequence X. k Perform global average pooling to obtain the statistical representation vector at scale k. The statistical representation vector μ k The input is fed into three multilayer perceptrons with shared structures but independent parameters, generating query weight matrices for the Transformer at that scale. Key weight matrix and value weight matrix

[0045] S43. Based on the query weight matrix Key weight matrix and value weight matrix For the input feature sequence X respectively k Perform matrix multiplication to obtain the query matrix Q at scale k. k Key matrix K k Sum matrix V k ;

[0046] S44. Calculate the attention weight matrix within the scale. Attention allocation is performed using a scaled dot product attention mechanism.

[0047] S45. Introduce a content-aware gating mechanism to dynamically adjust the attention distribution at the pixel level, based on the saliency response map S of the input medical image. k Construct pixel attention gating factor G k The pixel attention gating factor is then embedded into the attention-weighted output to obtain the dynamic attention output sequence Z. k :

[0048] Z k =(G k ⊙A k )·V k ;

[0049] Where ⊙ represents element-wise multiplication in row-wise broadcast, G k(i)=1+γ·S k (i) is used to enhance the dynamic response intensity of pixels in the lesion area during attention output;

[0050] S46. Dynamic attention output sequences Z at all scales k To perform scale-level fusion, a globally adaptive fusion weight α is introduced. k The global adaptive fusion weights are generated from the statistical features of the attention output at each scale, and are dynamically adjusted based on the response intensity of the lesion region at each scale.

[0051]

[0052] Among them, Z k Z represents the dynamic attention output sequence obtained after processing by the dynamic Transformer module at scale k. j The mean(Z) represents the dynamic attention output sequence obtained after processing by the dynamic Transformer module at scale j. k ) represents the dynamic attention output sequence Z k The global average pooling result, that is, the average value of the feature response of all spatial locations, is used to extract the main semantic features expressed by scale k in the whole image, reflecting the overall response intensity of the lesion area at that scale. w is the weight vector in the adaptive fusion function, and b is the bias term in the adaptive fusion function.

[0053] S47. According to the global adaptive fusion weight α k We perform a weighted summation of the dynamic outputs at all scales to obtain the fused global feature representation F. global .

[0054] Optionally, S5 includes the following steps:

[0055] S51. Represent the fused global features F global The input is fed into the decoding module, and the fused global feature representation F global Given a three-dimensional tensor of size H′×W′×d, the decoding module restores the spatial resolution step by step through layer-by-layer upsampling and deconvolution operations, constructing a sequence of decoding feature maps with progressively increasing resolution until the spatial resolution H×W is restored to the same as that of the original medical image. The number of channels and spatial size of each layer of the decoding feature map are adjusted sequentially according to the number of decoding layers, and finally a decoding output with the same spatial resolution as the original medical image is obtained.

[0056] S52. Introduce a skip connection mechanism during the decoding process to enhance the saliency of the feature map at multiple scales. The feature map with the same spatial resolution as the current decoding layer output resolution is spatially aligned through upsampling or convolution operations, and then concatenated with the current decoding feature map in the channel dimension to obtain a fused feature map. This is used to enhance the ability to preserve fine-grained structures and boundary features during the decoding process and to avoid the loss of lesion area information during upsampling.

[0057] S53. Perform channel mapping operation on the last layer of decoded feature map. Use a convolution kernel with the number of channels equal to the number of medical image segmentation categories to map the final decoded feature map into a preliminary medical image segmentation map. The spatial size of the preliminary medical image segmentation map is H×W. The number of output channels of each pixel is equal to the number of segmentation categories, which represents the probability distribution of the pixel belonging to each category. The probability distribution is processed by the Softmax normalization function so that the output of each pixel satisfies the condition that the sum of the categories is 1.

[0058] S54. Perform post-processing operations on the preliminary medical image segmentation map. The post-processing operations include morphological operations, edge restoration operations, and noise removal operations.

[0059] S55. Output the post-processed medical image segmentation result as the final medical image segmentation result, which is a two-dimensional label map of size H×W, where each pixel corresponds to a unique medical image segmentation category.

[0060] Optionally, in the morphological operation, a combination of closing and opening operations is performed using structuring elements, and an operation step of first dilation and then erosion is executed. The closing operation is used to fill small holes in the lesion area, and the opening operation is used to remove small isolated artifacts, thereby enhancing the connectivity and integrity of the segmented area.

[0061] In the edge repair operation, Gaussian filtering and curvature smoothing methods are used to adjust the edges of the segmented region to address the problems of jagged, discontinuous, or overly sharp boundaries in the preliminary medical image segmentation map, making the segmented edges smoother and more natural.

[0062] In the noise removal operation, through regional connectivity analysis and shape constraint judgment, false detection areas and isolated pixels in the background are automatically identified and removed, thereby optimizing the accuracy and stability of lesion areas in medical image segmentation results.

[0063] The beneficial effects of this invention are:

[0064] (1) This invention introduces an edge response guidance and saliency response map control mechanism on the basis of the traditional Laplacian pyramid. It uses guided Gaussian convolution to perform edge-sensitive Gaussian blurring on the image and performs pixel-level difference enhancement by fusing saliency maps when constructing the Laplacian pyramid layer. This not only improves the response intensity of the lesion area, but also suppresses the interference information of the background area. It can enhance the expression of multi-scale high-frequency detail features while maintaining the global structural semantics. It is suitable for segmentation and modeling of lesion areas in multi-morphological, low-contrast medical images.

[0065] (2) This invention combines the image content-driven mechanism with the Transformer structure. By statistically analyzing the global distribution of features at each scale, it dynamically generates query, key, and value weight matrices, so that the attention calculation of the Transformer no longer depends on static parameters, but is adjusted in real time according to the image content. Combined with the content-aware gating mechanism and saliency response map, the attention output is dynamically adjusted pixel by pixel in the spatial dimension, which effectively improves the model's sensitivity to lesion boundaries, morphological changes, and heterogeneous regions. The dynamic Transformer module significantly enhances the segmentation model's adaptability to fine-grained structures in complex medical images, making up for the shortcomings of traditional attention mechanisms in modeling the joint dynamic relationship between space and scale.

[0066] (3) Based on the fused global feature representation, this invention designs a stepwise upsampling decoding network and combines the skip connection mechanism of multi-scale feature maps to supplement detailed information during the decoding process, effectively avoiding semantic ambiguity and edge information loss during feature upsampling. In the output stage, a structured post-processing module is introduced, which uses morphological closing operation to enhance regional connectivity, edge repair filter to smooth the segmentation contour, and performs regional connectivity detection to remove isolated artifacts. Finally, it generates medical image segmentation results with clear boundaries, coherent regions, and accurate semantics. The structure improves the practicality of the model in clinical applications and has significant advantages in processing images with blurred tumor boundaries and densely overlapping tissues. Attached Figure Description

[0067] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:

[0068] Figure 1 This is a flowchart of a medical image segmentation method based on Laplacian pyramid and dynamic Transformer proposed in this invention;

[0069] Figure 2 This is a schematic diagram of the segmentation result on a brain MRI image, which is an embodiment of the medical image segmentation method based on Laplacian pyramid and dynamic Transformer proposed in this invention. Detailed Implementation

[0070] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.

[0071] refer to Figure 1 A medical image segmentation method based on Laplacian pyramid and dynamic Transformer includes the following steps:

[0072] S1. Acquire the input medical image, perform preprocessing on the medical image, and form a preprocessed medical image;

[0073] S2. Use the Laplacian pyramid to perform multi-scale decomposition on the preprocessed medical image, decomposing the preprocessed medical image into multiple image sub-layers of different scales;

[0074] S3. Extract features from each sub-layer of the image at each scale, and use a convolutional neural network to encode the local features of each sub-layer of the image at each scale to generate the corresponding multi-scale feature representation;

[0075] S4. Input the multi-scale feature representation into the dynamic Transformer module, and dynamically weight and fuse the features at each scale through a self-attention mechanism to generate the fused global feature representation;

[0076] S5. Decode the fused global feature representation and use upsampling, deconvolution and skip connection techniques to restore the fused global feature representation to the same spatial resolution as the original medical image, generate a preliminary segmentation map, and apply post-processing algorithms to the preliminary segmentation map to perform morphological operations, edge repair and noise removal to obtain a medical image segmentation result with clear boundaries and regional coherence.

[0077] In this embodiment, the medical image is a CT image, an MRI image, or an ultrasound image.

[0078] In this embodiment, S1 includes the following steps:

[0079] S11. Obtain the input medical image data I raw Medical image data I raw This is a raw medical image matrix with a two-dimensional or three-dimensional structure, containing multiple grayscale pixel value distributions, used to characterize the difference in medical image intensity between lesion areas and normal tissues.

[0080] I raw ={i x,y |i x,y ∈[0,I max ], x∈[1,H], y∈[1,W]};

[0081] Among them, i x,y This represents the pixel grayscale value at position (x, y), where H and W represent the height and width of the medical image, respectively, and I... max This represents the maximum grayscale value supported by the medical imaging system.

[0082] S12. Apply Gaussian filtering to medical image data I raw The gray value of each pixel in the image is weighted and averaged with its neighboring pixels. The filtering weights are calculated based on a two-dimensional Gaussian distribution function to obtain a noise-suppressed medical image.

[0083] S13. Standardize the gray values ​​of all pixels in the noise-suppressed medical image according to the difference between the minimum and maximum gray values, and convert it into a normalized medical image in the interval [0,1].

[0084] S14. Using a linear grayscale transformation method, the grayscale value of each pixel in the normalized medical image is increased by combining proportional scaling and constant offset to enhance the overall brightness and contrast of the medical image, resulting in a contrast-enhanced medical image I. pre Medical images with enhanced contrast I pre Used to improve the visibility of the boundary between lesion areas and background tissue in medical images.

[0085] In this embodiment, S2 includes the following steps:

[0086] S21. Medical image I with enhanced contrast pre A multi-scale Gaussian medical image sequence {G0, G1, ..., G...} is constructed using the initial input medical image. N}, where G0 = I pre For each scale of the Gaussian pyramid image G k By integrating the local edge gradient responses of medical images through guided Gaussian convolution for smoothing and downsampling, a next-level multi-scale Gaussian medical image G is generated. k+1 :

[0087]

[0088] Where ω(u,v) is the normalized two-dimensional Gaussian kernel, r represents the radius used for the Gaussian convolution kernel, and u and υ represent the offsets of the Gaussian convolution kernel in the horizontal and vertical directions, respectively. k For the image of the k-th level Gaussian pyramid, G k+1 (x,y) represents the pixel value at spatial location (x,y) in the Gaussian pyramid image at layer (k+1), λ is the edge enhancement factor, and E k (x,y) represents the edge gradient response intensity at pixel location (x,y) in a medical image at the current scale k:

[0089]

[0090] in, and The first-order gradient of medical images in the horizontal and vertical directions is used to highlight the gray-scale interface between the lesion edge and normal tissue.

[0091] S22. For each scale of the Gaussian pyramid image G k Upsampled medical images Up(G) k+1 A significance-guided difference operation was performed to obtain the high-frequency Laplacian medical image sublayer L. k The saliency-guided difference operation process involves fusing the saliency response map S of medical images. k Perform weight readjustment:

[0092] L k (x,y)=G k (x,y)-S k (x,y)·Up(G k+1 (x,y);

[0093] Significance response diagram S k (x,y)∈[0,1] represents the importance of the region at position (x,y) to the overall segmentation target. The saliency response is calculated by combining the lesion morphology, texture abnormalities, and structural asymmetry features in the medical image. It is used to enhance the layer response of the lesion region and suppress the influence of the background region.

[0094] S23. Repeat steps S21 and S22 to construct a complete multi-scale Laplacian pyramid medical image set.

[0095]

[0096] Among them, L N-1 For the (N-1)th high-frequency Laplacian medical image sublayer, G N This is the lowest-level Gaussian medical image.

[0097] In this embodiment, S3 includes the following steps:

[0098] S31. Medical image set of multi-scale Laplacian pyramid Each scale medical image sublayer L k and the lowest level global medical image G N Feature encoding is performed separately, using a scale-shared convolutional coding module F. conv Extract the local feature response of each medical image sublayer to obtain the initial encoded feature map F at each scale. k :

[0099]

[0100] Among them, F k (x,y) represents the feature response value of the initial encoded feature map at position (x,y) at scale k. C represents the k-th Laplacian medical image sublayer or the bottom-most global medical image of input medical image channel i. in Input the number of channels. The weight parameters b represent the weights of the scale k convolution kernel at position (u,v) in channel i. k σ represents the bias term, σ denotes the nonlinear activation function, and the kernel size is (2r+1)×(2r+1);

[0101] S32. Convert the initial encoded feature map F at each scale. k Its corresponding medical image saliency response map S k Perform pixel-wise weighted fusion to generate saliency-enhanced feature maps. Significance Enhancement Feature Map The augmentation value for each pixel in the initial encoded feature map F is the value of that pixel in the initial encoded feature map F. k The original values ​​and their corresponding positions in the medical image saliency response map S k The sum of the products of the response values, plus the result of scaling the original values ​​proportionally:

[0102]

[0103] Where γ is the significance enhancement coefficient, used to control the degree of enhancement of the characteristic response of the lesion area, and S k (x,y)∈[0,1] represents the saliency response value at pixel position (x,y) at scale k, which is used to highlight the lesion contour, edge abnormalities and texture discontinuities in medical images.

[0104] S33. Significance Enhancement Feature Maps at All Scales Dimensional unification and structural adjustment are performed. Through channel transformation and spatial alignment operations, feature maps of different scales are uniformly adjusted to a preset uniform resolution (H′, W′) and uniform number of channels C′, forming a standardized multi-scale feature representation set F. multi :

[0105]

[0106] Where φ(·) represents the composite transformation operation of upsampling, channel mapping, and feature normalization, H k With W k Let C be the spatial dimension of the original scale k. kHere, (H′, W′, C′) represents the number of channels, and (H′, W′, C′) represents the target spatial dimension and number of channels for uniform alignment.

[0107] In this embodiment, S4 includes the following steps:

[0108] S41. Input the standardized multi-scale feature representation set into the dynamic Transformer module, and then input the saliency enhancement feature map at each scale. The input feature sequence is flattened into a two-dimensional sequence representation. Where H′·W′ is the sequence length, and C′ is the channel dimension at each position;

[0109] S42. The image content-driven dynamic parameter generation module generates input feature sequences X for each scale. k Encoding processing is performed first on the input feature sequence X. k Perform global average pooling to obtain the statistical representation vector at scale k. The statistical representation vector μ k The input is fed into three multilayer perceptrons with shared structures but independent parameters, generating query weight matrices for the Transformer at that scale. Key weight matrix and value weight matrix

[0110] S43. Based on the query weight matrix Key weight matrix and value weight matrix For the input feature sequence X respectively k Perform matrix multiplication to obtain the query matrix Q at scale k. k Key matrix K k Sum matrix V k ;

[0111] S44. Calculate the attention weight matrix within the scale. Attention allocation is performed using a scaled dot product attention mechanism.

[0112] S45. Introduce a content-aware gating mechanism to dynamically adjust the attention distribution at the pixel level, based on the saliency response map S of the input medical image. k Construct pixel attention gating factor G k The pixel attention gating factor is then embedded into the attention-weighted output to obtain the dynamic attention output sequence Z. k :

[0113] Z k =(G k ⊙A k )·V k ;

[0114] Where ⊙ represents element-wise multiplication in row-wise broadcast, G k (i)=1+γ·S k (i) is used to enhance the dynamic response intensity of pixels in the lesion area during attention output;

[0115] S46. Dynamic attention output sequences Z at all scales k To perform scale-level fusion, a globally adaptive fusion weight α is introduced. k The global adaptive fusion weights are generated from the statistical features of the attention output at each scale, and are dynamically adjusted based on the response intensity of the lesion region at each scale.

[0116]

[0117] Among them, Z k Z represents the dynamic attention output sequence obtained after processing by the dynamic Transformer module at scale k. j The mean(Z) represents the dynamic attention output sequence obtained after processing by the dynamic Transformer module at scale j. k ) represents the dynamic attention output sequence Z k The global average pooling result, that is, the average value of the feature response of all spatial locations, is used to extract the main semantic features expressed by scale k in the whole image, reflecting the overall response intensity of the lesion area at that scale. w is the weight vector in the adaptive fusion function, and b is the bias term in the adaptive fusion function.

[0118] S47. According to the global adaptive fusion weight α k We perform a weighted summation of the dynamic outputs at all scales to obtain the fused global feature representation F. global .

[0119] In this embodiment, S5 includes the following steps:

[0120] S51. Represent the fused global features F global The input is fed into the decoding module, and the fused global feature representation F global Given a three-dimensional tensor of size H′×W′×d, the decoding module restores the spatial resolution step by step through layer-by-layer upsampling and deconvolution operations, constructing a sequence of decoding feature maps with progressively increasing resolution until the spatial resolution H×W is restored to the same as that of the original medical image. The number of channels and spatial size of each layer of the decoding feature map are adjusted sequentially according to the number of decoding layers, and finally a decoding output with the same spatial resolution as the original medical image is obtained.

[0121] S52. Introduce a skip connection mechanism during the decoding process to enhance the saliency of the feature map at multiple scales. The feature map with the same spatial resolution as the current decoding layer output resolution is spatially aligned through upsampling or convolution operations, and then concatenated with the current decoding feature map in the channel dimension to obtain a fused feature map. This is used to enhance the ability to preserve fine-grained structures and boundary features during the decoding process and to avoid the loss of lesion area information during upsampling.

[0122] S53. Perform channel mapping operation on the last layer of decoded feature map. Use a convolution kernel with the number of channels equal to the number of medical image segmentation categories to map the final decoded feature map into a preliminary medical image segmentation map. The spatial size of the preliminary medical image segmentation map is H×W. The number of output channels of each pixel is equal to the number of segmentation categories, which represents the probability distribution of the pixel belonging to each category. The probability distribution is processed by the Softmax normalization function so that the output of each pixel satisfies the condition that the sum of the categories is 1.

[0123] S54. Perform post-processing operations on the preliminary medical image segmentation map. The post-processing operations include morphological operations, edge restoration operations, and noise removal operations.

[0124] S55. Output the post-processed medical image segmentation result as the final medical image segmentation result. The final medical image segmentation result is a two-dimensional label map of size H×W, where each pixel corresponds to a unique medical image segmentation category.

[0125] In this embodiment, during morphological operations, structural elements are used to perform a combination of closing and opening operations, and the operation steps of first dilation and then erosion are executed. The closing operation is used to fill small holes in the lesion area, and the opening operation is used to remove small isolated artifacts, thereby enhancing the connectivity and integrity of the segmented area.

[0126] In the edge restoration operation, Gaussian filtering and curvature smoothing methods are used to adjust the edges of the segmented region to address the problems of jagged, discontinuous, or overly sharp boundaries in the preliminary medical image segmentation, making the segmented edges smoother and more natural.

[0127] In the noise removal process, by using region connectivity analysis and shape constraint judgment, false detection regions and isolated pixels in the background are automatically identified and removed, thereby optimizing the accuracy and stability of lesion regions in medical image segmentation results.

[0128] Example 1:

[0129] In this example, the neurosurgery department of a tertiary general hospital admitted a 56-year-old male patient who presented with recurrent headaches accompanied by blurred vision. His medical history showed that he had undergone meningioma resection five years prior. Upon admission, the doctors arranged for a head MRI to assess for potential tumor recurrence.

[0130] The radiology department acquired the patient's complete multimodal MRI data, including four sequences: T1, T1ce, T2, and FLAIR, with each sequence having an image resolution of 240×240×155, and uploaded it to the hospital's PACS system. Due to the blurred lesion boundaries and the presence of high-density vascular areas in the surrounding tissues, the preliminary segmentation results generated by the traditional U-Net model in the PACS showed blurred outlines of suspected lesion locations, making it difficult for doctors to clearly define the recurrence boundaries and posing a risk of residual tissue in the surgical area.

[0131] Subsequently, the hospital's intelligent image analysis platform automatically invoked the method of this invention for fine segmentation processing:

[0132] First, the system automatically acquires the input MRI images and performs image preprocessing, including noise suppression, grayscale normalization, and contrast enhancement. Taking the T1ce modality as an example, the system generates an image matrix I after preprocessing. pre The enhanced image showed that the edges of the lesions were significantly clearer than those in the original image.

[0133] The system initiated a multi-scale decomposition module based on the Laplacian pyramid. For this case image, a total of 5 image sub-layers were constructed, each layer retaining information at different spatial frequencies. The bottom Gaussian layer preserved the approximate shape of the tumor, while the high-frequency layer clearly showed the irregular enhancement at the edge of the suspected lesion.

[0134] Subsequently, the system enters the feature encoding stage. Each scale layer, through a saliency enhancement mechanism, is combined with the saliency response map S. k The system enhanced the expression of suspected recurrent lesions. In the second-layer sub-map, the system automatically detected patchy signal enhancement points located at the junction of the right frontoparietal lobe, with a significance response value of 0.89, while the average response of the background brain tissue was only 0.12.

[0135] The enhanced multi-scale features were fed into a dynamic Transformer module, which analyzed the feature distribution of the patient's image in real time, dynamically generated a weight matrix corresponding to each scale, and executed an attention-weighted mechanism. After dynamic adjustment, the right-sided suspected lesion region had the highest attention value in the fused feature map, reaching 0.93. This mechanism effectively suppressed false responses from the background sulci and venous sinus regions.

[0136] The system completed upsampling and decoding operations, injecting edge details from the multi-scale feature maps into the decoding network via skip connections, generating a medical image segmentation map with a spatial resolution of 240×240. In the preliminary segmentation map, a lesion with a volume of 5.6 cm was detected in the right frontal lobe region. 3 It has an irregular nodular shape with clear boundaries and continuous signal.

[0137] The system automatically performs morphological processing and edge smoothing filtering, performs closing operations on the lesion area to eliminate stray small points, performs boundary curvature filtering to eliminate segmentation artifacts, and removes isolated signal artifacts in the left occipital lobe.

[0138] Final segmentation result S final The system automatically overlays the segmentation map onto the original MRI image, generating a 3D visualization. After reviewing the image on a graphics workstation, the doctor confirmed that the system's segmentation results completely covered the clinically suspicious area, and the lesion's edge contour showed good consistency with the enhanced MRI, indicating a very high probability of tumor recurrence. Preoperative planning was recommended.

[0139] To verify the effectiveness of the method of this invention compared with traditional methods, the hospital retrospectively selected imaging data of 40 patients with frontal lobe gliomas (including 20 low-grade gliomas and 20 high-grade gliomas) from its imaging database over the past 6 months for comparative experiments. The comparison models included the traditional U-Net and the method of this invention (LP-DT), and the two were evaluated under the same training set and the same hardware (NVIDIA RTX 3090):

[0140] Table 1. Comparison of segmentation performance metrics between traditional U-Net and the proposed method (LP-DT)

[0141] Segmentation performance metrics U-Net (traditional method) The method of this invention (LP-DT) Dice coefficient (average) 0.841 0.893 HD95 boundary error (mm) 6.02 3.68 <![CDATA[Small lesion detection rate (<3 cm 3 )]]> 73.5% 91.2% Average number of mis-segmented regions 2.3 0.7 Reasoning time (per sheet) 0.94 seconds 1.31 seconds

[0142] Furthermore, in one patient sample with a frontal lobe tumor, conventional U-Net missed detecting a thin, elongated lesion (1.2 cm in volume) located behind the tumor and close to the cisterns. 3 The method of this invention accurately segments the region through a multi-scale saliency guidance mechanism and dynamic fusion with a dynamic Transformer. Doctors say that if this region is missed, it will directly affect the surgical margin.

[0143] As can be seen from Example 1, the method proposed in this invention can effectively adapt to complex lesion morphology and solve the problems of blurred boundaries and misidentification. It is suitable for medical image segmentation tasks in areas with complex structures and dense tissues, such as glioma, liver cancer, and pancreatic cancer, and has extremely high clinical practical value.

[0144] refer to Figure 2 As can be seen, the background in the image is the patient's actual brain MRI scan image with a resolution of 240×240. The grayscale distribution shows the characteristics of normal brain tissue images. The highlighted areas in the image represent the lesion areas automatically identified by the present invention after fusing the Laplacian pyramid with the dynamic Transformer module through multi-scale saliency guidance.

[0145] As shown in the figure, a patchy structure with continuous boundary and enhanced signal intensity is displayed in the right frontoparietal junction region. The system automatically detects and segments the lesion region. The outline of the region fits the actual enhanced edge of the tumor. The segmentation boundary is highly consistent with the results of manual annotation by medical experts. No extra false detection areas or background missegmentation are found, which fully demonstrates the effectiveness of the present invention in lesion boundary detection, fine-grained segmentation and morphology preservation.

[0146] The method of this invention enhances the response of the lesion region by using saliency map-guided Laplacian pyramid decomposition, and combines it with the image content-driven dynamic Transformer mechanism to achieve adaptive scale feature fusion of the input image, and finally obtain the medical image segmentation output as shown in the figure.

[0147] This invention introduces an edge response guidance and saliency response map control mechanism on the basis of the traditional Laplacian pyramid. It uses guided Gaussian convolution to perform edge-sensitive Gaussian blurring on the image, and enhances pixel-level differences by fusing saliency maps when constructing the Laplacian pyramid layer. This not only improves the response intensity of the lesion area, but also suppresses the interference information of the background area. It can enhance the expression of multi-scale high-frequency detail features while maintaining the global structural semantics, and is suitable for segmentation and modeling of lesion areas in multi-morphological, low-contrast medical images.

[0148] This invention combines an image content-driven mechanism with a Transformer structure. By statistically analyzing the global distribution of features at each scale, it dynamically generates query, key, and value weight matrices. This allows the Transformer's attention calculation to no longer rely on static parameters but to adjust in real time according to the image content. Combined with a content-aware gating mechanism and a saliency response map, it dynamically adjusts the attention output pixel by pixel in the spatial dimension, effectively improving the model's sensitivity to lesion boundaries, morphological changes, and heterogeneous regions. The dynamic Transformer module significantly enhances the segmentation model's adaptability to fine-grained structures in complex medical images, making up for the shortcomings of traditional attention mechanisms in modeling the joint dynamic relationship between space and scale.

[0149] This invention designs a progressive upsampling decoding network based on the fused global feature representation. Combined with the skip connection mechanism of multi-scale feature maps, it supplements detailed information during the decoding process, effectively avoiding semantic ambiguity and edge information loss during feature upsampling. In the output stage, a structured post-processing module is introduced, which uses morphological closing operations to enhance regional connectivity, edge repair filters to smooth the segmented contours, and performs regional connectivity detection to remove isolated artifacts. Finally, it generates medical image segmentation results with clear boundaries, coherent regions, and accurate semantics. The structure improves the practicality of the model in clinical applications and has significant advantages in processing images with blurred tumor boundaries and densely overlapping tissues.

[0150] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A medical image segmentation method based on Laplacian pyramid and dynamic Transformer, characterized in that, The method comprises the following steps: S1. Collecting an input medical image, pre-processing the medical image to form a pre-processed medical image; S2. performing multi-scale decomposition on the pre-processed medical image using a Laplacian pyramid, and decomposing the pre-processed medical image into a plurality of image sub-layers of different scales; S3. performing feature extraction on each scale of the image sub-layers, respectively, using a convolutional neural network to encode local features of each scale of the image sub-layers to generate corresponding multi-scale feature representations; S4. inputting the multi-scale feature representations into a dynamic Transformer module, dynamically weighting and fusing the features of each scale through a self-attention mechanism to generate a fused global feature representation; S5. performing decoding processing on the fused global feature representation, using up-sampling, deconvolution and jump connection techniques to map the fused global feature representation to the same spatial resolution as the original medical image, generate a preliminary segmentation map, and apply a post-processing algorithm to the preliminary segmentation map to perform morphological operations, edge repair and noise removal to obtain a medical image segmentation result with clear boundaries and coherent regions; The S4 comprises the following steps: S41. input the normalized multi-scale feature representation set into a dynamic Transformer module, and obtain a saliency enhanced feature map at each scale input feature sequence represented as a two-dimensional sequence wherein is the sequence length, is the channel dimension of each position; S42. The dynamic parameter generation module driven by image content generates an input feature sequence of each scale Performs encoding processing on the input feature sequence Executes a global average pooling operation to obtain a statistical representation vector of the scale The statistical representation vector is input into three multi-layer perception networks with shared structures but independent parameters to generate a query weight matrix , a key weight matrix and a value weight matrix of the Transformer at the scale, respectively;​ S43. Based on the query weight matrix Key weight matrix and value weight matrix For the input feature sequences respectively Perform matrix multiplication to obtain the scale. Query matrix below Key matrix Sum matrix ; S44. Compute attention weight matrix within the scale with scaled dot-product attention mechanism for attention assignment; S45. Introduce a content-aware gating mechanism to dynamically adjust the attention distribution at pixel level, according to the input medical image saliency response map , construct a pixel attention gating factor , and embed the pixel attention gating factor into the attention weighted output to obtain a dynamic attention output sequence : ; wherein, represents an element-wise multiplication broadcasted by row, , for enhancing the dynamic response strength of the pixels in the lesion area in the attention output, is a weight coefficient; S46. Dynamic attention output sequence of all scales Scale-level fusion is performed, and global adaptive fusion weights are introduced The global adaptive fusion weights are generated from the statistical features of the attention output at each scale, and the global adaptive fusion weights are dynamically adjusted according to the response intensity of the lesion region at each scale: ; wherein, denotes a scale denotes a dynamic attention output sequence obtained after processing by the dynamic Transformer module, denotes a scale denotes a dynamic attention output sequence obtained after processing by the dynamic Transformer module, denotes a global average pooling result of the dynamic attention output sequence , i.e., taking the mean of the feature responses of all spatial positions, for extracting a scale main semantic features expressed in the overall image, is a weight vector in the adaptive fusion function, is a bias term in the adaptive fusion function; S47. The global adaptive fusion weight is determined according to The dynamic outputs of all scales are weighted and summed to obtain the fused global feature representation .

2. The medical image segmentation method based on Laplacian pyramid and dynamic Transformer according to claim 1, characterized in that, The medical image is a CT image, an MRI image or an ultrasound image.

3. The medical image segmentation method based on Laplacian pyramid and dynamic Transformer according to claim 1, characterized in that, The S1 comprises the following steps: S11. Acquiring input medical image data , medical image data is a raw medical image matrix of two or three dimensional structure, containing a plurality of gray scale pixel value distribution, for representing the medical image intensity difference between the lesion region and normal tissue: ; wherein, represents a pixel gray value at a position , and respectively represent a height and a width of a medical image, is a maximum gray value supported by a medical image system; S12. Adopting Gaussian filtering operation to the gray value of each pixel point in the medical image data and its neighborhood pixels are weighted and averaged, the filtering weight is calculated according to the two-dimensional Gaussian distribution function, and a noise suppression medical image is obtained. S13. Normalize the gray scale values of all pixels in the noise suppressed medical image by the difference between the minimum and maximum gray scale values, converting to a normalized medical image in the interval [00008] S14. Adopting a linear gray scale transformation method, the gray scale value of each pixel in the normalized medical image is improved by a combination of scaling and constant offset to enhance the overall light and dark contrast of the medical image, and a medical image with enhanced contrast is obtained .

4. The medical image segmentation method based on Laplacian pyramid and dynamic Transformer according to claim 3, characterized in that, The S2 comprises the following steps: S21. the medical image after contrast enhancement constructing a multi-scale Gaussian medical image sequence as initial input medical image wherein for each scale Gaussian pyramid image by smoothing and down-sampling processing in a guided Gaussian convolution manner integrating local edge gradient responses of the medical image, generating a next level multi-scale Gaussian medical image : ; wherein, is a normalized two-dimensional Gaussian kernel, r represents a radius for the Gaussian convolution kernel, u and v represent an offset of the Gaussian convolution kernel in horizontal and vertical directions, respectively, is a Gaussian pyramid image of the first layer, is a Gaussian pyramid image of the first layer, is a pixel value of the Gaussian pyramid image in the first layer at a spatial position is a pixel value of the Gaussian pyramid image in the first layer at a spatial position is a pixel value of the Gaussian pyramid image in the first layer at a spatial position is an edge enhancement factor, represents a current scale is an edge gradient response intensity at a pixel position in the medical image. S22. For each scale Gaussian pyramid image with the up-sampled medical image perform a saliency guided difference operation to obtain a high frequency Laplacian medical image sub-layer The saliency guided difference operation process fuses the medical image saliency response map weight retuning: ; Significance response map represents the importance of the region at the location to the overall segmentation target; S23. Repeat performing steps S21 and S22 to build a complete multi-scale Laplacian pyramid medical image set : ; wherein, is the N-1th high frequency Laplacian medical image sub-layer, is the bottommost Gaussian medical image.

5. The medical image segmentation method based on Laplacian pyramid and dynamic Transformer according to claim 4, characterized in that, The S3 comprises the following steps: S31. Medical image set of multi-scale Laplacian pyramid Each scale medical image sublayer and the lowest level of global medical images Feature encoding is performed separately, using a scale-shared convolutional coding module. Extract the local feature responses of each medical image sublayer to obtain the initial encoded feature map at each scale. : ; wherein, represents a position of a feature response value of an initial encoding feature map at a scale represents an input medical image channel of a first layer Laplacian medical image sublayer or a bottommost layer global medical image, is an input channel number, represents a weight parameter of a convolution kernel at a position of a channel , is a bias term, represents a nonlinear activation function;​ S32. The initial encoding feature map under each scale is fused pixel by pixel The medical image saliency response map corresponding thereto Pixel by pixel weighted fusion is performed to generate a saliency enhanced feature map The saliency enhanced feature map The enhanced value of each pixel in the saliency enhanced feature map is the sum of the product of the original value of the pixel in the initial encoding feature map and the response value of the corresponding position in the medical image saliency response map, plus the scaled result of the original value itself ​​ S33. Significant enhanced feature maps at all scales Dimension unification and structure adjustment are performed, and different scale feature maps are uniformly adjusted to a preset unified resolution through channel transformation and spatial alignment operations to a unified channel number , forming a standardized multi-scale feature representation set : ; in, This represents a composite transformation operation involving upsampling, channel mapping, and feature normalization. and Original scale Spatial dimension, For the number of channels, To unify the target space dimension and number of channels for alignment.

6. The medical image segmentation method based on Laplacian pyramid and dynamic Transformer according to claim 1, characterized in that, The S5 comprises the following steps: S51. The fused global feature representation is input into a decoding module, the fused global feature representation is a three-dimensional tensor with a size of The decoding module recovers the spatial resolution layer by layer through upsampling and deconvolution operations, constructs a decoding feature map sequence with ascending resolution, and recovers to the same spatial resolution as the original medical image wherein the number of channels and spatial dimensions of each decoding feature map are adjusted according to the number of decoding layers, and a decoding output consistent with the spatial resolution of the original medical image is obtained. S52. Introduce a skip connection mechanism in the decoding process, and enhance the multi-scale saliency feature map The feature map with spatial resolution consistent with the current decoding layer output resolution is spatially aligned through upsampling or convolution operation, and then spliced with the current decoding feature map in the channel dimension to obtain a fused feature map; S53. Perform a channel mapping operation on the last layer of decoded feature maps, and map the final decoded feature maps to a preliminary medical image segmentation map using a convolution kernel with a number of channels equal to the number of segmentation categories of the medical image, the spatial size of the preliminary medical image segmentation map being , the number of output channels of each pixel point being equal to the number of segmentation categories, representing the probability distribution of the pixel belonging to each category, the probability distribution being processed by a Softmax normalization function, so that the output of each pixel satisfies the sum of categories being 1; S54. performing post-processing operations on the preliminary medical image segmentation map, the post-processing operations including morphological operations, edge repair operations and noise removal operations; S55. The post-processed medical image segmentation result is output as a final medical image segmentation result, which is a two-dimensional label map of size with each pixel corresponding to a unique medical image segmentation class.

7. The medical image segmentation method based on Laplacian pyramid and dynamic Transformer according to claim 6, characterized in that, In the morphological operation, a combination of closing operation and opening operation using a structural element is performed, and the operation steps of first expansion and then corrosion are performed, the closing operation is used to fill small holes in the lesion area, and the opening operation is used to remove small area isolated artifacts; In the edge repair operation, for the problems of boundary sawtooth, discontinuity or excessive sharpness in the preliminary medical image segmentation map, a Gaussian filter and curvature smoothing method are used to adjust the edges of the segmentation region; In the noise removal operation, through region connectivity analysis and shape constraint judgment, misdetected regions and isolated pixel points in the background are automatically identified and removed.