Image segmentation method for lung infection based on bidirectional guided multi-scale feature decoding

By employing a hierarchical Swin Transformer encoder and a progressive bidirectional guided multi-scale feature decoding strategy, the problems of insufficient multi-scale feature representation and inadequate boundary localization accuracy in lung infection image segmentation are solved, achieving high-precision lesion segmentation and real-time processing.

CN120707864BActive Publication Date: 2025-10-28HANGZHOU DIANZI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511204585.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-27
Publication Date
2025-10-28
Estimated Expiration
2045-08-27

AI Technical Summary

Technical Problem

Existing technologies for segmenting images of lung infections suffer from problems such as insufficient multi-scale feature representation, imperfect fusion of encoding and decoding features, lack of feature guidance mechanisms, and insufficient boundary localization accuracy, resulting in inconsistent segmentation results that are difficult to meet clinical needs.

Method used

By employing a hierarchical Swin Transformer encoder and a progressive bidirectional guided multi-scale feature decoding strategy, and through adaptive preprocessing, hierarchical feature encoding, progressive bidirectional guided feature fusion, and multi-scale decoding, accurate segmentation of lesions of different types and sizes can be achieved.

Benefits of technology

It improves segmentation accuracy and boundary localization accuracy, enhances the sensitivity of small-scale lesion detection, meets clinical diagnostic needs, and achieves real-time processing on standard GPUs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120707864B_ABST
    Figure CN120707864B_ABST
Patent Text Reader

Abstract

This invention discloses a lung infection image segmentation method based on bidirectional guided multi-scale feature decoding. The method first receives and preprocesses lung CT image data to generate standardized image data. Second, it performs hierarchical feature encoding on the standardized image data based on the Swin Transformer architecture to generate multi-scale feature representations. Finally, based on these multi-scale feature representations, a progressive bidirectional guided multi-scale feature decoding strategy is employed to achieve adaptive enhancement of encoded features, bidirectional guided fusion, and multi-scale decoding, generating a segmentation result map of lung infection lesions. This invention better handles lesions of different sizes and shapes, achieving accurate segmentation of different types of lesions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of medical image processing technology, and specifically relates to a lung infection image segmentation method based on bidirectional guided multi-scale feature decoding, which can accurately segment lesions in various lung infection images. Background Technology

[0002] Lung infections are a significant type of disease threatening human health, including pneumonia caused by various pathogens such as COVID-19, bacterial pneumonia, viral pneumonia, and fungal pneumonia. Chest CT imaging is an important tool for diagnosing lung infections, and accurate lesion segmentation is of great importance.

[0003] Currently, lesion segmentation in lung infection imaging relies primarily on doctors' subjective judgment and manual annotation, which presents significant problems. Manual segmentation is inefficient and cannot meet the needs of large-scale screening. It is highly subjective, with differing diagnostic criteria among doctors leading to inconsistent segmentation results. Furthermore, its accuracy is limited, easily resulting in omissions or misdiagnosis of early lesions or lesions with indistinct borders.

[0004] While existing deep learning-based medical image segmentation methods have alleviated the aforementioned problems to some extent, they still suffer from significant technical limitations. First, multi-scale feature representation is insufficient. Existing methods typically utilize only single-scale feature information, making it difficult to effectively handle the multi-scale characteristics of lung infection lesions and simultaneously and accurately segment minute ground-glass opacities and large areas of solidity. Second, the encoder-decoder feature fusion mechanism is imperfect. Traditional encoder-decoder structures lack effective utilization of the complementarity between encoded and decoded features, resulting in insufficient fusion of semantic and detail information. Third, feature guidance mechanisms are lacking. Existing methods lack effective feature guidance strategies and cannot fully leverage the synergistic effects between features at different levels. Finally, boundary localization accuracy is limited. Lung infection lesions typically exhibit blurred boundaries and low contrast with normal tissue; existing methods lack the ability to accurately locate lesion boundaries. Summary of the Invention

[0005] To address the aforementioned problems, the present invention aims to provide a lung infection image segmentation method based on bidirectional guided multi-scale feature decoding. This method employs a hierarchical shift window Transformer (Swin Transformer) encoder and, through an innovative bidirectional guided feature fusion mechanism and adaptive multi-scale decoding strategy, fully utilizes the complementarity of global and local features to effectively solve the segmentation difficulties caused by the multi-scale characteristics of lung infection lesions, achieving accurate segmentation of lesions of different types and sizes.

