CT image neck lymph node partition automatic segmentation method and system

By designing a hybrid encoder and decoder, combining densely connected blocks and residual unit modules, and optimizing feature transfer and loss functions, the problem of inaccurate segmentation in the automatic delineation of cervical lymph node partitions in the existing technology is solved, and a high-precision and robust automatic segmentation effect is achieved.

CN120765615APending Publication Date: 2025-10-10HANGZHOU FIRST PEOPLES HOSPITAL
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510939467.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-08
Publication Date
2025-10-10

AI Technical Summary

Technical Problem

Existing technologies for automatic delineation of cervical lymph node partitioning have problems such as inaccurate segmentation, missegmentation of adjacent muscle and vascular tissue, insufficient global context modeling capabilities, and low segmentation accuracy. It is particularly difficult to achieve high-precision segmentation when the head and neck lymph node area varies greatly.

Method used

An automatic segmentation method for cervical lymph node partitioning in CT images is designed with a hybrid encoder and decoder. A hybrid encoder based on convolutional neural network and Transformer is adopted, combined with dense connection blocks and residual unit modules. The cross-attention mechanism is used to optimize feature transfer, and the separable Dice loss and contour weighted cross entropy loss functions are used to improve segmentation accuracy.

Benefits of technology

It achieves high-precision and robust automatic segmentation of the head and neck lymph node region, improves segmentation accuracy and stability, and has a significant effect on the segmentation of complex anatomical structures and large regional lymph nodes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120765615A_ABST
    Figure CN120765615A_ABST
Patent Text Reader

Abstract

The invention discloses a CT image neck lymph node partition automatic segmentation method and system. According to the method, firstly, data collection and preprocessing are carried out, secondly, a segmentation model is established, a hybrid encoder is designed, and the encoder comprises an encoder based on a convolutional neural network and an encoder based on Transform; designing a hybrid decoder, fusing the feature maps through a cross attention mechanism, and optimizing feature transfer by using a residual unit module; secondly, designing a loss function, wherein the loss function comprises separable Dice loss and contour weighted cross entropy loss; and finally training and verifying the segmentation model. According to the method, a Transform global context modeling capability is enhanced, a dense connection network block and a residual unit jump connection module are designed to optimize multi-scale feature fusion, and a boundary contour weighted loss function is proposed for lymph node region characteristics to relieve an inter-class imbalance problem; and high-precision and high-robustness automatic segmentation of the head and neck lymph node region is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of medical image processing, and in particular relates to a method and system for automatically segmenting cervical lymph nodes in CT images. Background Art

[0002] Cervical lymph nodes can generally be divided into seven zones, which are of great significance for clinical diagnosis. Head and neck lymph node regions are defined and separated by numerous anatomical landmarks. Unlike single organs or tissues with well-defined boundaries, accurate manual delineation requires considerable time and effort. Early research on head and neck lymph node segmentation focused primarily on atlas-based automated segmentation. This approach utilizes deformable image registration to automatically segment the delineation from an atlas onto a new patient's image. Automated delineation of head and neck lymph node regions using deep learning is highly relevant to radiotherapy research and clinical treatment planning, but research on this topic remains insufficient in the literature. Specifically, in a research setting, there are currently no publicly available solutions for large-scale automated segmentation of head and neck lymph node regions. For example, a Chinese patent (publication number CN115272206A) focuses on the segmentation of the entire abdominal pelvic region, which includes multiple subregions such as abdominal and pelvic lymph node anatomical zones. However, this patent briefly mentions "direct segmentation" or "two-stage segmentation" strategies without elaborating on specific segmentation methods.

[0003] Prior art also discloses methods based on convolutional neural networks and ensemble learning to segment multiple lymph node levels, as well as training a nnUnet 3D-fullres model for automatic segmentation of multiple cervical lymph node levels, which requires a post-processing step. These convolutional neural network-based methods lack the ability to model global context. Due to the limited receptive field of the convolution kernel, it is difficult to effectively model the long-range spatial dependencies of the head and neck lymph node regions. This leads to insufficient ability to capture the characteristics of anatomical structures such as organ muscle tissue, and is prone to problems such as segmented lymph node regions being broken and mis-segmentation of adjacent muscle and vascular tissue. This is especially true in situations where there are significant differences in the level of lymph nodes in larger regions (such as zones II-IV) and in the anatomical structure of the neck.

[0004] Existing techniques also propose dynamic multi-atlas selection methods that attempt to combine CNNs with atlas registration techniques. However, this approach suffers from inefficient fusion and low segmentation accuracy. Existing segmentation methods lack research on the optimization mechanisms of CNNs and Transformers, and thus fail to fully utilize the Transformer's global modeling advantages under large-scale data pre-training. The skip connection design of hybrid CNN-Transformer architecture medical segmentation models (such as TransUNet) still has room for improvement in fine-grained feature transfer capabilities. Summary of the Invention

