A method and system for automatic segmentation of hepatocellular carcinoma tumors based on CT images
Through the MSBP-Net network, Res2Net and other modules are used to enhance feature extraction and boundary prediction, which solves the shortcomings of the U-Net series network in low-contrast CT image segmentation and achieves efficient and accurate hepatocellular carcinoma tumor segmentation and volume assessment. The network complexity and memory usage are reduced, making it suitable for clinical applications.
Patent Information
- Application Number
- CN202410939341.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-15
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2044-07-15
AI Technical Summary
The existing U-Net series network is difficult to effectively segment hepatocellular carcinoma tumors when faced with complex and low-contrast CT images, and the network complexity and memory usage are high, which limits its clinical application prospects.
A CNN-based MSBP-Net network is designed, using pre-trained Res2Net as the encoder, combined with the cross-receptive field module, boundary prediction module, joint upsampling module and shallow filtering module to enhance feature extraction and boundary prediction capabilities and reduce Network complexity and memory usage to achieve efficient automatic segmentation of hepatocellular carcinoma tumors.
It achieves efficient and accurate hepatocellular carcinoma tumor segmentation in CT images, reduces network complexity and memory usage, improves segmentation speed and accuracy, and can automatically calculate tumor volume and maximum diameter, making it suitable for clinical applications.
Smart Images