[0006] To achieve the above objectives, this invention provides an intelligent segmentation method for lung infection based on a bidirectional guided multi-scale feature decoding network, comprising the following steps:

[0007] Step 1: Medical Image Preprocessing and Standardization

[0008] It receives lung CT image data, performs adaptive preprocessing operations, and generates standardized image data suitable for deep learning model processing, providing high-quality input for subsequent feature extraction.

[0009] The preprocessing process includes: first, adaptive adjustment of window width and level to optimize the contrast between lung tissue and lesion areas; then, noise removal using an edge-preserving bilateral filtering algorithm to remove noise interference from CT scans; and finally, pixel value normalization and size standardization, with the pixel value normalization process mapping the HU value range to... Range and size standardization adjusts all images to a uniform pixel size, using bilinear interpolation to maintain image quality. This step outputs standardized image data. As input data for subsequent Transformer feature encoding.

[0010] Step 2: Hierarchical Swing Transformer Feature Encoding

[0011] Based on the Swing Transformer architecture, the standardized image data output from step one... Perform hierarchical feature encoding to generate multi-scale feature representations. .

[0012] The feature encoding process: input standardized image data... The image is segmented into non-overlapping patches, and each patch is mapped to a feature vector and input into the encoder through a linear embedding layer. The encoder contains four progressive downsampling stages, each consisting of consecutive Swing Transformer blocks, which generate four feature maps at different resolutions, resulting in a multi-scale feature representation. The feature dimensions increase layer by layer, while the resolution decreases layer by layer.

[0013] Step 3: Progressive bidirectional guided multi-scale feature decoding

[0014] Based on the coding features generated in step two This study employs a progressive, bidirectional guided, multi-scale feature decoding strategy. Through an iterative processing step from deep to shallow layers, it achieves adaptive enhancement, bidirectional guided fusion, and multi-scale decoding of encoded features, generating high-precision segmentation results for lung infection lesions. This strategy unifies the traditional independent enhancement, fusion, and decoding steps into a collaboratively optimized progressive processing flow.

[0015] 3.1 Deep Feature Decoding Initialization

[0016] Deepest encoded features As the starting feature for the entire progressive decoding process, cross-layer feature connections are first performed:

[0017]

[0018] in This indicates a 2x bilinear upsampling. This represents channel-dimensional concatenation. This cross-layer connection combines deep semantic information with shallow detail information, forming a fused feature containing multi-layered information. Subsequent feature enhancement yields enhanced encoded features:

[0019]

[0020] in This represents combination operations, including cascaded convolutions for extracting spatial features, batch normalization for stabilizing training processes, and linear rectified activation functions.

[0021] Enhanced coding features Directly input to the multi-scale decoder to generate initial decoding features This decoder employs a four-way parallel processing strategy to process feature information at different resolutions. The original resolution path directly processes the features. This preserves complete spatial detail. The 1 / 2 resolution path is processed using adaptive average pooling and a channel attention module.

[0022]

[0023] in For channel attention module, It is a 2×2 average pooling.

[0024] 1 / 4 resolution path via:

[0025]

[0026] Generate semantically rich feature representations that incorporate more semantic information while preserving important details.

[0027] 1 / 8 resolution path via:

[0028]

[0029] It provides high-level semantic guidance information to ensure the semantic consistency of the segmentation results. for Double downsampling. Each processing path is equipped with a channel attention module, which adaptively adjusts the importance of feature channels by learning the dependencies between channels.

[0030] The multi-scale feature aggregation stage adaptively fuses the four features to generate the initial decoded features. :

[0031]

[0032] in express Double bilinear upsampling. This step generates the initial decoded features. It contains rich multi-scale semantic information, providing high-quality starting features for subsequent progressive bidirectional iterative guided processing.

[0033] 3.2 Progressive bidirectional guided iterative processing

[0034] For hierarchical indexes The process proceeds progressively from deep to shallow layers, with each processing cycle comprising three collaboratively optimized sub-processes: guided multi-scale feature enhancement, bidirectional guided feature fusion, and multi-scale feature decoding and segmentation output.

