Medical image segmentation method and device, computer equipment and medium
By introducing Attention U-Net network, enhanced convolution module and EFF module into the medical image segmentation model, the problem of inaccurate segmentation in traditional methods when facing lesions with high variability and complex backgrounds is solved, and higher segmentation accuracy and robustness are achieved.
Patent Information
- Application Number
- CN202510213893.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-26
- Publication Date
- 2025-06-10
AI Technical Summary
Traditional medical image segmentation methods are difficult to adapt to the shape and size variability of non-small cell lung cancer lesions, resulting in inaccurate segmentation results, especially when facing highly varied lesions and complex backgrounds.
A medical image segmentation model based on Attention U-Net network is adopted, combining the enhanced convolution module and the EFF module to perform feature extraction and enhancement. The enhanced convolution module enhances feature extraction capabilities through the combination of partial convolution and standard convolution; the EFF module adaptively learns the weights of feature information of different depths through the combination of spatial attention and channel attention, and improves feature representation capabilities.
The model's recognition ability and feature expression ability of the target area is improved, background interference is reduced, and more accurate medical image segmentation is achieved.
Smart Images

Figure CN120125820A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of medical image processing, and particularly to a medical image segmentation method, device, computer device, storage medium, and computer program product. Background Art
[0002] As one of the common malignant tumors, early detection and precise treatment of non-small cell lung cancer (NSCLC) are crucial for improving the survival rate of patients. At the same time, with the development of science and technology, medical image segmentation technology has been widely applied, and image segmentation technology based on neural networks provides good data support for final doctor diagnosis.
[0003] However, early-stage non-small cell lung cancer lesions show a high degree of variability in shape and size. This variability not only increases the difficulty of lesion recognition but also makes the neural network vulnerable to interference from non-target regions such as the background during the training process. This interference often causes difficulties for the neural network in accurately locating the nodule position and precisely outlining the nodule edge, and sometimes even results in insufficient segmentation to achieve accurate segmentation. Secondly, due to individual differences, there are significant differences in the lung structures and lesion characteristics of different patients. These differences include the size, shape, location of the lesion, and the invasiveness of tumor tissue, etc., which further increase the complexity of precise segmentation.
[0004] It can be seen that traditional medical image segmentation methods often struggle to adapt to these changes, resulting in inaccurate segmentation results. Summary of the Invention
[0005] Based on this, it is necessary to provide an accurate medical image segmentation method, device, computer device, storage medium, and computer program product for the above technical problems.
[0006] In a first aspect, the present application provides a medical image segmentation method. The method includes:
[0007] Obtain an initial historical medical image, and perform preprocessing on the initial historical medical image to obtain a processed medical image;
[0008] Use the processed medical image to train an initial medical image segmentation model to obtain a trained medical image segmentation model;
[0009] Obtain a collected medical image, and input the collected medical image into the trained medical image segmentation model to obtain a medical image segmentation result;
[0010] Wherein, the initial historical medical image segmentation model is constructed based on the Attention U-Net network, and an enhanced convolution module is set in its downsampling part, and an EFF module is set in its upsampling part.
[0011] In one embodiment, obtaining an initial historical medical image and preprocessing the initial historical medical image to obtain a processed medical image includes:
[0012] Obtain an initial historical medical image;
[0013] Preprocess the initial historical medical image by normalizing, windowing, cropping, and resampling to obtain a processed medical image.
[0014] In one embodiment, preprocessing the initial historical medical image by normalizing, windowing, cropping, and resampling to obtain a processed medical image includes:
[0015] Convert the initial medical image in.nii.gz format into 2D slices in.png format;
[0016] Preprocess the 2D slices by normalizing, windowing, cropping, and resampling to obtain a processed medical image.
[0017] In one embodiment, the conversion of the initial medical image in.nii.gz format into 2D slices in.png format includes:
[0018] Convert the initial medical image in.nii.gz format into 2D slices in.png format with a size of 512*512.
[0019] In one embodiment, the processing process of the EFF module in the initial historical medical image segmentation model includes:
[0020] Obtain the input original feature map;
[0021] Pass the original feature map through two branches of spatial attention and channel attention;
[0022] Output a spatial attention map from the spatial attention branch and output a channel weight vector from the channel attention branch;
[0023] Multiply the spatial attention map, the channel weight vector, and the original feature map to obtain a processed feature map;
[0024] Fuse the processed feature maps to obtain an enhanced feature representation.
[0025] In one embodiment, the processing process of the enhanced convolution module in the initial historical medical image segmentation model includes:
[0026] Obtain the input features;
[0027] Process the input features through a partial convolution layer to obtain a partial convolution output;
[0028] Pass the partial convolution output through a standard convolution layer, a batch normalization layer, and a ReLU activation function to obtain intermediate data;
[0029] Input the intermediate data into the partial convolution layer for processing again, and repeat a preset number of times to obtain an enhanced feature map.
[0030] In a second aspect, the present application also provides a medical image segmentation device. The device includes:
[0031] A preprocessing module, configured to obtain an initial historical medical image and perform preprocessing on the initial historical medical image to obtain a processed medical image;
[0032] A training module, configured to train an initial medical image segmentation model using the processed medical image to obtain a trained medical image segmentation model;
[0033] A segmentation module, configured to obtain a collected medical image and input the collected medical image into the trained medical image segmentation model to obtain a medical image segmentation result;
[0034] Wherein, the initial historical medical image segmentation model is constructed based on the Attention U-Net network, and an enhanced convolution module is provided in its downsampling part, and an EFF module is provided in its upsampling part.
[0035] In a third aspect, the present application also provides a computer device. The computer device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0036] Obtain an initial historical medical image and perform preprocessing on the initial historical medical image to obtain a processed medical image;
[0037] Train an initial medical image segmentation model using the processed medical image to obtain a trained medical image segmentation model;
[0038] Obtain a collected medical image and input the collected medical image into the trained medical image segmentation model to obtain a medical image segmentation result;
[0039] Wherein, the initial historical medical image segmentation model is constructed based on the Attention U-Net network, and an enhanced convolution module is provided in its downsampling part, and an EFF module is provided in its upsampling part.
[0040] In a fourth aspect, the present application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0041] Obtain an initial historical medical image, and preprocess the initial historical medical image to obtain a processed medical image;
[0042] Use the processed medical image to train an initial medical image segmentation model to obtain a trained medical image segmentation model;
[0043] Obtain a collected medical image, and input the collected medical image into the trained medical image segmentation model to obtain a medical image segmentation result;
[0044] Wherein, the initial historical medical image segmentation model is constructed based on the Attention U-Net network, an enhanced convolution module is arranged in its downsampling part, and an EFF module is arranged in its upsampling part.
[0045] In a fifth aspect, the present application also provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0046] Obtain an initial historical medical image, and preprocess the initial historical medical image to obtain a processed medical image;
[0047] Use the processed medical image to train an initial medical image segmentation model to obtain a trained medical image segmentation model;
[0048] Obtain a collected medical image, and input the collected medical image into the trained medical image segmentation model to obtain a medical image segmentation result;
[0049] Wherein, the initial historical medical image segmentation model is constructed based on the Attention U-Net network, an enhanced convolution module is arranged in its downsampling part, and an EFF module is arranged in its upsampling part.
[0050] The above-mentioned medical image segmentation method, device, computer device, storage medium and computer program product obtain an initial historical medical image, and preprocess the initial historical medical image to obtain a processed medical image; use the processed medical image to train an initial medical image segmentation model to obtain a trained medical image segmentation model; obtain the collected medical image, and input the collected medical image into the trained medical image segmentation model to obtain a medical image segmentation result. In the whole process, the initial medical image segmentation model is constructed by using the Attention U-Net network, and an enhanced convolution module is set in the downsampling part of the model, and an EFF module is added to the upsampling part. The EFF module adaptively learns the weights of different depth feature information by combining spatial attention and channel attention, improving the model's recognition ability and feature expression ability for the target area. The enhanced convolution module enhances the model's feature extraction ability by combining partial convolution and standard convolution. Therefore, the trained model can achieve accurate medical image segmentation. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 FIG. is an application environment diagram of the medical image segmentation method in an embodiment;
[0052] Figure 2 FIG. is a schematic flowchart of the medical image segmentation method in an embodiment;
[0053] Figure 3 FIG. is a schematic diagram of the architecture of the initial medical image segmentation model;
[0054] Figure 4 FIG. is a schematic flowchart of the medical image segmentation method in another embodiment;
[0055] Figure 5 FIG. is a structural block diagram of the medical image segmentation device in an embodiment;
[0056] Figure 6 FIG. is an internal structure diagram of a computer device in an embodiment. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0057] In order to make the objectives, technical solutions and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0058] The medical image segmentation method provided by the embodiments of the present application can be applied to, for example Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or placed on the cloud or other network servers. The terminal 102 sends a medical image segmentation request to the server 104. The server 104 responds to the medical image segmentation request, obtains the initial historical medical image, and preprocesses the initial historical medical image to obtain the processed medical image; uses the processed medical image to train the initial medical image segmentation model to obtain the trained medical image segmentation model; obtains the collected medical image, and inputs the collected medical image into the trained medical image segmentation model to obtain the medical image segmentation result. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, Internet of Things devices, and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, etc. The portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers.
[0059] In one embodiment, as Figure 2 shown, a medical image segmentation method is provided. Taking the server 104 in Figure 1 as an example for illustration, the method includes the following steps:
[0060] S200: Obtain the initial historical medical image, and preprocess the initial historical medical image to obtain the processed medical image.
[0061] Collect a batch of historical medical images from the existing medical image database as the basis of the training data. Preprocess the initial historical medical image, such as denoising, standardization, enhancing contrast, etc., to improve the image quality and obtain the processed medical image. This step is to ensure the accuracy and consistency of the training data.
[0062] S400: Use the processed medical image to train the initial medical image segmentation model to obtain the trained medical image segmentation model. Among them, the initial historical medical image segmentation model is constructed based on the Attention U-Net network, and an enhanced convolutional module is set in its downsampling part, and an EFF module is set in its upsampling part.
[0063] Use the initial medical image segmentation model based on the Attention U-Net network. Attention U-Net is an improved U-Net network, which enhances the model's ability to capture key information by introducing an attention mechanism. Specifically, the architecture of the entire initial medical image segmentation model is as Figure 3As shown in the figure, the entire model is divided into a downsampling part and an upsampling part, which is specifically based on the structure of ATTUNet. The convolutional layer used in the downsampling part is changed to PConv (partial convolution) to enhance feature extraction. An EFF module (a feature fusion method that combines channel attention and spatial attention, adaptively learning the weights of different-depth feature information for feature screening and fusion) is added after the original convolutional part in the downsampling part to enhance the feature fusion effect. A PConv (partial convolution) is added after the EFF to help the model better handle missing or abnormal regions in the image, improving the robustness and extraction ability of the model for medical image features. At the same time, the original attention mechanism of ATTUNet is still retained, using the attention module to dynamically select relevant global features and enhancing the feature fusion effect by calculating the correlation between feature maps.
[0064] S600: Obtain the collected medical image and input the collected medical image into the trained medical image segmentation model to obtain the medical image segmentation result.
[0065] Collect new medical images from medical devices (such as CT, MRI, etc.), input the collected medical images into the trained medical image segmentation model, and the model outputs the segmentation result of the medical image, such as the precise boundaries of organs, tissues, or lesion regions.
[0066] For the above medical image segmentation method, obtain the initial historical medical image and preprocess the initial historical medical image to obtain the processed medical image; use the processed medical image to train the initial medical image segmentation model to obtain the trained medical image segmentation model; obtain the collected medical image and input the collected medical image into the trained medical image segmentation model to obtain the medical image segmentation result. Throughout the process, the initial medical image segmentation model is constructed using the Attention U-Net network, and an enhanced convolutional module is set in the downsampling part of the model, and an EFF module is added to the upsampling part. The EFF module combines spatial attention and channel attention to adaptively learn the weights of different-depth feature information, improving the model's recognition ability and feature expression ability for the target region. The enhanced convolutional module combines partial convolution and standard convolution to enhance the model's feature extraction ability. Therefore, the trained model can achieve accurate medical image segmentation.
[0067] Overall, medical image segmentation technology has been widely applied in recent years. Especially driven by neural network technology, the accuracy and efficiency of medical image segmentation have been significantly improved. However, traditional medical image segmentation methods often struggle to provide sufficiently accurate segmentation results when faced with non-small cell lung cancer (NSCLC) where the shapes and sizes of early lesions vary highly. Background interference and lesion variability are the main reasons for inaccurate segmentation.
[0068] To address these problems, the present application provides a new medical image segmentation method. First, an initial historical medical image is obtained and preprocessed to obtain a processed medical image. Then, the processed medical image is used to train an initial medical image segmentation model to obtain a trained medical image segmentation model. Next, a collected medical image is obtained and input into the trained medical image segmentation model to obtain a medical image segmentation result. The initial historical medical image segmentation model is constructed based on the Attention U-Net network, with an enhanced convolutional module set in the downsampling part and an EFF module set in the upsampling part.
[0069] In medical image segmentation, due to the problem of inaccurate segmentation caused by lesion variability and background interference, traditional methods are difficult to effectively solve. By preprocessing the initial historical medical image, such as normalization, windowing, cropping, and resampling, more consistent and standardized input data can be obtained, thereby improving the effect of model training. Constructing the initial historical medical image segmentation model using the Attention U-Net network, through the combination of the enhanced convolutional module and the EFF module, can better extract and enhance features, effectively reduce background interference, and improve the accuracy of segmentation.
[0070] The initial historical medical image segmentation model is constructed based on the Attention U-Net network. On the basis of the traditional U-Net, the Attention U-Net network introduces an attention mechanism, enabling the model to better focus on important feature regions. The enhanced convolutional module set in the downsampling part enhances the feature extraction ability through multiple convolutional and activation operations. The EFF module set in the upsampling part further enhances the feature representation ability through the combination of spatial attention and channel attention. Specifically, an initial historical medical image is obtained and preprocessed, and the processed medical image is used to train the initial medical image segmentation model to obtain a trained model. Then, the newly acquired medical image is input into the trained model to obtain a segmentation result. The enhanced convolutional module, according to the subtle features of the medical image, especially through the combination of partial convolutional layers and standard convolutional layers instead of using a single type of convolutional layer, improves the accuracy of feature extraction. The EFF module enhances the feature representation ability through the combination of spatial attention and channel attention. Compared with the prior art, the present application effectively solves the problem of inaccurate segmentation caused by lesion variability and background interference in medical image segmentation through the application of the Attention U-Net network and the combination of the enhanced convolutional module and the EFF module. Traditional methods often have difficulty providing accurate segmentation results when faced with highly variable lesions and complex backgrounds. The present invention improves the accuracy and robustness of segmentation through various preprocessing means and module designs for enhancing feature extraction and representation. By obtaining the initial historical medical image and preprocessing it, consistent and standardized input data are obtained. The initial historical medical image segmentation model is constructed using the Attention U-Net network, and the enhanced convolutional module in the downsampling part and the EFF module in the upsampling part play roles in feature extraction and feature enhancement respectively. The enhanced convolutional module improves the accuracy of feature extraction through multiple convolutional and activation operations. The EFF module further enhances the feature representation ability through the combination of spatial attention and channel attention. Finally, the trained model can accurately segment the newly acquired medical image, effectively solving the problem of inaccurate segmentation caused by lesion variability and background interference.
[0071] In one of the embodiments, as Figure 4 shown, S200 includes:
[0072] S220: Obtain an initial historical medical image.
[0073] The step of obtaining the initial historical medical image may include extracting relevant image data from a medical database or a hospital information system.
[0074] S240: Perform preprocessing such as normalization, windowing, cropping, and resampling on the initial historical medical image to obtain a processed medical image.
[0075] The normalization step refers to adjusting the pixel values of an image to a standard range to eliminate the brightness differences between different images. The windowing step is to adjust the gray-level range of the image to make the structures of interest clearer. The cropping step is to remove the unnecessary parts of the image and retain the region of interest. The resampling step is to resample the image to a standard resolution for subsequent processing. For example, normalization can adjust the pixel values of the image to the range of 0 to 1 through linear transformation. Windowing can be achieved by setting a window width and a window center value. Cropping can be achieved by setting a bounding box of the region of interest. Resampling can resample the image to the standard resolution by methods such as bilinear interpolation or cubic spline interpolation.
[0076] In this embodiment, the present application preprocesses the initial historical medical image by normalization, windowing, cropping, and resampling, improving the quality and consistency of the medical image and providing a better data basis for subsequent image segmentation. Compared with the prior art, the preprocessing steps of the present application can effectively eliminate the noise and unnecessary parts in the image, making the image clearer and more uniform, thereby improving the accuracy and reliability of image segmentation.
[0077] In one of the embodiments, preprocessing the initial historical medical image by normalization, windowing, cropping, and resampling to obtain the processed medical image includes:
[0078] Step 1: Convert the initial medical image in.nii.gz format to 2D slices in.png format.
[0079] Converting the initial medical image in.nii.gz format to 2D slices in.png format can be achieved through the following steps: First, read the data of the initial medical image in.nii.gz format, and then slice the three-dimensional medical image data into a series of two-dimensional slices, with each slice saved as a.png format file.
[0080] Step 2: Preprocess the 2D slices by normalization, windowing, cropping, and resampling to obtain the processed medical image.
[0081] Perform normalization processing on these two-dimensional slices to standardize the range of image pixel values. The windowing operation is used to adjust the contrast and brightness of the image to highlight the regions of interest. The cropping step is used to remove the irrelevant parts of the image and retain the important regions. Finally, the resampling step is used to adjust the resolution of the image to meet the requirements of subsequent processing. For example, the image can be resampled to a resolution of 512x512.
[0082] Through the above preprocessing steps, this application solves the problem of how to convert the initial medical image format into a format suitable for processing, making the image data more standardized and consistent, thereby improving the accuracy and efficiency of subsequent image segmentation. Compared with the prior art, the preprocessing method of this application can effectively reduce the differences between images and standardize the image data, enabling the image segmentation model based on neural network to train and predict more accurately, and improving the accuracy of medical image segmentation.
[0083] In one embodiment, converting the initial medical image in.nii.gz format into 2D slices in.png format includes:
[0084] Converting the initial medical image in.nii.gz format into 2D slices in.png format with a size of 512*512.
[0085] Converting the initial medical image in.nii.gz format into 2D slices in.png format with a size of 512512. This technical feature plays a key role in solving the problem of initial medical image format conversion. By converting the 3D image in.nii.gz format into 2D slices and uniformly adjusting them to a size of 512512, the subsequent processing steps are simplified, enabling the image segmentation model to process image data more efficiently. This conversion not only improves the efficiency of image processing but also ensures the consistency of image data, providing a good foundation for subsequent image preprocessing and segmentation.
[0086] Specifically, the steps of converting the initial medical image in.nii.gz format into 2D slices in.png format with a size of 512*512 can include the following implementation methods: reading the 3D medical image data in.nii.gz format and decomposing it into a series of 2D slices; adjusting the size of each 2D slice and uniformly adjusting it to a resolution of 512*512; saving the adjusted 2D slices as image files in.png format. Further, these 2D slices can be preprocessed, such as normalization, windowing, cropping, and resampling, to obtain more consistent and standardized image data. Through the above steps, the complex 3D medical image data can be effectively converted into a standardized 2D slice format, thereby simplifying the subsequent image processing and analysis work.
[0087] The technical solution of this application solves the problem of initial medical image format conversion by converting the initial medical image in.nii.gz format into 2D slices in.png format with a size of 512*512. Compared with the prior art, this conversion method not only improves the efficiency of image processing but also ensures the consistency of image data, providing a good foundation for subsequent image preprocessing and segmentation. Thus, the image segmentation model can process image data more efficiently, ultimately improving the accuracy and reliability of medical image segmentation.
[0088] In one of the embodiments, the processing procedure of the EFF module in the initial historical medical image segmentation model includes:
[0089] Step 1: Obtain the input original feature map.
[0090] This step is the starting point of the EFF module, which receives the original feature map output from the previous layer of the network (possibly the downsampling part or a certain convolutional layer before).
[0091] Step 2: Pass the original feature map through two branches of spatial attention and channel attention.
[0092] The spatial attention branch focuses on capturing the spatial information of the feature map, that is, the importance of different positions in the image. It generates a spatial attention map by analyzing the spatial distribution of the feature map, which indicates which positions are more critical for the current task (such as medical image segmentation). The channel attention branch focuses on the channel information of the feature map, that is, the importance of different feature channels. It generates a channel weight vector by weighting the channels of the feature map, which reflects the contribution degree of each channel to the current task.
[0093] Step 3: The spatial attention branch outputs the spatial attention map, and the channel attention branch outputs the channel weight vector.
[0094] The spatial attention branch outputs a spatial attention map with the same spatial dimension as the original feature map. The channel attention branch outputs a channel weight vector with the same number of channels as the original feature map.
[0095] Step 4: Multiply the spatial attention map, the channel weight vector and the original feature map to obtain the processed feature map.
[0096] Multiply the spatial attention map and the original feature map element by element to emphasize or suppress different spatial positions of the feature map. Multiply the channel weight vector and each channel of the original feature map with weighting to adjust the importance of different channels. After the above two multiplication operations, the processed feature map is obtained, and this feature map is enhanced in both the spatial dimension and the channel dimension.
[0097] Step 5: Fuse the processed feature maps to obtain an enhanced feature representation.
[0098] Fuse the processed feature maps, possibly through simple addition, concatenation or other fusion strategies, to obtain the final enhanced feature representation. This step aims to integrate the effects of spatial attention and channel attention to form a more robust and discriminative feature representation.
[0099] Overall, this application includes all the features of the preamble part and the characterizing part. The preamble part is related to obtaining the original feature map of the input, and the characterizing part includes the processing of the spatial attention branch and the channel attention branch. The spatial attention branch outputs a spatial attention map, and the channel attention branch outputs a channel weight vector. By multiplying the spatial attention map and the channel weight vector with the original feature map, the processed feature maps are obtained, and these processed feature maps are fused to obtain an enhanced feature representation. These technical features cooperate with each other to effectively solve the problem that the neural network is interfered by non-target regions such as the background during the medical image segmentation process. The spatial attention and channel attention modules process the feature map from two dimensions of space and channel respectively, which can better extract the features of the target region, reduce background interference, and improve the segmentation accuracy. To implement the above technical solution, the original feature map first passes through two branches of spatial attention and channel attention. The spatial attention branch generates a spatial attention map by calculating the importance of each pixel point in the entire feature map. The channel attention branch generates a channel weight vector by calculating the importance of each channel in the entire feature map. Then, the spatial attention map and the channel weight vector are respectively multiplied with the original feature map to obtain the processed feature maps. Finally, these processed feature maps are fused to obtain an enhanced feature representation. Specifically, the spatial attention branch can use convolution operations and activation functions to generate the spatial attention map, and the channel attention branch can use fully connected layers and activation functions to generate the channel weight vector. The fused processed feature maps can be weighted sum or concatenation, etc.
[0100] By adopting the above technical solution, this application can effectively solve the problem that the neural network is interfered by non-target regions such as the background during the medical image segmentation process. Compared with the prior art, by introducing the spatial attention and channel attention modules, this application can better extract the features of the target region, reduce background interference, and improve the segmentation accuracy. Therefore, this application has significant technical advantages and application value in the field of medical image segmentation.
[0101] Specifically, the EFF module combines spatial attention and efficient channel attention, and through adaptively learning the weights of different depth feature information, performs feature screening and fusion, thereby improving the performance of the model.
[0102] 1. Spatial attention: This part calculates the average value and the maximum value of the input feature map, then combines these two feature maps, and calculates the spatial attention map through a convolutional layer. The spatial attention map can highlight the important regions in the image and suppress the unimportant background regions, thereby improving the model's recognition ability for the target region.
[0103] 2. Channel Attention: This part compresses the feature map into a vector through adaptive average pooling, and then calculates the weights of each channel through a one-dimensional convolutional layer and a sigmoid activation function. Channel attention can highlight important feature channels and suppress unimportant channels, thereby enhancing feature expression.
[0104] In AttU-Net, the EFF module is applied to each stage of the decoder. By enhancing the effect of feature fusion, it improves the model's ability to capture detailed information, making the segmentation results more accurate and refined.
[0105] In one embodiment, the processing process of the enhanced convolutional module in the initial historical medical image segmentation model includes:
[0106] Step 1: Obtain input features.
[0107] This step is the starting point of the enhanced convolutional module, which receives the feature map output from the previous layer of the network as input.
[0108] Step 2: Perform partial convolutional layer processing on the input features to obtain partial convolutional output.
[0109] Perform partial convolutional layer processing on the input features. The partial convolutional layer is used to extract different aspects of the input features. The output of the partial convolutional layer will be used as the input for subsequent processing. Partial convolution is a special convolutional operation that is particularly useful when processing incomplete or damaged images. In the enhanced convolutional module (enhanced_conv_block module), partial convolution can better handle missing or abnormal regions in the image by performing convolutional operations only on a part of the input features.
[0110] Step 3: Pass the partial convolutional output through a standard convolutional layer, a batch normalization layer, and a ReLU activation function to obtain intermediate data.
[0111] The output of the partial convolutional layer is passed to the standard convolutional layer for further feature extraction. The output of the standard convolutional layer then goes through a Batch Normalization layer, which is used to accelerate the training process and improve the stability of the model. Finally, non-linearity is introduced through the ReLU (Rectified Linear Unit) activation function to enhance the expressive power of the model. After the above processing, intermediate data is obtained, which contains the feature representations after convolution, normalization, and activation. Specifically, the standard convolution is used to extract the basic features of the image. By stacking multiple convolutional layers, Batch Normalization layers, and ReLU activation functions, the non-linear expressive power of the model can be increased. In AttU-Net, the enhanced_conv_block module is applied to each stage of the encoder and decoder, which improves the robustness and expressive power of the model for image features by enhancing the effect of feature extraction. This enables the model to more effectively extract features and improve the segmentation accuracy when dealing with complex medical image data.
[0112] Step 4: The intermediate data is input into the partial convolutional layer again for processing, and after repeating a preset number of times, an enhanced feature map is obtained.
[0113] The intermediate data is re-input into the partial convolutional layer for another round of feature extraction and transformation. This process aims to further refine the feature representation and introduce more diversity. The above steps (from the standard convolutional layer to re-inputting into the partial convolutional layer) are repeated a preset number of times. This preset number is a hyperparameter that needs to be adjusted according to the specific task and model architecture. The more times it is repeated, the more complex and deep feature representations the model may be able to learn.
[0114] Generally speaking, this application also proposes that the processing process of the enhanced convolutional module in the initial historical medical image segmentation model includes: obtaining input features; performing partial convolutional layer processing on the input features to obtain partial convolutional output; passing the partial convolutional output through a standard convolutional layer, a Batch Normalization layer, and a ReLU activation function to obtain intermediate data; inputting the intermediate data into the partial convolutional layer again for processing, and after repeating a preset number of times, an enhanced feature map is obtained.
[0115] Through the design of the enhanced convolution module, this application solves the technical problem of improving feature extraction and enhancing feature representation during medical image segmentation. Specifically, through multiple processes of partial convolution layers, standard convolution layers, batch normalization layers, and ReLU activation functions, the representation ability of feature maps is enhanced, thereby improving the accuracy and effect of medical image segmentation. The partial convolution layer can preserve the spatial information of the input features during processing, the standard convolution layer further extracts features, the batch normalization layer is used to stabilize the training process, and the ReLU activation function introduces non-linear features. By repeating the above processing process multiple times, an enhanced feature map is finally obtained.
[0116] For the implementation of the enhanced convolution module, several variants can be adopted. For example, the partial convolution layer can use different convolution kernel sizes and strides to adapt to different input features; the standard convolution layer can select different numbers of convolution kernels and layers to enhance the feature extraction ability; the batch normalization layer can adjust the normalization parameters according to specific training data; the ReLU activation function can be replaced with other non-linear activation functions, such as Leaky ReLU or ELU, to further improve the diversity of feature representation. In addition, the preset number of repetitions of the enhanced convolution module can also be adjusted according to specific application requirements to balance the computational complexity and feature enhancement effect.
[0117] Through the above technical solutions, this application significantly improves the ability of feature extraction and feature representation during medical image segmentation. Compared with the prior art, this application effectively enhances the expression ability of feature maps through a multi-level and multi-step feature processing method, thereby improving the accuracy and robustness of the segmentation results. This improvement is not only applicable to the medical image segmentation of non-small cell lung cancer, but also can be extended to other types of medical image segmentation tasks, with broad application prospects.
[0118] It should be understood that although the steps in the flowcharts involved in the above embodiments are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or steps or stages in other steps.
[0119] Based on the same inventive concept, an embodiment of the present application further provides a medical image segmentation device for implementing the medical image segmentation method involved above. The solution provided by this device to solve the problem is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the medical image segmentation device provided below can refer to the limitations on the medical image segmentation method in the above text, and will not be repeated here.
[0120] In one embodiment, as Figure 5 shown, a medical image segmentation device is provided, including:
[0121] A preprocessing module 200, configured to obtain an initial historical medical image and perform preprocessing on the initial historical medical image to obtain a processed medical image;
[0122] A training module 400, configured to train an initial medical image segmentation model using the processed medical image to obtain a trained medical image segmentation model;
[0123] A segmentation module 600, configured to obtain a collected medical image and input the collected medical image into the trained medical image segmentation model to obtain a medical image segmentation result;
[0124] Among them, the initial historical medical image segmentation model is constructed based on the Attention U-Net network, and an enhanced convolution module is set in its downsampling part, and an EFF module is set in its upsampling part.
[0125] In one of the embodiments, the preprocessing module 200 is further configured to obtain an initial historical medical image; perform preprocessing including normalization, windowing, cropping, and resampling on the initial historical medical image to obtain a processed medical image.
[0126] In one of the embodiments, the preprocessing module 200 is further configured to convert the initial medical image in.nii.gz format into 2D slices in.png format; perform preprocessing including normalization, windowing, cropping, and resampling on the 2D slices to obtain a processed medical image.
[0127] In one of the embodiments, the preprocessing module 200 is further configured to convert the initial medical image in.nii.gz format into 2D slices in.png format with a size of 512*512.
[0128] In one embodiment, the training module 400 is further configured to obtain an input original feature map; pass the original feature map through two branches of spatial attention and channel attention; output a spatial attention map by the spatial attention branch and output a channel weight vector by the channel attention branch; multiply the spatial attention map, the channel weight vector, and the original feature map to obtain a processed feature map; and fuse the processed feature map to obtain an enhanced feature representation.
[0129] In one embodiment, the training module 400 is further configured to obtain input features; perform partial convolution layer processing on the input features to obtain a partial convolution output; pass the partial convolution output through a standard convolution layer, a batch normalization layer, and a ReLU activation function to obtain intermediate data; input the intermediate data into the partial convolution layer for processing again, and obtain an enhanced feature map after repeating a preset number of times.
[0130] Each module in the above medical image segmentation device can be implemented in whole or in part by software, hardware, and their combination. Each of the above modules can be embedded in or independent of a processor in a computer device in the form of hardware, or stored in a memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0131] In one embodiment, a computer device is provided. The computer device can be a server, and its internal structure diagram can be as Figure 6 shown. The computer device includes a processor, a memory, and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store preset data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements a medical image segmentation method.
[0132] Those skilled in the art can understand that Figure 6 the structure shown in
[0133] is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0134] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned medical image segmentation method is implemented.
[0135] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the above-mentioned medical image segmentation method is implemented.
[0136] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the various embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memories can include read-only memory (ROM), magnetic tapes, floppy disks, flash memories, optical memories, high-density embedded non-volatile memories, resistive random-access memories (ReRAM), magnetoresistive random-access memories (MRAM), ferroelectric random-access memories (FRAM), phase change memories (PCM), graphene memories, etc. Volatile memories can include random access memory (RAM) or external cache memories, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the various embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the various embodiments provided in the present application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.
[0137] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
[0138] The above embodiments only illustrate several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation to the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several variations and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.
Claims
1. A medical image segmentation method, characterized in that: The method comprises: Acquire an initial historical medical image, and preprocess the initial historical medical image to obtain a processed medical image; Using the processed medical image to train an initial medical image segmentation model to obtain a trained medical image segmentation model; Acquire a collected medical image, and input the collected medical image into the trained medical image segmentation model to obtain a medical image segmentation result; Among them, the initial historical medical image segmentation model is constructed based on the Attention U-Net network, the downsampling part of which is provided with an enhanced convolution module, and the upsampling part of which is provided with an EFF module.
2. The method according to claim 1, characterized in that Obtaining an initial historical medical image, and preprocessing the initial historical medical image to obtain a processed medical image includes: Obtaining initial historical medical images; The initial historical medical image is preprocessed by normalization, window adjustment, cropping and resampling to obtain a processed medical image.
3. The method according to claim 2, characterized in that The initial historical medical image is preprocessed by normalization, window adjustment, cropping and resampling to obtain a processed medical image including: Convert the original medical image in .nii.gz format to 2D slices in .png format; The 2D slices are preprocessed by normalization, window adjustment, cropping and resampling to obtain a processed medical image.
4. The method according to claim 3, characterized in that The conversion of the initial medical image in .nii.gz format into 2D slices in .png format comprises: Convert the original medical image in .nii.gz format to 2D slices in .png format with a size of 512*512.
5. The method according to claim 1, characterized in that The processing process of the EFF module in the initial historical medical image segmentation model includes: Get the original feature map of the input; The original feature map is passed through two branches: spatial attention and channel attention; The spatial attention branch outputs a spatial attention map, and the channel attention branch outputs a channel weight vector; Multiplying the spatial attention map, the channel weight vector and the original feature map to obtain a processed feature map; The processed feature maps are fused to obtain enhanced feature representation.
6. The method according to claim 1, characterized in that The processing process of the enhanced convolution module in the initial historical medical image segmentation model includes: Get input features; Perform partial convolution layer processing on the input features to obtain partial convolution output; Passing the partial convolution output through a standard convolution layer, a batch normalization layer, and a ReLU activation function to obtain intermediate data; The intermediate data is input into the partial convolution layer again for processing, and the enhanced feature map is obtained after repeating the process for a preset number of times.
7. A medical image segmentation device, characterized in that: The device comprises: A preprocessing module, used for acquiring an initial historical medical image and preprocessing the initial historical medical image to obtain a processed medical image; A training module, used to train the initial medical image segmentation model using the processed medical image to obtain a trained medical image segmentation model; A segmentation module, used to acquire a collected medical image, and input the collected medical image into the trained medical image segmentation model to obtain a medical image segmentation result; Among them, the initial historical medical image segmentation model is constructed based on the Attention U-Net network, the downsampling part of which is provided with an enhanced convolution module, and the upsampling part of which is provided with an EFF module.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.