[0005] In response to the problems existing in the above-mentioned prior art methods for automatically delineating cervical lymph node regions, the present invention proposes a method and system for automatically segmenting cervical lymph node regions in CT images.

[0006] A first aspect of the present invention provides a method for automatically segmenting cervical lymph nodes in CT images, the method comprising the following steps:

[0007] Data collection and preprocessing:

[0008] Collecting cervical CT image data, and annotating the CT image data according to the zoning standard of the cervical lymph node area to generate a lymph node area mask;

[0009] Normalizing the CT image data and the annotation mask, scaling the pixel values ​​of the image data to a preset range, and adjusting the pixel spacing to a preset value;

[0010] Build the segmentation model:

[0011] Designing a hybrid encoder, which includes a convolutional neural network-based encoder and a Transformer-based encoder;

[0012] The encoder of the convolutional neural network adopts densely connected blocks, performs feature extraction through batch normalization, nonlinear activation and convolution operations, and gradually reduces the spatial resolution of the feature map through downsampling operations;

[0013] The Transformer encoder is composed of multiple stacked Transformer blocks, each of which includes a linear projection module, a block embedding module, and a Transformer layer to capture long-range spatial dependencies.

[0014] Design a hybrid decoder that includes a CNN-based decoder and a Transformer-based decoder, fuses feature maps through a cross-attention mechanism, and optimizes feature transfer using a residual unit module;

[0015] The feature map output by the encoder is upsampled through the decoder to generate a segmentation mask;

[0016] Design loss function:

[0017] Construct a composite loss function, including separable Dice loss and contour weighted cross entropy loss, to improve the inter-class imbalance problem and improve segmentation accuracy;

[0018] Training and validating the segmentation model:

[0019] The segmentation model is trained using the optimizer and the learning rate is updated using warmed cosine annealing.

[0020] The segmentation performance of the model is verified, and the Dice similarity coefficient, the average surface distance and the Hausdorff distance are used to evaluate the segmentation effect of the segmentation model on the lymph node region of the test set.

[0021] The second aspect of the application provides a CT image neck lymph node partition automatic segmentation system for realizing the image neck lymph node partition automatic segmentation method, comprising:

[0022] The data collection and preprocessing module is used for:

[0023] Collecting neck CT image data, and labeling the CT image data according to the partition standard of the neck lymph node region to generate a lymph node region mask;

[0024] The CT image data and the labeled mask are standardized, the pixel value of the image data is scaled to a preset range, and the pixel spacing is adjusted to a preset value;

[0025] The segmentation model establishment module is used for:

[0026] A hybrid encoder is designed, and the encoder includes a convolutional neural network-based encoder and a Transformer-based encoder;

[0027] The convolutional neural network-based encoder adopts a dense connection block, performs feature extraction through batch normalization, nonlinear activation and convolution operation, and gradually reduces the spatial resolution of the feature map through downsampling operation;

[0028] The Transformer encoder is composed of a plurality of Transformer blocks, each of which includes a linear projection module, a block embedding module and a Transformer layer, for capturing long-distance spatial dependence;

[0029] A hybrid decoder is designed, and the decoder includes a CNN-based decoder and a Transformer-based decoder, which fuse feature maps through cross-attention mechanism and optimize feature transmission by using residual unit module;

[0030] The feature map output by the encoder is upsampled by the decoder to generate a segmentation mask;

[0031] The loss function design module is used for:

[0032] A composite loss function is constructed, including a separable Dice loss and a contour weighted cross-entropy loss, for relieving the class imbalance problem and improving the segmentation accuracy;

[0033] The training and verification segmentation model module is used for:

[0034] The segmentation model is trained using the optimizer and the learning rate is updated using warmed cosine annealing.

[0035] To verify the segmentation performance of the model, the Diess similarity coefficient, mean surface distance, and Hausdorff distance were used to evaluate the segmentation effect of the segmentation model on the lymph node area of ​​the test set.

[0036] Beneficial effects of the present invention: The method of the present invention enhances the global context modeling capability of Transformer, designs a densely connected network block (3D Dense Block) and a residual unit skip connection module (3D Residuals Module) to optimize multi-scale feature fusion, and proposes a boundary contour weighted loss function based on the characteristics of the lymph node region to alleviate the problem of inter-class imbalance, thereby achieving high-precision and high-robust automatic segmentation of the head and neck lymph node region. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 This is a flowchart of a method for automatic segmentation and identification of cervical lymph node regions in CT images based on an improved 3D TransUnet according to a specific embodiment of the present invention;

[0038] Figure 2 This is a schematic diagram of lymph node region marking according to a specific embodiment of the present invention;

[0039] Figure 3 This is a network diagram of a lymph node region segmentation model according to a specific embodiment of the present invention;

[0040] Figure 4 Schematic diagram of a 3D densely connected module and a residual unit module of a lymph node segmentation model according to a specific embodiment of the present invention;