[0035] 3.2.1 Guided Multi-Scale Feature Enhancement

[0036] Decoding features based on the current level Generate spatial guidance signals to encode shallow features. Perform adaptive enhancement.

[0037] Decoding features go through Generate guiding weights by utilizing the spatial distribution characteristics of the current layer's decoded features. This space guidance signal It can highlight the spatial area related to the lesion and suppress background interference from normal tissue.

[0038] Connect and fuse deep semantic information with shallow detailed information:

[0039]

[0040] In particular, when hour, This cross-layer connection combines deep semantic information with shallow detailed information to form a fusion feature containing multi-layered information.

[0041] Spatial guidance signals are used to differentially enhance connectivity features, generating enhanced coded features. :

[0042]

[0043] in Represents element-wise multiplication, spatial guidance signal As spatial attention weights, they enable differentiated enhancement of features at different spatial locations. Residual connections ensure the integrity of feature information and prevent the gradient vanishing problem in deep networks.

[0044] 3.2.2 Bidirectional Guided Feature Fusion

[0045] The bidirectional guidance mechanism first performs adaptive gating enhancement on the enhanced encoded features. Feature importance weights are generated through a multi-head attention gating mechanism, and then the gating operation is performed:

[0046]

[0047]

[0048] in Ensure the stability of feature distribution. Transform the complex relationships between learned features This represents the activation function. This indicates that the gating mechanism enables adaptive selection and enhancement of encoded features.

[0049] Cross-guidance is the core technology of bidirectional fusion. This mechanism uses enhanced encoded features to guide the update process of decoded features:

[0050]

[0051] in This is a multi-head attention mechanism, with 8 attention heads. The decoded features are used as... Encoding features as and This enables dynamic querying and retrieval of relevant information from encoded features using decoded features.

[0052] Feature fusion employs a learned adaptive weighting strategy, followed by weighted fusion:

[0053]

[0054]

[0055] in This is a global average pooling approach. Compared to fixed-weight fusion, this strategy learns adaptive weights to dynamically balance the contributions of encoded and decoded features, achieving optimal feature combinations in different regions.

[0056] Finally, the fused features are further optimized using a channel-space dual attention mechanism:

[0057]

[0058]

[0059]

[0060] in For global max pooling, This indicates that it is achieved through a 7×7 convolution.

[0061] 3.2.3 Multi-scale feature decoding and segmentation output

[0062] Based on generated fusion features Directly input into the multi-scale decoder to generate decoding features .

[0063] As can be seen from the preceding steps, decoding features A bidirectional guided feature fusion process operating at different levels, based on decoded features Generated space guidance signal This then applies to the guided multi-scale feature enhancement process at different levels. From the initial decoded features... Initially, the final decoded features are generated in a layer-by-layer manner. Decoding features pass Activation mapping generates the final segmentation result. The segmentation results accurately identified the spatial distribution and boundary contours of lung infection lesions.

[0064] The beneficial effects of the present invention are as follows:

[0065] By leveraging the complementarity of encoded and decoded features through a bidirectional guided feature fusion mechanism, segmentation accuracy is improved by 8-15% compared to traditional unidirectional feature transfer methods. The hierarchical Transformer encoder effectively establishes long-distance dependencies, better handling lesions of different sizes and shapes, and improving the detection sensitivity for small-scale lesions by over 20%. A multi-scale parallel decoding strategy achieves accurate segmentation of different lesion types, with segmentation accuracy exceeding 90% for various lesion types such as ground-glass opacities and consolidation. Guided enhancement mechanisms and dual attention optimization significantly improve boundary localization accuracy, increasing the boundary IoU index by 12%, meeting the needs of accurate clinical diagnosis. The algorithm processes a single image in approximately 2 seconds on a standard GPU, meeting real-time clinical processing requirements and demonstrating good deployment feasibility. Attached Figure Description

[0066] Figure 1 This is a schematic diagram of the structure of the present invention;

[0067] Figure 2 To guide the multi-scale feature enhancement module;

[0068] Figure 3To guide the feature fusion module;

[0069] Figure 4 This is a multi-scale feature decoding module. Detailed Implementation

[0070] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0071] A lung infection image segmentation method based on bidirectional guided multi-scale feature decoding, such as Figure 1 As shown, the process includes the following:

[0072] Example 1: Specific Implementation of Hierarchical Transformer Feature Encoding

[0073] It receives lung CT image data, performs adaptive preprocessing operations, and generates standardized image data suitable for deep learning model processing, providing high-quality input for subsequent feature extraction.

[0074] The preprocessing process first performs adaptive window width and level adjustment. Based on the distribution characteristics of HU (Huntersfield units) values ​​in lung tissue, the window width is dynamically set to 1500 HU and the window level to -600 HU to optimize the contrast between lung tissue and lesion areas. Then, noise removal is performed using an edge-preserving bilateral filtering algorithm to remove noise interference from the CT scan. The filtering parameters are as follows: While removing noise, the clarity of the lesion boundary is maintained.

[0075] The pixel value normalization process maps the HU value range to The normalization formula for the interval is:

[0076]

[0077] in The original HU value, These are the normalized pixel values. Size normalization resizes all images to 512×512 pixels, using bilinear interpolation to maintain image quality. This step outputs normalized image data. As input data for subsequent Transformer feature encoding.

[0078] This embodiment details the technical implementation of Transformer feature encoding. A pre-trained SwingTransformer-Base network is used as the encoder backbone, and a transfer learning strategy is employed to adapt it to the medical imaging domain. The encoder input is a standardized CT image of 512×512×3, and the output is a four-level feature representation.

[0079] The image patch embedding stage segments the input image into 4×4 non-overlapping patches, and each patch is mapped to a 96-dimensional feature vector through a linear embedding layer. Location encoding employs a learnable two-dimensional location embedding, assigning a unique location identifier to each patch location.

[0080] The first stage contains two Swin Transformer Blocks, processing a 128×128×96 feature map. The second to fourth stages achieve downsampling and feature dimension expansion through patch merging. Patch merging combines adjacent 2×2 patches into a single patch, while simultaneously expanding the feature dimension to twice its original size using linear layers. The number of blocks in each stage is as follows: The feature dimension is .

[0081] Based on the Swing Transformer architecture, the standardized image data output from step one... Perform hierarchical feature encoding to generate multi-scale feature representations. The details are as follows:

[0082] The feature encoding process first inputs the image The image is divided into 4×4 non-overlapping patches, and each patch is mapped to a linear embedding layer. The encoder takes 1-dimensional feature vectors as input. The encoder consists of four progressive downsampling stages, each composed of consecutive Swing Transformer blocks.

[0083] The first stage generates a feature map F1 with a resolution of 128×128 and a feature dimension of 96. The second stage reduces the resolution to 64×64 and increases the feature dimension to 192 through a patching and merging operation, generating the new feature map. The third stage involves further downsampling to a 32×32 resolution, with a feature dimension of 384, outputting a feature map. The fourth stage generates the deepest feature map with a resolution of 16×16 and a dimension of 768. .

[0084] Each Swin Transformer block employs a shift window mechanism, with a window size of 7×7 and attention heads of {3, 6, 12, 24}. The shift window mechanism achieves cross-window information interaction through a (3, 3) shift operation, moving the window 3 pixels to the lower right. The multilayer perceptron uses the GELU activation function, and the hidden layer dimension is four times the input dimension.

[0085] The multi-scale feature representation output by this step It contains hierarchical information ranging from detailed textures to high-level semantics, with feature dimensions increasing layer by layer and resolution decreasing layer by layer, providing basic data for subsequent guided multi-scale feature enhancement.

[0086] Example 2: Technical Implementation of Guided Multi-Scale Feature Enhancement

[0087] Combine Figure 2 This embodiment illustrates the detailed implementation process of the guidance enhancement module. This module achieves iterative feature enhancement through a cyclic guidance mechanism, which is one of the core innovations of this invention.

[0088] Based on the coding features generated in step two This study employs a progressive, bidirectional guided, multi-scale feature decoding strategy. Through an iterative processing step from deep to shallow layers, it achieves adaptive enhancement, bidirectional guided fusion, and multi-scale decoding of encoded features, generating high-precision segmentation results for lung infection lesions. This strategy unifies the traditional independent enhancement, fusion, and decoding steps into a collaboratively optimized progressive processing flow.

[0089] 3.1 Deep Feature Decoding Initialization

