Three-dimensional ultrasound thyroid segmentation method and device based on multi-scale fusion network
By predicting the boundary distance map through the multi-scale fusion network and using deep supervised training, combined with the CBAM attention module and the atrous convolution module, the accuracy and computational efficiency problems of edge recognition in 3D ultrasound thyroid segmentation are solved, and efficient 3D thyroid segmentation is achieved. .
Patent Information
- Application Number
- CN202110202637.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-23
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-02-23
AI Technical Summary
Existing three-dimensional ultrasound thyroid segmentation methods have insufficient accuracy when dealing with the edges of heterogeneous organ structures, and the segmentation results are easily affected by the intermediate results of distance map prediction, which requires a large amount of calculation and makes it difficult to effectively utilize multi-level semantic information.
A method based on multi-scale fusion network is adopted to predict the boundary distance map, use deep supervised training and CBAM attention module to focus on edge information, and gradually refine the probability map through the dense fusion module of atrous convolution to avoid relying on distance map prediction results. Taking into account both semantic information utilization and computational efficiency.
It achieves accurate segmentation of the edges of heterogeneous organ structures, reduces the dependence of segmentation results on distance maps, improves the accuracy and computational efficiency of three-dimensional thyroid segmentation, and achieves better results.
Smart Images

Figure CN112967300B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of medical image processing, and in particular to a three-dimensional ultrasonic thyroid segmentation method based on a multi-scale fusion network, and a three-dimensional ultrasonic thyroid segmentation device based on a multi-scale fusion network. Background Art
[0002] Ultrasound imaging relies on the echo energy that penetrates tissues, and the energy is partially attenuated, absorbed, and reflected due to the characteristics of the tissues. The returned signal is collected and rendered by an ultrasound probe. The imaging characteristics of ultrasound cause random speckle noise in the image, low contrast, and blurred edges of organs. The anisotropy of tissues in ultrasound images and the echo properties between adjacent tissues can lead to multiple different patterns in the same tissue. In addition, ultrasound imaging is often used for real-time clinical testing, and the acquisition of three-dimensional ultrasound volume data is often performed by sliding a handheld two-dimensional ultrasound probe to collect and reconstruct the generated volume data, which introduces displacement and blur between frames. The above reasons make organ segmentation in three-dimensional ultrasound a challenging problem.
[0003] There are many 2D ultrasound segmentation methods. Some use region-based active contour models that require initialization masks. Some use fuzzy C clustering, histogram clustering, region growing, and random walks. Some use unbounded active contours, region-based active contours, and distance-regularized level sets. Some use classic algorithms such as thresholds, region splitting and merging, watersheds, and graph cuts. Some use multi-organ segmentation methods based on spot-related pixels and image artifacts as information. The above methods rely on manually designed features and are mostly semi-automatic methods.
[0004] There are also many methods for the segmentation of three-dimensional thyroid images. Some use 3D spring deformation models to segment thyroid cartilage, but for CT images. Some use geodesic active contour models to obtain the contour of the thyroid gland in three-dimensional images, but it is still a semi-automatic segmentation method. Some use radial basis functions to directly segment ultrasound data blocks. Some compare the level set, graph cut and pixel classifier methods, showing the effectiveness of learning methods, or perform frame-by-frame volume data segmentation, or try to use 3DUnet to directly segment the thyroid gland. Some use SUMNET based on SegNet for frame-by-frame three-dimensional thyroid segmentation.
[0005] Recently, fully convolutional neural networks are more widely used in ultrasound image segmentation, such as using feedforward neural networks for thyroid segmentation. Some have proposed IVUS-Net, which uses a segmentation network with multi-channel and multi-scale convolution kernels for two-dimensional intravascular ultrasound segmentation. Some have used a Deeplab-based network with deep supervision of boundary distance graphs for two-dimensional ultrasound kidney segmentation. Some have used a multi-channel fusion deep supervision method to improve the accuracy of ultrasound prostate segmentation boundaries. These methods are mainly used for two-dimensional segmentation, while some three-dimensional segmentation networks are often used on images directly acquired by three-dimensional ultrasound probes.
[0006] For 3D ultrasound volume data acquired and reconstructed from 2D data, previous work has attempted to segment the data frame by frame or directly perform 3D segmentation. Some people mentioned that it is difficult to train a 3D segmentation network, and that a 2D network can better focus on the edges of organs. Experiments have also shown that using a 2D network for segmentation and reconstruction has better results than a 3D segmentation network. However, previous methods were only used for healthy thyroid data, and nodules in clinical thyroid images often have a strong contrast with the gland, making them difficult to segment as a whole. When nodules are located at the edge of an organ, this will affect edge segmentation.
[0007] There are many methods to improve the accuracy of segmentation edges. Some use mesh paths in the encoding and decoding structure to better combine and utilize multi-layer features, but practice has found that training is prone to instability. Some use dual-channel attention modules to focus on effective information at both the position and channel levels, but the amount of calculation is huge when the feature map has a higher resolution. Some use high-level features in adjacent levels to guide feature fusion, but do not make better use of more scale information. Some use multi-scale channel-based attention modules without effectively utilizing the feature information of the position, but this is equivalent to only learning the weights of the channels at each position of the feature map, without learning the information on the position. Summary of the invention
[0008] In order to overcome the defects of the prior art, the technical problem to be solved by the present invention is to provide a three-dimensional ultrasonic thyroid segmentation method based on a multi-scale fusion network, which can accurately segment the edges of heterogeneous organ structures, avoid the final segmentation result from relying on the intermediate results predicted by the distance map, take into account the use of multi-level semantic information and maintain a small amount of calculation, and can accurately segment the three-dimensional thyroid to achieve very good results.
[0009] The technical solution of the present invention is: the three-dimensional ultrasonic thyroid segmentation method based on multi-scale fusion network comprises the following steps:
[0010] (1) Let the network learn to predict the boundary distance map in order to segment the edges of heterogeneous organ structures;
[0011] (2) Using deep supervision to add constraints to the network to guide training, so as to avoid the final segmentation result being dependent on the intermediate result of distance map prediction;
[0012] (3) Use CBAM attention module to focus on edge distance information at multiple scales;
[0013] (4) A dense fusion module with dilated convolution is used to fuse the probability maps of each layer, gradually refine the output probability maps, and generate the final results of each layer.
[0014] The present invention allows the network to learn to predict the boundary distance map, and can accurately segment the edges of heterogeneous organ structures. Different from the serial connection method, the present invention uses deep supervision to add constraints to the network to guide training to avoid the final segmentation result from relying on the intermediate results predicted by the distance map. In addition, in order to take into account the use of multi-level semantic information and keep the amount of calculation small, the CBAM attention module is used at multiple scales to better focus on the edge distance information. Finally, the dense fusion module of the hole convolution is used to fuse the probability maps of each layer, gradually refine the output probability map, and generate the final results of each layer. Therefore, the edges of heterogeneous organ structures can be accurately segmented, avoiding the final segmentation result from relying on the intermediate results predicted by the distance map, taking into account the use of multi-level semantic information and keeping the amount of calculation small, and the three-dimensional thyroid gland can be accurately segmented to achieve very good results.
[0015] A three-dimensional ultrasonic thyroid segmentation device based on a multi-scale fusion network is also provided, which includes:
[0016] a segmentation module configured to allow the network to learn to predict boundary distance maps in order to segment the edges of heterogeneous organ structures;
[0017] The boundary distance map module is configured to add constraints to the network in a deep supervision manner to guide training, so as to avoid the final segmentation result being dependent on the intermediate results predicted by the distance map;
[0018] Attention module, which is configured to focus on edge distance information at multiple scales using CBAM attention module;
[0019] The atrous dense fusion module is configured to use the dense fusion module of the atrous convolution to fuse the probability maps of each layer, gradually refine the output probability maps, and produce the final results of each layer. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 An example of a potential distance map generated by a thyroid segmentation mask, where (a) the original image, (b) the thyroid mask, and (c) the normalized distance map.
[0021] Figure 2 It is a flow chart of a three-dimensional ultrasonic thyroid segmentation method based on a multi-scale fusion network according to the present invention. DETAILED DESCRIPTION
[0022] like Figure 2 As shown, this three-dimensional ultrasound thyroid segmentation method based on a multi-scale fusion network includes the following steps:
[0023] (1) Let the network learn to predict the boundary distance map in order to segment the edges of heterogeneous organ structures;
[0024] (2) Using deep supervision to add constraints to the network to guide training, so as to avoid the final segmentation result being dependent on the intermediate result of distance map prediction;
[0025] (3) Use CBAM attention module to focus on edge distance information at multiple scales;
[0026] (4) A dense fusion module with dilated convolution is used to fuse the probability maps of each layer, gradually refine the output probability maps, and generate the final results of each layer.
[0027] The present invention allows the network to learn to predict the boundary distance map, and can accurately segment the edges of heterogeneous organ structures. Different from the serial connection method, the present invention uses deep supervision to add constraints to the network to guide training to avoid the final segmentation result from relying on the intermediate results predicted by the distance map. In addition, in order to take into account the use of multi-level semantic information and keep the amount of calculation small, the CBAM attention module is used at multiple scales to better focus on the edge distance information. Finally, the dense fusion module of the hole convolution is used to fuse the probability maps of each layer, gradually refine the output probability map, and generate the final results of each layer. Therefore, the edges of heterogeneous organ structures can be accurately segmented, avoiding the final segmentation result from relying on the intermediate results predicted by the distance map, taking into account the use of multi-level semantic information and keeping the amount of calculation small, and the three-dimensional thyroid gland can be accurately segmented to achieve very good results.
[0028] Preferably, in the step (1), the encoder part uses the same number of convolution blocks in each stage, and uses a strided convolution with a step size of 2 to replace the maximum pooling layer; a single convolution layer is constructed in the order of GN-PReLU-Conv, with a normalization layer in the front; all convolution layers use grouped convolution with a grouping number of 4; and in the third and fourth stages of the encoder, a dilated convolution with a dilation rate of 2 is used to increase the receptive field and obtain more instructive semantic information.
[0029] Preferably, in step (2), the feature maps of subsequent levels are unified to the size of the feature map of the first stage through bilinear interpolation, and the edge distance map calculated by the mask is used as a constraint for deep supervision.
[0030] Preferably, in step (2), a thyroid mask is given, and after obtaining its edge mask, the pixel P is calculated. iDistance to the edge of the thyroid gland i , and through formula (1), d is the normalized distance map,
[0031] d(P i )=exp(-λD i ) (1)
[0032] Where D i =min bj∈b dist(P i ,b j ), is the pixel P i To the boundary pixel b = {b j} j∈J The shortest distance, λ is a parameter used to control the normalization effect,
[0033] The loss function form of the normalized distance graph deep supervision is:
[0034]
[0035] in The distance map predicted by the network.
[0036] Preferably, in step (2), λ is set to 0.01.
[0037] Preferably, in the step (3), the feature maps SLF of each layer of the encoder are unified in resolution by bilinear interpolation based on the resolution of the second layer, and then spliced and convolved to obtain multi-layer convolution features MLF. The SLF and MLF are spliced and sent to the attention module. The weights of information fusion are learned under the guidance of multi-scale features. The weights are applied to the MLF to obtain effective information required for hierarchical SLF refinement, and the output feature map is obtained by combining with the SLF.
[0038] Preferably, in step (3), the channel attention weight of the attention module is
[0039] M c (F)=σ(W1W0(AvgPool(F))+W1W0(MaxPool(F))) (3)
[0040] Among them, σ represents the sigmoid function, AvgPool and MaxPool are average pooling and maximum pooling operations respectively, and W0∈R C / r×C , W1∈R C×C / r Two convolution operations for channel compression and restoration, followed by a PReLU activation function;
[0041] The spatial attention weight is
[0042] M S (F) = σ(f7×7 ([AvgPool(F);MaxPool(F)])) (4)
[0043] Among them, σ represents the sigmoid function, AvgPool and MaxPool are average pooling and maximum pooling operations respectively, and f 7×7 Indicates a convolution operation with a convolution kernel of 7×7;
[0044] The channel and spatial attention modules are connected in series to form a residual block. The convolution in the block uses grouped convolution, the normalization layer uses the GN layer, and the activation function uses PReLU.
[0045] Preferably, in step (4), the feature maps of multiple levels are input one by one and fused in a densely connected manner; the fourth-level feature map with high-level semantic information is input first, the convolution results are successively spliced with the feature maps of other levels, and the convolution operation is iterated; as the receptive field continues to expand and new level information is incorporated, the prediction results are gradually optimized, and the receptive field calculation method is as follows:
[0046] R cur =R pre +S pre ×(K cur -1)×rate (5)
[0047] Where R cur is the receptive field of the current layer, R pre is the receptive field of the previous layer, S pre is the stride distance of the previous layer, K cur is the convolution kernel size of the current layer, and rate is the current dilation rate. For a convolution operation with a convolution kernel size of 3 and a dilation rate of 2, assuming that the stride length of the previous layer is 1, the receptive field after n dilation convolutions with rate = 2 is R n =R pre +4×n, due to the combination of mlf and slf, the receptive fields of each layer are actually the same. After passing through the attention module with global pooling, the receptive field quickly grows to 240, so it already has a relatively large receptive field. In the subsequent DFM, a convolution with a dilation rate of 2 is used to moderately increase the receptive field, without widening the gap between the receptive fields of each layer, which has the effect of refining the output results.
[0048] Preferably, the loss function of this method is
[0049]
[0050]
[0051] L hybrid =L distance+λ1L Dice +λ2L BCE (6)
[0053] Among them, L Dice is the loss function for evaluating the overlap between two things, L BCE is the second-class cross entropy, L hybrid It is a mixed loss function, pred is the pixel prediction probability map, target is the ground truth, ε is the smoothing term, which is set to 1e-8 in the experiment, λ1 and λ2 are the loss weighting coefficients, and the coefficients are set to λ1=0.5 and λ2=0.5 in the experiment.
[0054] Those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes the steps of the above-mentioned embodiment method, and the storage medium can be: ROM / RAM, disk, CD, memory card, etc. Therefore, corresponding to the method of the present invention, the present invention also includes a three-dimensional ultrasonic thyroid segmentation device based on a multi-scale fusion network, which is usually represented in the form of functional modules corresponding to the steps of the method. The device includes:
[0055] a segmentation module configured to allow the network to learn to predict boundary distance maps in order to segment the edges of heterogeneous organ structures;
[0056] The boundary distance map module is configured to add constraints to the network in a deep supervision manner to guide training, so as to avoid the final segmentation result being dependent on the intermediate results predicted by the distance map;
[0057] Attention module, which is configured to focus on edge distance information at multiple scales using CBAM attention module;
[0058] The atrous dense fusion module is configured to use the dense fusion module of the atrous convolution to fuse the probability maps of each layer, gradually refine the output probability maps, and produce the final results of each layer.
[0059] The present invention is described in more detail below.
[0060] Continuing the practice of Vnet, the encoder part of the present invention uses the same number of convolution blocks in each stage, and uses strided convolution with a step size of 2 to replace the maximum pooling layer, so that the downsampling process has learnable parameters and is more suitable for semantic segmentation tasks. A single convolution layer is formed in the order of GN-PReLU-Conv, and the normalization layer is placed in front to train the network more quickly and effectively to achieve better results. GN has better performance than BN and is stable over a wider range of batch sizes. All convolutional layers use grouped convolutions with a grouping number of 4 to reduce long-distance coupling between channels, reduce network parameters, and improve parameter utilization. In the third and fourth stages of the encoder, a dilated convolution with a dilated rate of 2 is used to increase the receptive field and obtain more instructive semantic information.
[0061] In order to make the network pay attention to the edge information of the organ earlier, the feature maps of each subsequent level are unified to the size of the feature map of the first stage through bilinear interpolation, and the edge distance map calculated by the mask is used as a constraint for deep supervision. Different from using the prediction result directly as the intermediate result, which causes the final result to be affected by the intermediate result, the present invention adopts a deep supervision method to take into account the learning of edge features and the backward transmission of features.
[0062] Given a thyroid mask, after obtaining its edge mask, calculate each pixel P i Distance to the edge of the thyroid gland i and through
[0063] d(P i )=exp(-λD i )
[0064] Get d as the normalized distance map, where D i =min bj∈b dist(P i ,b j ), is the pixel P i To the boundary pixel b = {b j} j∈J The shortest distance of , λ is a parameter used to control the normalization effect, and is empirically set to 0.01 in the experiment. Under this parameter, the distance map obtained by the thyroid mask is as follows Figure 1 .
[0065] The loss function form of the normalized distance graph deep supervision is:
[0066]
[0067] in The distance map predicted by the network. The network focuses more on learning the marginal information of the thyroid gland by learning the predicted distance map.
[0068] The feature maps of each layer of the network have different resolutions. After deep supervision by the edge distance map, the features contain different levels of semantic information of the organ edge. Inspired by this, in order to more effectively combine the semantic information of each layer, the feature maps slf (single layer feature-map) of each layer of the encoder are unified in resolution by bilinear interpolation based on the resolution of the second layer, and then concatenated and convolved to obtain multi-layer convolution features mlf (multiple layer feature-map). After that, the slf and mlf are concatenated and sent to the attention module. The weights of information fusion are guided by multi-scale features. The weights are applied to mlf to obtain the effective information required for hierarchical slf refinement, and combined with slf to obtain the output feature map.
[0069] Effectively combining multiple layers of feature maps requires that the attention mechanism can learn how to combine information between channels and between different positions. In order to effectively use the features about the edges of organs generated under deep supervision, the attention mechanism should be able to learn important spatial position information. Considering the computational complexity of the current resolution and the better effect of dual-channel attention serialization, the CBAM module is used to take into account the weight learning of channels and space while reducing the computational complexity.
[0070] The channel attention weight of the attention module, M c (F) = σ(W1W0(AvgPool(F))+W1W0(MaxPool(F))). Where σ represents the sigmoid function, AvgPool and MaxPool are average pooling and maximum pooling operations respectively, and W0∈R C / r×C , W1∈R C×C / r These are two convolution operations for channel compression and restoration, followed by a PReLU activation function.
[0071] Spatial attention weight, M S (F) = σ(f 7×7 ([AvgPool(F); MaxPool(F)])). Where σ represents the sigmoid function, AvgPool and MaxPool are average pooling and maximum pooling operations respectively, and f 7×7 Indicates a convolution operation with a convolution kernel of 7×7.
[0072] The channel and spatial attention modules are connected in series to form a residual block. The convolution in the block uses grouped convolution, the normalization layer uses the GN layer, and the activation function uses PReLU.
[0073] Some people adopt the method of averaging the output results of each layer as the final result, which has the idea of ensemble learning and helps to produce more accurate segmentation results, but does not further refine and combine the results of each layer. The idea of the decoder is to perform multi-scale optimization of the results in a learnable process. Inspired by DenseASPP, the present invention passes the feature maps of each level through the void dense fusion module, and takes the average result of the probability map of the results at each level as the final output.
[0074] The outstanding performance of Deeplabv3 in semantic segmentation is due to the parallel convolution of various void rates in ASPP, which obtains rich long-distance semantic information. DenseASPP uses the idea of dense connection of DenseNet, and obtains a larger range and denser multi-scale receptive field through multiple increasing void rate dense connections. The present invention uses this idea to refine the results. Instead of processing a single feature map, it inputs feature maps of multiple levels one by one and fuses them in a densely connected manner. The fourth-layer feature map with high-level semantic information is input first, and the convolution results are successively spliced with feature maps of other levels, and the convolution operation is iterated. With the continuous expansion of the receptive field and the integration of new hierarchical information, the prediction results are gradually optimized. Compared with the parallel method of ASPP, a more intensive method can continuously expand the receptive field and gradually combine the features of different receptive fields.
[0075] The amount of calculation of the receptive field is R cur =R pre +S pre ×(K cur -1)×rate. cur is the receptive field of the current layer, R pre is the receptive field of the previous layer, S pre is the stride distance of the previous layer, K cur is the kernel size of the current layer, and rate is the current dilation rate. So for a convolution operation with a kernel size of 3 and a dilation rate of 2, assume that the stride length of the previous layer is 1. After n dilation convolutions with rate = 2, the receptive field is R n =R pre +4×n. Due to the combination of mlf and slf, the receptive fields of each level are actually the same. After passing through the attention module with global pooling, the receptive field quickly grows to 240, so it already has a relatively large receptive field. Due to the above reasons, the present invention does not adopt a two-fold geometric expansion of the void rate in the subsequent DFM, but uses a convolution with a void rate of 2 to moderately increase the receptive field, without widening the gap between the receptive fields of each level, which has the effect of refining the output results.
[0076] BCE loss, or cross entropy loss function, is one of the two commonly used segmentation loss functions. It is suitable for large object segmentation, but has poor effects on unbalanced scenes with small targets. Dice loss is often used for small object segmentation, and its function calculation method is not affected by the ratio of pixels of different categories. In order to take into account the segmentation effects of slices located in the middle of the organ with a large number of foreground pixels and slices located at both ends of the organ with fewer foreground pixels during the training process, the present invention combines BCE loss and Dice loss. In addition, the loss of the object edge distance map is used as deep supervision to allow the network to pay attention to the object edge information earlier. The hybrid loss function of the present invention is defined as follows:
[0077]
[0078]
[0079] L hybrid =L distance +λ1L Dice +λ2L BCE
[0080] Among them, pred is the pixel prediction probability map, target is the ground truth, ε is the smoothing term, which is set to 1e-8 in the experiment. λ1 and λ2 are the loss weighting coefficients, and the coefficients are set to λ1 = 0.5 and λ2 = 0.5 in the experiment.
[0081] The proposed method was verified on clinical ultrasound data and OpenCAS public datasets. The experiments show that the proposed model can accurately segment the 3D thyroid gland, achieving the best results currently.
[0082] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Any simple modification, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention are still within the protection scope of the technical solution of the present invention.
Claims
1. A three-dimensional ultrasound thyroid segmentation method based on a multi-scale fusion network, characterized by: It includes the following steps: (1) Let the network learn to predict the boundary distance map in order to segment the edges of heterogeneous organ structures; (2) Using deep supervision to add constraints to the network to guide training, so as to avoid the final segmentation result being dependent on the intermediate result of distance map prediction; (3) Use CBAM attention module to focus on edge distance information at multiple scales; (4) The dense fusion module of the dilated convolution is used to fuse the probability maps of each layer, gradually refine the output probability map, and produce the final results of each layer; In the step (1), the same number of convolution blocks are used in each stage of the encoder, and a strided convolution with a step size of 2 is used to replace the maximum pooling layer; a single convolution layer is constructed in the order of GN-PReLU-Conv, and a normalization layer is placed in front; all convolution layers use grouped convolution with a group number of 4; and a dilated convolution with a dilation rate of 2 is used in the third and fourth stages of the encoder to increase the receptive field and obtain more instructive semantic information; In the step (2), the feature maps of each subsequent level are unified to the size of the feature map of the first stage through bilinear interpolation, and the edge distance map obtained by mask calculation is used as a constraint for deep supervision; given a thyroid mask, after obtaining its edge mask, the distance map of each pixel P is calculated. i Distance to the edge of the thyroid gland i , and through formula (1), d is the normalized distance map, d(P i )=exp(-λD i ) (1) Where D i =min bj∈b dist(P i ,b j ), is the pixel P i To the boundary pixel b = {b j } j∈J The shortest distance, λ is a parameter used to control the normalization effect, The loss function form of the normalized distance graph deep supervision is: in The distance map predicted by the network; In the step (3), the feature maps SLF of each layer of the encoder are unified in resolution by bilinear interpolation based on the resolution of the second layer, and then spliced and convolved to obtain multi-layer convolution features MLF, and the SLF and MLF are spliced and sent to the attention module, and the weights of information fusion are learned under the guidance of multi-scale features. The weights are applied to the MLF to obtain effective information required for hierarchical SLF refinement, and combined with the SLF to obtain the output feature map; The channel attention weight of the attention module is M c (F)=σ(W1W0(AvgPool(F))+W1W0(MaxPool(F))) (3) Among them, σ represents the sigmoid function, AvgPool and MaxPool are average pooling and maximum pooling operations respectively, and W0∈R C / r×C , W1∈R C×C / r Two convolution operations for channel compression and restoration, followed by a PReLU activation function; The spatial attention weight is M S (F)=σ(f 7×7 ([AvgPool(F);MaxPool(F)])) (4) Among them, σ represents the sigmoid function, AvgPool and MaxPool are average pooling and maximum pooling operations respectively, and f 7×7 Indicates a convolution operation with a convolution kernel of 7×7; The channel and spatial attention modules are connected in series to form a residual block. The convolution in the block uses grouped convolution, the normalization layer uses the GN layer, and the activation function uses PReLU. In the step (4), the feature maps of multiple levels are input one by one and fused in a densely connected manner; the fourth-level feature map with high-level semantic information is input first, the convolution results are successively spliced with the feature maps of other levels, and the convolution operation is iterated; as the receptive field continues to expand and new level information is incorporated, the prediction results are gradually optimized. The calculation method of the receptive field is as follows: R cur =R pre +S pre ×(K cur -1)×rate (5) Where R cur is the receptive field of the current layer, R pre is the receptive field of the previous layer, S pre is the stride distance of the previous layer, K cur is the convolution kernel size of the current layer, and rate is the current dilation rate. For a convolution operation with a convolution kernel size of 3 and a dilation rate of 2, assuming that the stride length of the previous layer is 1, the receptive field after n dilation convolutions with rate = 2 is R n =R pre +4×n, due to the combination of mlf and slf, the receptive fields of each layer are actually the same. After passing through the attention module with global pooling, the receptive field quickly grows to 240, so it already has a relatively large receptive field. In the subsequent DFM, a convolution with a dilation rate of 2 is used to moderately increase the receptive field, without widening the gap between the receptive fields of each layer, which has the effect of refining the output results.
2. The three-dimensional ultrasonic thyroid segmentation method based on multi-scale fusion network according to claim 1, characterized in that: In the step (2), λ is set to 0.
01.
3. The three-dimensional ultrasonic thyroid segmentation method based on multi-scale fusion network according to claim 2, characterized in that: The loss function of this method is L hybrid =L distance +λ1L Dice +λ2L BCE (6) Among them, L Dice is the loss function for evaluating the overlap between two things, L BCE is the second-class cross entropy, L hybrid It is a mixed loss function, pred is the pixel prediction probability map, target is the ground truth, ε is the smoothing term, which is set to 1e-8 in the experiment, λ1 and λ2 are the loss weighting coefficients, and the coefficients are set to λ1=0.5 and λ2=0.5 in the experiment.
4. A three-dimensional ultrasonic thyroid segmentation device based on a multi-scale fusion network, characterized in that: It includes: a segmentation module configured to allow the network to learn to predict boundary distance maps in order to segment the edges of heterogeneous organ structures; The boundary distance map module is configured to add constraints to the network in a deep supervision manner to guide training, so as to avoid the final segmentation result being dependent on the intermediate results predicted by the distance map; Attention module, which is configured to focus on edge distance information at multiple scales using CBAM attention module; The dilated dense fusion module is configured to use the dilated convolution dense fusion module to fuse the probability maps of each layer, gradually refine the output probability map, and produce the final results of each layer; In the segmentation module, the encoder part uses the same number of convolution blocks in each stage, and uses strided convolution with a step size of 2 to replace the maximum pooling layer; a single convolution layer is constructed in the order of GN-PReLU-Conv, and the normalization layer is placed in front; all convolution layers use grouped convolution with a group number of 4; in the third and fourth stages of the encoder, a dilated convolution with a dilation rate of 2 is used to increase the receptive field and obtain more instructive semantic information; In the boundary distance map module, the feature maps of subsequent levels are unified to the feature map size of the first stage through bilinear interpolation, and the edge distance map calculated by the mask is used as a constraint for deep supervision; given a thyroid mask, after obtaining its edge mask, the distance map of each pixel P is calculated. i Distance to the edge of the thyroid gland i , and through formula (1), d is the normalized distance map, d(P i )=exp(-λD i ) (1) Where D i =min bj∈b dist(P i ,b j ), is the pixel P i To the boundary pixel b = {b j } j∈J The shortest distance, λ is a parameter used to control the normalization effect, The loss function form of the normalized distance graph deep supervision is: in The distance map predicted by the network; In the attention module, the feature maps slf of each layer of the encoder are unified in resolution by bilinear interpolation based on the resolution of the second layer, and then concatenated to obtain multi-layer convolution features mlf through convolution operation. The slf and mlf are concatenated and sent to the attention module. The weights of information fusion are learned under the guidance of multi-scale features. The weights are applied to mlf to obtain effective information required for hierarchical slf refinement, and combined with slf to obtain the output feature map; The channel attention weight of the attention module is M c (F)=σ(W1W0(AvgPool(F))+W1W0(MaxPool(F))) (3) Among them, σ represents the sigmoid function, AvgPool and MaxPool are average pooling and maximum pooling operations respectively, and W0∈R C / r×C , W1∈R C×C / r Two convolution operations for channel compression and restoration, followed by a PReLU activation function; The spatial attention weight is M S (F)=σ(f 7×7 ([AvgPool(F);MaxPool(F)])) (4) Among them, σ represents the sigmoid function, AvgPool and MaxPool are average pooling and maximum pooling operations respectively, and f 7×7 Indicates a convolution operation with a convolution kernel of 7×7; The channel and spatial attention modules are connected in series to form a residual block. The convolution in the block uses grouped convolution, the normalization layer uses the GN layer, and the activation function uses PReLU. In the hole dense fusion module, feature maps of multiple levels are input one by one and fused in a densely connected manner; the fourth-level feature map with high-level semantic information is input first, and the convolution results are successively spliced with feature maps of other levels, and the convolution operation is iterated; with the continuous expansion of the receptive field and the integration of new level information, the prediction results are gradually optimized. The calculation method of the receptive field is as follows: R cur =R pre +S pre ×(K cur -1)×rate (5) Where R cur is the receptive field of the current layer, R pre is the receptive field of the previous layer, S pre is the stride distance of the previous layer, K cur is the convolution kernel size of the current layer, and rate is the current dilation rate. For a convolution operation with a convolution kernel size of 3 and a dilation rate of 2, assuming that the stride length of the previous layer is 1, the receptive field after n dilation convolutions with rate = 2 is R n =R pre +4×n, due to the combination of mlf and slf, the receptive fields of each layer are actually the same. After passing through the attention module with global pooling, the receptive field quickly grows to 240, so it already has a relatively large receptive field. In the subsequent DFM, a convolution with a dilation rate of 2 is used to moderately increase the receptive field, without widening the gap between the receptive fields of each layer, which has the effect of refining the output results.
