Liver image segmentation method based on multi-scale feature fusion and grid attention mechanism

The three-dimensional liver image segmentation method using multi-scale feature fusion and grid attention mechanism solves the problem that existing liver image segmentation methods do not fully utilize information between and within slices, achieving more accurate liver segmentation and improving segmentation results and diagnostic assistance capabilities.

CN115170582BActive Publication Date: 2026-07-31WUHAN UNIV OF SCI & TECH
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
WUHAN UNIV OF SCI & TECH
Filing Date
2022-06-13
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing liver 3D image segmentation methods fail to fully utilize information between and within slices, and the fusion of high-level and low-level features is insufficient, resulting in poor segmentation performance and significant susceptibility to noise.

Method used

A multi-scale feature fusion module and a grid attention mechanism are employed, combined with encoder and decoder networks. Through the multi-scale feature fusion module, grid attention mechanism and deep supervision mechanism, a three-dimensional convolutional neural network is used for liver image segmentation, and the segmentation results are optimized by morphological post-processing.

Benefits of technology

It improves the segmentation effect of 3D liver images, enhances feature representation ability, suppresses noise, reduces training error, achieves more accurate liver segmentation, and provides diagnostic assistance to doctors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115170582B_ABST
    Figure CN115170582B_ABST
Patent Text Reader

Abstract

This invention relates to a liver image segmentation method based on multi-scale feature fusion and a grid attention mechanism, comprising the following steps: selecting a liver image dataset to be segmented and dividing it into a training set and a test set; preprocessing the liver images in the training set; in the encoder stage, obtaining liver feature maps using a multi-scale feature fusion module and a convolutional network; in the decoder stage, obtaining segmented liver images using a multi-scale feature fusion module, a grid attention mechanism, an attention-guided connection module, transposed convolution, and a depth-supervised mechanism; and performing morphological post-processing on the segmented liver images. This method improves the segmentation effect of three-dimensional liver images, achieving relatively accurate segmentation of three-dimensional liver images and providing significant assistance to doctors in medical diagnosis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to three-dimensional medical image segmentation methods, and in particular to a three-dimensional liver image segmentation method based on multi-scale feature fusion and grid attention mechanism. Background Technology

[0002] In recent years, computed tomography (CT) and magnetic resonance imaging (MRI) have become the primary imaging methods for physicians to diagnose and evaluate liver cancer. In medical imaging, precise segmentation of the liver is crucial for the qualitative analysis and treatment planning of liver cancer. In clinical diagnosis, liver segmentation is typically performed by experienced specialists who manually delineate the liver's edges according to anatomical structures—a tedious, time-consuming, and labor-intensive process that demands a high level of expertise from the specialist. The segmentation results can be influenced by factors such as the specialist's subjective experience and cognitive abilities, making liver segmentation a challenging task.

[0003] Generally, medical image segmentation methods can be divided into three categories: manual segmentation, semi-automatic segmentation, and automatic segmentation. Manual segmentation is a method that relies heavily on subjective experience, has poor repeatability, and is time-consuming. It largely depends on human-recognizable features and requires highly skilled personnel to perform such tasks. These factors make it impractical in real-world applications. Semi-automatic segmentation is a combination of manual and computer-based methods. Human intervention provides useful information, which the computer then uses for segmentation. However, human intervention can lead to segmentation errors. Automatic segmentation relies entirely on computers. Recent research in medical image segmentation has focused primarily on automatic segmentation, specifically designing computer-executable algorithms for automatic segmentation. Currently, liver segmentation algorithms mainly consist of traditional methods and deep learning methods. Traditional methods include threshold-based methods, region growing methods, active contour models, and edge detection-based methods. These methods are primarily based on grayscale, texture, and edge information. However, variations in liver structure, the similarity between the liver and neighboring organs, the complexity of three-dimensional spatial features, and the influence of noise make automated segmentation extremely difficult.

[0004] In recent years, deep neural networks (DNNs) have made rapid progress in computer vision and image processing. Deep learning methods, especially convolutional neural networks (CNNs), have achieved significant success in medical image segmentation. This method learns from a large number of labeled samples, and its outstanding feature learning ability enables accurate automatic image segmentation. Later, fully convolutional neural networks (FCNs) can perform pixel-level image classification, thus solving the semantic-level image segmentation problem. And then there are the classic U-net and V-net network models. Both are U-shaped network structures that use skip-connections to connect low-level and high-level features. The difference lies in that U-net is used to process two-dimensional data, while V-net is used to process three-dimensional data, and V-net also incorporates residual blocks. While these methods have made some progress in liver segmentation, the spatial information between liver three-dimensional image slices is not fully utilized; high-level and low-level features are simply connected, resulting in insufficient fusion. Summary of the Invention