[0090] Deepest encoded features As the starting feature for the entire progressive decoding process, cross-layer feature connections are first performed:

[0091]

[0092] in This indicates a 2x bilinear upsampling. This represents channel-dimensional concatenation. This cross-layer connection combines deep semantic information with shallow detail information, forming a fused feature containing multi-layered information. Subsequent feature enhancement yields enhanced encoded features:

[0093]

[0094] in This represents a combination of operations, including convolution to extract spatial features, batch normalization to stabilize the training process, and linear rectified activation functions.

[0095] Enhanced coding features Directly input to the multi-scale decoder to generate initial decoding features This decoder employs a four-way parallel processing strategy to process feature information at different resolutions. The original resolution path directly processes the features. This preserves complete spatial detail. The 1 / 2 resolution path is processed using adaptive average pooling and a channel attention module.

[0096]

[0097] in For channel attention module, It is a 2×2 average pooling.

[0098] 1 / 4 resolution path via:

[0099]

[0100] Generate semantically rich feature representations that incorporate more semantic information while preserving important details.

[0101] 1 / 8 resolution path via:

[0102]

[0103] It provides high-level semantic guidance information to ensure the semantic consistency of the segmentation results. for Double downsampling. Each processing path is equipped with a channel attention module, which adaptively adjusts the importance of feature channels by learning the dependencies between channels.

[0104] The multi-scale feature aggregation stage adaptively fuses the four features to generate the initial decoded features. :

[0105]

[0106] in express Double bilinear upsampling. This step generates the initial decoded features. It contains rich multi-scale semantic information, providing high-quality starting features for subsequent progressive bidirectional iterative guided processing.

[0107] For hierarchical indexes The process proceeds progressively from deep to shallow layers, with each processing cycle comprising three collaboratively optimized sub-processes: guided multi-scale feature enhancement, bidirectional guided feature fusion, and multi-scale feature decoding and segmentation output.

[0108] Decoding features based on the current level Generate spatial guidance signals to encode shallow features. Perform adaptive enhancement.

[0109] Generate guiding weights using the spatial distribution characteristics of the decoded features of the current layer:

[0110]

[0111] This space guidance signal It can highlight the spatial area related to the lesion and suppress background interference from normal tissue.

[0112] Connect and fuse deep semantic information with shallow detailed information:

[0113]

[0114] In particular, when hour, This cross-layer connection combines deep semantic information with shallow detailed information to form a fusion feature containing multi-layered information.

[0115] Spatial guidance signals are used to differentially enhance connectivity features, generating enhanced coded features. :

[0116]

[0117] in Represents element-wise multiplication, spatial guidance signal As spatial attention weights, they enable differentiated enhancement of features at different spatial locations. Residual connections ensure the integrity of feature information and prevent the gradient vanishing problem in deep networks.

[0118] Module receives encoder features and the guide signal fed back by the decoder As input, the generation process of the guiding signal adopts an adaptive threshold strategy, dynamically adjusting the generation parameters of the saliency map according to the statistical characteristics of different levels of features.

[0119] In the cross-layer feature connection process, a channel attention-weighted feature alignment strategy is adopted to ensure the consistency of feature dimensions. For the first layer... Layer feature connections:

[0120]

[0121] The saliency map generation employs a multi-scale fusion strategy to improve guidance accuracy. For decoded features... First, generate saliency maps at three different scales:

[0122] Original scale:

[0123] Downsampling scale:

[0124]

[0125] Upsampling scale:

[0126] The final saliency map is generated through weighted fusion:

[0127]

[0128] Among them, weight Acquired through learning.

[0129] The feature enhancement process incorporates a residual dense connection mechanism to improve feature propagation performance.

[0130]

[0131] This dense connection design enables better gradient propagation and improves training stability.

[0132] Example 3: Innovative Implementation of Guided Feature Fusion

[0133] Combine Figure 3 This embodiment details the technical implementation of bidirectional guided fusion. This module employs an attention-oriented feature interaction mechanism to achieve deep fusion of encoded and decoded features.

[0134] Adaptive gating enhancement employs a multi-layer gating strategy to improve feature selection accuracy. The first layer of gating is based on global feature statistics.

[0135]

[0136] The second-layer gating is based on local feature distribution:

[0137]

[0138] The final gating weights are:

[0139]

[0140] Cross-guidance is the core technology of bidirectional guidance. This mechanism uses enhanced encoded features to guide the update process of decoded features:

[0141]

[0142] in, For multi-head attention, this mechanism divides the feature space into multiple subspaces, with each attention head focusing on different feature aspects. and They represent , They come from the decoding features respectively. and coding features This design allows decoded features to query relevant information within encoded features. The number of attention heads is set to 8, with each head having a dimension that is 1 / 8 of the total dimension, thus controlling computational complexity while maintaining expressive power. Through this cross-attention mechanism, decoded features can obtain rich semantic information from encoded features, while encoded features can also adaptively adjust according to the needs of the decoding task.

[0143] The learning-based weighted fusion strategy replaces simple linear combination with an attention-weighted mechanism. Feature fusion employs a learning-based adaptive weighting strategy, followed by weighted fusion:

[0144]

[0145]

[0146] in This is a global average pooling approach. Compared to fixed-weight fusion, this strategy learns adaptive weights to dynamically balance the contributions of encoded and decoded features, achieving optimal feature combinations in different regions.

[0147] Finally, the fused features are further optimized using a channel-space dual attention mechanism:

[0148]

[0149]

[0150]

[0151] in For global max pooling, This indicates that it is achieved through a 7×7 convolution.

[0152] This serialization design can better model the dependencies between features compared to parallel processing.

[0153] Example 4: Parallel Implementation of Multi-Scale Feature Decoding

[0154] Combine Figure 4 This embodiment illustrates the specific implementation of multi-scale decoding. This module adopts an adaptive scale selection strategy, dynamically adjusting the contribution weight of each scale based on the feature content.

[0155] Based on generated fusion features Directly input into the multi-scale decoder to generate decoding features Similarly, the original resolution path directly processes features. To preserve complete spatial detail information. The processing procedures for 1 / 2 resolution paths, 1 / 4 resolution paths, and 1 / 8 resolution paths are as follows:

[0156]

[0157]

[0158]

[0159] The feature aggregation stage adaptively fuses multi-scale features to generate decoded features. :

[0160]

[0161] This multi-scale aggregation mechanism can simultaneously leverage the advantages of features at different resolutions, preserving fine boundary details while incorporating rich semantic information.

[0162] As can be seen from the preceding steps, decoding features A bidirectional guided feature fusion process operating at different levels, based on decoded features Generated space guidance signal This then applies to the guided multi-scale feature enhancement process at different levels. From the initial decoded features... Initially, the final decoded features are generated in a layer-by-layer manner. Decoding features pass Activation mapping generates the final segmentation mask. The segmentation results accurately identified the spatial distribution and boundary contours of lung infection lesions.

[0163] Example 5: Loss Function Design and System Verification

[0164] This embodiment details the loss function design and system performance verification.

[0165] The loss function uses an adaptive weighted combination of four loss terms:

[0166] Improved Focal loss:

[0167]

[0168] in The category weights are dynamically adjusted based on the category frequency. This represents the predicted probability of the target category. This is a focusing parameter used to adjust the weights of easy and difficult samples.

[0169] Generalized Dice loss:

[0170]

[0171] in, For category weights, For the first The real label of each pixel For the first The prediction result for each pixel. For intersection, Indicate quantity, For smoothing parameters.

[0172] Boundary-aware loss:

[0173]

[0174] in Represents the gradient operator. For the true segmentation mask, To predict the segmentation mask, Denotes the square of the L2 norm. These are the weighting coefficients. The binary cross-entropy loss function is... This indicates a boundary extraction operation.

[0175] Loss of deep supervision:

[0176]

[0177] in Indicates the Layer weight coefficients, Indicates the Layer space saliency map.

[0178] The total loss is:

[0179]

[0180] Weight Determined through grid search.

[0181] System validation used a multi-center dataset containing 5000 CT images of lung infections, covering four infection types: pneumonia caused by SARS-CoV-2, bacterial pneumonia, viral pneumonia, and fungal pneumonia. The training set consisted of 3500 images, the validation set of 750 images, and the test set of 750 images. Evaluation metrics included region overlap accuracy (Dice, IoU) and boundary localization accuracy (HD95, ASD). Dice measures the degree of overlap between the predicted and ground truth regions; IoU is the intersection-to-union ratio, representing the ratio of the intersection to the union of the predicted and ground truth regions; HD95 is the 95th percentile Hausdorff distance, representing the 95th percentile of the distance between the predicted and ground truth boundaries; and ASD is the average surface distance, representing the average distance from all points on the predicted boundary to the ground truth boundary.