[0041] Figure 5 Schematic diagram of the cross-attention mechanism module of the lymph node segmentation model according to a specific embodiment of the present invention;

[0042] Figure 6 This is a schematic diagram of contour extraction according to a specific embodiment of the present invention. DETAILED DESCRIPTION

[0043] The present invention will be further described below with reference to the accompanying drawings and specific embodiments. Figure 1 As shown, the embodiment of this application is mainly divided into four steps: collecting and annotating CT neck datasets, establishing an automatic segmentation model for neck lymph node partitioning, designing a loss function, and training and verifying the performance of the segmentation model. The specific steps are as follows:

[0044] S1: Collect and process datasets

[0045] S1.1 Collect and annotate CT neck imaging data:

[0046] This example collects an experimental dataset of 100 venous phase head and neck CT sequence images, which is called HN_LNL_100 (head and neck lymph node level). The CT sequence images of each patient are saved in NIFTI format, and the image size is (unit pixel), N represents the number of slices ( ), the slice thickness is 0.504mm.

[0047] like Figure 2 As shown, three experienced experts manually delineated and annotated the head and neck lymph node regions, referring to the seven-region standard. To ensure consistency and accuracy, a single expert independently delineated and annotated each sequence in the first pass. Using the 3D Slicer 5.6.2 medical image segmentation tool, six lymph node regions (I–VI) were delineated layer by layer on each image. (Since CT scans do not fully capture region VII, only regions I–VI were delineated in this case.) Six lymph node region masks were generated. In the second pass, two additional experts discussed the masking and made additional corrections. The NH_LNL_100 dataset was randomly divided into training, validation, and test sets using an 8:1:1 ratio.

[0048] S1.2 CT neck image data preprocessing

[0049] After obtaining the neck CT image, preprocessing operations such as standardization and data enhancement are performed on the CT neck image data and the annotation mask.

[0050] The image intensity was scaled to [0, 1] using the Window Width (400) and Window Center (50) of the neck soft tissue window to improve the numerical distribution differences of the CT data. Because medical images often come from different devices, they may have different resolutions, pixel sizes, and pixel spacing. Therefore, the pixel spacing of the image was adjusted simultaneously in the x, y, and z directions, so that the target image pixel spacing was 1.5mm, 1.5mm, and 2mm, respectively. This can reduce the physical scale differences between different CT devices, eliminate the numerical distribution and physical scale differences of data collected by different CT devices, unify data standards, improve model generalization and computational efficiency, and adapt the deep learning model activation function to accelerate convergence.

[0051] The voxel of interest and the corresponding mask are scaled to (96, 96, 96) in size by bilinear interpolation, which not only unifies the input dimension and optimizes the use of video memory, but also focuses on the characteristics of the target region and reduces noise interference; along the three axes Random flip rotation data enhancement processing can expand the training data set, reduce the dependence of the model on a specific perspective, introduce regularization effect, and improve the robustness of the model.

[0052] S2: Establishing a neck lymph node partition segmentation model

[0053] Unlike previous automatic lymph node region delineation methods, the embodiment improves the hybrid coding and decoding structure 3D segmentation network based on convolution and Transformer according to the characteristics of the neck image, and the network structure diagram is as shown in Figure 3 .

[0054] S2.1 Design a model encoder, which is composed of a CNN encoder and a Transformer encoder.

[0055] The CNN encoder is improved from a simple convolution block to a 3D Dense Block (dense connection block), and each layer in the dense connection block is successively operated as batch normalization, a rectified linear unit and a convolution layer. After processing by each 3D Dense Block, a 3D Max Pooling layer is used for down-sampling, and the channel dimension is doubled using a standard convolution. The encoder design using the dense connection block obtains a more excellent fine-grained feature extraction mechanism, and the features are processed more finely, so that the model can capture more discriminative features of the lymph node region, thereby improving the accuracy of lymph node region segmentation and reducing the missegmentation of other tissues such as blood vessels. The feature maps output by the encoder in the three down-sampling stages are fed to the CNN decoder up-sampling stage through a residual convolution unit. The residual convolution unit module improves the gradient propagation of the network in the model, making the model easier to train, thereby improving the segmentation performance. At the same time, through the residual unit module connection method on multiple scales, the lymph node region features of different scales are more accurately fused and utilized, which can better adapt to the segmentation needs of lymph node regions of different sizes and shapes, and the application is more efficient and accurate in processing multi-scale features of lymph node regions with complex structures.

[0056] In a preferred example:

[0057] Design the Encoder of the hybrid network: In the original CNN Encoder design of the 3D TransUnet network, the convolution block Convolution Block is composed of convolution (the convolution kernel size is set to or ), batch normalization (BN), rectified linear unit (ReLU) and random deactivation operation (Dropout).