[0005] To overcome the shortcomings of existing technologies, this invention provides a liver image segmentation method based on multi-scale feature fusion and grid attention mechanism, implemented using the following technical solution:

[0006] A liver image segmentation method based on multi-scale feature fusion and grid attention mechanism includes the following steps:

[0007] S1. Select the medical image dataset that needs to be segmented into a training set and a test set;

[0008] S2. Preprocess the three-dimensional liver images in the selected training set, initialize the network model parameters, and input the preprocessed images into the network model, which includes an encoder network and a decoder network.

[0009] S3. In the encoder stage, the feature map of the liver is obtained by using a multi-scale feature fusion module and a convolutional network.

[0010] S4. In the decoder stage, the segmented image of the liver is obtained by using a multi-scale feature fusion module, a grid attention mechanism, an attention-guided connection module, transposed convolution, and a deep supervision mechanism.

[0011] Furthermore, in step S2, the preprocessing of the selected three-dimensional liver images in the training set specifically includes:

[0012] S21. Select an appropriate window for the CT image window in the training set and set the CT value of the window to a preset range.

[0013] S22. Downsample and resample the training set to adjust the interlayer spacing of the image data to 1mm.

[0014] S23. Locate the beginning and end slices of the liver region, and expand 20 slices in each direction;

[0015] S24. Perform histogram equalization on the acquired slice image;

[0016] S25. Randomly select 32 consecutive slices as input to the network model. The input image size is... .

[0017] Furthermore, in step S2, initializing the network model parameters specifically includes:

[0018] S26. Initialize network model parameters, including batch size, learning rate, number of iterations, learning rate decay strategy, and deep supervision decay coefficient;

[0019] S27. Initialize the network model weights using the Kaiming weight initialization method.

[0020] Furthermore, step S3 specifically includes:

[0021] S31. Add a multi-scale feature fusion module to each layer of the encoder network.

[0022] S32. Feature extraction is performed by downsampling through max pooling to obtain the feature map of the liver;

[0023] The encoder network comprises four downsampling layers. Each downsampling layer consists of a multi-scale feature fusion module, two 3×3×3 convolutions, a batch normalization, and a ReLU activation function. The number of filters in each convolution is [32, 64, 128, 256, 512]. Each layer is followed by a max pooling operation with a stride of 2 to obtain the feature map of the liver.

[0024] Furthermore, in the multi-scale feature fusion module, the input feature map is processed by a 1×1×1 three-dimensional convolution to adjust the number of channels, dividing the feature map into four different feature maps according to the number of channels, denoted as... , Each feature group has one-quarter the number of channels as the input feature map, while the size of the feature map remains unchanged; except In addition, each Each feature is subjected to a 3×3×3 convolution operation, followed by batch normalization and ReLU activation to obtain features at four different scales. The features at four different scales are summed element-wise and then convolved with a kernel size of 1×1×1 to obtain the result. Then, using a concept similar to residuals, and Each element is added together to obtain four features. Features at four different scales Perform a concat operation to obtain a feature map with the same number of channels as the input feature map; then, use a convolutional layer with a kernel size of 1×1×1 to obtain the final output feature map.

[0025] Furthermore, the formula for the multi-scale feature fusion module is as follows:

[0026]

[0027]

[0028]

[0029]

[0030] in, This indicates a convolution operation with a kernel size of 3×3×3. It represents feature information at four different scales. This represents a convolution operation with a kernel size of 1×1×1. This is the output feature map of the multi-scale feature fusion module.

[0031] Furthermore, in step S4, the decoder network includes four upsampling layers, each containing a deconvolution with a stride of 2 followed by two convolutions with kernel size of 3×3×3, a batch normalization, a ReLU activation function, and a multi-scale feature fusion module.

[0032] Furthermore, step S4 specifically includes:

[0033] S41. Based on the features obtained by the multi-scale feature fusion module at the end of each layer of the decoder network and the features obtained by the convolution at the end of the corresponding layer of the encoder network, the attention map is obtained by the attention-guided connection module as high-level features and low-level features, respectively.

[0034] S42. Perform a series of convolution operations on the attention maps obtained by the attention-guided connection module in each layer to extract features. In the decoder network, except for the bottom layer, the results of each other layer are upsampled at different scales to restore the image size and obtain an output. Finally, four outputs are obtained. The first three outputs are used as auxiliary losses in the deep supervision mechanism, and the last output is used as the final mask map of the output.

[0035] S43. In the backpropagation process during the iterative training of the network model, the loss value is calculated by calculating the difference between the segmentation result predicted by the network model and the label value. Then, the iterative parameter value is continuously updated based on the loss value to make the segmentation result predicted by the network model close to the label value, thereby obtaining the segmented image of the liver.

[0036] Furthermore, in the attention-guided connection module, there are high-level features and low-level features as inputs. First, the high-level features are upsampled using a transposed convolution operation. The two features are then input into the grid attention module to obtain attention feature maps. Then, the generated attention feature maps are multiplied element-wise with the low-level features. The result is then concatted with the feature map obtained by transposing the high-level features to output the feature map.

[0037] In the grid attention mechanism, high-level features and low-level features are input separately. First, the number of channels of the high-level and low-level features is adjusted by a 3D convolution with a kernel size of 1×1×1. Then, a 3D convolution operation with a stride of 2 is performed to downsample them. Then, they are simply added together. The features obtained by addition and fusion are subjected to ReLU activation nonlinear transformation. Attention coefficients are generated by the Sigmoid activation function. Transposed convolution is used to upsample them to match the dimension of the low-level features input from the upper layer. Finally, they are multiplied element-wise with the low-level features to obtain the final attention map.

[0038] Furthermore, the formula for the grid attention mechanism is as follows:

[0039]

[0040] in, For convolution operations, It is the ReLU activation function. For the Sigmoid activation function, For grid attention coefficients;

[0041] The formula for the attention-guided connection module is as follows:

[0042]

[0043] in, For grid attention mechanism, This is element-wise multiplication.

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

[0045] The method of this invention first trains a three-dimensional liver image using a multi-scale feature fusion module and convolutional blocks, expanding the receptive field of the neural network and enhancing its feature representation capability. This fully utilizes information both within and between slices in the three-dimensional liver image to obtain a liver feature map with more representative feature information. Then, it employs an attention-guided connection module and a grid attention mechanism in a skip structure to highlight the features of the segmented region and suppress other noise components. A deep supervision mechanism is used to reduce training and validation errors, mitigating problems such as gradient vanishing, gradient exploding, and slow convergence, ultimately obtaining a segmented liver image. The multi-scale feature fusion module, attention-guided connection module, and grid attention mechanism are used multiple times at the connection between the encoder and decoder to acquire multi-scale semantic information and important contextual information. Finally, morphological post-processing methods are used to optimize the model segmentation results.

[0046] Therefore, this invention utilizes a multi-scale feature fusion module, an attention-guided connection module, a grid attention mechanism, and the training and fusion of a three-dimensional convolutional neural network to extract semantic information from three-dimensional liver images and perform segmentation. This method has the characteristic of improving the segmentation effect of three-dimensional liver images, achieving relatively accurate segmentation of three-dimensional liver images, and providing great assistance to doctors in medical diagnosis. Attached Figure Description

[0047] Figure 1 This is a flowchart illustrating the method of an embodiment of the present invention.

[0048] Figure 2 This is a comparison image of the liver before and after pretreatment in an embodiment of the present invention.

[0049] Figure 3 This is a diagram of the overall network architecture in an embodiment of the present invention.

[0050] Figure 4 This is a structural design diagram of the multi-scale feature fusion module in an embodiment of the present invention.

[0051] Figure 5 This is a structural design diagram of the attention-guided connection module in an embodiment of the present invention.

[0052] Figure 6 This is a structural design diagram of the attention mechanism in an embodiment of the present invention.

[0053] Figure 7 This is a visualization of the segmentation results of the method of the present invention on the test set 3Dircadb. Detailed Implementation

[0054] To facilitate a better understanding of the present invention by those skilled in the art, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. The following are merely exemplary and do not limit the scope of protection of the present invention.

[0055] Terminology Explanation:

[0056] 1. Kaiming: Represents an initialization method for neural networks.

[0057] 2. ReLU: Represents an activation function in a neural network that transforms the final result of the fitted curve to the interval [0, +∞).

[0058] 3. Skip-connection: This refers to the skip connection in the middle of a U-shaped network.

[0059] 4. concat: indicates that two tensors are connected along the channel dimension.

[0060] 5. Sigmoid: A neural network activation function that transforms the final result of the fitted curve to the (0,1) interval.

[0061] This embodiment discloses a three-dimensional liver image segmentation method based on multi-scale feature fusion and grid attention mechanism (referred to as the MAGNet method). Taking LiTS (from the medical liver public dataset released at https: / / competitions.codalab.org / competitions / 17094), 3Dircadb (from the medical liver public dataset released at https: / / www.ircad.fr / research / 3dircadb / ), and Sliver07 (from the medical liver public dataset released at https: / / sliver07.grand-challenge.org / Download / ) as examples, LITS is a three-dimensional liver image with 131 labeled sequences, of which sequences 28-47 are from the 3Dircadb dataset. The Sliver07 dataset is a three-dimensional liver image with 20 sequences, all with a pixel size of 512×512. This embodiment uses the LITS dataset (with the 3Dircadb dataset removed) as the training set and the 3Dircadb and Sliver07 datasets as the test sets.

[0062] like Figure 1 As shown, the three-dimensional liver image segmentation method based on multi-scale feature fusion and grid attention mechanism described in this embodiment specifically includes the following steps:

[0063] Step 1) Dataset partitioning;

[0064] Select the medical image dataset that needs to be segmented into a training set and a test set;

[0065] Step 2) Data preprocessing, comparison of liver before and after preprocessing. Figure 2 (a) (before processing) and Figure 2 (b) (after processing) is shown;

[0066] 2.1) Select an appropriate window for the CT images in the training set and set the CT value of the window between [-200, 200];

[0067] 2.2) Downsample and resample the training set to adjust the inter-layer spacing of the image data to 1mm;

[0068] 2.3) Locate the beginning and end sections of the liver region, and expand outwards by 20 sections in both directions;

[0069] 2.4) Perform histogram equalization on the images in the training set;

[0070] 2.5) Randomly select 32 consecutive slices as the input to the network model. The input size of the network is then... .

[0071] Step 3) In the encoder stage, the feature map of the liver is obtained using a multi-scale feature fusion module and a convolutional network. The overall network structure is as follows: Figure 3 As shown;

[0072] 3.1) Initialize network parameters, including batch size, learning rate, number of iterations, learning rate decay strategy, and deep supervision decay coefficient;

[0073] 3.2) Initialize network weights using the Kaiming weight initialization method;

[0074] 3.3) Input the preprocessed 3D image into the convolutional neural network of the network model.

[0075] 3.4) A multi-scale feature fusion module is added to each layer of the encoder and decoder stages. In the encoder stage, feature extraction is performed by downsampling through max pooling. The encoder path contains four downsampling layers, each consisting of a multi-scale feature fusion module, two 3×3×3 convolutional kernels, a batch normalization, and a ReLU activation function. Each layer is followed by a max pooling operation with a stride of 2, ultimately yielding the liver feature map. The overall network structure is as follows: Figure 3 As shown.

[0076] The number of filters in each convolution is [32, 64, 128, 256, 512]. In the multi-scale feature fusion module, the input feature map is processed by a 3D convolution with a kernel size of 1×1×1 to adjust the number of channels, dividing the feature map into four different feature maps according to the number of channels, denoted as . , The number of feature channels in each group is one-quarter of the number of channels in the input feature map, while the size of the feature map remains unchanged. Except... In addition, each Each feature is subjected to a 3×3×3 convolution operation, followed by batch normalization and ReLU activation to obtain features at four different scales. The four features at different scales are summed element-wise and then convolved with a kernel size of 1×1×1 to obtain the result. Then, using a concept similar to residuals, and Each element is added together to obtain four features. Four different scale features Performing a concat operation results in a feature map with the same number of channels as the input feature map. The final output feature map is then obtained through a convolutional layer with a kernel size of 1×1×1, as shown below. Figure 4 As shown.

[0077] In step 3.4), the formula for the multi-scale feature fusion module is as follows:

[0078] (1)

