Thyroid nodule elastic ultrasonic image segmentation method based on MSA-FA
By introducing a multi-scale attention module and feature distribution alignment network into the segmentation of thyroid nodule elastic ultrasound images, and using gray-scale ultrasound image data for transfer learning, the problem of insufficient data is solved and the segmentation accuracy of thyroid nodule elastic ultrasound images is improved. and diagnostic accuracy.
Patent Information
- Application Number
- CN202410684773.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-30
- Publication Date
- 2024-10-01
AI Technical Summary
The existing technology has problems of insufficient data and low segmentation accuracy in the segmentation of elastic ultrasound images of thyroid nodules. In particular, due to the difficulty in collecting and annotating elastic ultrasound image data, the application of models based on deep learning is limited.
Introduce transfer learning, combine with multi-scale attention module and feature distribution alignment network, build a thyroid nodule elastic ultrasound image segmentation model based on MSA-FA, perform data enhancement and feature migration through gray-scale ultrasound image data, and improve the efficiency of elastic ultrasound image segmentation. Accuracy.
Through the multi-scale attention module and feature distribution alignment network, the segmentation accuracy of elastic ultrasound images of thyroid nodules is improved, more accurate extraction of nodule edge and location information is achieved, and the accuracy of diagnosis is improved.
Smart Images