[0058] In the embodiment, the dense connection block Dense Block is extended to be used in 3D space. The dense connection module schematic is as follows: Figure 4 As shown in (a), the dense connection block densely connects all the layers before a certain layer. The dense connection is expressed as follows:

[0059] (1)

[0060] in, Represents the concatenation of all previous layer output feature maps in the channel dimension, Implement continuous operations, namely batch normalization (BN), rectified linear unit (ReLU) and Convolution (3DConv). If the composite function The function generates k feature maps, then The number of input feature layers will be ,in Indicates the number of channels of the input layer.

[0061] The structure configuration table of the CNN Encoder of the improved network is shown in Table 1. The cervical CT image data after data preprocessing is input into the hybrid network. The input image data is a single-channel image with an image size of , after three stages of processing by the CNN Encoder module, the feature map sizes of the three stages are (64, 48, 48, 48), (128, 24, 24, 24) and (256, 12, 12, 12). In the first stage, 3D Dense Block1 is instantiated into 4 Convolution, followed by downsampling using 3D Max Pooling Layer1 with a step size of 2, and finally using The convolution adjusts the channel size to 64. The feature maps output by the three downsampling stages are fed to the upsampling stage through the residual unit. The design details of the residual unit are as follows Figure 4 As shown in (b), the residual unit is instantiated as Convolution, batch normalization BN and rectified linear unit ReLU.

[0062] Table 1 Network structure configuration of the three stages of CNN Encoder

[0063]

[0064] The Transformer Encoder part consists of 12 layers of Transformer Block stacking. TransformerBlock consists of a 3D image linear projection module (Linear Projection), a block embedding module (Patch Embedding) and a Transformer Layer.

[0065] Linear Projection performs a sequence of 3D images by passing the input Transform (reshape) into 3D image blocks, where the size of each image block is , is the number of image blocks (also called the length of the input sequence), and the size of P is empirically set to 12.

[0066] Patch Embedding uses trainable linear projection to vectorize image patches. Mapped to a D-dimensional embedding space, we learn specific position embeddings to encode the patch space and add them to the patch embeddings to preserve the position information, as shown in the formula:

[0067] (2)

[0068] Among them, E represents the embedded projection feature space of the image block, E pos Represents the position embedding feature space.

[0069] The Transformer layer consists of Multihead Self-Attention (MSA) and Multi-Layer Perceptron (MLP). These attention mechanisms can effectively capture the dependent features of the anatomical structure of organ tissues and efficiently model the long-distance spatial relationships of the cervical lymph node region, improving the problem of segmentation of the lymph node region.

[0070] In a preferred example: The output of the layer is represented as:

[0071] (3)

[0072] (4)

[0073] Where LN is layer normalization, z l-1represents the output image representation after encoding at layer l-1, is the encoded image representation. The output of the last Transformer Layer is reshaped, and the output spatial dimension size is (512, 6, 6, 6).

[0074] S2.2 Design model decoder

[0075] The decoder part also adopts a hybrid CNN and Transformer decoder design. The design of the CNN structure is similar to that of the encoder. It uses its local feature extraction capability to quickly capture the detailed information of the lymph node area while preserving the spatial structure of the image.

[0076] In the Transformer decoder, the t-th layer region query matrix is ​​expressed as , similarly, an intermediate feature in the decoder convolution block is converted to a d-dimensional feature matrix . From the Transition to the first At the layer, the lymph node region query matrix is ​​updated through the cross attention mechanism, and the first The layer query features, keys, and values ​​are linearly projected onto the weight matrix of the next layer. This process is repeated, and each layer is updated using a residual unit module. The Transformer decoder uses the region query matrix and a cross-attention mechanism to globally model the long-range dependencies between lymph node regions and surrounding tissues, effectively handling semantic associations in complex contexts and avoiding missegmentation caused by information limitations in traditional methods. During inter-layer transfer, the region query matrix is ​​iteratively updated using a cross-attention mechanism and optimized through linear projection and connection with the residual unit module, ensuring feature stability and effectiveness.

[0077] Finally, the dot product of the final layer's region query matrix and the CNN decoder's output features is performed to obtain a probability distribution for each pixel, which is then binarized to generate a mask. This design not only enhances the precise positioning of lymph node boundaries but also improves the ability to identify small, fuzzy areas, adapting to the needs of cervical lymph node segmentation in various shapes and locations.

[0078] In a preferred example: In the first Layer, the refined region query matrix is ​​expressed as At the same time, an intermediate feature from the decoder convolutional block is converted to dimensional features, using The number of upsampling blocks in the CNN decoder is consistent with the Transformer decoder layer, so the multi-scale CNN features can be effectively projected into the feature space Among them 、 and Defined in The spatial dimension of the feature map at the upsampling layer. Transition to the first When the layer is used, the lymph node region query is updated through the cross attention mechanism as shown in the following formula:

[0079] (5)