[0079] (2)

[0080] (3)

[0081] (4)

[0082] in, This indicates a convolution operation with a kernel size of 3×3×3. It represents feature information at four different scales. This indicates a convolution operation with a kernel size of 1×1×1. This is the output feature map of the multi-scale feature fusion module.

[0083] Step 4) Obtain the segmented image of the liver using a multi-scale feature fusion module, a grid attention mechanism, an attention-guided connection module, transposed convolution, and a deep supervision mechanism;

[0084] 4.1) In the decoder stage, there are four upsampling layers. Each layer contains a deconvolution with a stride of 2 followed by two convolutional blocks with a kernel size of 3×3×3, a batch normalization, a ReLU activation function, and a multi-scale feature fusion module.

[0085] 4.2) Using the features obtained from the multi-scale feature fusion module at the end of each layer in the decoder stage and the features obtained from the convolution of the corresponding layer above the encoder, respectively, as high-level and low-level information, an attention map is obtained through the attention-guided connection module, such as... Figure 5 As shown.

[0086] 4.3) In the attention-guided connection module, high-level and low-level features are input separately. First, the high-level features are upsampled using a transposed convolution operation. The two features are then input into the grid attention module to obtain attention feature maps. Next, the generated attention feature map is multiplied element-wise with the low-level features. The result is then concatenated with the feature map obtained from the transposed convolution of the high-level features to output the feature map. In the grid attention module, high-level and low-level features are input separately. First, the number of channels in the high-level and low-level features is adjusted using a 1×1×1 3D convolution. A 2-stride 3D convolution is then used for downsampling, followed by a simple addition operation. The resulting feature is then subjected to a ReLU activation nonlinear transformation, and attention coefficients are generated using the Sigmoid activation function. A transposed convolution is then used to upsample the feature to match the dimension of the low-level features input from the upper layer. Finally, the feature is multiplied element-wise with the low-level features to obtain the final feature map, as shown below. Figure 6 As shown.

[0087] Step 4.3) The grid attention formula is as follows:

[0088] (5)

[0089] in, For convolution operations, It is the ReLU activation function. For the Sigmoid activation function, For grid attention coefficients;

[0090] The formula for the attention-guided connection module is as follows:

[0091] (6)

[0092] in For grid attention mechanism, This is element-wise multiplication.

[0093] 4.4) The feature maps obtained by the attention-guided connection module of each layer are subjected to a series of convolution operations to extract features; among them, except for the bottom layer, the results of each other layer in the decoder are upsampled at different scales to restore the image size and obtain an output. Finally, four outputs are obtained. The first three outputs are used as auxiliary loss in the deep supervision mechanism, and the last output is used as the final segmentation map.

[0094] 4.5) In the backpropagation process of neural network iterative training, the loss value is calculated by calculating the difference between the segmentation result predicted by the network and the label value. Then, the iterative parameter value is continuously updated based on the loss value so that the segmentation result predicted by the network is close to the label value.

[0095] In steps 4.4) and 4.5), the Tversky Loss formula is used to calculate the loss, and the specific formula is as follows:

[0096] (7)

[0097] in and These represent the predicted value and the label value, respectively. and These are hyperparameters. Adjust them... and We can control the balance between false positives and false negatives;

[0098] The joint loss function for deep supervised networks is as follows:

[0099] (8)

[0100] Where loss1-loss4 are the loss functions of the upsampled output of each layer of the decoder. This represents the depth of supervision coefficient.

[0101] Step 5) Perform morphological post-processing on the liver image obtained after model segmentation.

[0102] 5.1) Extract the maximum connected component from the segmented liver region;

[0103] 5.2) Remove the segmented small areas and fill the internal voids.

[0104] The segmentation visualization results of the 3D liver image segmentation method (MAGNet) based on multi-scale feature fusion and grid attention mechanism described in this invention on the 3Dircadb test set are as follows: Figure 7As shown, the segmentation results obtained by the MAGNet method described in this invention are very close to the labeled results. Furthermore, Table 1 below compares the segmentation results of the 3D liver image segmentation method (MAGNet) based on multi-scale feature fusion and grid attention mechanism described in this invention on the 3D Dircadb test set with those of other state-of-the-art methods (mean±std). Table 2 below compares the segmentation results of the 3D liver image segmentation method (MAGNet) based on multi-scale feature fusion and grid attention mechanism described in this invention on Silver07 with those of other state-of-the-art methods (mean±std).

