Research on lung nodule segmentation algorithm based on GAEU-Net
By using an improved GAEU-Net network, combined with multi-module collaborative design and hybrid loss functions, the problems of blurred edges, irregular shapes, and class imbalance in lung nodule segmentation are solved, achieving high-precision lung nodule segmentation and boundary restoration, which is suitable for early lung cancer screening and diagnostic support systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HEBEI UNIV OF TECH
- Filing Date
- 2026-03-12
- Publication Date
- 2026-06-12
Smart Images

Figure CN122199964A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical image processing technology, and in particular to an automatic segmentation method and system for lung nodule CT images based on deep learning. It involves convolutional neural networks, residual learning, Transformer modeling, attention mechanisms, multi-scale feature fusion and high-resolution reconstruction technology, which is suitable for the accurate identification, segmentation and auxiliary diagnosis of nodules in lung CT images. Background Technology
[0002] Lung cancer, with its high incidence and mortality rates, has become a serious global public health challenge, with its five-year survival rate still hovering around 19%. This situation highlights the importance of early screening and accurate diagnosis in improving patient survival outcomes and reducing the risk of death. Lung nodules, as a major early imaging manifestation of lung cancer, have received significant attention for their dynamic changes. However, in clinical practice, the segmentation and detection of lung nodules still mainly rely on manual image interpretation by radiologists. This is not only time-consuming and labor-intensive but also susceptible to visual fatigue and differences in experience, leading to the risk of missed detections and misdiagnosis.
[0003] Traditional lung nodule segmentation methods are mainly based on shallow image features, including thresholding, edge detection, region growing, and morphological processing. While these methods have an intuitive theoretical basis, they rely too heavily on manually designed feature extraction operators and lack adaptability. For small nodules, nodules with strong morphological heterogeneity, and nodule regions with blurred boundaries, the segmentation accuracy is limited, and they are prone to missed detections and boundary deviations.
[0004] In recent years, deep learning methods have made significant progress in lung nodule segmentation, including convolutional neural networks (CNNs), fully convolutional networks (FCNs), U-Net, and its improved versions. U-Net, through its symmetric encoder-decoder structure and skip connections, fuses deep semantic information with shallow high-resolution features, effectively improving the segmentation of blurred boundaries and becoming a benchmark model for medical image segmentation. Improved methods based on U-Net (such as UNet++, UNet3+, and Wavelet U-Net++) further enhance the model's ability to resolve fine-grained structures through multi-scale feature fusion, dense skip connections, and multi-directional wavelet feature enhancement. Meanwhile, the introduction of attention mechanisms, dilated convolutions, ASPP modules, and visual Transformers provides effective means to capture long-range dependencies and enhance contextual information.
[0005] Nevertheless, existing methods still have several problems in handling lung nodule segmentation: (1) The downsampling process leads to the loss of edge information; (2) The localization of micronodules and low-contrast lesions is not accurate enough; (3) Uneven category distribution leads to unstable segmentation results; (4) The shallow backbone network of U-Net may introduce redundant noise, which limits the feature extraction depth and segmentation accuracy.
[0006] To address the aforementioned issues, this invention proposes an improved lung nodule image segmentation method—GAEU-Net. By introducing a multi-module collaborative design onto the residual U-Net backbone, it achieves multi-scale perception and global modeling. Simultaneously, by combining PixelTransformer, a dynamic feature selection module, an MSCA attention mechanism, and improved ASPP and PixelShuffle upsampling modules, it enhances the ability to capture lung nodule edges and detailed features. Furthermore, by employing a hybrid loss function, it effectively addresses class imbalance and boundary ambiguity issues, thereby improving the reliability and detail recovery capabilities of lung nodule segmentation. This method can be applied to early lung cancer screening and diagnostic support systems. Summary of the Invention
[0007] The purpose of this invention is to propose a Global Awareness Enhancement Network (GAEU-Net) based on the residual U-Net backbone. By introducing Pixel Transformer, dynamic feature selection module, multi-branch cross-attention mechanism (MSCA) and improved multi-scale feature fusion module, it can achieve automatic segmentation of pulmonary nodule CT images, solve the problems of blurred nodule edges, irregular shape, easy omission of small targets and class imbalance in the existing technology, and significantly improve segmentation accuracy, boundary recovery ability and model robustness.
[0008] To achieve the above objectives, the technical solution adopted by the present invention is as follows: A study on a lung nodule segmentation algorithm based on GAEU-Net, the steps of which are as follows: Step 1: Data preprocessing. The CT images of lung nodules are cropped to obtain two-dimensional image patches suitable for network training and testing. Step 2: Construct a GAEU-Net network based on a residual encoder, and design an improved generative network GAEU-Net, including a residual encoder, a Pixel Transformer module, a dynamic feature selection module, an MSCA attention mechanism, and an improved multi-scale feature fusion module (SE-ASPP + ESPCN upsampling). This network can extract multi-scale semantic features of lung nodules and enhance edge and detail information, thereby improving segmentation accuracy. Step 3: Constructing a hybrid loss function and evaluation metrics. To address the issues of extremely small proportions of lung nodules in CT images and class imbalance, this invention introduces a hybrid optimization strategy of Dice loss and binary cross-entropy (BCE) loss during model training. Simultaneously, five evaluation metrics are used to comprehensively measure model performance. Through this step, the model can focus on pixel-level accuracy in small foreground target regions while also considering global region overlap, thereby improving the stability and accuracy of lung nodule segmentation. Step 4: Train the GAEU-Net model constructed in Step 2 to obtain lung nodule segmentation results, and verify the model performance using the indicator system in Step 3.
[0009] 1. The specific process in step 1 is as follows: 1) Extract the center location of nodules within the lung parenchyma from the annotation results; 2) Cropping yields a 2D image patch with a size of 128×128, and foreground-free images are removed; 3) The cropped image patches and their corresponding labeled masks are used to form training and testing sample sets, generating a total of 18,620 samples, including 12,440 training images, 3,110 validation images, and 3,110 test images. 4) To make full use of the annotation information of multiple doctors, a logical "OR" operation is used to merge the annotation results of four doctors, ensuring that any area marked as a nodule by any doctor is considered a positive nodule area, thereby improving the sensitivity and generalization ability of the training data.
[0010] 2. The specific process in step 2 is as follows: 1) The encoder introduces a Shuffle-ResBlock residual module: In GAEU-Net, the encoder uses a residual structure composed of multiple convolutional units for feature extraction. To alleviate the gradient vanishing problem in deep networks and reduce computational cost, a lightweight Shuffle-ResBlock module is introduced. This module uses depthwise separable convolutions in the residual path and combines them with channel rearrangement operations to achieve effective interaction and fusion of cross-group features, thereby improving multi-scale context modeling capabilities and boundary recognition performance.
[0011] 2) Pixel Transformer module: At the end of the encoder, a Pixel Transformer module is introduced to model the long-range dependencies of lung nodule regions. The Pixel Transformer divides high-order semantic features into image patches and encodes global features through a multi-head self-attention mechanism and a multilayer perceptron. The output features are then reshaped back to the original number of channels and participate in feature fusion during the decoding stage, effectively enhancing the network's ability to perceive lung nodule regions with blurred boundaries and irregular shapes.
[0012] 3) Dynamic Feature Selection Module (Gated Fusion): To enhance the co-modeling capability of multi-layer features in the encoder, GAEU-Net introduces a dynamic feature selection module in the decoding stage. This module uses a gating mechanism to weight and fuse features from different levels, enabling the network to adaptively select feature regions that are more critical to the current task, thereby improving the efficiency of inter-layer feature interaction and information utilization.
[0013] 4) MSCA multi-branch cross-attention mechanism: For each level of the fused features, a lightweight multi-branch cross-attention mechanism (MSCA) is introduced, using a three-branch design to explore the interaction between channels and spatial dimensions. The first branch performs CH interaction, the second branch performs CW interaction, and the third branch performs CC channel attention. The results of the three branches are weighted and applied to the original features, enhancing the network's ability to perceive lung nodule boundaries and complex textures, effectively reducing false positives and false negatives.
[0014] 5) Multi-scale feature fusion module (SE-ASPP + PixelShuffle): In the decoder upsampling stage, a multi-scale dilated spatial pyramid pooling module (SE-ASPP) with a fusion channel attention mechanism is combined with an efficient subpixel convolutional network (ESPCN). The SE-ASPP module acquires features from different receptive fields through dilated convolutions with multiple dilation rates and modulates important channels using SE channel attention. Subsequently, high-resolution features are recovered through PixelShuffle subpixel upsampling, achieving a balance between spatial accuracy and semantic consistency, enabling the network to segment lung nodules more accurately.
[0015] 3. The specific process in step 3 is as follows:
[0016] 1) Dice loss construction: Dice loss is used to measure the overlap between the predicted segmentation region and the ground truth labeled region. Dice loss can highlight the foreground region, and it is particularly robust to small targets and class imbalance problems, which helps to improve the fitting effect of the nodule region during training.
[0017] 2) Construction of BCE loss: Binary cross-entropy (BCE) loss is introduced to measure the difference between the predicted probability and the true label for each pixel. BCE loss provides stable and fine-grained gradient information in the early stages of training, helping the model converge quickly and optimizing pixel-level classification accuracy.
[0018] 3) Improve the loss function: By combining the Dice loss and BCE loss in a weighted manner to form a hybrid loss function, the network can balance global region fitting and local pixel accuracy during training. The BCE loss provides the network with a clear learning direction in the early stages, while the Dice loss enhances the overall region overlap in the later stages of training, thereby improving the segmentation stability and accuracy of small target nodules.
[0019] 4) Segmentation performance evaluation: To comprehensively evaluate the model's segmentation capabilities, five evaluation metrics were established: a mixture loss function, IoU, precision, recall, and F1-Score. The loss function and IoU directly measure the overlap between the predicted and ground truth regions; precision and recall reflect the accuracy and coverage of the predictions; and the F1-Score comprehensively measures the balance between precision and recall. These metrics are used together during the training and testing phases to validate the model's performance in segmenting small nodules and overall segmentation.
[0020] 4. The specific process in step 4 is as follows: Network Training and Lung Nodule Segmentation: Preprocessed 2D lung nodule CT images were input into GAEU-Net for training. During training, multi-layer features were extracted through the encoder, and then sequentially passed through the Pixel Transformer, dynamic feature selection module, MSCA attention mechanism, and multi-scale feature fusion module in the decoder stage to achieve global feature modeling and fine-grained restoration. After training, the network can directly output lung nodule segmentation maps with the same size as the input images, achieving accurate localization of nodule regions and restoration of boundary details.
[0021] The improved generative adversarial network model proposed in this invention has the following beneficial effects: 1) The Pixel Transformer module effectively models pixel-level dependencies in the encoder stage, enhancing the ability to capture fine-grained structural information; 2) The dynamic feature selection module enables adaptive fusion of key information across scales, suppressing redundant features; 3) The MSCA attention mechanism improves the network's responsiveness to small target regions; 4) The SE-ASPP and PixelShuffle structures in the improved decoder expand the receptive field while retaining spatial resolution information, thereby achieving accurate reconstruction of lung nodule boundary details. Attached Figure Description
[0022] Figure 1 : Overall network structure diagram of this invention; Figure 2 Shuffle-ResBlock Structure Diagram Figure 3 Pixel Transformer Structure Diagram Figure 4 Dynamic Feature Selection Module (Guted Fusion) Structure Diagram Figure 5 Schematic diagram of the MSCA module; Figure 6 SE-ASPP+ESPCN architecture diagram; Figure 7 Comparison of segmentation results from different models. Detailed Implementation
[0023] The overall structure of the globally perceptive enhanced network GAEU-Net for lung nodule segmentation proposed in this invention is as follows: Figure 1 As shown, the LIDC-IDRI CT images of lung nodules are first preprocessed, including nodule center extraction, image cropping, and logical "OR" fusion with multi-physician annotations, to construct training and testing samples of size 128×128. Subsequently, the preprocessed images are input into an improved GAEU-Net model. This model is based on a residual encoder, integrates a Pixel Transformer module for global feature modeling, performs cross-layer feature fusion through a dynamic feature selection module, and utilizes the MSCA multi-scale channel attention mechanism to enhance the response of key regions. In the decoding part, the network uses an ASPP structure with SE channel attention to extract multi-scale contextual information and performs high-quality upsampling using PixelShuffle to recover lung nodule boundaries and details. Finally, a predicted segmentation map with the same size as the input is generated through 1×1 convolution, achieving accurate automatic segmentation of lung nodules.
[0024] 1. Data preprocessing:
[0025] To construct a suitable CT image dataset of lung nodules for network training and testing, this step systematically preprocesses the original LIDC-IDRI dataset. This involves cropping the central regions of nodules within the lung parenchyma to create two-dimensional image patches, while simultaneously integrating annotation information from multiple doctors. If any doctor labels a region as a nodule, it is considered a nodule. This generates training, validation, and testing sample sets, enhancing the model's sensitivity and generalization ability to small target nodules.
[0026] 2. Construct the GAEU-Net model: 1) Shuffle Residual Module: This invention introduces a lightweight Shuffle-ResBlock structure (such as...) into the network. Figure 2 (As shown). The residual branch of this module uses depthwise separable convolution, splitting regular convolution into channel-wise convolution and pointwise convolution to reduce computational cost and the number of parameters. Furthermore, the module incorporates channel rearrangement operations to improve the channel isolation problem caused by grouped convolution.
[0027] The convolutional output channels are rearranged according to a predefined grouping method. Through dimensionality transformation and flattening, channels from different groups can exchange information. This maintains the efficiency of the lightweight structure while enhancing the correlation between features. Through this design, Shuffle-ResBlock can improve the network's ability to represent multi-scale information and local structures while maintaining end-to-end training stability, making it suitable for constructing encoding and decoding modules in medical image segmentation tasks.
[0028] 2) Pixel Transformer: This invention introduces a PixelTransformer module at the end of the encoder, using high-level semantic features extracted by a CNN as input to model long-range dependencies in lung nodule regions. The overall structure of the PixelTransformer is as follows: Figure 3 As shown. In ViT, the input feature map First, it is divided into sizes of The image patch is flattened into a two-dimensional sequence. .in, Given the height and width of the input feature map, For the number of channels, The size of each image patch Indicates the number of image patches. This is the length of the vector after each block is flattened. Subsequently, the sequence is mapped to a fixed dimension using a trainable linear projection. And with a fixed position code for each position, the input is represented as follows: in It is a projection matrix. It is a position embedding.
[0029] Transformer encoders are composed of The system consists of layers, each including a multi-head self-attention mechanism (MSA) and a multilayer perceptron (MLP). Layer Normalization (LN) is applied before each submodule, followed by residual connections. ; in, This represents the Layer Normalization operation. MSA is used to model the global dependencies between different image patches, while MLP is used to enhance the non-linear expressive power of features.
[0030] In MSA, the input vector is first projected into a query (Q), key (K), and value (V) vector, and the attention mechanism is calculated as follows: ; Multi-head attention is composed of multiple heads performing parallel computations and then concatenating the results. Each of them The projection matrices are respectively The output is transformed into .
[0031] MLP submodules typically contain a two-layer fully connected structure, first dividing the dimensions from... Expand to (in (This is an expansion factor for the MLP), then compressed back to the original dimension. This structure enhances feature abstraction and expressiveness through a non-linear mapping process of dimensionality increase followed by dimensionality reduction.
[0032] The specific parameter settings for PixelTransformer are as follows: The number of bullish positions is 12. Image patch size The input feature map size is Number of channels .
[0033] The input feature map size is Through a Convolution dimensionality reduction to Then flatten it into a two-dimensional sequence The input is then fed into a 6-layer Transformer encoder. The output is a Hidden Feature. It contains 64 patch features and 1 classification token. After removing the classification token, the size is [size missing]. Then reshape it back. and through a The convolution is increased to 1024 channels.
[0034] The PixelTransformer is used only to model global features at the encoder end, eliminating the need for an additional decoder Transformer layer, thus balancing model performance and computational efficiency. The globally perceived features output by the lightweight Transformer will participate in the decoding process together with the results from the gating fusion module and the SW-TA module, improving the network's ability to recognize lung nodule boundaries and irregularly shaped regions.
[0035] 3) Dynamic Feature Selection Module (Guted Fusion) and MSCA Attention Mechanism: To enhance the collaborative modeling capability among multi-layer features in the encoder, GAEU-Net introduces a dynamic feature selection mechanism and a multi-scale channel attention (MSCA) module. The former achieves dynamic weighting of inter-layer features through a gating fusion strategy, while the latter integrates information from spatial and channel dimensions to guide the network to focus on salient features in the lung nodule region.
[0036] The dynamic feature selection mechanism can effectively achieve adaptive fusion of hierarchical features, thereby improving the selectivity of the fusion effect and the efficiency of information utilization. Its structure... Figure 4 As shown below. First, the features extracted from adjacent layers of the encoder are... and Alignment in spatial and channel dimensions, where Upsampled to the same level by a 2×2 transposed convolution. Consistent dimensions. The two are then concatenated along the channel dimension, and the fusion weight mapping is extracted through two sets of parallel 1×1 convolutions and batch normalization operations: ; ; The two gated feature maps are then normalized to weights using the Softmax function: ; ; Dynamic weighted fusion is achieved using the above weights to obtain the fused output: This mechanism enables the network to select when integrating information from different levels, dynamically focusing on feature regions that are more critical to the current task, and improving the expressive efficiency of feature interaction between layers.
[0037] To further strengthen the dependency modeling between channels and spatial dimensions in the fused feature map, GAEU-Net introduces a lightweight multi-branch cross-attention mechanism (MSCA) at each level of the fused features to enhance the semantic connections within the features and improve the model's perceptual capabilities. This module employs a three-branch design, exploring the interaction between channels and spatial dimensions separately. Each branch is based on the input feature map, performing different dimensional reshaping and attention calculations: First branch (CH interaction): rearranges the feature maps as follows Application in the width direction (W dimension) The compressed information is processed and then a spatial attention map is generated through 3×3 convolution, batch normalization, and sigmoid activation.
[0038] Second branch (CW interaction): Rearranges features into In the height direction (H dimension), the same operation process as the first branch is performed.
[0039] The third branch (CC channel attention): without changing the spatial structure, it performs the attention directly at the channel dimension. Then extract the dependencies between channels.
[0040] The operation, by concatenating the results of average pooling and max pooling, effectively compresses the feature dimension while preserving multi-scale statistical information, and is defined as follows: Finally, the outputs of the three branches are summed element-wise and averaged, and this average is used as the fusion attention weight, which is then applied to the original input features. This mechanism, while ensuring feature richness, significantly improves the model's ability to perceive lung nodule boundary regions and complex textures, effectively reducing false positives and false negatives. The structure diagram is shown below. Figure 5 As shown.
[0041] 4) Improved multi-scale feature fusion module: To better recover details during the decoding stage, this invention introduces a multi-scale dilated spatial pyramid pooling module (SE-ASPP) with a fused channel attention mechanism before upsampling, and combines it with an efficient subpixel convolutional network (ESPCN) to achieve high-resolution feature reconstruction. The overall structure of this module is as follows: Figure 6 As shown.
[0042] The SE-ASPP module is designed to simultaneously capture local details and broad contextual information without significantly increasing computational overhead. The module has four parallel branches. The first branch uses a 1×1 convolution to perform a linear transformation on the features while maintaining spatial dimensions, primarily preserving local texture details. The other three branches use 3×3 dilated convolutions with dilation rates of 2, 3, and 4, respectively. The outputs of the four branches are concatenated along the channel dimension and then compressed and integrated using a 1×1 convolution to obtain a fused multi-scale feature map.
[0043] After fusing multi-scale features, we introduce a Squeeze-and-Excitation (SE) channel attention mechanism for further modulation. The SE module first performs global average pooling on the feature map, compressing spatial information into a global description vector for each channel. Then, it learns the channel weights through a two-layer fully connected network: the first layer compresses the number of channels to reduce the number of parameters and increase non-linear modeling capability, while the second layer restores the number of channels to their original size. Finally, the channel weights generated by sigmoid activation are multiplied channel-by-channel with the original features, causing the network to focus more on feature channels that contribute more to target segmentation during subsequent upsampling. After SE modulation, the size of the output feature is... ,in This is the upsampling factor, which is set to 2 in this experiment.
[0044] The other part of the upsampling employs an ESPCN structure. First, sufficiently rich features are extracted in the low-resolution space through convolution, and then these features are mapped to the high-resolution space using sub-pixel rearrangement. In this invention, the input to ESPCN is processed by the SE-ASPP module. Feature map. The rearrangement process of subpixel convolution is as follows: Figure 6 As shown. This feature is directly fed into the sub-pixel convolutional layer, according to... The proportions are rearranged in the spatial dimension. PixelShuffle rearranges the channels at each pixel. The channels were redistributed to Each channel Spatial neighborhood, thus obtaining a size of The high-resolution feature maps are obtained. The advantage of this approach is that the detailed information required for upsampling has already been encoded into the channel dimension during the convolution stage, and PixelShuffle is just a deterministic rearrangement operation. Therefore, it does not introduce the checkerboard effect and can also preserve the texture and boundary details learned by the convolution.
[0045] Through this design, SE-ASPP fully integrates multi-scale contextual information and performs channel weighting before upsampling, enabling the network to simultaneously capture the shape and boundary information of the target at different scales. ESPCN then effectively maps this information back to high-resolution space during the upsampling stage, achieving a balance between spatial accuracy and semantic consistency. This combination demonstrates clearer boundary recovery capabilities in experiments, especially in the segmentation of small targets such as lung nodules.
[0046] 3. Improve the loss function: The Dice coefficient reflects the degree of overlap between the predicted region and the true labeled region, and has good robustness to cases of extreme class imbalance. Its calculation formula is as follows: in This represents the number of pixels where the prediction and the actual values intersect. and These represent the total number of pixels in the predicted and ground truth regions, respectively. Dice loss tends to enhance the fit to the foreground region during training, but when dealing with small targets or when prediction bias is large in the early stages of training, the gradient may be too small, affecting the convergence speed.
[0047] BCE loss measures classification error by the cross-entropy between pixel-level probability predictions and labels: in For pixels The probability of being predicted as a nodule. For real labels, These are the weighting coefficients. Unlike Dice, BCE provides stable and fine-grained gradients in the early stages of training, guiding the model to converge quickly.
[0048] This invention employs the following combination: This strategy allows BCE to provide the network with a clear pixel-level learning direction in the early stages of optimization, while Dice strengthens the overlap of the overall region in the later stages of training, thus taking into account both global and local optimization needs and improving the stability and accuracy of small target nodule segmentation.
[0049] After designing the loss function, reasonable evaluation metrics are needed to verify the effectiveness of the optimization strategy. To comprehensively measure the model's performance in lung nodule segmentation, this paper selects five commonly used metrics: L, IoU, Precision, Recall, and F1-Score. Among them, the hybrid loss function L and IoU directly reflect the region overlap, which is highly consistent with the design goal of the loss function in this paper, and therefore are the core reference metrics. The remaining formulas are shown below.
[0050] ; ; ; ; 4. Train the model: The dataset is input into GAEU-Net for training. During training, multi-layer features are extracted through the encoder and then sequentially processed through the Pixel Transformer, dynamic feature selection module, MSCA attention mechanism, and multi-scale feature fusion module to achieve global feature modeling and fine-grained restoration. After training, the network can directly output lung nodule segmentation maps with the same size as the input image, achieving accurate localization of nodule regions and restoration of boundary details.
[0051] 5. Evaluation and analysis of experimental results: This invention uses L (hybrid loss function) and IoU as core evaluation metrics. Higher values of these metrics indicate better segmentation performance. As shown in Table 1, in experiments on the same dataset, the proposed method improved all metrics compared to the baseline model, and each improved module had a beneficial impact on the segmentation results.
[0052]
[0053] Table 1
[0054] To verify the superiority of the improved model, this invention selects it as a comparison with existing mainstream segmentation networks. We compare it with classic U-Net, ResUNet++, U-Net3+, Swin-UNet, DETR-SAM, and S... 3 Comparative experiments were conducted with mainstream segmentation networks such as TU-Net on the same dataset. The results showed that the improved network had a significant advantage in lung nodule segmentation. The experimental results are shown in Table 2. Compared to other networks, the present invention showed improved sensitivity in five evaluation metrics: L (hybrid loss function), IoU, Precision, Recall, and F1. A comparison of segmentation results from different network models is shown in the figure below. Figure 7 As shown in the comparison figures, the algorithm of this invention is more accurate in segmenting the edges of lung nodules.
[0055]
[0056] Table 2.
Claims
1. Research on a lung nodule segmentation algorithm based on GAEU-Net, the steps are as follows: Step 1: Data preprocessing. The CT images of lung nodules are cropped to obtain two-dimensional image patches suitable for network training and testing. Step 2: Construct a GAEU-Net network based on a residual encoder, and design an improved generative network GAEU-Net, including a residual encoder, a Pixel Transformer module, a dynamic feature selection module, an MSCA attention mechanism, and an improved multi-scale feature fusion module (SE-ASPP + ESPCN upsampling). This network can extract multi-scale semantic features of lung nodules and enhance edge and detail information, thereby improving segmentation accuracy. Step 3: Constructing a hybrid loss function and evaluation metrics. To address the issues of extremely small proportions of lung nodules in CT images and class imbalance, this invention introduces a hybrid optimization strategy of Dice loss and binary cross-entropy (BCE) loss during model training. Simultaneously, five evaluation metrics are used to comprehensively measure model performance. Through this step, the model can focus on pixel-level accuracy in small foreground target regions while also considering global region overlap, thereby improving the stability and accuracy of lung nodule segmentation. Step 4: Train the GAEU-Net model constructed in Step 2 to obtain lung nodule segmentation results, and verify the model performance using the indicator system in Step 3.
2. The research on a lung nodule segmentation algorithm based on GAEU-Net according to claim 1, characterized in that, The specific process in step 1 is as follows: 1) Extract the center location of nodules within the lung parenchyma from the annotation results; 2) Cropping yields a 2D image patch with a size of 128×128, and foreground-free images are removed; 3) The cropped image patches and their corresponding labeled masks are used to form training and testing sample sets, generating a total of 18,620 samples, including 12,440 training images, 3,110 validation images, and 3,110 test images. 4) To make full use of the annotation information of multiple doctors, a logical "OR" operation is used to merge the annotation results of four doctors, ensuring that any area marked as a nodule by any doctor is considered a positive nodule area, thereby improving the sensitivity and generalization ability of the training data.
3. The research on a lung nodule segmentation algorithm based on GAEU-Net according to claim 1, characterized in that, The specific process in step 2 is as follows: 1) The encoder introduces a Shuffle-ResBlock residual module: In GAEU-Net, the encoder uses a residual structure composed of multiple convolutional units for feature extraction. To alleviate the gradient vanishing problem in deep networks and reduce computational cost, a lightweight Shuffle-ResBlock module is introduced. This module uses depthwise separable convolutions in the residual path and combines them with channel rearrangement operations to achieve effective interaction and fusion of cross-group features, thereby improving multi-scale context modeling capabilities and boundary recognition performance. 2) Pixel Transformer module: At the end of the encoder, a Pixel Transformer module is introduced to model long-range dependencies in the lung nodule region. The Pixel Transformer divides high-order semantic features into image patches and encodes global features through a multi-head self-attention mechanism and a multilayer perceptron. The output features are then reshaped back to the original number of channels and participate in feature fusion during the decoding stage, effectively enhancing the network's ability to perceive regions with blurred boundaries and irregular shapes of lung nodules. 3) Dynamic Feature Selection Module (Gated Fusion): To enhance the collaborative modeling capability of multi-layer features in the encoder, GAEU-Net introduces a dynamic feature selection module in the decoding stage. This module uses a gating mechanism to weight and fuse features from different levels, enabling the network to adaptively select feature regions that are more critical to the current task, thereby improving the efficiency of inter-layer feature interaction and information utilization. 4) MSCA multi-branch cross-attention mechanism: For each level of the fused features, a lightweight multi-branch cross-attention mechanism (MSCA) is introduced, which uses a three-branch design to explore the interaction between channels and spatial dimensions. The first branch performs CH interaction, the second branch performs CW interaction, and the third branch performs CC channel attention. The results of the three branches are weighted and applied to the original features to enhance the network's ability to perceive lung nodule boundaries and complex textures, effectively reducing false positives and false negatives. 5) Multi-scale feature fusion module (SE-ASPP + PixelShuffle): In the decoder upsampling stage, a multi-scale dilated spatial pyramid pooling module (SE-ASPP) with a fusion channel attention mechanism is combined with an efficient subpixel convolutional network (ESPCN). The SE-ASPP module acquires features from different receptive fields through dilated convolutions with multiple dilation rates and modulates important channels using SE channel attention. Subsequently, high-resolution features are recovered through PixelShuffle subpixel upsampling, achieving a balance between spatial accuracy and semantic consistency, enabling the network to segment lung nodules more accurately.
4. The research on a lung nodule segmentation algorithm based on GAEU-Net according to claim 1, characterized in that, The specific process in step 3 is as follows: 1) Dice loss construction: Dice loss is used to measure the overlap between the predicted segmentation region and the ground truth labeled region. Dice loss can highlight the foreground region, and it is particularly robust to small targets and class imbalance problems, which helps to improve the fitting effect of the nodule region during training. 2) Construction of BCE loss: Binary cross-entropy (BCE) loss is introduced to measure the difference between the predicted probability and the true label for each pixel. BCE loss provides stable and fine-grained gradient information in the early stages of training, helping the model converge quickly and optimizing pixel-level classification accuracy. 3) Improve the loss function: By combining the Dice loss and BCE loss in a weighted manner to form a hybrid loss function, the network can balance global region fitting and local pixel accuracy during training. The BCE loss provides the network with a clear learning direction in the early stages, while the Dice loss enhances the overall region overlap in the later stages of training, thereby improving the segmentation stability and accuracy of small target nodules. 4) Segmentation performance evaluation: To comprehensively evaluate the model's segmentation capabilities, five evaluation metrics were established: a mixture loss function, IoU, precision, recall, and F1-Score. The loss function and IoU directly measure the overlap between the predicted and ground truth regions; precision and recall reflect the accuracy and coverage of the predictions; and the F1-Score comprehensively measures the balance between precision and recall. These metrics are used together during the training and testing phases to validate the model's performance in segmenting small nodules and overall segmentation.
5. The research on a lung nodule segmentation algorithm based on GAEU-Net according to claim 1, characterized in that, The specific process in step 4 is as follows: Network Training and Lung Nodule Segmentation: Preprocessed 2D lung nodule CT images were input into GAEU-Net for training. During training, multi-layer features were extracted through the encoder, and then sequentially passed through the Pixel Transformer, dynamic feature selection module, MSCA attention mechanism, and multi-scale feature fusion module in the decoder stage to achieve global feature modeling and fine-grained restoration. After training, the network can directly output lung nodule segmentation maps with the same size as the input images, achieving accurate localization of nodule regions and restoration of boundary details.