[0080] in 、 and It is the first The layer query features, keys and values ​​are linearly projected to the weight matrix of the next layer. Figure 5 The process is repeated and updated after each layer using residual connections. The final prediction is obtained by formula (6), which details the process of converting the segmentation map into a binary map, that is, the last feature map of the CNN decoder. Performing the dot product operation yields:

[0081] (6)

[0082] Among them is After sigmoid activation, a threshold operation with a threshold of 0.5 is performed to decode the lymph node region mask of the corresponding channel.

[0083] S3: Design loss function

[0084] The inter-class imbalance of lymph node regions is significant. The volume distribution of the seven horizontal regions (I-VII) of lymph nodes is quite different (e.g., region II is small and region III is large). Using traditional segmentation loss functions (such as cross entropy loss and Dice loss) is difficult to alleviate the inter-class regional imbalance problem, resulting in low segmentation accuracy in small regions and blurred boundary contours that are easily affected by surrounding tissues. This application designs a composite loss consisting of a separable Dice loss and a contour-weighted cross entropy loss.

[0085] like Figure 6 As shown in the figure, a contour weighted graph is constructed on the label image, and the morphological operation is performed to obtain the contour of the segmented target. First, the boundary of the connected region is eroded by morphology, and then the boundary is retracted. The boundary contour area is obtained by subtracting the retracted labeled area from the original labeled area. The target boundary is eroded inward by morphology, and the contour is obtained by subtracting the eroded target from the original target. , the formula is

[0086] (7)

[0087] in, is the mask area, It is the mask area after the morphological corrosion operation.

[0088] S3.1 Design of Separable Dice Loss

[0089] In this lymph node region medical image segmentation task, which involves the segmentation of multiple target regions, when there is an imbalance between categories, it is difficult for the model to accurately capture all targets and it is easy to converge to the local minimum of the loss function, causing the network to select a single or partial target region and ignore the rest.

[0090] (8)

[0091] A separable Dice loss function is designed, and a weighted graph is generated from the boundary of the target area to alleviate the imbalance. The Dice loss function is generally in the form of formula (8). Since the segmentation error comes from over-segmentation and under-segmentation, and the error is mostly at the edge, the target area is split into contour and non-contour components and the Dice loss is calculated separately to weight the segmentation boundary. The formula is as follows:

[0092] (9)

[0093] (10)

[0094] (11)

[0095] in, is the contour Dice loss, is the non-contour Dice loss, represents the number of category regions, and Represents contour components and non-contour components respectively, , Similarly, and Represent the predicted contour components and non-contour components respectively. In order to control the importance of the contour, a weight parameter is introduced When updating the gradient, it is found that the contour loss decreases faster, indicating that the contour loss is equally important. The separable Dice loss can effectively handle inter-class imbalance because it pays more attention to the overlap between the prediction and the true mask of each individual category.

[0096] S3.2 Design contour weighted loss

[0097] Cross-entropy loss is widely used in deep learning, especially in neural networks for image segmentation. Its effectiveness in reducing the distance between predicted and actual probability distributions makes it a preferred choice for optimizing neural networks. However, in the case of data imbalance, the cross-entropy loss function may lead to biased training results.

[0098] (12)

[0099] When there are multiple categories of target areas to be segmented, the cross entropy loss is calculated by the following formula:

[0100] (13)

[0101] To alleviate the intra-class imbalance, a contour-based weighted cross entropy loss function is designed, which is defined as:

[0102] (14)

[0103] in, Represents the extracted contour weight map, M represents the number of category areas, and N represents the number of pixels in the category. represents the true pixel category, Represents the predicted pixel category score. Contour weighted cross entropy assigns a larger weight to pixels belonging to the contour, thereby emphasizing the importance of the target region boundary. The composite loss function is obtained by the following formula:

[0104] (15)

[0105] The composite loss function fusion handles intra-class and inter-class imbalance, improving the robustness and accuracy of multi-category target area segmentation.

[0106] S4: Train and verify segmentation performance

[0107] S4.1 Training Model

[0108] AdamW is used as the optimizer for training, and the learning rate is updated using the warm-up cosine annealing method. In the first 20 rounds of training, the learning rate gradually increases from a small value to a predetermined initial learning rate of 1e-4. After the warm-up phase, the learning rate will be adjusted in the form of a cosine function curve. The learning rate will begin to gradually decrease, and its change is similar to the cosine function, so that the parameters of the model can be adjusted more finely in the later stage. By adjusting the hyperparameter weight parameters and Design multiple groups of experiments to obtain a set of optimal weight parameters.

[0109] In a preferred example:

[0110] This experiment was conducted on the Ubuntu 20.04.6 LTS operating system, using Python (3.8) and the PyTorch (version 1.12.1) deep learning framework, trained on two NVIDIA GeForce RTX 3090 24G GPUs. The 12-layer Transformer Block in the network's encoder was pre-trained on the ImageNet21k dataset. Training was performed using the AdamW optimizer with a momentum of 0.95 and a weight decay of 1e-5. The batch size was set to 2, and the model was trained for 100 epochs. Warmed-up cosine annealing was used to update the learning rate. For the first 20 epochs, the learning rate was gradually increased from a low value of 1e-6 to a predetermined initial learning rate of 1e-4. This approach avoids problems such as falling into local optima caused by excessively high learning rates during the early stages of training. After the warm-up phase, the learning rate is adjusted in a cosine-like manner, gradually decreasing. This behavior, similar to a cosine function, allows for more precise parameter adjustments later in the model.

[0111] As shown in formula (11) and formula (15), the weight parameter and The size of the setting will affect the performance of the model, and the settings of these two hyperparameters need to be studied. Controls the importance of boundary contours. Effectively alleviate the imbalance within the class. In order to analyze their impact on experimental performance, multiple sets of experiments were designed by adjusting the values ​​of these two hyperparameters. As shown in Table 2, according to the empirical setting method of weights, DSC When the value increases between 0.4 and 0.60, it first increases and then decreases. =0.55 reaches its maximum value. As shown in Table 3, DSC When the value increases between 0.30 and 0.50, it first increases and then decreases. = 0.4, the maximum value is 0.921. Set to 0.55, Set to 0.4.

[0112] Table 2 Hyperparameter sensitivity study, setting different parameters DSC value under

[0113]

[0114] Table 3 Hyperparameter sensitivity study, setting different parameters DSC value under

[0115]

[0116] S4.2 Validation Model

[0117] To evaluate the model's performance in automatically delineating lymph node regions in the test set, the mean Dice Similarity Coefficient (DSC), mean surface distance (MSD), and Hausdorff distance (HD95) were calculated for each horizontal lymph node region. DSC measures the similarity between the predicted and true results; higher values ​​indicate better segmentation. MSD reflects the average surface distance between the predicted segmentation result and the true result; smaller values ​​indicate closer the model's segmentation boundary is to the true boundary. HD95 measures the maximum error in the segmentation result; smaller values ​​indicate greater model stability and reliability.

[0118] DSC is an indicator that measures the degree of overlap between the model's predicted outline area Pred and the GT's true annotation. The calculation formula is as follows:

[0119] (16)

[0120] in, and Represent the area predicted by the model and the area outlined by the experts, is the intersection pixel between them. MSD represents the mean distance between two regions (in mm), which is expressed by the following formula:

[0121] (17)

[0122] (18)

[0123] in, It represents the three-dimensional distance between the predicted point in region A and the actual point in region B. Hausdorff distance calculates the maximum distance between any two closest points in any direction of two regions, as shown in formula (19). HD95 considers the 95th percentile of the closest distance, not the maximum value.

[0124] (19)

[0125] As shown in the experimental results in Table 4, the hybrid segmentation framework proposed in this embodiment demonstrates high performance in the automated segmentation of head and neck lymph nodes. Key metrics include an average DSC (Dice Similarity Coefficient) of 0.91, with the highest DSC value (0.94) for region IV, indicating particularly high segmentation accuracy. Regions V and VII exhibit relatively low DSC values ​​(0.86 and 0.84), likely due to the complex characteristics of the corresponding lymph node regions. The MSD (Mean Symmetric Surface Distance) and HD95 (Hausdorff Distance) metrics also performed well overall, with average values ​​of 0.99 and 7.7, respectively. This demonstrates the model's accuracy in locating lymph node boundaries and effectively reduces segmentation error.

[0126] Table 4 Performance evaluation results of the model of the present invention

[0127]

[0128] The model enhances the global modeling capabilities of the Transformer, designs dense connections and residual unit modules to optimize multi-scale feature fusion, and combines a boundary contour weighted loss function to alleviate inter-class imbalance, ultimately achieving highly accurate and robust segmentation. The DSC values ​​for each partition mostly remain above 0.9, validating the hybrid framework's adaptability to different lymph node regions and demonstrating the effectiveness of the improved strategy in improving segmentation performance.

[0129] To verify the effectiveness of each module in this method, seven sets of ablation experiments were conducted. This example uses 3D TransUnet as the baseline model and trains various combinations of densely connected encoders, skip connections using residual unit modules, and boundary contour weighted loss optimization strategies to verify their performance and the effectiveness of these combinations. The specific performance is shown in Table 5.

[0130] Table 5 Ablation experiment results

[0131]

[0132] When only the densely connected encoder is used (comparison between the first and second experiments in Table 5), DSC increases from 0.85 to 0.87, which indicates that the use of the densely connected encoder has a certain improvement on the model performance. It may help the model to better extract features, thereby improving the accuracy of segmentation and increasing the DSC similarity coefficient.