[0105] Table 1

[0106] Model VOE(%) RVD(%) ASD(mm) RMSD (mm) DSC UNet 14.21± 5.71 0.05 ± 0.10 4.33 ± 3.39 8.35 ± 7.54 0.923 ± 0.03 ResNet 11.65± 4.06 0.03 ± 0.06 3.91 ± 3.95 8.11 ± 9.68 0.938 ± 0.02 Christ et al. 10.7 1.4 1.5 24.0 0.943 H-DenseUNet 10.20± 3.44 0.01 ± 0.05 4.06 ± 3.85 9.63 ± 10.41 0.947 ± 0.01 Channel-Unet 9.52 ± 4.65 0.02 ± 0.07 8.43 ± 9.39 14.21 ± 5.71 0.946 ± 0.03 <![CDATA[U 3 -Net+DC]]> 6.14 1.98 - - 0.964 MAGNet(ours) 6.59± 1.97 0.01 ± 0.04 1.13 ± 0.34 2.68 ± 1.39 0.965 ± 0.01

[0107] As shown in Table 1, we compare the prediction results of MAGNet, the method described in this embodiment, on the 3DIRCADb dataset with other state-of-the-art models. MAGNet shows a significant improvement in DSC performance compared to UNet and ResNet, and also shows some improvement compared to other state-of-the-art models. For example, compared to UNet, the model that performs best on the DSC metric... 3 MAGNet improved by 0.1 percentage points compared to DC. It significantly reduced ASD and RMSD metrics compared to other state-of-the-art models. It also showed some improvement in RVD and was slightly higher than U in VOE. 3 -Net+DC model.

[0108] Table 2

[0109] Model No. of training images VOE(%) RVD(%) ASD(mm) RMSD (mm) DSC Lu et al. 78 5.90 2.70 0.91 1.88 0.969 A1-Shaikhli et al. 20 6.44 1.53 0.95 1.58 0.966 Dong et al. 38 6.44 0.01 0.98 1.87 0.966 Hu et al. 109 5.35 -0.17 0.84 1.78 0.972 Lu et al. 40 5.92 1.03 1.06 1.68 - MAGNet(ours) 111 5.21 0.01 0.97 2.35 0.973

[0110] As can be seen from Table 2, the prediction results of the proposed method reached 97.3% on the DSC index. Compared with other advanced methods, the proposed method has certain improvements in the DSC, VOE and RVD indices, proving that the method of this embodiment has good superiority and generalization ability.

[0111] The above description only outlines the basic principles and preferred embodiments of the present invention. Those skilled in the art can make many changes and modifications based on the above description, and these changes and modifications should fall within the protection scope of the present invention.

Claims