[0182] Table 1. Segmentation Performance Comparison

[0183]

[0184] Table 2. Segmentation results of different lung infection types according to the present invention.

[0185]

[0186] Table 3 Computational efficiency analysis of the present invention

[0187]

[0188] The experimental results are shown in Tables 1, 2, and 3. The results demonstrate that the method described in this invention significantly outperforms existing methods in key metrics such as Dice coefficient, IoU, and boundary accuracy. The bidirectional guidance mechanism improves segmentation accuracy by 5.6% and boundary localization accuracy by 25% compared to the basic Swin-UNet. The multi-scale decoding strategy improves the sensitivity of small-scale lesion detection by 18%, meeting the needs of accurate clinical diagnosis. The system's processing speed on a standard GPU meets real-time requirements, demonstrating good feasibility for clinical deployment.

[0189] Through systematic experimental verification, the technological advancement and practicality of this invention in the intelligent segmentation of lung infections have been fully demonstrated, providing an effective technical solution for medical image segmentation.

Claims

1. A lung infection image segmentation method based on bidirectional guided multi-scale feature decoding, characterized in that, Includes the following steps: Step 1: Receive lung CT image data and preprocess it to generate standardized image data; Step 2: Based on the Swing Transformer architecture, hierarchical feature encoding is performed on the standardized image data to generate multi-scale feature representations; Step 3: Based on multi-scale feature representation, a progressive bidirectional guided multi-scale feature decoding strategy is adopted to achieve adaptive enhancement of encoded features, bidirectional guided fusion, and multi-scale decoding, generating a segmentation result map of lung infection lesions. The specific implementation process is as follows: Step 3.1 Deep Feature Decoding Initialization: Initialize the features As the starting feature of the entire progressive decoding process, enhanced features are obtained through feature enhancement, which are then used by a multi-scale decoder to generate the initial decoding features. , Step 3.2 Based on initial decoding features The process sequentially executes a progressive, bidirectional guided iterative process from deep to shallow layers. Each processing cycle includes three collaboratively optimized sub-processes: guided multi-scale feature enhancement, bidirectional guided feature fusion, and multi-scale feature decoding and segmentation output, generating the final decoded features. Decoding features pass Activation mapping generates the final segmentation result. The segmentation results identified the spatial distribution and boundary contours of the lung infection lesions; The progressive bidirectional guided iterative processing is specifically implemented as follows: Step 3.2.1 Guided Multi-Scale Feature Enhancement: For Hierarchical Indexes Based on the decoding features of the current level Generate spatial guidance signals for coded features Perform adaptive enhancement to generate enhanced coding features ; Step 3.2.2 Bidirectional Guided Feature Fusion: First, enhance the encoded features... Adaptive gating enhancement is performed, then the enhanced encoded features are used to guide the update process of the decoded features through a cross-guiding mechanism. A learning-based adaptive weighting strategy is employed for feature fusion, and finally, the fused features are optimized through a channel-space dual attention mechanism to obtain the optimized features. ; Step 3.2.3 Multi-scale feature decoding and segmentation output: feature-based Directly input into the multi-scale decoder to generate decoding features ; Decoding features A bidirectional guided feature fusion process operating at different levels, based on decoded features Generated space guidance signal This then acts on the multi-scale feature enhancement process at different levels; From initial decoded features Initially, the final decoded features are generated in a layer-by-layer manner. ; Decoding features pass Activation mapping generates the final segmentation result. The segmentation results identified the spatial distribution and boundary contours of lung infection lesions.

2. The lung infection image segmentation method based on bidirectional guided multi-scale feature decoding according to claim 1, characterized in that, The preprocessing specifically involves: first, adaptive adjustment of window width and level to optimize the contrast between lung tissue and lesion areas; then, noise removal using an edge-preserving bilateral filtering algorithm to remove noise interference from CT scans; and finally, pixel value normalization and size standardization, with the pixel value normalization process mapping the HU value range to... The range and size standardization adjust all images to uniform pixels, and bilinear interpolation is used to maintain image quality.