[0133] Using only the residual unit module (comparison between the first group of experiments and the third group of experiments), the DSC improves from 0.85 to 0.86, indicating that the residual unit module can also play an active role in the model, possibly by improving the gradient propagation of the network, making the model easier to train, and thus improving the segmentation performance. Only applying the boundary contour weighted loss (comparison between the first group of experiments and the fourth group of experiments), the DSC improves from 0.85 to 0.87. This shows that the boundary contour weighted loss optimization strategy has a significant improvement on the performance of the model. This strategy may effectively solve the problem of inaccurate boundaries or unbalanced regions in segmentation, and has a greater contribution to improving the DSC value.

[0134] Combining the densely connected encoder and the residual unit module (comparison between the first group of experiments and the fifth group of experiments), the DSC is 0.87, which has a certain degree of improvement compared with the use of the densely connected encoder (0.87) and the residual unit module (0.86) alone, but the improvement is not particularly large, which indicates that the two improvement measures can promote each other to some extent and improve the performance of the model together, but their synergistic effect is relatively limited.

[0135] Combining the densely connected encoder and the boundary contour weighted loss (comparison between the first group of experiments and the sixth group of experiments), the DSC reaches 0.88, which is higher than the use of the densely connected encoder (0.87) and the boundary contour weighted loss (0.87) alone, indicating that the combination of the two can produce better results, and the features extracted by the densely connected encoder are more conducive to improving the accuracy of segmentation under the optimization of the boundary contour weighted loss.

[0136] When all three improvement measures are applied (comparison between the first group of experiments and the seventh group of experiments), the DSC reaches 0.91, which is the highest among all combinations, indicating that there is a strong synergistic effect between the three improvement measures, which cooperate with each other to optimize the model from different aspects, making the performance of the model on the segmentation task significantly improved. The densely connected encoder is responsible for better feature extraction, the residual unit module improves network training, and the boundary contour weighted loss optimizes the boundary and region balance. The three work together to achieve the best segmentation effect.

[0137] The embodiment of the application also provides a CT image neck lymph node partition automatic segmentation system for realizing the image neck lymph node partition automatic segmentation method, comprising:

[0138] A data collection and preprocessing module is configured to:

[0139] Collecting neck CT image data, and labeling the CT image data according to the partition standard of the neck lymph node region to generate a lymph node region mask;

[0140] Standardize the CT image data and the annotation mask, scale the pixel value of the image data to a preset range, and adjust the pixel pitch to a preset value;

[0141] The segmentation model establishment module is configured to:

[0142] A hybrid encoder is designed, which includes a convolutional neural network-based encoder and a Transformer-based encoder;

[0143] The convolutional neural network-based encoder adopts a densely connected block, extracts features through batch normalization, nonlinear activation and convolution operation, and gradually reduces the spatial resolution of the feature map through downsampling operation;

[0144] The Transformer encoder is composed of multiple Transformer blocks, each of which includes a linear projection module, a block embedding module and a Transformer layer, for capturing long-distance spatial dependencies;

[0145] A hybrid decoder is designed, which includes a CNN-based decoder and a Transformer-based decoder, fuses feature maps through cross-attention mechanism, and optimizes feature transmission through residual unit module;

[0146] The feature map output by the encoder is upsampled by the decoder to generate a segmentation mask;

[0147] The loss function design module is configured to:

[0148] A composite loss function is constructed, including a separable Dice loss and a contour weighted cross-entropy loss, to alleviate the class imbalance problem and improve the segmentation accuracy;

[0149] The segmentation model training and verification module is configured to:

[0150] The optimizer is used to train the segmentation model, and the preheating cosine annealing method is used to update the learning rate;

[0151] The segmentation performance of the model is verified, and the Davies similarity coefficient, the average surface distance and the Hausdorff distance are used to evaluate the segmentation effect of the segmentation model on the lymph node region of the test set.

[0152] Although embodiments of the present application have been shown and described, it will be understood by those of ordinary skill in the art that various changes, modifications, substitutions and alterations can be made without departing from the principles and spirit of the present application, and the scope of the present application is defined by the appended claims and their equivalents.

Claims

1. A method for automatic segmentation of cervical lymph nodes in CT images, characterized in that The method comprises the following steps: Data collection and preprocessing: Collecting cervical CT image data, and annotating the CT image data according to the zoning standard of the cervical lymph node area to generate a lymph node area mask; Normalizing the CT image data and the annotation mask, scaling the pixel values ​​of the image data to a preset range, and adjusting the pixel spacing to a preset value; Build the segmentation model: Designing a hybrid encoder, which includes a convolutional neural network-based encoder and a Transformer-based encoder; The encoder of the convolutional neural network adopts densely connected blocks, performs feature extraction through batch normalization, nonlinear activation and convolution operations, and gradually reduces the spatial resolution of the feature map through downsampling operations; The Transformer encoder is composed of multiple stacked Transformer blocks, each of which includes a linear projection module, a block embedding module, and a Transformer layer to capture long-range spatial dependencies. Design a hybrid decoder that includes a CNN-based decoder and a Transformer-based decoder, fuses feature maps through a cross-attention mechanism, and optimizes feature transfer using a residual unit module; The feature map output by the encoder is upsampled through the decoder to generate a segmentation mask; Design loss function: Construct a composite loss function, including separable Dice loss and contour weighted cross entropy loss, to improve the inter-class imbalance problem and improve segmentation accuracy; Training and validating the segmentation model: The segmentation model is trained using the optimizer and the learning rate is updated using warmed cosine annealing. To verify the segmentation performance of the model, the Diess similarity coefficient, mean surface distance, and Hausdorff distance were used to evaluate the segmentation effect of the segmentation model on the lymph node area of ​​the test set.

