A brain tumor image segmentation method combining feature fusion and attention mechanism
By combining feature fusion and attention mechanisms, a brain tumor image segmentation method has been developed, which solves the problems of redundant feature extraction and class imbalance in existing technologies, and achieves more accurate brain tumor image segmentation and higher segmentation performance.
Patent Information
- Application Number
- CN202310325927.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-29
- Publication Date
- 2026-03-03
- Estimated Expiration
- 2043-03-29
AI Technical Summary
Existing end-to-end deep learning-based methods for brain tumor image segmentation suffer from redundant feature extraction leading to poor segmentation results, severe class imbalance, and a lack of large labeled datasets resulting in weak model learning capabilities, low segmentation accuracy, and poor robustness.
By combining feature fusion and attention mechanisms, a brain tumor image segmentation network is constructed by introducing the MobileNetV2 network as the feature extraction network, and then introducing attention mechanisms and hypercolumns on it for multi-scale feature fusion.
It improves the model's adaptability to features at different scales, alleviates the class imbalance problem, improves the accuracy and performance of segmentation, reduces the number of model parameters, improves storage efficiency and computation speed, and enhances the model's generalization ability.
Smart Images

Figure CN116342624B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical image processing technology, and in particular to a brain tumor image segmentation method that combines feature fusion and attention mechanisms. Background Technology
[0002] For brain tumor image segmentation, current methods primarily employ end-to-end deep learning approaches. Following breakthroughs in medical image segmentation with fully convolutional networks and UNet, subsequent innovations have focused on constructing fully convolutional encoder-decoder networks without fully connected layers to achieve end-to-end medical image segmentation. The general process involves the encoder acquiring detailed and contour information of the image, then passing the extracted features to the decoder via skip connections. Finally, the decoder combines features from multiple scales to perform feature recovery.
[0003] In end-to-end deep learning methods, firstly, the features extracted by the encoder contain a lot of redundant information, resulting in poor segmentation performance; secondly, the segmentation performance for images with severe class imbalance is not ideal; and finally, medical images lack large labeled datasets, resulting in weak network learning ability, low model segmentation accuracy, and poor robustness. Summary of the Invention
[0004] In view of this, the purpose of this invention is to propose a brain tumor image segmentation method that combines feature fusion and attention mechanism to solve the problem that the features extracted by the existing encoder contain a lot of redundant information, resulting in poor segmentation effect.
[0005] To achieve the above objectives, this invention provides a brain tumor image segmentation method combining feature fusion and attention mechanisms, comprising:
[0006] Step 1: Obtain brain tumor image samples and corresponding segmentation masks, and process and analyze the samples and corresponding segmentation masks to obtain the actual training set, validation set and test set;
[0007] Step 2: Based on the traditional UNet medical image segmentation model, the MobileNetV2 network is selected as the feature extraction network of the UNet medical image segmentation model to achieve deep feature extraction, resulting in the first brain tumor image segmentation network with MobileNetV2 as the backbone.
[0008] Step 3: Based on the first brain tumor image segmentation network, an attention mechanism is introduced to obtain a second brain tumor image segmentation network that incorporates the attention mechanism.
[0009] Step 4: Based on the second brain tumor image segmentation network, multi-scale feature fusion is performed by combining hypercolumns to obtain a third brain tumor image segmentation network that combines feature fusion and attention mechanisms.
[0010] Step 5: Use the training set to train the third brain tumor image segmentation network from Step 4 to obtain the trained optimal brain tumor image segmentation model.
[0011] Step 6: Based on the brain tumor image segmentation model, predict the test set and output the results of brain tumor region segmentation.
[0012] Optionally, step one, which involves processing and analyzing the samples and corresponding segmentation masks to obtain the actual training set, validation set, and test set, includes:
[0013] The sample and its corresponding segmentation mask are normalized, and the pixel values are scaled from [0,255] to [0,1]. The normalized segmentation mask is then binarized to obtain the processed image sample.
[0014] The processed image samples are divided into an initial training set and a test set at a ratio of 9:1, and then the initial training set is divided into an actual training set and a validation set at a ratio of 8:2.
[0015] Perform one or more data augmentation operations on the actual training set, including random rotation, random horizontal and vertical translation, random scaling, random flipping, and random cropping.
[0016] Optionally, in step two, the MobileNetV2 network is selected as the feature extraction network of the model to achieve deep feature extraction. This includes: loading the weights of the MobileNetV2 network pre-trained on the ImageNet dataset; using the outputs of the 1st, 3rd, and 6th linear bottleneck layers of the MobileNetV2 network as the outputs of the four stages in the encoder of the UNet medical image segmentation model network; and using the 13th linear bottleneck layer as a bridge in the network to construct the feature extraction network of the model to achieve deep feature extraction.
[0017] Optionally, the introduced attention mechanism includes: introducing a Spatial and Channel Squeeze & Excitation Block (scSE) attention mechanism, where scSE is a hybrid attention mechanism that includes channel attention (SpatialSqueeze and Channel Excitation Block, cSE) and spatial attention (Channel Squeeze and Spatial Excitation Block, sSE).
[0018] The channel attention cSE first transforms the feature map of dimension [C,H,W] into dimension [C,1,1] using global average pooling. Then, it is processed by C / 2×1×1 and C×1×1 convolutions to obtain a C-dimensional vector. After that, the sigmoid function is used for normalization. Finally, the normalized result is multiplied with the original feature map to obtain the cSE feature map.
[0019] The spatial attention sSE first transforms the [C,H,W] dimension feature map into [1,H,W] dimension through a 1×1×1 convolution, then obtains the spatial feature map through the sigmoid activation function, and finally multiplies it with the original feature map to obtain the sSE feature map.
[0020] Adding the cSE feature map and the sSE feature map results in the scSE attention mechanism.
[0021] Optionally, the multi-scale feature fusion using hypercolumns includes: treating each stage of the UNet medical image segmentation model network decoder as a feature map; scaling the feature maps to a uniform size using bilinear interpolation since the stage feature maps have different scales; obtaining the hypercolumns at the corresponding positions of each stage; and finally fusing the features at different scales.
[0022] Optionally, using the training set to train the third brain tumor image segmentation network in step four to obtain the trained optimal brain tumor image segmentation model includes the following steps:
[0023] Step 4.1 Initialize the parameters of the third brain tumor image segmentation network;
[0024] Step 4.2 Set training parameters;
[0025] Step 4.3 Load training data;
[0026] Step 4.4 Iterative training yields the best-trained brain tumor image segmentation model.
[0027] Optionally, step 4.1, network parameter initialization, includes: extracting feature information of the input image using weights pre-trained on the ImageNet dataset using the MobileNetV2 model.
[0028] Optionally, step 4.2 of setting training parameters includes: setting the training epoch of the third brain tumor image segmentation network to 150, the batch size to 16, the initial learning rate (lr) of the network to 1e-4, the exponential decay rate (beta1) of the first moment estimation to 0.9, the exponential decay rate (beta2) of the second moment estimation to 0.999, the weight decay coefficient to lr / epoch, and using the Adam optimizer.
[0029] Optionally, in step 4.4 iterative training, the stochastic gradient descent algorithm is used to iteratively train the third brain tumor image segmentation network. The model is saved only when the training result is improved compared to the previous one. After a specified number of iterations, the best trained brain tumor image segmentation model is obtained.
[0030] This invention, by combining multi-scale feature fusion, can better utilize the information extracted by the model at different stages, improving the model's adaptability to features at different scales and thus enhancing its segmentation performance. Compared to the UNet network, the model in this invention segments brain tumor image regions more accurately. This invention incorporates a scSE attention mechanism after the encoder extracts image features. scSE attention is a mechanism that combines spatial attention and channel attention to focus on specific regions. Spatial attention helps the model focus on specific spatial locations, while channel attention helps the model focus on specific channel features. Through this mechanism, the model can better focus on the regions that need to be segmented, thereby improving segmentation accuracy. This makes the network more focused on the tumor region in the image, thus alleviating the class imbalance problem and improving the model's segmentation performance and effectiveness. Attached Figure Description
[0031] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only for this invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0032] Figure 1 This is a schematic diagram of the process of the present invention;
[0033] Figure 2 This is a network structure diagram of the present invention;
[0034] Figure 3This is a diagram of the multi-scale feature fusion structure of the present invention;
[0035] Figure 4 This is a structural diagram of the scSE attention mechanism of the present invention;
[0036] Figure 5 This is a diagram showing the brain tumor image segmentation effect of the present invention. Detailed Implementation
[0037] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments.
[0038] It should be noted that, unless otherwise defined, the technical or scientific terms used in this invention should have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms "first," "second," and similar terms used in this invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed following the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are used only to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0039] like Figures 1 to 5 As shown, a brain tumor image segmentation method combining feature fusion and attention mechanisms includes:
[0040] Step 1: Obtain brain tumor image samples and corresponding segmentation masks, and process and analyze the samples and corresponding segmentation masks to obtain the actual training set, validation set and test set;
[0041] Step 2: Based on the traditional UNet medical image segmentation model, the MobileNetV2 network is selected as the feature extraction network of the UNet medical image segmentation model to achieve deep feature extraction, resulting in the first brain tumor image segmentation network with MobileNetV2 as the backbone.
[0042] UNet is an image segmentation network used in medical image processing. The structure of UNet consists of a symmetrical encoder and decoder, connected by a span of convolutional layers at different depths.
[0043] UNet's distinguishing feature is that it performs span convolution operations on features at different depths in the encoder and decoder, combining the contextual information learned in the encoder with the local information in the decoder. This allows UNet to have excellent prediction performance for information such as the contours and edges of objects.
[0044] MobileNetV2 is a convolutional neural network model for image classification and object detection. Compared to other deep neural networks, MobileNetV2 is more lightweight in terms of model size and computational complexity, making it suitable for use in resource-constrained environments such as mobile devices.
[0045] MobileNetV2 employs two key techniques: depthwise separable convolution and a linear bottleneck. Depthwise separable convolution breaks down the convolution operation into depthwise convolution and pointwise convolution, reducing computational complexity while improving model performance without significantly sacrificing accuracy. The linear bottleneck uses a bottleneck layer to compress the input feature map to a lower dimension before performing the convolution operation, further reducing computational cost.
[0046] Like other models such as MobileNetV2, the encoder part of UNet extracts image features through convolutional layers, so MobileNetV2 can be used to replace the encoder stage of UNet.
[0047] Step 3: Based on the first brain tumor image segmentation network, an attention mechanism is introduced to obtain a second brain tumor image segmentation network that incorporates the attention mechanism.
[0048] Step 4: Based on the second brain tumor image segmentation network, multi-scale feature fusion is performed by combining hypercolumns to obtain a third brain tumor image segmentation network that combines feature fusion and attention mechanisms.
[0049] Hypercolumns are a hierarchical feature representation method that combines low-level visual features (such as edges and corners) with high-level semantic information (such as object categories and scene information) to construct a rich feature representation. Specifically, hypercolumns concatenate feature vectors from lower-level visual processing layers (such as edge detection layers) with feature vectors from top-level semantic layers (such as object category recognition layers) to form a more comprehensive feature representation.
[0050] The advantage of hypercolumns is that they can simultaneously capture low-level visual features and high-level semantic information, which is extremely useful for many computer vision tasks. For example, in image classification tasks, hypercolumns can provide better classification performance than traditional feature representation methods; in object detection tasks, hypercolumns can provide more accurate location information.
[0051] Step 5: Use the training set to train the third brain tumor image segmentation network from Step 4 to obtain the trained optimal brain tumor image segmentation model.
[0052] Step Six: Based on the brain tumor image segmentation model, predict the brain tumor region segmentation results on the test set. The results are as follows: Figure 5 As shown in the figure, the first column is the original image, the second column is the segmentation mask corresponding to the original image, the third column is the segmentation result of the UNet network, and the fourth column is the segmentation result of the model trained in step five.
[0053] The above method reduces the number of model parameters: the backbone network of this invention adopts the MobileNetV2 lightweight model, which can greatly reduce the number of network parameters, making the number of model parameters only 15.6% of the number of UNet network parameters.
[0054] Reducing the number of parameters in a network model can bring the following benefits:
[0055] 1. Reduce model storage space: The fewer parameters a model has, the less data needs to be stored, which can reduce the storage space required by the model.
[0056] 2. Reduce model computation time and complexity: The fewer parameters a model has, the fewer multiplication and addition operations it needs to perform, which can reduce the model's computation time and complexity, and accelerate the model's training and inference speed.
[0057] 3. Improve the model's generalization ability: Reducing the number of model parameters can reduce the risk of overfitting, thereby improving the model's generalization ability and making it more suitable for prediction and classification of new data.
[0058] 4. Easier to optimize and adjust: Models with fewer parameters are easier to optimize and adjust. The performance of the model can be improved by increasing or decreasing the number of network layers, adjusting the number of neurons in each layer, or modifying other hyperparameters, so that it can better meet the needs of real-world application scenarios.
[0059] In conclusion, reducing the number of parameters in a network model can improve its storage efficiency, computation speed, generalization ability, and ease of optimization and adjustment, which has significant practical implications.
[0060] The above method can also achieve more accurate segmentation: This invention combines multi-scale feature fusion, which can better utilize the information extracted by the model at different stages, improve the model's adaptability to features at different scales, and thus improve the model's segmentation performance. Compared with the UNet network, the model in this invention segments brain tumor image regions more accurately;
[0061] The above method improves the class imbalance problem: After the encoder extracts image features, this invention incorporates the scSE attention mechanism, which combines spatial attention and channel attention to focus on specific regions. Spatial attention helps the model focus on specific spatial locations, while channel attention helps the model focus on specific channel features. Through this mechanism, the model can better focus on the regions that need to be segmented, thereby improving segmentation accuracy. This makes the network pay more attention to tumor regions in the image, thus alleviating the class imbalance problem and improving the model's segmentation performance and effectiveness.
[0062] In some embodiments, step one, which involves processing and analyzing the samples and their corresponding segmentation masks to obtain the actual training set, validation set, and test set, includes:
[0063] The sample and its corresponding segmentation mask are normalized, and the pixel values are scaled from [0,255] to [0,1]. The normalized segmentation mask is then binarized to obtain the processed image sample.
[0064] The processed image samples are divided into an initial training set and a test set at a ratio of 9:1, and then the initial training set is divided into an actual training set and a validation set at a ratio of 8:2.
[0065] Perform one or more data augmentation operations on the actual training set, including random rotation, random horizontal and vertical translation, random scaling, random flipping, and random cropping.
[0066] In some embodiments, step two involves selecting the MobileNetV2 network as the feature extraction network of the model to achieve deep feature extraction. This includes: loading the weights of the MobileNetV2 network pre-trained on the ImageNet dataset; using the outputs of the 1st, 3rd, and 6th linear bottleneck layers of the MobileNetV2 network's input layer as the outputs of the four stages in the UNet medical image segmentation model network encoder; and using the 13th linear bottleneck layer as a bridge in the network to construct the model's feature extraction network, thereby achieving deep feature extraction.
[0067] ImageNet is a large-scale image database designed to support research in visual object recognition. MobileNetV2 is pre-trained using the ImageNet dataset. During pre-training, the network uses 15 million images and 1000 class labels from the ImageNet dataset to learn object recognition tasks. Pre-training enables the network to achieve better generalization performance when learning new object recognition tasks.
[0068] In some embodiments, the introduction of the attention mechanism includes: introducing a Spatial and ChannelSqueeze & Excitation Block (scSE) attention mechanism, where scSE is a hybrid attention mechanism that includes channel attention (Spatial Squeeze and Channel Excitation Block, cSE) and spatial attention (ChannelSqueeze and Spatial Excitation Block, sSE).
[0069] The cSE first transforms the feature map with dimensions [C,H,W] into a dimension of [C,1,1] using global average pooling. Then, it is processed by C / 2×1×1 and C×1×1 convolutions to obtain a C-dimensional vector. After that, the sigmoid function is used for normalization. Finally, the normalized result is multiplied by the original feature map to obtain the cSE feature map.
[0070] The sSE first transforms the [C,H,W] dimension feature map into [1,H,W] dimension through a 1×1×1 convolution, then obtains a spatial feature map through a sigmoid activation function, and finally multiplies it with the original feature map to obtain the sSE feature map.
[0071] Adding the cSE feature map and the sSE feature map results in the scSE attention mechanism.
[0072] In some embodiments, the multi-scale feature fusion using hypercolumns includes: treating each stage of the UNet medical image segmentation model network decoder as a feature map; scaling the feature maps to a uniform size using bilinear interpolation since the stage feature maps have different scales; obtaining the hypercolumns at the corresponding positions of each stage; and finally fusing the features at different scales.
[0073] Normally, the feature maps from each stage of the decoder are restored step by step, and the final segmentation result with the same size as the original image is output. This process loses some information. This paper uses hypercolumns for feature fusion, which involves scaling the feature maps of different scales obtained from the four stages of the decoder to a uniform size through bilinear interpolation before fusing them and then outputting the result.
[0074] Using hypercolumns to fuse features can improve segmentation accuracy because different features can complement each other, reduce the shortcomings of single features, and improve the generalization ability of the model.
[0075] In some embodiments, training the third brain tumor image segmentation network in step four using the training set to obtain the trained optimal brain tumor image segmentation model includes the following steps:
[0076] 4.1 Initialization of parameters for the third brain tumor image segmentation network;
[0077] 4.2 Set training parameters;
[0078] 4.3 Load training data;
[0079] 4.4 Iterative training to obtain the best trained brain tumor image segmentation model.
[0080] In some embodiments, step 4.1, network parameter initialization, includes: extracting feature information of the input image using weights pre-trained on the ImageNet dataset using the MobileNetV2 model.
[0081] In some embodiments, step 4.2 of setting training parameters includes: setting the training epoch of the third brain tumor image segmentation network to 150, the batch size to 16, the initial learning rate (lr) of the network to 1e-4, the exponential decay rate (beta1) of the first moment estimation to 0.9, the exponential decay rate (beta2) of the second moment estimation to 0.999, the weight decay coefficient to lr / epoch, and using the Adam optimizer.
[0082] Epoch: An epoch refers to the number of times the dataset is traversed during training. Generally, the more training epochs (number of epochs), the more features the model learns; however, too many training epochs can lead to overfitting. Therefore, the choice of epochs needs to be determined based on the specific circumstances and the model's training and validation errors. Generally, training can be stopped when both the training and validation errors no longer change.
[0083] Batch size: Batch size refers to the number of samples selected in each training iteration. Choosing an appropriate batch size can improve training speed and accuracy. Generally, a larger batch size results in faster training, but requires more memory. Conversely, a batch size that is too small can lead to unstable training and slower convergence. Therefore, it is necessary to select an appropriate batch size through experimentation.
[0084] Learning rate: The learning rate is the scaling factor used to multiply parameters each time they are updated, controlling the magnitude of each parameter update. A learning rate that is too small will lead to slow training convergence; a learning rate that is too large may cause training instability or even prevent the model from converging. Therefore, it is necessary to determine the appropriate learning rate through experiments.
[0085] Beta: Beta refers to the coefficient used to calculate the moving average in the Adam optimization algorithm. Adam is a commonly used optimization algorithm for optimizing parameters in neural networks. An appropriate Beta coefficient can help the algorithm better adapt to different datasets and tasks, improving optimization performance. Generally, Beta1 ranges from around 0.9, and Beta2 ranges from around 0.999, but the specific values need to be determined based on experimental results.
[0086] In some embodiments, in step 4.4 iterative training, the stochastic gradient descent algorithm is used to iteratively train the third brain tumor image segmentation network. The model is saved only when the training result is improved compared to the previous one. After a specified number of iterations, the best trained brain tumor image segmentation model is obtained.
[0087] The specified number of rounds can be the 150 training rounds mentioned above. Each round will yield a result, including the loss function, Dice similarity coefficient (DSC), intersection-over-union (IoU), accuracy, and so on.
[0088] To determine if there is an improvement: Use the loss function used during model training. Typically, the loss function will gradually decrease during model training. Therefore, you can determine if there is an improvement by comparing the loss function value of the current training with the loss function value of the previous training.
[0089] If the current result is better than the previous one, the model is saved. The iteration will not stop. Each subsequent result is compared with the saved result. When there is another improvement, the better result is saved to overwrite the original result. In other words, the optimal brain tumor image segmentation model is saved in the end.
[0090] After setting the hyperparameters, the model is trained. The trained model is evaluated using commonly used performance metrics in medical image segmentation algorithms, including the Dice similarity coefficient (DSC), intersection over union (IoU), and accuracy. The formulas are shown below:
[0091]
[0092]
[0093]
[0094] Where A represents the predicted segmentation result; B represents the true segmentation result; δ is set to 1 in the experiment to prevent the denominator from being 0. TP (True Positive) refers to the number of samples correctly classified as positive, that is, the number of samples predicted as positive in the true positive class; TN (True Negative) refers to the number of samples correctly classified as negative, that is, the number of samples predicted as negative in the true negative class; FP (False Positive) refers to the number of samples incorrectly classified as positive, that is, the number of samples predicted as positive in the true negative class; FN (False Negative) refers to the number of samples incorrectly classified as negative, that is, the number of samples predicted as negative in the true positive class.
[0095] In image segmentation, a single pixel can be considered a sample. In this case, TP represents the number of pixels correctly classified as target pixels, i.e., the number of real target pixels predicted as target pixels; TN represents the number of pixels correctly classified as background pixels, i.e., the number of real background pixels predicted as background pixels; FP represents the number of pixels incorrectly classified as target pixels, i.e., the number of real background pixels predicted as target pixels; and FN represents the number of pixels incorrectly classified as background pixels, i.e., the number of real target pixels predicted as background pixels.
[0096] The specific values of TP, TN, FP, and FN are obtained by comparing the prediction results of the image segmentation algorithm with the true labels.
[0097] The results of comparing it with other commonly used medical image algorithms on a brain tumor dataset are shown in Table 1.
[0098] Table 1 Comparison of the present invention with other segmentation algorithms
[0099]
[0100] This invention was compared with other commonly used medical image segmentation algorithms on a brain tumor dataset. Under the same experimental parameters, the Dice coefficient of this invention reached 91.93%, which is slightly higher than other commonly used medical image segmentation algorithms, and achieved good segmentation performance.
[0101] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of the invention (including the claims) is limited to these examples; within the framework of the invention, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of the different aspects of the invention as described above, which are not provided in the details for the sake of brevity.
[0102] This invention is intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A brain tumor image segmentation method combining feature fusion and attention mechanism, characterized in that, The application relates to a brain tumor image segmentation method based on MobileNetV2 and scSE attention mechanism. The method comprises the following steps: Step 1: obtaining brain tumor image samples and corresponding segmentation masks, and processing and analyzing the samples and the corresponding segmentation masks to obtain an actual training set, a verification set and a test set; Step 2: based on a traditional UNet medical image segmentation model, a MobileNetV2 network is selected as a feature extraction network of the UNet medical image segmentation model to realize deep feature extraction, and a first brain tumor image segmentation network taking the MobileNetV2 as a backbone is obtained; The MobileNetV2 network is selected as the feature extraction network of the model to realize deep feature extraction, which comprises the following steps: loading pre-trained weights of the MobileNetV2 network on an ImageNet dataset, taking output results of a first, third and sixth linear bottleneck layer of the MobileNetV2 network as output results of four stages in a network encoder of the UNet medical image segmentation model, and taking a thirteenth linear bottleneck layer as a bridge of the network to construct the feature extraction network of the model, so that deep feature extraction is realized; Step 3: introducing an attention mechanism based on the first brain tumor image segmentation network to obtain a second brain tumor image segmentation network combined with the attention mechanism; the attention mechanism comprises introducing a Spatial and Channel Squeeze & Excitation Block (scSE) attention mechanism; the scSE is a hybrid attention mechanism, which comprises a channel attention (Spatial Squeeze and Channel Excitation Block, cSE) and a spatial attention (Channel Squeeze and Spatial Excitation Block, sSE); The channel attention cSE firstly changes a feature map with a dimension of [C, H, W] into a dimension of [C, 1, 1] through a global average pooling method, then sequentially uses C / 2x1x1 and Cx1x1 convolution to process, obtains a C-dimensional vector, then uses a sigmoid function to normalize, and finally multiplies the normalized result with the original feature map to obtain a cSE feature map; The spatial attention sSE firstly changes a feature map with a dimension of [C, H, W] into a dimension of [1, H, W] through 1x1x1 convolution, then obtains a spatial feature map through a sigmoid activation function, and finally multiplies the spatial feature map with the original feature map to obtain an sSE feature map; The cSE feature map and the sSE feature map are added, and the result is the scSE attention mechanism; Step 4: combining hypercolumns for multi-scale feature fusion based on the second brain tumor image segmentation network to obtain a third brain tumor image segmentation network combined with feature fusion and the attention mechanism. Model training of the third brain tumor image segmentation network in step four is performed using the training set to obtain a trained optimal brain tumor image segmentation model, including the following steps: Step 4.1, parameter initialization of the third brain tumor image segmentation network, including: using the pre-trained weights of the MobileNetV2 model on the ImageNet dataset to extract feature information of the input image; Step 4.2, setting training parameters, including: setting the training round (Epoch) of the third brain tumor image segmentation network model training network to 150, the sample batch size (Batch Size) to 16, the initial learning rate (lr) of the network to 1e-4, the exponential decay rate (beta1) of the first moment estimation to 0.9, the exponential decay rate (beta2) of the second moment estimation to 0.999, the weight decay coefficient to lr / Epoch, and using the Adam optimizer; Step 4.3, loading training data; Step 4.4, iterative training to obtain a trained optimal brain tumor image segmentation model, wherein the random gradient descent algorithm is used to iteratively train the third brain tumor image segmentation network model, and the model is only saved when the current training result is better than the last one. After a specified number of iterations, a trained optimal brain tumor image segmentation model is obtained; Step five, model training of the third brain tumor image segmentation network in step four is performed using the training set to obtain a trained optimal brain tumor image segmentation model; Step six, based on the brain tumor image segmentation model, the test set is predicted and the result of brain tumor region segmentation is output.
2. The brain tumor image segmentation method combining feature fusion and attention mechanism according to claim 1, characterized in that, In step one, the samples and corresponding segmentation masks are processed and analyzed to obtain actual training set, validation set and test set, including: The samples and corresponding segmentation masks are normalized to scale the pixel values from [0, 255] to [0, 1], and the normalized segmentation masks are binarized to obtain processed image samples; The processed image samples are divided into an initial training set and a test set in a ratio of 9:1, and the initial training set is divided into an actual training set and a validation set in a ratio of 8:2; Random rotation, random horizontal and vertical translation, random scaling, random flipping and random cropping are performed on the actual training set.
3. The brain tumor image segmentation method combining feature fusion and attention mechanism according to claim 1, characterized in that, The combination of hypercolumns for multi-scale feature fusion includes: each stage of the UNet medical image segmentation model network decoder is regarded as a feature map. Due to the different scales of the stage feature maps, the feature maps are scaled to a uniform size using bilinear interpolation, then the hypercolumns corresponding to each stage are obtained, and finally the features of different scales are fused.
Citation Information
Patent Citations
Fetal cerebellum ultrasound image segmentation method based on convolutional neural network
CN114049339A
Brain tumor classification detection method and system based on feature pyramid network structure and channel attention mechanism
CN115170885A