Figure CN118470052B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of CT image segmentation, and in particular to a method and system for automatic segmentation of hepatocellular carcinoma tumors based on CT images. Background Art
[0002] Hepatocellular carcinoma (HCC) is the most common primary liver cancer, with the characteristics of low predictability, rapid deterioration and high mortality. The recurrence rate of early HCC is lower than that of late HCC, and the 5-year survival rate is higher. Therefore, timely and accurate diagnosis and treatment of HCC is of great significance.
[0003] Currently, HCC is mainly screened through imaging techniques, among which computed tomography (CT) has become one of the most commonly used imaging techniques for screening HCC due to its short examination time and high imaging quality. Accurately locating the cancerous area in CT images is an important part of the treatment of HCC. Figure 1 As shown in the figure, due to the different tumor conditions of different patients, the low contrast between the cancerous area and the normal area, and the close connection between the liver and other surrounding tissues and organs, it is difficult to define the boundary between the cancerous area and the normal area. Therefore, accurate segmentation of the cancerous area has become the primary task of HCC treatment.
[0004] In recent years, deep learning methods have provided new solutions for medical image segmentation with their powerful feature learning capabilities. In practical applications, many researchers have experimentally proved that the accuracy of convolutional neural networks (CNNs) in medical image recognition of different modalities is better than other existing deep learning networks. The U-Net and its improved versions such as U-Net++ and U-Net3+ are the most representative CNN networks in the field of medical image segmentation and are widely used because of their simple structure and effectiveness.
[0005] However, the U-Net series of networks are prone to being unable to effectively predict when faced with complex and low-contrast image information. At the same time, the complexity of the U-Net series of networks, including parameter complexity, computational complexity, and video memory usage, is relatively high. In the future, lightweight automatic segmentation methods will have more clinical application prospects.
[0006] Therefore, we will propose a medical image segmentation network based on CNN that can achieve efficient segmentation and is memory-friendly, and design a corresponding segmentation system and method to quickly and accurately segment the HCC area in CT images. Summary of the invention
[0007] The purpose of the present invention is to solve the above technical problem and to provide a method and system for automatic segmentation of hepatocellular carcinoma tumors based on CT images.
[0008] A method for automatic segmentation of hepatocellular carcinoma tumors based on CT images comprises the following steps:
[0009] S1: Construct the MSBP-Net network to segment the HCC area from 2D CT images;
[0010] S11: Res2Net encoder performs encoding operations on the two-dimensional CT image entering the MSBP-Net network;
[0011] S12: The MSBP-Net network records the end of the Res2Net encoder as the deep layer and starts decoding towards the shallow layer;
[0012] S2: Divide and preprocess the data, then train and test the MSBP-Net network to build an automatic hepatocellular carcinoma tumor segmentation system;
[0013] S21: The CT images were randomly divided into training set, validation set and test set in a ratio of 8:1:1, and each image was sliced;
[0014] S22: Import the training set and validation set into the MSBP-Net network for training and validation, use the composite loss function to calculate the training loss, update the parameters according to the loss of the training set, and save the best segmentation model with reference to the results of the validation set;
[0015] S23: the best segmentation model is evaluated on the test set, and after the evaluation result reaches the expected result, the best segmentation model is used as the two-dimensional segmentation model of the segmentation system;
[0016] S24: Connect the three functions of nii file slicing, 2D segmentation, 3D reconstruction and size assessment into one process to create an automatic segmentation system for hepatocellular carcinoma tumors;
[0017] The composite loss function includes dice loss and cross entropy loss;
[0018] The slicing process includes slicing operation and resizing function, and the processed two-dimensional CT image is 352×352 pixels;
[0019] The specifications of the feature map are number × length × width.
[0020] Furthermore, in a method for automatic segmentation of hepatocellular carcinoma tumors based on CT images, step S11 includes the following sub-steps:
[0021] S111: The two-dimensional CT image passes through the five convolution modules of the Res2Net encoder in sequence to obtain feature maps of five sizes. Each module is recorded as a level, with a total of five levels.
[0022] S112: The feature maps output by the last three layers are passed through the receptive field module and the cross receptive field module to extract the large-scale receptive field and global information, and the number of feature maps is compressed to 64;
[0023] The feature map specifications of the five levels’ outputs are 64×88×88, 256×88×88, 512×44×44, 1024×22×22, and 2048×11×11, respectively.
[0024] Furthermore, in a method for automatic segmentation of hepatocellular carcinoma tumors based on CT images, step S12 includes the following sub-steps:
[0025] S121: Boundary prediction:
[0026] The outputs of the fifth and fourth layers of the Res2Net encoder simultaneously enter the first boundary prediction module and output BP4;
[0027] The output of the third layer of the Res2Net encoder and BP4 simultaneously enter the second boundary prediction module and output BP3;
[0028] The output of the second layer of the Res2Net encoder and BP3 simultaneously enter the third boundary prediction module and output BP2;
[0029] BP4, BP3 and BP2 represent the results of rough segmentation, and the specifications are 64×22×22, 64×44×44, and 64×88×88 respectively;
[0030] S122: Joint upsampling: BP4, BP3 and BP2 enter the joint upsampling module, and after upsampling and mutual fusion, the output feature map has a size of 64×88×88;
[0031] S123: Shallow filtering: The feature map output by the first layer of Res2Net and the feature map output by the joint upsampling are simultaneously introduced into the shallow filtering module to obtain a feature map with a size of 64×88×88;
[0032] The feature map obtained by the shallow filtering module contains fine boundary information;
[0033] S124: The MSBP-Net network upsamples the outputs of BP3, BP2, the joint upsampling module, and the output of the shallow filtering module, and restores them to four 1×352×352 feature maps;
[0034] S125: The MSBP-Net network concatenates the four restored feature maps, uses 1×1 convolution and Sigmoid activation function for dimensionality reduction and activation, and obtains a binary mask with a size of 1×352×352.
[0035] Furthermore, in a method for automatic segmentation of hepatocellular carcinoma tumors based on CT images, step S112 includes the following sub-steps:
[0036] S1121: The 1×1 convolution at the beginning is used in the cross receptive field module to compress the number of feature maps to 64, and enter the cross attention module to extract global information;
[0037] S1122: The outputs of the three branches are concatenated into 192 feature maps, and the 1×1 convolution at the end compresses the 192 feature maps into 64 feature maps.
[0038] Furthermore, in a method for automatic segmentation of hepatocellular carcinoma tumors based on CT images, the step S121 includes the following sub-steps:
[0039] S1211: In the boundary prediction module, the size of the deep feature map is doubled after upsampling, and is unified with the size of the shallow feature map;
[0040] S1212: After the shallow feature map passes through the 1×1 convolution block, it has the same number as the deep feature map, and then multiplies and adds it with the deep feature map (, using the deep feature map as the weight to find the location of the boundary in the shallow feature map), and outputs a new shallow feature map;
[0041] S1213: The output shallow feature map finally enters the 3×3 convolution block so that the correction boundary information therein is corrected.
[0042] Furthermore, in a method for automatic segmentation of hepatocellular carcinoma tumors based on CT images, step S122 includes the following sub-steps:
[0043] S1221: The input of the joint upsampling module is BP4, BP3 and BP2. After the depthwise convolution and pointwise convolution of the depthwise separable convolution block are used for feature extraction, they are still recorded as BP4, BP3 and BP2.
[0044] S1222: BP4 is upsampled once and its size is doubled, multiplied with BP3 and then added, and the weighted result enters the 3×3 convolution block, where the boundary information is further corrected to obtain the corrected BP3;
[0045] S1223: weighting the corrected BP3 with BP2 in the same steps to obtain a corrected BP2;
[0046] S1224: upsampling the corrected BP3 using the corrected BP2 as a template, and then splicing BP2 and BP3 with the second upsampled BP4 to obtain a splicing result with a size of 192×88×88;
[0047] S1225: The concatenated results are subjected to four parallel dilated convolutions to obtain four sets of feature maps with a size of 64×88×88;
[0048] S1226: The four groups of feature maps are concatenated to obtain a feature map with a size of 256×88×88. After the feature map is convolved through the last 3×3 convolution block, an output result with a size of 64×88×88 is obtained.
[0049] Furthermore, in a method for automatic segmentation of hepatocellular carcinoma tumors based on CT images, step S123 further includes the following sub-steps:
[0050] S1231: The shallow filtering module concatenates the shallow feature map with the deep feature map, passes through two consecutive 3×3 convolution blocks, uses the Sigmoid function for activation, and filters out some noise;
[0051] S1232: The activation result is multiplied by the deep feature map to obtain a weighted feature map. The weighted feature map is concatenated with the deep feature map, and after two consecutive 3×3 convolution blocks and a Sigmoid function, an output result containing fine boundaries is obtained.
[0052] An automatic segmentation system for hepatocellular carcinoma tumors based on CT images. It can complete 2D slicing, 2D segmentation and 3D reconstruction of 3D CT data through simple click operations, and calculate the volume and maximum diameter of the tumor.
[0053] The automatic segmentation system for hepatocellular carcinoma tumors includes a MSBP-Net model and a data processing system;
[0054] The MSBP-Net represents a CNN structure for segmentation of weak boundary regions;
[0055] The MSBP-Net model is derived from the optimal model after MSBP-Net training and testing, and is designed to achieve two-dimensional segmentation, and cooperate with the data processing system to achieve automatic segmentation and size assessment of HCC in the HCC region;
[0056] The MSBP-Net model includes a Res2Net encoder, a receptive field module, a cross receptive field module, a boundary prediction module, a joint upsampling module, and a shallow filtering module;
[0057] The Res2Net encoder enhances the encoding capability of the network;
[0058] The receptive field module compresses the number of feature maps to 64;
[0059] The cross receptive field module is designed based on the receptive field module and the cross attention module;
[0060] The cross-attention module extracts global information;
[0061] The boundary prediction module realizes the positioning and rough segmentation of the target boundary;
[0062] The joint upsampling module fuses the outputs of the three boundary modules to suppress the problem of wrong segmentation;
[0063] The shallow filtering module denoises the shallow features from the jump connection;
[0064] The data processing system includes two-dimensional slice processing, three-dimensional reconstruction, and tumor size assessment;
[0065] The two-dimensional slicing process slices each image and resizes it to 352×352 pixels;
[0066] The resize function is to transform the image size;
[0067] The three-dimensional reconstruction reconstructs the prediction result corresponding to the two-dimensional CT image into a three-dimensional segmentation result according to the specifications of each image;
[0068] The tumor size assessment uses the Pyradiomics tool to perform voxel statistics on the three-dimensional segmentation results and calculate the volume and maximum diameter of the tumor;
[0069] The segmentation model construction module includes functional submodules, a user interaction interface, and a PyInstaller tool;
[0070] The functions of the functional submodules are slicing operation and resizing function of nii files, two-dimensional segmentation, three-dimensional reconstruction and size evaluation;
[0071] The user interaction interface is created using PyQt5, and function buttons and display boxes are drawn and connected to corresponding callback programs respectively;
[0072] The PyInstaller tool encapsulates the functional submodules and the user interaction interface to form an automatic hepatocellular carcinoma tumor segmentation system.
[0073] Furthermore, a hepatocellular carcinoma tumor automatic segmentation system based on CT images, wherein the Res2Net encoder captures feature information of different scales through cross-connection and multi-branching mechanisms to adapt to tumors of different scales and shapes; feature maps are transmitted and reused within different networks, and the feature reuse rate is improved by using the information of the input image;
[0074] The boundary prediction module fuses the feature maps of two adjacent layers through simple multiplication and addition operations and a convolution operation to predict the position and shape of the target boundary and achieve rough boundary segmentation;
[0075] The joint upsampling module uses depthwise separable convolution to replace some convolution operations; uses high-resolution low-level feature maps to guide low-resolution high-level feature maps to restore, locate and segment tumor boundaries, and suppress the problem of erroneous segmentation;
[0076] The shallow filtering module is used to denoise the shallow features from the jump connection and extract the boundary information in the shallow information to further correct the segmentation result;
[0077] The test evaluates model performance through DSC, Hausdorff distance, intersection over union, and recall.
[0078] Beneficial effects of the present invention:
[0079] (1) The encoder’s ability to capture tumors is enhanced. The MSBP-Ne network uses a pre-trained multi-scale feature extraction network Res2Net as the encoder and constructs a cross-receptive field module, which can obtain richer and more advanced semantic features, providing a more solid foundation for the decoder’s information reconstruction;
[0080] (2) The decoder’s ability to predict boundaries is enhanced. A boundary prediction module, a joint upsampling module, and a shallow filtering module are proposed. The deep feature maps are repeatedly used to weight and fuse the shallow feature maps to capture the location and shape of the cancerous area, and finally the boundary segmentation is accurately completed.
[0081] (3) Reduced network complexity and video memory usage. By controlling the number of filters in each decoding layer and using depthwise separable convolution, feature redundancy and parameter redundancy were reduced. While ensuring stable segmentation performance, the segmentation speed of the model was optimized and the video memory usage of the model was compressed.
[0082] (4) It can not only automatically segment the tumor area, but also automatically calculate the tumor volume, maximum diameter and other values for the doctor's reference. BRIEF DESCRIPTION OF THE DRAWINGS
[0083] Figure 1 This is a comparison chart between the cancerous area and the normal area.
[0084] Figure 2 This is the structural diagram of the MSBP-Net network.
[0085] Figure 3 This is the main structure diagram of the Res2Net encoder.
[0086] Figure 4 This is the structure diagram of the cross receptive field module.
[0087] Figure 5 This is the structure diagram of the boundary prediction module.
[0088] Figure 6 This is the structural diagram of the joint upsampling module.
[0089] Figure 7 This is the structural diagram of the shallow filtering module.
[0090] Figure 8 Flowchart constructed for the segmentation system.
[0091] Fig. 9 The figure shows the segmentation results.
[0092] Fig.10 Flowchart of system operation. DETAILED DESCRIPTION
[0093] The present invention is further described below, but the protection scope of the present invention is not limited to the following description.
[0094] 1. Software
[0095] A new CNN with an encoder-decoder structure is proposed to target the low-contrast characteristics of cancerous areas, which can be used to automatically segment HCC cancerous areas in CT images. On the one hand, given the small information difference between tumors and normal tissues, the encoder's ability to extract multi-scale features and the decoder's ability to predict boundaries will be enhanced to improve the network's segmentation performance. On the other hand, in order to maintain the network's complexity and memory usage at a low level, the number of filters in the decoder and the redundant structure of the modules will be compressed while ensuring good segmentation performance, so as to improve the network's lightweightness and ultimately obtain an efficient segmentation model.
[0096] In order to improve the flexibility of the model, the model and a series of data processing operations are encapsulated into a segmentation system. Through simple clicks, two-dimensional slicing, two-dimensional segmentation and three-dimensional reconstruction of three-dimensional CT data can be completed, and the volume and maximum diameter of the tumor and other values can be calculated for the doctor's reference. The system does not require a high-performance graphics card as a platform to assist doctors in efficiently completing the segmentation and evaluation of HCC cancerous areas in CT images.
[0097] 1.1 Algorithm model improvement
[0098] A CNN structure focusing on weak boundary region segmentation, named MSBP-Net, is proposed to efficiently segment the HCC region in CT images. In previous studies, the U-Net series of networks are prone to incorrect segmentation when the contrast between the background and the foreground is low. The main reasons for this may be:
[0099] (1) The encoder’s feature extraction capability is insufficient and it is difficult to fully capture the difference between foreground and background;
[0100] (2) The decoder has a single feature fusion method and cannot efficiently use boundary information for boundary segmentation;
[0101] (3) The deepest layer of the decoder of the U-Net series network has 1024 filters, which leads to a significant increase in computational complexity and memory usage.
[0102] In order to make up for these shortcomings, MSBP-Net will be designed from the following aspects:
[0103] (1) Use the pre-trained novel multi-scale residual network Res2Net as the encoder of MSBP-Net to enhance the encoding ability of the network;
[0104] (2) The decoding layer connected to the deep layer of the encoder is recorded as the deep layer of the decoder. In the deep layer of the decoder, a boundary prediction module is proposed to perform target positioning and rough boundary segmentation, and a joint upsampling module is constructed to fuse the outputs of the three boundary modules to suppress the problem of incorrect segmentation;
[0105] (3) In the shallow layer of the decoder, a shallow filtering module is designed to extract boundary information from the shallow layer information to further correct the segmentation results.
[0106] As attached Figure 2 As shown in the figure, in order to reduce the complexity of the model and the memory usage, the number of filters in each decoding layer is unified to 64. The specific process of CT images entering MSBP-Net is as follows:
[0107] (1) The two-dimensional CT image enters the MSBP-Net and first receives the encoding operation of the encoder:
[0108] 1. After passing through the five convolutional modules of Res2Net in sequence, feature maps of five sizes are obtained, and each module is recorded as a layer separately;
[0109] The specifications of the feature maps output by the five levels are: number×length×width are 64×88×88, 256×88×88, 512×44×44, 1024×22×22, 2048×11×11 respectively;
[0110] 2. The feature maps output by the last three levels are further passed through the receptive field module and the cross receptive field module to further extract the large-scale receptive field and global information, and the number of feature maps is compressed to 64. At this point, MSBP-Net completes the encoding operation.
[0111] (2) MSBP-Net starts from the end of the encoder Res2Net and gradually decodes to the shallow layer, which is 1. boundary prediction, 2. joint upsampling and 3. shallow filtering:
[0112] The end of Res2Net is recorded as the deep layer;
[0113] 1. Boundary prediction: The outputs of the fifth and fourth layers of the encoder simultaneously enter the first boundary prediction module and output BP4; the output of the third layer of the encoder and BP4 simultaneously enter the second boundary prediction module and output BP3; the output of the second layer of the encoder and BP3 simultaneously enter the third boundary prediction module and output BP2;
[0114] BP4, BP3, and BP2 are regarded as the results of rough segmentation, with specifications of 64×22×22, 64×44×44, and 64×88×88, respectively;
[0115] 2. Joint upsampling: BP4, BP3 and BP2 enter the joint upsampling module. After upsampling and mutual fusion, the output feature map is 64×88×88, which can alleviate the problem of incorrect segmentation in the rough segmentation result.
[0116] 3. Shallow filtering: The feature map output by the first layer of the encoder and the feature map output by the joint upsampling are simultaneously introduced into the shallow filtering module to obtain a feature map with a size of 64×88×88, which contains fine boundary information.
[0117] (3) MSBP-Net upsamples the outputs of BP3, BP2, the joint upsampling module, and the output of the shallow filtering module, restoring them into four 1×352×352 feature maps. These four feature maps are then concatenated and dimensionality reduced and activated using 1×1 convolution and Sigmoid activation functions to obtain a binary mask with a size of 1×352×352.
[0118] 1.1.1 Encoder composition
[0119] HCC in CT images is difficult to accurately capture due to its random size, shape and position. MSBP-Net uses pre-trained Res2Net as an encoder. Compared with the single-size convolution kernel stacking form in the U-Net series of networks, Res2Net can capture feature information of different scales through structural cross-connection and multi-branch mechanism, and adapt to tumors of different scales and shapes. At the same time, feature maps are transmitted and reused within different networks, which helps to make full use of the information of the input image and improve the reuse rate of features. Res2Net pre-trained on the ImageNet dataset can accelerate the convergence of the network and improve the generalization ability of the model.
[0120] As attached Figure 3 As shown, the process of feature map entering Res2Net encoder is:
[0121] (1) After the feature map is dimensionalized by 1×1 convolution, it is separated into four equal parts, and the number and size of feature maps contained in each part are the same;
[0122] (2) The four parts enter the corresponding four branches respectively, and the feature information of four scales is obtained by adding three 3×3 convolutions and two skip connections;
[0123] (3) The feature maps of the four branches are concatenated and dimensionality reduced using 1×1 convolution, and then added to the input feature map to finally obtain a feature map containing multi-scale information.
[0124] In addition, MSBP-Net uses a receptive field module between the encoder and decoder, and designs a cross receptive field module based on the receptive field module and the cross attention module, aiming to further obtain large-scale receptive fields and global information, and compress the number of channels of the multi-scale feature map to 64 to match the number of filters in each decoding layer of the decoder. Although cross attention can capture global information, it has a high complexity. Therefore, after comprehensive consideration, only the cross receptive field module is used between the fourth-layer encoder and decoder.
[0125] As attached Figure 4 As shown in Figure 1, the process of the feature map entering the cross receptive field module is as follows:
[0126] (1) The receptive field module can directly compress the number of feature maps to 64, while the cross-attention module cannot perform this operation. Therefore, in the cross-receptive field module, the number of feature maps is first compressed to 64 using the initial 1×1 convolution, and then enters the cross-attention module to extract global information;
[0127] (2) Finally, the outputs of the three branches are concatenated into 192 feature maps, which are then compressed into 64 feature maps by the 1×1 convolution at the end.
[0128] 1.1.2 Deep Design of Decoder
[0129] In CT images, the contrast between the HCC area and normal liver tissue is low, which makes boundary prediction difficult. The main structure of the decoder in the U-Net series network only contains convolutional layers and layer-by-layer upsampling operations, and the boundary prediction effect needs to be improved. Therefore, a boundary prediction module is designed to fuse the feature maps of two adjacent layers through simple multiplication and addition operations and a convolution operation to predict the position and shape of the target boundary, thereby efficiently achieving rough boundary segmentation.
[0130] As attached Figure 5 As shown, the process of the feature map entering the boundary prediction module structure diagram is:
[0131] (1) After upsampling, the size of the deep feature map is doubled and unified with the size of the shallow feature map;
[0132] (2) After passing through the 1×1 convolution block, the shallow feature map has the same number as the deep feature map. It is then multiplied with the deep feature map and then added. The deep feature map is used as the weight to find the location of the boundary in the shallow feature map. The output shallow feature map finally enters the 3×3 convolution block, so that the boundary information therein is further verified.
[0133] Secondly, in order to enhance the effect of boundary prediction, a joint upsampling module is constructed to fuse the outputs of the three boundary prediction modules, and use the high-resolution low-level feature map to guide the low-resolution high-level feature map for restoration, so as to better locate and segment the tumor boundary and suppress the problem of incorrect segmentation. The joint upsampling module uses deep separable convolution to replace part of the traditional convolution operations to further reduce the complexity of the module. The complexity of deep separable convolution is low, but it has a slight negative impact on the segmentation accuracy.
[0134] As attached Figure 6 As shown in Figure 2, the process of feature maps entering the joint upsampling module structure is as follows:
[0135] (1) The input of the joint upsampling module is BP4, BP3 and BP2, with specifications of 64×22×22, 64×44×44, and 64×88×88, respectively. After feature extraction by depthwise convolution + pointwise convolution of the depthwise separable convolution block, they are still recorded as BP4, BP3 and BP2;
[0136] (2) After BP4 is upsampled once, its size is doubled, and then it is multiplied and added with BP3. The weighted result enters the 3×3 convolution block, where the boundary information is further verified to obtain the corrected BP3.
[0137] (3) The corrected BP3 is weighted with BP2 in the same way to obtain the corrected BP2;
[0138] (4) Using the corrected BP2 as a template, upsample the corrected BP3 once, and then concatenate the two with the twice-upsampled BP4 to obtain a concatenation result with a size of 192×88×88;
[0139] (5) After four parallel dilated convolutions, the concatenated results are four sets of feature maps with a size of 64×88×88. These four sets of feature maps are concatenated again to obtain feature maps with a size of 256×88×88. After the feature maps are convolved through the final 3×3 convolution block, the output result with a size of 64×88×88 is obtained.
[0140] 1.1.3 Shallow Decoder Design
[0141] Shallow features contain fine information about boundaries, but also contain a large amount of irrelevant noise. The U-Net series of networks directly transfer shallow features to the decoding layer for splicing through jump connections. This method will have a negative impact on the final result due to noise. Therefore, some studies have directly abandoned shallow features. In fact, fully integrating the boundary information in shallow features can achieve better segmentation effects.
[0142] Therefore, a shallow filtering module is designed to denoise the shallow features from the jump connection. The module first uses the feature map from the deep layer as a reference, and suppresses the irrelevant information of the shallow features through convolution and multiplication operations; then the denoised shallow features are fused with the feature map from the deep layer to obtain the corrected segmentation result.
[0143] As attached Figure 7 As shown in the figure, the process of the feature map entering the shallow filtering module is:
[0144] (1) The specifications of the deep feature map and the shallow feature map are both 64×88×88. The shallow filtering module first concatenates the shallow feature map and the deep feature map, passes through two consecutive 3×3 convolution blocks, and uses the Sigmoid function for activation to filter out some noise;
[0145] (2) The activation result is multiplied by the deep feature map to obtain a weighted feature map, which is concatenated with the deep feature map. After two consecutive 3×3 convolution blocks and a Sigmoid function, an output result containing fine boundaries is obtained.
[0146] 1.2 Segmentation system design
[0147] As attached Figure 8 As shown in the figure, there are three steps in total: (1) data division and preprocessing; (2) model training and testing; (3) segmentation system construction.
[0148] (1) Data division and preprocessing:
[0149] First, 289 CT images were randomly divided into training set, validation set, and test set in a ratio of 8:1:1;
[0150] Each image is sliced and resized to 352×352 pixels. The slice results of each image include two situations: a. an image with a tumor and the corresponding binary label; b. an image without a tumor and the corresponding pure black background. Therefore, the model needs to first determine whether the image contains HCC, and then segment the area where HCC exists.
[0151] (2) Model training and testing: The training set and validation set are imported into MSBP-Net for training and validation. The training loss is calculated using a composite loss function. The model updates parameters based on the loss of the training set, and the best model is saved with reference to the results of the validation set.
[0152] Among them, the composite loss function includes Dice loss and cross entropy loss;
[0153] Since the training process guided by the Dice loss may not be credible, the Dice Similarity Coefficient (DSC) of the validation set is used as a reference, and the change of DSC within 20 epochs is monitored through the early stopping mechanism. If the verified DSC no longer rises within 20 epochs, it is considered that the model has converged to the ideal range. Finally, in the test phase, DSC, Hausdorff Distance (HD), Intersection of Union (IOU), and Recall (Rec) are used to evaluate the performance of the model, and the model with the best performance is included in the segmentation system.
[0154] (3) Segmentation system construction: connect the three functions of 1.nii file slicing and resizing, 2.2D segmentation, 3.3D reconstruction, and volume and size evaluation into a complete process;
[0155] Use PyQt5 to create a user interaction interface, draw function buttons and display boxes, and connect them to the corresponding callback programs respectively;
[0156] The entire process and interface are encapsulated through PyInstaller, eventually forming a simple HCC segmentation system.
[0157] 2 Experimental Results
[0158] In order to verify the effectiveness of the proposed MSBP-Net, three networks of the U-Net series, U-Net, U-Net++, and U-Net3+, were used for ablation experiments. During the test, two test sets were used: (1) only the slices and labels containing tumors were retained, recorded as test set 1, to test the performance of the model focusing on HCC boundary segmentation; (2) all slices and labels of each case were retained, recorded as test set 2, to comprehensively test the model's ability to capture HCC and segmentation performance.
[0159] The test results on the test set are shown in Table 1. MSBP-Net improves DSC by at least 8.95% on test set 1 and at least 1.51% on test set 2.
[0160] Table 1 Performance comparison between MSBP-Net and other networks
[0161]
[0162] The final segmentation result is shown in the attached Fig. 9 As shown in the figure, the relevant results prove that MSBP-Net has obvious performance advantages on both datasets.
[0163] Under the same experimental conditions, the parameter amount, computation amount, and video memory usage of MSBP-Net and the three U-Net series networks are counted respectively, as shown in Table 2. It can be intuitively seen that MSBP-Net has the advantage of lightweight.
[0164] Table 2 Comparison of lightweightness between MSBP-Net and other networks
[0165]
[0166] In addition, the time consumed by different networks to process the test set is also recorded. The data proves that the segmentation speed of MSBP-Net is also faster than that of the U-Net series networks.
[0167] 3 System operation process
[0168] In order to facilitate the use of clinicians, the complete process of HCC segmentation was packaged into a segmentation system using PyQt5, which includes three stages: 1 slicing operation, 2 segmentation operation, and 3 3D reconstruction operation;
[0169] The initial user interface mainly includes the operation box part, the image display part and the tumor size evaluation display part. The system operation process is as follows: Fig.10 As shown, the main operation process is:
[0170] "Select .nii file" Select the sampling save path "2D Slice" "Select the path to save the segmentation results" "2D Segmentation" "Select the path to save the .nii results" "3D Reconstruction".
[0171] After the system completes the "3D reconstruction", it will automatically evaluate the size of the tumor and pop up a folder to save the .nii results. The doctor can complete the segmentation of HCC in the CT image by selecting the corresponding path in the operation box and clicking the corresponding function button. It can also automatically calculate the volume and maximum diameter of the tumor for the doctor's reference. The entire operation process is simple and clear, saving time and effort.
[0172] This scheme proposes an efficient medical image segmentation network MSBP-Net through an automatic segmentation method and system for hepatocellular carcinoma tumors based on CT images, which takes into account the advantages of high performance, lightweight and speed, and has lower dependence on high-performance graphics cards; the HCC automatic segmentation system based on CT images built by relying on MSBP-Net includes three steps: CT image two-dimensional slicing, two-dimensional segmentation and three-dimensional reconstruction. The segmentation task of the specified case can be quickly completed by clicking the corresponding buttons in sequence, and the tumor volume and maximum diameter and other indicators can be automatically calculated for the doctor's reference; thanks to the high efficiency and lightweight characteristics of MSBP-Net, the automatic segmentation system can run normally on ordinary computers and has more practical application value in the clinical field.
[0173] The above shows and describes the basic principles and main features of the present invention and the advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. An automatic segmentation method for hepatocellular carcinoma tumors based on CT images, It is characterized in that The following steps are involved: S1: Construct the MSBP-Net network to segment the HCC area from the two-dimensional CT image; S11: Res2Net encoder performs encoding operations on the two-dimensional CT image entering the MSBP-Net network; S12: The MSBP-Net network records the end of the Res2Net encoder as the deep layer and starts decoding towards the shallow layer; S2: Divide and preprocess the data, train and test the MSBP-Net network, and build an automatic segmentation system for hepatocellular carcinoma tumors; S21: The CT images were randomly divided into training set, validation set and test set in a ratio of 8:1:1, and each image was sliced; S22: Import the training set and the validation set into the MSBP-Net network for training and validation, use the composite loss function to calculate the training loss, update the parameters according to the loss of the training set, and save the best segmentation model with reference to the results of the validation set; S23: The best segmentation model is evaluated on the test set. After the evaluation result meets expectations, the best segmentation model is used as the two-dimensional segmentation model of the segmentation system. S24: Connect the three functions of nii file slicing, 2D segmentation, 3D reconstruction and size assessment into one process to create an automatic segmentation system for hepatocellular carcinoma tumors; The composite loss function includes dice loss and cross entropy loss; The slicing process includes slicing operation and resizing function, and the processed two-dimensional CT image is 352×352 pixels; The specifications of the feature map are number × length × width; The MSBP-Net network focuses on the CNN structure of weak boundary area segmentation to efficiently segment the HCC area in the CT image. The specific design is as follows: (1) Use the pre-trained novel multi-scale residual network Res2Net as the encoder of MSBP-Net to enhance the encoding ability of the network; (2) The decoding layer connected to the deep layer of the encoder is recorded as the deep layer of the decoder. In the deep layer of the decoder, a boundary prediction module is proposed to perform target positioning and rough boundary segmentation, and a joint upsampling module is constructed to fuse the outputs of the three boundary modules to suppress the problem of incorrect segmentation; (3) In the shallow layer of the decoder, a shallow filtering module is designed to extract boundary information from the shallow information to further correct the segmentation results; In order to reduce the complexity of the model and the amount of video memory occupied, the number of filters in each decoding layer is unified to 64. The specific process of CT images entering MSBP-Net is as follows: The S11 comprises the following sub-steps: S111: The two-dimensional CT image passes through the five convolution modules of the Res2Net encoder in sequence to obtain feature maps of five sizes. Each module is recorded as a level, with a total of five levels. S112: The feature maps output by the last three layers are passed through the receptive field module and the cross receptive field module to extract the large-scale receptive field and global information, and the number of feature maps is compressed to 64; The feature map specifications of the five levels are 64×88×88, 256×88×88, 512×44×44, 1024×22×22, and 2048×11×11 respectively; The S12 comprises the following sub-steps: S121: Boundary prediction: The outputs of the fifth and fourth layers of the Res2Net encoder simultaneously enter the first boundary prediction module and output BP4; The output of the third layer of the Res2Net encoder and BP4 simultaneously enter the second boundary prediction module and output BP3; The output of the second layer of the Res2Net encoder and BP3 simultaneously enter the third boundary prediction module and output BP2; BP4, BP3 and BP2 represent the results of rough segmentation, and the specifications are 64×22×22, 64×44×44, and 64×88×88 respectively; S122: Joint upsampling: BP4, BP3 and BP2 enter the joint upsampling module, and after upsampling and mutual fusion, the output feature map has a size of 64×88×88; S123: Shallow filtering: The feature map output by the first layer of Res2Net and the feature map output by the joint upsampling are simultaneously introduced into the shallow filtering module to obtain a feature map with a size of 64×88×88; The feature map obtained by the shallow filtering module contains fine boundary information; S124: The MSBP-Net network upsamples the outputs of BP3, BP2, the joint upsampling module, and the output of the shallow filtering module, and restores them to four 1×352×352 feature maps; S125: The MSBP-Net network concatenates the four restored feature maps, uses 1×1 convolution and Sigmoid activation function for dimensionality reduction and activation, and obtains a binary mask with a size of 1×352×352.
2. The method for automatic segmentation of hepatocellular carcinoma tumors based on CT images according to claim 1, It is characterized in that The step S112 includes the following sub-steps: S1121: The 1×1 convolution at the beginning is used in the cross receptive field module to compress the number of feature maps to 64, and enter the cross attention module to extract global information; S1122: The outputs of the three branches are concatenated into 192 feature maps, and the 1×1 convolution at the end compresses the 192 feature maps into 64 feature maps.
3. The method for automatic segmentation of hepatocellular carcinoma tumors based on CT images according to claim 1, It is characterized in that The step S121 includes the following sub-steps: S1211: In the boundary prediction module, the size of the deep feature map is doubled after upsampling, and the size is unified with the shallow feature map; S1212: After the shallow feature map passes through the 1×1 convolution block, it has the same number as the deep feature map, multiplying it with the deep feature map and then adding it, using the deep feature map as the weight to find the location of the boundary in the shallow feature map, and outputting a new shallow feature map; S1213: The output shallow feature map finally enters the 3×3 convolution block to correct the boundary information.
4. The method for automatic segmentation of hepatocellular carcinoma tumors based on CT images according to claim 1, It is characterized in that The step S122 includes the following sub-steps: S1221: The input of the joint upsampling module is BP4, BP3 and BP2. After the depthwise convolution and pointwise convolution of the depthwise separable convolution block are used for feature extraction, they are still recorded as BP4, BP3 and BP2. S1222: BP4 is upsampled once and its size is doubled, multiplied with BP3 and then added, and the weighted result enters the 3×3 convolution block to further correct the boundary information to obtain the corrected BP3; S1223: weighting the corrected BP3 with BP2 in the same steps to obtain a corrected BP2; S1224: upsampling the modified BP3 using the modified BP2 as a template, and then splicing BP2 and BP3 with the twice-upsampled BP4 to obtain a splicing result with a size of 192×88×88; S1225: The concatenated results are subjected to four parallel dilated convolutions to obtain four sets of feature maps with a size of 64×88×88; S1226: The four groups of feature maps are concatenated to obtain a feature map with a size of 256×88×88. After the feature map is convolved through the last 3×3 convolution block, an output result with a size of 64×88×88 is obtained.
5. The method for automatic segmentation of hepatocellular carcinoma tumors based on CT images according to claim 1, It is characterized in that The step S123 further includes the following sub-steps: S1231: The shallow filtering module concatenates the shallow feature map with the deep feature map, passes through two consecutive 3×3 convolution blocks, uses the Sigmoid function for activation, and filters out some noise; S1232: The activation result is multiplied by the deep feature map to obtain a weighted feature map. The weighted feature map is concatenated with the deep feature map, and after two consecutive 3×3 convolution blocks and a Sigmoid function, an output result containing fine boundaries is obtained.