3. The lung infection image segmentation method based on bidirectional guided multi-scale feature decoding according to claim 1, characterized in that, Step two is specifically implemented as follows: input standardized image data The image is segmented into non-overlapping patches, and each patch is mapped to a feature vector and input into the encoder through a linear embedding layer. The encoder contains four progressive downsampling stages, each consisting of consecutive Swing Transformer blocks, which generate four feature maps at different resolutions, resulting in a multi-scale feature representation. The feature dimensions increase layer by layer, while the resolution decreases layer by layer.

4. The lung infection image segmentation method based on bidirectional guided multi-scale feature decoding according to claim 3, characterized in that, The generation of initial decoding features The specific process is as follows: Features As the starting feature of the entire progressive decoding process, cross-layer feature concatenation is first performed to connect the features. Compared with 2x bilinear upsampling By splicing the data, a fused feature containing multi-level information is obtained. Then the features go through Combinatorial operations and features Perform residual connections to complete feature enhancement and obtain enhanced encoded features. The Combination operations include cascaded convolutions for extracting spatial features, batch normalization, and linear rectified activation functions; Enhanced coding features Directly input to the multi-scale decoder to generate initial decoding features This multi-scale decoder employs a four-way parallel processing strategy to process feature information at different resolutions, as detailed below: Original resolution path directly processes features ; 1 / 2 resolution path through After undergoing adaptive average pooling and channel attention modules Processing to obtain features ; 1 / 4 resolution path via: After 2x downsampling and Element-wise addition, followed by adaptive average pooling and channel attention modules. Processing to obtain features ; 1 / 8 resolution path via: After 2x downsampling and Element-wise addition, followed by adaptive average pooling and channel attention modules. Processing to obtain features ; The multi-scale feature aggregation stage will combine four features , , , After corresponding bilinear upsampling, element-wise addition is performed to complete adaptive fusion and generate initial decoding features. .

5. The lung infection image segmentation method based on bidirectional guided multi-scale feature decoding according to claim 4, characterized in that, The adaptive enhancement described in step 3.2.1 is specifically implemented as follows: Utilizing the spatial distribution characteristics of the current layer's decoded features, go through Combining operations to generate guiding weights ; Through the Perform upsampling and Concatenation involves connecting and fusing deep semantic information with shallow detail information to obtain features. , and when hour, ; Will go through After the combined operation and Perform element-wise multiplication, then connect the residuals to the input. Element-wise addition is performed, and spatially guided signals are used to differentially enhance the connectivity features, generating enhanced coded features. .

6. The lung infection image segmentation method based on bidirectional guided multi-scale feature decoding according to claim 5, characterized in that, The bidirectional guided feature fusion described in step 3.2.2 is specifically implemented as follows: The bidirectional guidance mechanism first enhances the coding features. Execute adaptive gating enhancements: Enhance coding features Through normalization layer, linear layer and To achieve adaptive selection and enhancement of encoded features through a gating mechanism, the gating mechanism is then used to process the features... and Element-wise multiplication is performed, and finally, the input is augmented and encoded features are obtained through residual connections. Adding them together gives ; The enhanced encoded features are used to guide the update process of the decoded features through a cross-guiding mechanism. Specifically, this involves... The bond was obtained after calculation through two linear layers. Sum :feature The query is obtained after the linear layer. Output after multi-head attention mechanism ; Feature fusion is performed using a learning-based adaptive weighting strategy: and After being subjected to two separate global average pooling operations, the results are summed, and then... The function outputs the score. ;at last and Multiply element by element and add and The result of element-wise multiplication yields the fusion feature. ; Finally, the fused features are optimized using a channel-space dual attention mechanism: fused features After linear layer and After the activation function, the linear mapping and... Function output characteristics ; Global max pooling and global average pooling are performed separately, then concatenated, followed by convolution. Function output characteristics ;at last , , The three are multiplied element-wise, and then added from the residual join. , to obtain optimized features .

Citation Information

Patent Citations

  • Lung CT image segmentation method based on mixed Swin Transform U-Net

    CN117274147A

  • Insulator fault detection method based on multi-scale expansion and perception codec

    CN118657716A