Figure CN118735938A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of intelligent medical image processing, and in particular relates to a thyroid nodule elastic ultrasound image segmentation method based on multi-scale attention and feature alignment (MSA-FA). Background Art
[0002] Ultrasound images of thyroid nodules contain information such as the size, shape, structure, and blood flow of thyroid nodules. In clinical practice, multiple ultrasound modalities such as grayscale ultrasound and elastic ultrasound are commonly used to examine the thyroid gland. Compared with grayscale ultrasound, elastic ultrasound images can quantify tissue hardness, which helps doctors to more accurately determine the nature and state of diseased tissues. Therefore, segmenting elastic ultrasound images of thyroid nodules and obtaining nodule edge and location information can improve the accuracy of diagnosis of benign and malignant thyroid nodules.
[0003] Region- and contour-based thyroid nodule ultrasound image segmentation uses the grayscale statistical characteristics between regions, or sets the initial contour and prior shape information to segment the thyroid nodule ultrasound image. It requires artificially designed features, is difficult to model, and has low segmentation accuracy. Deep learning-based thyroid nodule ultrasound image segmentation uses deep neural networks to capture high-level semantics and contextual information of thyroid nodule ultrasound images, which can achieve accurate segmentation of thyroid nodules. However, this method usually relies on high-quality data sets, and elastic ultrasound image data collection and annotation are difficult, resulting in less data available for model training, which limits the clinical application of deep learning-based thyroid nodule elastic ultrasound image segmentation.
[0004] Transfer learning can alleviate the problem of insufficient data for medical image modeling and improve the performance of the model when the amount of data is limited. Therefore, the present invention fully considers the common characteristics of elastic ultrasound images and grayscale ultrasound images of thyroid nodules, and introduces transfer learning to address the problem that the small number of elastic ultrasound image samples affects the accuracy of thyroid nodule segmentation. It constructs a multi-scale attention module and a feature distribution alignment network, and establishes a thyroid nodule elastic ultrasound image segmentation model based on MSA-FA to achieve accurate segmentation of thyroid nodule elastic ultrasound images. Summary of the invention
[0005] The present invention aims to improve the segmentation accuracy of elastic ultrasound images of thyroid nodules and invents a thyroid nodule elastic ultrasound image segmentation method based on MSA-FA, comprising the following steps:
[0006] Step 1: Obtain the location information of thyroid nodules in thyroid grayscale ultrasound and elastic ultrasound images and crop them. Data enhancement is achieved by rotating the original images at different angles to construct a thyroid nodule ultrasound image dataset.
[0007] Step 2: Introduce the large-core attention mechanism, construct a multi-scale attention module and apply it to the U-Net skip connection layer, use the sum of the Dice loss function and the binary cross entropy loss function as the model loss function, and establish a grayscale ultrasound image segmentation model for thyroid nodules;
[0008] Step 3: Combine the conditional generative adversarial network to construct a feature distribution alignment network to achieve feature distribution alignment of the thyroid grayscale ultrasound image and the elastic ultrasound image; Based on the grayscale ultrasound image segmentation model of thyroid nodules constructed in step 2, a weight sharing strategy is adopted to migrate the feature extraction layer parameters of the grayscale ultrasound image segmentation network, construct the objective function of the elastic ultrasound image segmentation network of thyroid nodules, and establish the elastic ultrasound image segmentation model of thyroid nodules based on MSA-FA;
[0009] Step 4: Input the elastic ultrasound image of the thyroid nodule to be tested, segment the thyroid nodules in the elastic ultrasound image using the thyroid nodule elastic ultrasound image segmentation model based on MSA-FA, and output the segmentation result of the thyroid nodule in each elastic ultrasound image.
[0010] Specifically, step one includes the following steps:
[0011] Grayscale ultrasound image data and elastic ultrasound image data of thyroid nodules were collected and invalid borders were removed. The Labelme annotation tool was used to draw the edge shape of thyroid nodules in the image to generate annotation files in JSON format, which were converted into PNG format label files after batch binarization. The original thyroid ultrasound images were enhanced by rotation angle, horizontal flip, vertical flip and other transformations to achieve thyroid nodule ultrasound image data preprocessing, and the thyroid grayscale ultrasound dataset and elastic ultrasound dataset were constructed.
[0012] Step 2 includes the following steps:
[0013] The multi-scale attention network consists of batch normalization, GELU activation function, large kernel attention and convolutional feedforward network. The schematic diagram is as follows Figure 1 Large-Kernel Attention (LKA) captures long-distance dependencies in thyroid nodule ultrasound images by constructing a large kernel convolution (size 21×21), which consists of deep convolution (size 7×7), deep dilated convolution (size 5×5, dilation rate 4) and 1×1 point convolution. It uses a small amount of computational cost and parameters to estimate the importance of a certain area in the thyroid nodule ultrasound image and generate attention weights. The calculation formula is:
[0014] Attention=Conv 1×1(DD-Conv(D-Conv(Input))) (1)
[0015]
[0016] In the formula, Input∈R C×H×W is the input thyroid nodule ultrasound image, C is the number of channels of the thyroid nodule ultrasound image, H is the length of the thyroid nodule ultrasound image, and W is the width of the thyroid nodule ultrasound image; D-Conv(·) represents depthwise convolution; DD-Conv(·) represents depthwise dilated convolution; Conv 1×1 (·) represents point convolution; Attention∈R C×H×W is the attention weight; is the Kronecker product.
[0017] The skip connection layer in the U-Net network is replaced with a multi-scale attention network module, and the first four layers of features extracted by the backbone network are input into the multi-scale attention network. The multi-scale information of the grayscale ultrasound image of the thyroid nodule is fused using the multi-scale attention network module, and the output feature map is fused with the feature map obtained by deconvolution to fully extract the boundary and detail feature information of the thyroid nodule. The network structure of the grayscale ultrasound image segmentation of thyroid nodules based on the multi-scale attention mechanism is as follows: Figure 2 shown.
[0018] The loss function of the grayscale ultrasound image segmentation network of thyroid nodules is:
[0019] Loss = loss dice +loss BCE (3)
[0020] In the formula, loss dice is the Dice loss function; loss BEC It is the Binary Cross Entropy (BCE) loss function.
[0021] The Dice loss function is used to evaluate the similarity of different regions in thyroid nodule ultrasound images. The Dice loss function value is calculated as follows:
[0022]
[0023] Wherein, |X∩Y| is the area of the intersection of region X and region Y in the ultrasound image of the thyroid nodule; |X| and |Y| represent the areas of region X and region Y in the ultrasound image of the thyroid nodule, respectively.
[0024] The BCE loss function is used to measure the difference between the output of the thyroid nodule ultrasound image segmentation model and the true value. The calculation formula of the BCE loss function value is:
[0025] loss BCE =-(y*log(p)+(1-y)*log(1-p)) (5)
[0026] Where y represents the true value of the thyroid nodule margin; p represents the predicted value of the thyroid nodule margin output by the model; and log(·) represents logarithmic calculation.
[0027] The pre-trained segmentation model is trained using the grayscale ultrasound image training data of thyroid nodules constructed in step one, and the network parameters are iterated until the loss function converges to obtain a grayscale ultrasound image segmentation model of thyroid nodules based on a multi-scale attention mechanism.
[0028] Step three includes the following steps:
[0029] A conditional generative adversarial network was introduced, and the feature extraction layer of the grayscale ultrasound image segmentation network of thyroid nodules was used to extract the features of grayscale ultrasound images and elastic ultrasound images. The network was then divided into two branches. One branch used the grayscale ultrasound image features and labels to train the grayscale ultrasound image discriminator, and the other branch calculated the domain classification error to determine whether the input features came from the grayscale ultrasound image or the elastic ultrasound image. This allowed the model to understand and reduce the differences in feature distribution between different modalities, and achieve alignment of cross-modal feature distributions.
[0030] The feature distribution alignment network of grayscale ultrasound image and elastic ultrasound image of thyroid nodules is as follows Figure 3 As shown in Figure 2, the loss function of the thyroid nodule ultrasound image feature distribution alignment network is constructed by combining the conditional generative adversarial network objective function. DA for
[0031] Loss DA =L MMD +L CORAL (6)
[0032] Where, L MMD is the maximum mean discrepancy (MMD) loss function; L CORAL is the CORAL loss function.
[0033] The MMD loss value is calculated as
[0034]
[0035] Where φ(·) represents the nonlinear mapping function; n and m represent the number of grayscale ultrasound images and elastic ultrasound images of thyroid nodules, respectively; x i and jThey represent the grayscale ultrasound image features of the i-th thyroid nodule and the elastic ultrasound image features of the j-th thyroid nodule respectively.
[0036] The CORAL loss function characterizes the difference in distribution by calculating the second-order moment of the grayscale ultrasound image and elastic ultrasound image of the thyroid nodule. The calculation formula of the CORAL loss function value is:
[0037]
[0038] In the formula, d is the characteristic number; C S and C T They are the covariance matrices of the grayscale ultrasound image features and elastic ultrasound image features output by the domain adaptation layer.
[0039] Combining the loss function and the regularization term, the objective function of the thyroid nodule elastic ultrasound image segmentation network is constructed. The objective function L is composed of the Dice loss function, the binary cross entropy loss function and the regularization term. Through the back propagation of the error, the model parameters are continuously updated to make the objective function converge. The optimization goal of the model is
[0040]
[0041] Where θ is the model parameter of thyroid nodule elastic ultrasound image segmentation; λ is the regularization coefficient.
[0042] The structure of the constructed thyroid nodule elastic ultrasound image segmentation model is as follows: Figure 4 As shown, the thyroid nodule elastic ultrasound image training data constructed in step one is used to train the thyroid nodule elastic ultrasound image segmentation model, and the network parameters are iterated until the objective function converges to obtain the thyroid nodule elastic ultrasound image segmentation model based on MSA-FA.
[0043] Step 4 includes the following steps:
[0044] Input the thyroid elastic ultrasound image to be segmented, load the thyroid nodule elastic ultrasound image segmentation model based on MSA-FA trained in step three, segment the thyroid nodule elastic ultrasound image data, and output the thyroid nodule segmentation result of the final elastic ultrasound image.
[0045] The advantages of the present invention are as follows: in view of the problem that the thyroid elastic ultrasound data has little impact on the accuracy of thyroid nodule segmentation, the common features of the thyroid nodule elastic ultrasound image and the thyroid nodule grayscale ultrasound image are fully considered, and multi-scale attention is introduced in the jump connection of the U-Net network to enhance the segmentation network's ability to extract local and global information of the thyroid nodule ultrasound image, thereby improving the accuracy of thyroid nodule grayscale ultrasound image segmentation; on this basis, the feature distribution alignment network and weight sharing strategy are adopted to migrate the grayscale ultrasound image features to the elastic ultrasound image, thereby achieving accurate segmentation of the thyroid nodule elastic ultrasound image and improving the segmentation accuracy of the thyroid nodule elastic ultrasound image. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 This is the schematic diagram of the multi-scale attention module;
[0047] Figure 2 This is a network structure diagram of grayscale ultrasound image segmentation of thyroid nodules based on a multi-scale attention mechanism;
[0048] Figure 3 is the feature distribution alignment network graph;
[0049] Figure 4 This is a segmentation model diagram of thyroid nodule elastic ultrasound images based on MSA-FA;
[0050] Figure 5 This is a flow chart of the elastic ultrasound image segmentation method of thyroid nodules based on MSA-FA;
[0051] Figure 6 It is the thyroid nodule segmentation result of the thyroid nodule elastic ultrasound image segmentation model on the EU-TN elastic ultrasound image dataset. DETAILED DESCRIPTION
[0052] The present invention is further described below in conjunction with examples and drawings. It should be noted that the embodiments do not limit the scope of protection claimed by the present invention.
[0053] Example
[0054] The embodiment adopts the EU-TN dataset, which is based on the grayscale ultrasound and elastic ultrasound image data collected by a tertiary hospital in Beijing from October 2021 to August 10, 2023. It uses the Philips iU22 ultrasound diagnostic instrument combined with the L21-5 ultrasound probe, and is collected by two senior ultrasound experts. It contains 218 cases and a total of more than 3,800 images in JGP format. The EU-TN dataset contains 700 grayscale ultrasound images in JPG format, 700 elastic ultrasound images in JPG format, and corresponding label files in PNG format. In order to construct an experimental dataset suitable for the task of ultrasound image segmentation of thyroid nodules, ultrasound images of appropriate size are intercepted for each case as samples. Two ultrasound experts use the Labelme annotation tool to draw the edge shape of the thyroid nodule in the sample image, and generate an annotation file in JSON format, which is converted into a label file in PNG format after batch binarization.
[0055] The server configuration of the embodiment has an Intel Xeon Gold 5217 3.00GHz CPU and 64GB of memory; the display processor is a dual Nvidia RTX 2080Ti GPU, each with 11.00GB of video memory and CUDA version 11.6; the embodiment code is based on the Pytorch deep learning framework, and the experimental codes are all implemented based on Python 3.8 language programming; the operating system of the experimental platform is Ubuntu 18.04.
[0056] The training process uses the stochastic gradient descent optimization algorithm to iteratively update the network node weights. The initial learning rate is set to 1e-5, the training momentum is selected to 0.9, the weight decay coefficient is 1e-8, and the gradient is clipped after the gradient is back-transmitted to prevent gradient explosion. The ReduceLROnPlateau learning rate adjustment strategy is adopted to dynamically adjust the learning rate of the model according to the Dice coefficient value of the validation set. In the experiment, when the Dice coefficient does not increase for 25 times, the learning rate is adjusted to be reduced by ten times. A total of 150 training cycles are set in the training, and the batch size is 8. The size of the input network is changed to 256×256.
[0057] The flow chart of the thyroid nodule elastic ultrasound image segmentation method based on MSA-FA is as follows: Figure 5 As shown in the figure; the thyroid nodule segmentation results of the thyroid nodule elastic ultrasound image segmentation model on the EU-TN elastic ultrasound image dataset are shown in the figure Figure 6 shown.
[0058] In order to verify the effectiveness of the present invention, five segmentation methods, namely U-Net, U-Net++, Attention U-Net, ASPP-U-Net and MAU-Net, were set as experimental comparison methods, and the Dice coefficient, average interaction ratio (IOU), recall rate and precision rate were used as performance evaluation indicators to evaluate the performance of the thyroid nodule elastic ultrasound image segmentation model based on MSA-FA. The experimental results of thyroid nodule elastic ultrasound image segmentation are shown in Table 1.
[0059] Table 1 Comparative experimental results of EU-TN dataset segmentation methods
[0060]
[0061]
[0062] As shown in Table 1, the method of the present invention has the highest Dice coefficient, IOU, Recall, and Precision results of 77.09%, 65.20%, 78.19%, and 81.05%, followed by the MAU-Net segmentation method, and the U-Net segmentation method has the worst result. Among them, the IOU coefficient of the method of the present invention is 5.06%, 4.29%, 3.57%, 3.51%, and 2.65% higher than that of U-Net, U-Net++, Attention U-Net, ASPP-U-Net, and MAU-Net, respectively, indicating that the method of the present invention can more accurately capture the morphology and boundary information of the nodule, thereby improving the accuracy and reliability of elastic ultrasound image segmentation of thyroid nodules.
Claims
1. A thyroid nodule elastic ultrasound image segmentation method based on MSA-FA, characterized by: The method comprises the following steps: Step 1: Obtain the location information of thyroid nodules in thyroid grayscale ultrasound and elastic ultrasound images and crop them. Data enhancement is achieved by rotating thyroid grayscale ultrasound and elastic ultrasound images at different angles to construct a dataset of thyroid nodule ultrasound images. Step 2: Introduce the large-core attention mechanism, construct a multi-scale attention module and apply it to the U-Net skip connection layer, use the sum of the Dice loss function and the binary cross entropy loss function as the model loss function, and establish a grayscale ultrasound image segmentation model for thyroid nodules; Step 3: Combine the conditional generative adversarial network to construct a feature distribution alignment network to achieve feature distribution alignment of the thyroid grayscale ultrasound image and the elastic ultrasound image; Based on the grayscale ultrasound image segmentation model of thyroid nodules constructed in step 2, a weight sharing strategy is adopted to migrate the feature extraction layer parameters of the grayscale ultrasound image segmentation network, construct the objective function of the elastic ultrasound image segmentation network of thyroid nodules, and establish the elastic ultrasound image segmentation model of thyroid nodules based on MSA-FA; Step 4: Input the elastic ultrasound image of the thyroid nodule to be tested, segment the thyroid nodules in the elastic ultrasound image using the thyroid nodule elastic ultrasound image segmentation model based on MSA-FA, and output the segmentation result of the thyroid nodule in each elastic ultrasound image.
2. The method for segmenting thyroid nodules using elastic ultrasound images based on MSA-FA according to claim 1, characterized in that: Step 1 includes the following steps: Grayscale ultrasound image data and elastic ultrasound image data of thyroid nodules were collected and invalid borders were removed. The Labelme annotation tool was used to draw the edge shape of thyroid nodules in the image to generate annotation files in JSON format, which were converted into label files in PNG format after batch binarization. The original thyroid ultrasound images were enhanced by rotation angle, horizontal flipping, and vertical flipping transformations to achieve data preprocessing of thyroid grayscale nodule ultrasound images and construct a dataset of thyroid nodule ultrasound images.
3. The method for segmenting thyroid nodules using elastic ultrasound images based on MSA-FA according to claim 1, characterized in that: Step 2 includes the following steps: The multi-scale attention network consists of batch normalization, GELU activation function, large kernel attention and convolutional feedforward network; the large kernel attention LKA captures the long-distance dependencies in thyroid nodule ultrasound images by constructing a large kernel convolution. It consists of deep convolution, deep dilated convolution and 1×1 point convolution. It estimates the importance of a certain area in the thyroid nodule ultrasound image with a small amount of computational cost and parameters and generates attention weights. The calculation formula is: Attention=Conv 1×1 (DD-Conv(D-Conv(Input))) (1) In the formula, Input∈R C×H×W is the input thyroid nodule ultrasound image, C is the number of channels of the thyroid nodule ultrasound image, H is the length of the thyroid nodule ultrasound image, and W is the width of the thyroid nodule ultrasound image; D-Conv() represents depth convolution; DD-Conv() represents depth dilated convolution; Conv 1×1 () represents point convolution; Attention∈R C×H×W is the attention weight; is the Kronecker product; The skip connection layer in the U-Net network is replaced with a multi-scale attention network module, and the first four layers of features extracted by the backbone network are input into the multi-scale attention network. The multi-scale information of the grayscale ultrasound image of the thyroid nodule is fused using the multi-scale attention network module, and the output feature map is fused with the feature map obtained by deconvolution to extract the boundary and detail feature information of the thyroid nodule. The loss function of the grayscale ultrasound image segmentation network of thyroid nodules is: Loss=loss dice +loss BCE (3) In the formula, loss dice is the Dice loss function; loss BEC is the binary cross entropy BCE loss function; The Dice loss function is used to evaluate the similarity of different regions in thyroid nodule ultrasound images. The Dice loss function value is calculated as follows: Wherein, |X∩Y| is the area of the intersection of region X and region Y in the ultrasound image of the thyroid nodule; |X| and |Y| represent the areas of region X and region Y in the ultrasound image of the thyroid nodule, respectively; The BCE loss function is used to measure the difference between the output of the thyroid nodule ultrasound image segmentation model and the true value. The calculation formula of the BCE loss function value is: loss BCE =-(y*log(p)+(1-y)*log(1-p)) (5) In the formula, y represents the true value of the thyroid nodule margin; p represents the predicted value of the thyroid nodule margin output by the model; log() represents logarithmic calculation; The pre-trained segmentation model is trained using the grayscale ultrasound image training data of thyroid nodules constructed in step one, and the network parameters are iterated until the loss function converges to obtain a grayscale ultrasound image segmentation model of thyroid nodules based on a multi-scale attention mechanism.
4. The method for segmenting thyroid nodules using elastic ultrasound images based on MSA-FA according to claim 1, characterized in that: Step three includes the following steps: The conditional generative adversarial network is introduced, and the feature extraction layer of the grayscale ultrasound image segmentation network of thyroid nodules is used to extract the features of grayscale ultrasound images and elastic ultrasound images. Then, the network is divided into two branches. One branch uses the grayscale ultrasound image features and labels to train the grayscale ultrasound image discriminator, and the other branch calculates the domain classification error to determine whether the input feature comes from the grayscale ultrasound image or the elastic ultrasound image. This allows the model to understand and reduce the feature distribution differences between different modalities and achieve cross-modal feature distribution alignment. In the feature distribution alignment network of thyroid nodule grayscale ultrasound image and elastic ultrasound image, the loss function of the thyroid nodule ultrasound image feature distribution alignment network is constructed by combining the conditional generative adversarial network objective function. DA for Loss DA =L MMD +L CORAL (6) Where, L MMD is the maximum mean difference MMD loss function; L CORAL is the CORAL loss function; The MMD loss value is calculated as Where φ() represents the nonlinear mapping function; n and m represent the number of grayscale ultrasound images and elastic ultrasound images of thyroid nodules, respectively; x i and j They represent the grayscale ultrasound image features of the i-th thyroid nodule and the elastic ultrasound image features of the j-th thyroid nodule respectively; The CORAL loss function characterizes the difference in distribution by calculating the second-order moment of the grayscale ultrasound image and elastic ultrasound image of the thyroid nodule. The calculation formula of the CORAL loss function value is: In the formula, d is the characteristic number; C S and C T are the covariance matrices of the grayscale ultrasound image features and elastic ultrasound image features output by the domain adaptation layer; Combining the loss function and the regularization term, the objective function of the thyroid nodule elastic ultrasound image segmentation network is constructed; the objective function L is composed of the Dice loss function, the binary cross entropy loss function and the regularization term. Through the back propagation of the error, the model parameters are continuously updated to make the objective function converge; the optimization goal of the model is Where, θ is the model parameter of thyroid nodule elastic ultrasound image segmentation; λ is the regularization coefficient; The structure of the thyroid nodule elastic ultrasound image segmentation model was constructed, and the thyroid nodule elastic ultrasound image training data constructed in step 1 was used to train the thyroid nodule elastic ultrasound image segmentation model. The network parameters were iterated until the objective function converged to obtain the thyroid nodule elastic ultrasound image segmentation model based on MSA-FA.
5. The method for segmenting thyroid nodules using elastic ultrasound images based on MSA-FA according to claim 1, characterized in that: Step 4 includes the following steps: Input the thyroid elastic ultrasound image to be segmented, load the thyroid nodule elastic ultrasound image segmentation model based on MSA-FA trained in step three, segment the thyroid nodule elastic ultrasound image data, and output the thyroid nodule segmentation result of the final elastic ultrasound image.
Citation Information
Patent Citations
Ultrasonic image modal migration and classification method based on generative adversarial network and terminal
CN110910351A
Multi-mode ultrasonic image classification method and breast cancer diagnosis device
CN110930367A
Thyroid nodule segmentation method based on improved Unet network
CN114998296A
Establishment method of thyroid nodule segmentation and classification model based on multitask ultrasound, segmentation and classification method and computer equipment
CN115393584A