1. A liver image segmentation method based on multi-scale feature fusion and grid attention mechanism, characterized in that, Includes the following steps: S1. Select the medical image dataset that needs to be segmented into a training set and a test set; S2. Preprocess the three-dimensional liver images in the selected training set, initialize the network model parameters, and input the preprocessed images into the network model, which includes an encoder network and a decoder network. S3. In the encoder stage, a multi-scale feature fusion module and a convolutional network are used to obtain the liver feature map; specifically including: S31. Add a multi-scale feature fusion module to each layer of the encoder network. S32. Feature extraction is performed by downsampling through max pooling to obtain the feature map of the liver; In the multi-scale feature fusion module, the input feature map is processed by a 1×1×1 three-dimensional convolution to adjust the number of channels, dividing the feature map into four distinct feature maps based on the number of channels, denoted as . , Each feature group has one-quarter the number of channels as the input feature map, while the size of the feature map remains unchanged; except In addition, each Each feature is subjected to a 3×3×3 convolution operation, followed by batch normalization and ReLU activation to obtain features at four different scales. The features at four different scales are summed element-wise and then convolved with a kernel size of 1×1×1 to obtain the result. Then and Each element is added together to obtain four features. Features at four different scales A concat operation is performed to obtain a feature map with the same number of channels as the input feature map; the final output feature map is obtained through a convolutional layer with a kernel size of 1×1×1; the formula for the multi-scale feature fusion module is as follows: in, This indicates a convolution operation with a kernel size of 3×3×3. It represents feature information at four different scales. This represents a convolution operation with a kernel size of 1×1×1. This is the output feature map of the multi-scale feature fusion module; S4. In the decoder stage, a segmented image of the liver is obtained using a multi-scale feature fusion module, a grid attention mechanism, an attention-guided connection module, transposed convolution, and a deep supervision mechanism; specifically including: S41. Based on the features obtained by the multi-scale feature fusion module at the end of each layer of the decoder network and the features obtained by the convolution at the end of the corresponding layer of the encoder network, these are used as high-level features and low-level features, respectively, and then passed through the attention-guided connection module to obtain an attention map. In the attention-guided connection module, the high-level features are first upsampled using a transposed convolution operation. The upsampled high-level features and the low-level features are then input into the grid attention mechanism to obtain attention feature maps. Next, the generated attention feature maps are multiplied element-wise with the low-level features, and the result is concatted with the feature map obtained by transposing the high-level features. Output attention map; In the grid attention mechanism, the upsampled result of high-level features and low-level features are input separately; First, the upsampled result of high-level features and low-level features are adjusted for the number of channels by a 3D convolution with a kernel size of 1×1×1, and downsampled by a 3D convolution operation with a stride of 2, and then simply added together; The features obtained by addition and fusion are subjected to ReLU activation nonlinear transformation, attention coefficients are generated by the Sigmoid activation function, and upsampled by transposed convolution to match the dimension of the input low-level features from the upper layer, and finally multiplied element-wise with the low-level features to obtain the attention feature map; S42. Perform a series of convolution operations on the attention maps obtained by the attention-guided connection module in each layer to extract features. In the decoder network, except for the bottom layer, the results of each other layer are upsampled at different scales to restore the image size and obtain an output. Finally, four outputs are obtained. The first three outputs are used as auxiliary losses in the deep supervision mechanism, and the last output is used as the final mask map of the output. S43. In the backpropagation process during the iterative training of the network model, the loss value is calculated by calculating the difference between the segmentation result predicted by the network model and the label value. Then, the iterative parameter value is continuously updated based on the loss value to make the segmentation result predicted by the network model close to the label value, thereby obtaining the segmentation image of the liver.

2. The liver image segmentation method based on multi-scale feature fusion and grid attention mechanism according to claim 1, characterized in that, Step S2, specifically the preprocessing of the selected three-dimensional liver images in the training set, includes: S21. Select an appropriate window for the CT image window in the training set and set the CT value of the window to a preset range. S22. Downsample and resample the training set to adjust the interlayer spacing of the image data to 1mm. S23. Locate the beginning and end slices of the liver region, and expand 20 slices in each direction; S24. Perform histogram equalization on the acquired slice image; S25. Randomly select 32 consecutive slices as input to the network model. The input image size is... .

3. The liver image segmentation method based on multi-scale feature fusion and grid attention mechanism according to claim 2, characterized in that, In step S2, initializing the network model parameters specifically includes: S26. Initialize network model parameters, including batch size, learning rate, number of iterations, learning rate decay strategy, and deep supervision decay coefficient; S27. Initialize the network model weights using the Kaiming weight initialization method.

4. The liver image segmentation method based on multi-scale feature fusion and grid attention mechanism according to claim 3, characterized in that, The encoder network includes four downsampling layers. Each downsampling layer consists of a multi-scale feature fusion module, two 3×3×3 convolutional kernels, a batch normalization, and a ReLU activation function. The number of filters in each convolution is [32, 64, 128, 256, 512]. Each layer is followed by a max pooling operation with a stride of 2 to obtain the feature map of the liver.

5. The liver image segmentation method based on multi-scale feature fusion and grid attention mechanism according to claim 1, characterized in that, In step S4, the decoder network includes four upsampling layers. Each layer contains a deconvolution with a stride of 2 followed by two convolutions with kernel size of 3×3×3, a batch normalization, a ReLU activation function, and a multi-scale feature fusion module.

6. The liver image segmentation method based on multi-scale feature fusion and grid attention mechanism according to claim 1, characterized in that: The formula for the grid attention mechanism is as follows: in, For convolution operations, It is the ReLU activation function. Here, f is the sigmoid activation function, f represents the low-level features, and g is the result of upsampling the high-level features using a transposed convolution operation. For bias terms; The formula for the attention-guided connection module is as follows: in, This is element-wise multiplication.