2. The method for automatic segmentation of cervical lymph nodes in CT images according to claim 1, characterized in that: The standardization process includes: Scale the pixel values ​​of CT image data to the range of [0,1]; Adjust the pixel spacing of the three axes.

3. The method for automatic segmentation of cervical lymph nodes in CT images according to claim 1 or 2, characterized in that: It also includes data enhancement processing on the CT image data to expand the training data set; specifically, three-axis random flipping and rotation.

4. The method for automatic segmentation of cervical lymph nodes in CT images according to claim 1, characterized in that: The dense connection block realizes continuous feature operation and layer-by-layer transmission of information by splicing the output feature maps of all previous layers in the channel dimension.

5. The method for automatic segmentation of cervical lymph nodes in CT images according to claim 4, characterized in that: The Transformer encoder consists of 12 layers of stacked Transformer blocks. Each Transformer block includes a 3D image linear projection module, a block embedding module, and a Transformer layer. The 3D linear projection module converts the input image into a series of vectorized small image blocks. The block embedding module maps these small image blocks to a high-dimensional space and adds position embedding to preserve spatial information.

6. The method for automatic segmentation of cervical lymph nodes in CT images according to claim 1, characterized in that: The cross-attention mechanism in the decoder includes linearly projecting the query features, keys and values ​​of the decoder layer to the weight matrix of the next layer and updating the features through residual connections, wherein the cross-attention mechanism is used to model the long-range dependency relationship between the lymph node region and the surrounding tissues on a global scale.

7. The method for automatic segmentation of cervical lymph nodes in CT images according to claim 1, characterized in that: The separable Dice loss involves calculating the Dice loss for the contour component and the non-contour component of the target region respectively, and controls the importance of the contour loss by introducing a weight parameter to deal with the inter-class imbalance problem.

8. The method for automatic segmentation of cervical lymph nodes in CT images according to claim 1 or 7, characterized in that: The contour weighted cross entropy loss emphasizes the importance of the target region boundary in the loss calculation by assigning large weights to pixels belonging to the contour region, where the contour region is extracted from the original annotated region through morphological operations, including erosion and boundary indentation operations.

9. The method for automatic segmentation of cervical lymph nodes in CT images according to claim 8, characterized in that: The optimizer adopts AdamW, and the learning rate update method is preheating cosine annealing. During the preheating stage, the learning rate gradually increases from 0.000001 to 0.0001.

10. A system for automatically segmenting cervical lymph nodes in CT images, used to implement the method for automatically segmenting cervical lymph nodes in images according to any one of claims 1 to 9, characterized in that: include: Data collection and preprocessing module for: Collecting cervical CT image data, and annotating the CT image data according to the zoning standard of the cervical lymph node area to generate a lymph node area mask; Normalizing the CT image data and the annotation mask, scaling the pixel values ​​of the image data to a preset range, and adjusting the pixel spacing to a preset value; Segmentation model building module for: Designing a hybrid encoder, which includes a convolutional neural network-based encoder and a Transformer-based encoder; The encoder of the convolutional neural network adopts densely connected blocks, performs feature extraction through batch normalization, nonlinear activation and convolution operations, and gradually reduces the spatial resolution of the feature map through downsampling operations; The Transformer encoder is composed of multiple stacked Transformer blocks, each of which includes a linear projection module, a block embedding module, and a Transformer layer to capture long-range spatial dependencies. Design a hybrid decoder that includes a CNN-based decoder and a Transformer-based decoder, fuses feature maps through a cross-attention mechanism, and optimizes feature transfer using a residual unit module; The feature map output by the encoder is upsampled through the decoder to generate a segmentation mask; Loss function design module, used for: Construct a composite loss function, including separable Dice loss and contour weighted cross entropy loss, to alleviate the problem of inter-class imbalance and improve segmentation accuracy; Training and validation of segmentation model modules, used to: The segmentation model is trained using the optimizer and the learning rate is updated using warmed cosine annealing. To verify the segmentation performance of the model, the Diess similarity coefficient, mean surface distance, and Hausdorff distance were used to evaluate the segmentation effect of the segmentation model on the lymph node area of ​​the test set.

Citation Information

Patent Citations

  • Medical image processing method and device, computer equipment and storage medium

    CN115272206A