Thyroid nodule ultrasonic image processing method and system
By constructing a segmentation network based on physical guidance and noise-adaptive attention, the problem of thyroid nodule recognition in ultrasound images relying on human experience was solved, achieving higher segmentation accuracy and robustness. In particular, when dealing with noise interference and boundary blurring in ultrasound images, the accuracy of nodule segmentation and boundary preservation ability were significantly improved.
Patent Information
- Application Number
- CN202511317563.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-16
- Publication Date
- 2025-12-16
AI Technical Summary
In existing technologies, the identification of thyroid nodules in ultrasound images relies on human experience, which leads to the recognition results being affected by subjective factors and insufficient accuracy, especially in resource-limited environments where it is difficult to meet clinical needs.
A segmentation network based on physical guidance and noise adaptive attention is adopted. By constructing an encoder-decoder network containing a physical prior module and a noise adaptive module, and training it with Dice loss and Focal loss, the feature extraction and boundary segmentation of ultrasound images are optimized.
It improves the accuracy and robustness of thyroid nodule segmentation, especially in dealing with inherent noise interference and boundary ambiguity in the nodule region, significantly enhancing segmentation accuracy and boundary preservation capabilities.
Smart Images

Figure CN121147239A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of image processing, and in particular, to a thyroid nodule ultrasound image processing method and system. BACKGROUND
[0002] At present, ultrasound imaging has become the preferred method for thyroid nodule screening due to its non-invasiveness, real-time nature and high resolution. However, the accuracy of ultrasound diagnosis is highly dependent on the experience of doctors, which requires a combination of rich professional knowledge and clinical judgment. Given the high requirements for practitioners, such professional knowledge can be very scarce, especially in resource-limited environments.
[0003] In the prior art, the thyroid nodule in the ultrasound image is identified by artificial means, and the identification result can be affected by subjective factors due to reliance on artificial experience. SUMMARY
[0004] The present application provides a thyroid nodule ultrasound image processing method and system to at least solve the problem.
[0005] According to one aspect of the present application, a thyroid nodule ultrasound image processing method is provided, comprising: obtaining training data, wherein the training data is an ultrasound image in which a thyroid nodule has been divided; constructing a segmentation network for segmenting a thyroid nodule from an ultrasound image, wherein the segmentation network includes an encoder and a decoder, the encoder and the decoder include a calculation unit, the calculation unit includes a physical prior module and a noise adaptive module, the physical prior module is used to process the weight of each part in the ultrasound image, and the noise adaptive module is used to generate a global feature to replace the noise in the ultrasound image, thereby reducing the influence of the noise in the ultrasound image; training the segmentation network using the training data to obtain a converged segmentation network; inputting an ultrasound image to be segmented into the segmentation network, and the segmentation network outputs a segmented thyroid nodule.
[0006] Further, obtaining the training data comprises: obtaining a set of ultrasound images of thyroid nodules, wherein the set includes multiple ultrasound images of thyroid nodules; pre-processing the ultrasound images in the set, wherein the pre-processing includes at least one of the following: adjusting the size of the ultrasound image, horizontal flipping, vertical flipping, random rotation, adjusting the contrast, adjusting the brightness; dividing the ultrasound images after pre-processing into a training set, a test set and a validation set, wherein the training set is used as the training data.
[0007] Further, the physical prior module is configured to process the ultrasound image, for the ultrasound image, the axial center row weight is increased to more than 100%, the adjacent row weight is attenuated to less than 100%, and the convolution kernel four-corner weight is reduced to less than 100%, wherein the convolution kernel four-corner weight is lower than the adjacent row weight.
[0008] Further, the physical prior module is configured to process the ultrasound image, for the ultrasound image, the axial center row weight is increased to 200%, the adjacent row weight is attenuated to 80%, and the convolution kernel four-corner weight is reduced to 50%.
[0009] Further, the noise adaptive module adopts a three-step cascade: the first layer generates a pixel-level noise intensity map; the middle layer dynamically fuses local details and global background features according to the noise intensity; and the last layer calculates attention weights based on the ultrasound image after replacing the noise with global features.
[0010] Further, the segmentation network includes four encoders that extract features through bridging, and four decoders that restore features using skip connections, wherein the encoders and decoders both use an enhanced residual module that includes one or more physical prior modules and one or more noise adaptive modules.
[0011] Further, the segmentation network is trained using the training data to obtain a converged segmentation network, including: using a weighted sum of Dice loss and Focal loss as a loss function when training the segmentation network, and obtaining the converged segmentation network when the loss function meets the requirements; wherein the Dice loss is a loss function based on set similarity measure, and the Focal loss is a loss function that adds a coefficient factor to the standard cross-entropy loss.
[0012] According to another aspect of the present application, an ultrasound image processing system for thyroid nodules is also provided, which is a software system configured to implement the method described above.
[0013] According to another aspect of the present application, an electronic device is also provided, which includes a memory and a processor; wherein the memory is configured to store one or more computer instructions, and the one or more computer instructions are executed by the processor to implement the method steps described above.
[0014] According to another aspect of the present application, a readable storage medium is also provided, which stores computer instructions, and the computer instructions are executed by a processor to implement the method steps described above.
[0015] In the embodiment of the present application, the training data is obtained, wherein the training data is an ultrasound image in which thyroid nodules have been divided; a segmentation network for segmenting thyroid nodules from the ultrasound image is constructed, wherein the segmentation network includes an encoder and a decoder, the encoder and the decoder include a calculation unit, the calculation unit includes a physical prior module and a noise adaptive module, the physical prior module is used to process the weight of each part in the ultrasound image, and the noise adaptive module is used to generate a global feature to replace the noise in the ultrasound image, thereby reducing the influence of the noise in the ultrasound image; the training data is used to train the segmentation network to obtain a converged segmentation network; the ultrasound image to be segmented is input into the segmentation network, and the segmentation network outputs the segmented thyroid nodules. The present application solves the problem that the thyroid nodules in the ultrasound image are manually identified, and the identification result is affected by subjective factors due to the dependence on artificial experience, thereby improving the accuracy of thyroid nodule segmentation. BRIEF DESCRIPTION OF DRAWINGS
[0016] The accompanying drawings, which form a part of the present application, are intended to provide further understanding of the present application, and the illustrative embodiments of the present application and their description serve the purpose of explaining the present application. The accompanying drawings should not be construed as an inappropriate limitation on the present application. In the drawings:
[0017] Figure 1 is a flowchart of a thyroid nodule ultrasound image segmentation method according to an embodiment of the present application Figure 1 ;
[0018] Figure 2 is a schematic diagram of an algorithm network structure according to an embodiment of the present application;
[0019] Figure 3 is a schematic diagram of an UltrasoundConv module according to an embodiment of the present application;
[0020] Figure 4 is a schematic diagram of a NoiseAdaptiveECA module according to an embodiment of the present application;
[0021] Figure 5 is an actual segmentation effect diagram in a data set according to an embodiment of the present application;
[0022] Figure 6 is a flowchart of an ultrasound thyroid nodule segmentation method according to an embodiment of the present application Figure 2 . DETAILED DESCRIPTION
[0023] It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0024] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0025] To solve the problems in the related art, in order to solve the problems caused by manually identifying the thyroid in the ultrasound image, an automatic segmentation technology of the image can be used to segment the thyroid nodule from the ultrasound image.
[0026] Deep learning technology has promoted the rapid development of the field of medical image segmentation. A series of advanced models have been integrated into computer-aided diagnosis systems (CAD), effectively helping medical personnel to improve the efficiency and accuracy of diagnosis, while significantly reducing their work burden. However, despite the above progress, when a general deep learning model is directly applied to the segmentation task of thyroid nodules in ultrasound images, it still faces challenges from this specific scenario, resulting in the segmentation accuracy and robustness of existing technologies far from meeting clinical needs. These challenges are mainly rooted in the unique properties of thyroid ultrasound images and the pathological characteristics of nodules. Specifically, these challenges mainly manifest in the following aspects:
[0027] Inherent noise interference and fuzzy boundary of nodule region: The inherent speckle noise in ultrasound images penetrates into the thyroid parenchyma and the interior of the nodule, making the texture features of the nodule extremely similar to those of the normal glandular tissue. More troublesome is that the edges of many nodules (especially malignant nodules) are irregular and unclear, and this pathological feature superimposes the noise effect, posing a double challenge to the segmentation algorithm. The existing standard convolutional network is difficult to accurately distinguish the true boundary of the nodule in this low signal-to-noise ratio environment when extracting features, often resulting in a segmentation result that is too smooth to lose details or produces a large number of false small segmentation regions.
[0028] Morphological diversity and acoustic artifacts of thyroid nodules: The morphology, size, and echo characteristics of thyroid nodules vary greatly, and in addition, larger nodules or calcified lesions are often accompanied by acoustic shadows, resulting in the absence of information in the deep region of the nodule; while cystic components can cause enhanced echoes in the rear. These complex acoustic artifacts can seriously interfere with image information, causing general models relying on pure data-driven learning to misjudge, such as incorrectly excluding the shadow region from the nodule or misjudging the enhanced region as a lesion, resulting in incomplete or over-segmentation of the segmentation.
[0029] The following embodiments can solve at least one of the above problems. In the following embodiments, a thyroid nodule ultrasound image processing method is provided, which uses physical guidance and noise adaptive attention, so the method is also referred to as an ultrasound thyroid nodule segmentation method based on physical guidance and noise adaptive attention, Figure 6 is a flow of an ultrasound thyroid nodule segmentation method according to an embodiment of the present application Figure 1 As shown in Figure 6 , the steps involved in the method in Figure 6 are described below.
[0030] Step S601, obtain a set of thyroid nodule ultrasound images, and pre-process the set of thyroid nodule ultrasound images.
[0031] In this step, the ultrasound image set is used to train a neural network model, and the purpose of pre-processing is mainly to make the pictures meet the needs of training, for example, performing size normalization, data enhancement, etc. Preprocessing operations are performed on the original ultrasound images containing thyroid nodules and their corresponding segmentation annotation files to construct training sets, validation sets and test sets.
[0032] Step S602, construct a segmentation network based on physical guidance and noise adaptive attention, and the overall architecture of the network follows the classic encoder-decoder design and skip connection.
[0033] There are many ways to construct a segmentation network, for example, the following method can be used to construct a U-shaped segmentation network based on an enhanced residual module: a U-shaped encoder-decoder segmentation network is constructed, and the core computing unit of the encoder and the decoder is composed of an enhanced residual module containing a physical guidance convolution layer and a noise adaptive channel attention module.
[0034] Multiple encoders and decoders can be used in the segmentation network, for example, four encoders and bridge feature extraction are used, and four decoders are used to recover features through skip connection. Each encoder, bridge and decoder is composed of an enhanced residual module.
[0035] The enhanced residual module is described in the following paper, which has been published on the network, and will not be described one by one. The title of the paper is "Enhanced Deep Residual Networks for Single Image Super-Resolutiong", and the authors of the paper are: Bee Lim, Sanghyun Son, Heewon Kim, Seungjun Nah, Kyoung Mu Lee.
[0036] In this embodiment, the enhanced residual module is adjusted, which is composed of two physical prior (UltrasoundConv) modules and a noise adaptive (NoiseAdaptiveECA) module, and functions in fusing axial physical prior and noise dynamic purification, enhancing feature discriminability and boundary preservation ability. The two modules are described below.
[0037] The physical prior module is used to process the ultrasound image. For the ultrasound image, the axial center row weight is increased to more than 100%, the adjacent row weight is attenuated to less than 100%, and the convolution kernel four corner weight is reduced to less than 100%, wherein the convolution kernel four corner weight is lower than the adjacent row weight.
[0038] For example, the UltrasoundConv module encodes acoustic prior through programmatic weight constraints: axial center row weight is strengthened by 200% to utilize higher resolution, adjacent row weight is attenuated to 80% to suppress lateral artifacts, and convolution kernel four corner weight is reduced to 50% to correct edge distortion.
[0039] The noise adaptive module is used to generate a global feature to replace the noise in the ultrasound image, thereby reducing the influence of the noise in the ultrasound image. There are many ways to implement the noise adaptive module, and one of the better ways is to use a three-step cascade processing. This is described below.
[0040] The noise adaptive module uses a three-step cascade: the first layer generates a pixel-level noise intensity map; the middle layer dynamically fuses local details and global background features according to the noise intensity; and the last layer calculates attention weights based on the ultrasound image after replacing the noise with the global feature.
[0041] The NoiseAdaptiveECA module innovatively implements a three-step cascade processing: the first layer generates a pixel-level noise intensity map through double convolution; the middle layer dynamically fuses local details and global background features (low-noise area retains details / high-noise area replaces global features) according to this; and the last layer calculates channel attention weights based on the purified features. The two modules work together to break through the dual limitations of ultrasound images: the former optimizes the response of tissue boundaries, and the latter blocks the interference of noise on decision-making, thereby improving the anatomical fidelity of nodule segmentation.
[0042] The skip connection generates a spatial attention mask by real-time calculation of the difference between the decoder and the encoder features, dynamically suppresses the acoustic shadow / noise interference area in the encoder features, only weights and fuses the effective tissue structure information, and blocks the noise from transmitting across levels.
[0043] The above embodiments are described below through an example.
[0044] The input 3-channel 224×224 image first passes through a 4-level encoding layer. Each level contains two UltrasoundConv layers and one NoiseAdaptiveECA layer, with max pooling connecting different levels. During encoding, the number of channels successively changes to 64, 128, 256, and 512, and the image size also decreases by half from 224 to 28. After bridging, it becomes 1024 channels and 14×14. During decoding, the current feature is upsampled and then fused with the corresponding encoder feature through SpatialAttentionSkip. After decoding, the final number of channels is halved and the size is doubled. This decoding process is repeated until the number of feature channels decreases from 1024 to 64, and the size recovers from 14 to 224. Finally, the output layer converts the number of channels from 64 to 1, resulting in the segmentation map.
[0045] Step S603: The processed training set data is fed into the network for training to obtain the network model.
[0046] In this step, the segmentation network established in step S602 is trained end-to-end using the training set constructed in step S601. The network weights are iteratively updated through the backpropagation algorithm and optimizer until the loss function converges, and the trained segmentation model is obtained.
[0047] In this step, a composite loss combining Dice loss and Focal loss, along with Dice supervised loss, can be used to guide the model's learning. The Adamw optimizer is used to accelerate convergence, with a learning rate of 0.0005 and a batch size of 16. Dice loss is a loss function based on set similarity, primarily used in image segmentation tasks to optimize the overlap between predicted regions and ground truth labels. Focal loss adds a coefficient factor to the standard cross-entropy loss, thereby reducing learning on easy samples and strengthening learning on difficult samples, thus improving the model's classification ability.
[0048] Step S604: Verify the segmentation effect of the network model obtained in step S603 on the test set.
[0049] In this step, nodule segmentation and evaluation can be performed: ultrasound images from the test set are input into the segmentation model trained in step S603 to obtain predicted segmentation maps of thyroid nodules. The overall segmentation ability and boundary segmentation ability of the model are evaluated using metrics such as Dice coefficient, intersection-over-union ratio, HD95, ASD, sensitivity, and recall. Simultaneously, a dataset of small nodules from the test set is selected for testing to verify the model's small nodule segmentation ability.
[0050] In this step, the model's segmentation ability can be verified using Dice and IoU metrics, while segmentation quality can be verified using recall and sensitivity. The model's segmentation boundary capabilities are verified using ASD and HD95, and its segmentation ability in the small nodule case is verified by testing on a small nodule dataset.
[0051] The above implementation method will be described below with reference to an example and accompanying drawings. Figure 1 This is a flowchart of a thyroid nodule ultrasound image segmentation method according to an embodiment of this application. Figure 1 Below is Figure 1 The steps involved in the method described are explained.
[0052] Step 1: Obtain and preprocess the ultrasound image set of thyroid nodules. First, obtain the TN3K dataset, a dataset of ultrasound images containing thyroid nodules, from a publicly available medical imaging database. To ensure the stability and effectiveness of model training, a series of preprocessing operations need to be performed on the original image set, which may include the following steps:
[0053] Step 1.1: Scale all images in the dataset to a uniform size of 224×224 to fit the input requirements of the network model.
[0054] Step 1.2: To expand the dataset size and improve the model's generalization ability, perform random data augmentation operations on the images, including but not limited to: random horizontal or vertical flipping, random rotation at small angles, and slight adjustments to contrast and brightness.
[0055] Step 2: Construct an enhanced U-shaped segmentation network. This step corresponds to... Figure 1 The second flowchart in this example highlights a key technical feature. This step constructs a novel enhanced U-shaped segmentation network, whose overall architecture follows the classic encoder-decoder design. The core innovation lies in its fundamental building block: an enhanced residual module integrating physically guided convolution and noise-adaptive attention, which serves as the core component of both the encoder and decoder. The network also employs a novel spatial attention skip connection for cross-layer feature fusion, and its upsampling stage uses pixel reconstruction to restore image resolution. Figure 2 This is a schematic diagram of the algorithm network structure according to an embodiment of this application. Figure 2 The network structure is shown, such as Figure 2 As shown below, in conjunction with Figure 2 Step 2 above will be explained.
[0056] Step 2.1: Construct a physically guided convolutional layer (UltrasoundConv). Figure 3 This is a schematic diagram of the UltrasoundConv module according to an embodiment of this application, with reference to... Figure 3This layer is one of the fundamental computational units in this example, designed to encode the physical prior knowledge of ultrasound imaging (i.e., axial resolution is better than lateral resolution) into the network. Assume the input feature map is... The core of this layer lies in the k×k two-dimensional convolution kernel. Perform special weight initialization.
[0057] Specifically, before training begins, we do not use standard random initialization, but instead generate initial weights W in a procedural manner. init This process can be formally described as follows:
[0058] Let W rand Let M be a randomly initialized weight tensor. We define a weight adjustment matrix M ∈ R with the same dimensions as the convolution kernel space. k×k For any position (p, q) in the convolution kernel (where p, q ∈ {0, 1, ..., k-1}), the elements M of M p,q Defined as:
[0059]
[0060] Where p mid =[k / 2] is the index of the center row. Then, the weights of the four corner points are further attenuated:
[0061] If (p,q)∈C, then M p,g← M p,g 0.5 (2)
[0062] The set of corner points is C = {(0,0),(0,k-1),(k-1,0),(k-1,k-1)}. The final initial weight W... init By broadcasting the adjustment matrix M and using random weights W rand Element-wise multiplication yields:
[0063] W init =W rand ×M (3)
[0064] Here, × represents element-wise multiplication. This design guides the network to prioritize axial structures with more reliable information in the initial stage of feature extraction, thus enabling it to more robustly handle the boundary blurring problem commonly found in ultrasound images.
[0065] In terms of data flow, this layer consists of a two-dimensional convolutional layer with the aforementioned special initialization, a batch normalization layer, and a Leaky ReLU activation function. A layer of size (C... in The input feature map X (H,W) is processed by this layer, and the output feature map Z has a size of (C,W,W). out(H,W), meaning only the number of channels is changed, without changing the spatial size.
[0066] Step 2.2: Construct the NoiseAdaptive Channel Attention Module (NoiseAdaptiveECA). Figure 4 This is a schematic diagram of the NoiseAdaptiveECA module according to an embodiment of this application, with reference to... Figure 4 This module is another core component of this example, designed to address the inherent speckle noise interference in ultrasound images. It employs an innovative "clean first, focus later" strategy.
[0067] Let the input feature map be X, with dimensions (B, C, H, W). The module's calculation process is as follows:
[0068] (1) Noise Estimation. The input feature map X is first passed through a lightweight noise estimator subnetwork to generate a pixel-level noise map M_noise. This subnetwork consists of two 3×3 convolutional layers and a sigmoid activation function. The specific process is as follows:
[0069] M_noise=Sigmoid(Conv_2(ReLU(Conv_1(X)))) (4)
[0070] Conv_1 and Conv_2 are 3×3 two-dimensional convolutional layers. M_noise has the same dimension as X, and each element has a value between (0,1) to represent the noise intensity at the corresponding position.
[0071] (2) Adaptive Feature Denoising. The original feature X is dynamically denoised using the noise map M_noise, resulting in the denoised feature X_denoised. This process combines local details with global contextual information, and the specific formula is as follows:
[0072] X_denoised=X·(1-M_noised)+GAP(X)·M_noise (5)
[0073] Where · denotes element-wise multiplication (Hadamard product), and GAP(X) represents global average pooling of X, resulting in a vector of dimension (B,C,1,1), which is then broadcast to the same dimension (B,C,H,W) as X. This formula means that in regions where M_noise is close to 1 (strong noise), the value of X_denoised depends more on the global average feature; in regions where M_noise is close to 0 (weak noise), the original local features X are preserved more.
[0074] (3) Channel attention calculation and application.
[0075] Channel attention weights are calculated based on the purified features. First, global average pooling is performed on X_denoised to obtain a channel-level global feature vector z. Then, z is fed into a simple fully connected network (fc) consisting of 1×1 convolutions (implemented as fully connected layers), batch normalization, and a sigmoid activation function to obtain the final channel attention weight vector w.
[0076] w=Sigmoid(BN(Conv_fc(z))) (6)
[0077] Here, Conv_fc is a 1×1 convolutional layer, and BN is batch normalization. The dimension of w is (B,C,1,1), where each element represents the importance of a channel.
[0078] Finally, the weighted attention w is applied to the original input feature map X.
[0079] Step 2.3: Construct the enhanced core module. This module is the basic building block of the entire network encoder and decoder. Its structure consists of two cascaded physically guided convolutional layers as described in Step 2.1 and a noise-adaptive channel attention module as described in Step 2.2. The computational flow of the module can be represented by the following composite function:
[0080] Y_out=A(H_2(H_1(X_in))) (7)
[0081] Where A represents the NoiseAdaptiveECA module, and H_1 and H_2 represent the first-layer UltrasoundConv and the second-layer UltrasoundConv, respectively.
[0082] This combined design allows the network to first extract preliminary features using physical priors through the UltrasoundConv layer in each core feature extraction operation, and then perform noise-aware adaptive recalibration of these features through the NoiseAdaptiveECA module, thereby obtaining a high-quality feature representation that is highly adaptable to the characteristics of ultrasound images.
[0083] The input feature map X(C_in,H,W) is processed by the enhancement unit, and the output feature map size is X(C_out,H,W).
[0084] Step 2.4: Construct the encoder path. The encoder path is responsible for extracting multi-scale features from the input image, ranging from shallow texture to deep semantics. This path consists of four encoder modules (encoder1 to encoder4) connected in series and a bridge module, where each module is an enhanced core module as described in Step 2.3. Adjacent encoder modules are downsampled through a max-pooling layer with a stride of 2 to reduce the feature map size and expand the receptive field.
[0085] Specifically, after the input image X(3,224,224) passes through encoder1, the output e1 has a size of (64,224,224). After one pooling layer, the number of channels remains the same while the size is halved, changing from 224×224 to 112×112. In each subsequent encoding layer, the number of feature map channels doubles while the size remains the same. After another pooling layer, the number of feature map channels remains the same while the size is halved, resulting in the final output e4 of (512,14,14). After passing through a bridge layer, the final size of the feature map is (1024,14,14).
[0086] Step 2.5: Construct the decoder path and enhanced skip connections. The decoder path is structurally symmetrical to the encoder path. Its core function is to progressively restore the spatial resolution of the feature map and intelligently fuse the detailed feature information provided by the encoder at different levels, ultimately generating a pixel-level segmentation prediction map. This path consists of four decoder stages, each containing an upsampling module, a spatial attention skip connection module, and a decoder module, with a depth-supervised output head added in some stages. The specific design of each part is as follows:
[0087] (1) Upsampling Module: The upsampling sub-module in the decoder path is implemented using pixel recombination technology. Feature maps from deeper layers of the decoder are first expanded to four times their target number of channels through a 3x3 convolutional layer, and then the information in the channel dimension is rearranged into the spatial dimension through pixel recombination. This operation can efficiently double the resolution of the feature map while halving the number of channels. Compared with deconvolution, it has fewer parameters and is less prone to checkerboard artifacts.
[0088] (2) Spatial attention jump connection. Figure 5 This is a diagram showing the actual segmentation effect in the dataset according to the embodiments of this application, with reference to... Figure 5 This module acts as a "bridge" connecting the encoder and decoder. Its function is to filter the features of the encoder based on the semantic information provided by the decoder, suppress irrelevant regions (such as background noise), and enhance regions related to the target, thereby achieving more accurate feature fusion.
[0089] Let X be the high-resolution feature from the encoder.h The low-resolution feature from the decoder after upsampling is X. l X l It has stronger semantic information, while X h It includes richer spatial details. The calculation process for this module is as follows:
[0090] (2.1) Feature alignment: First, X is aligned using bilinear interpolation. l Spatial size upsampling as X h Completely identical, yielding the characteristic X of climate. up .
[0091] (2.2) Attention gate calculation: X h and X l The difference is taken as input, and a 1×1 convolutional layer is used for linear transformation. Then, a spatial attention gate G_attn is generated by applying the Sigmoid activation function.
[0092] G_attn=Sigmoid(Cpnv_{1×1}(X h -X up (8)
[0093] (2.3) Feature gating and fusion: The calculated attention gate G_attn is multiplied element by element by the encoder feature X. h The gating features X after attention filtering are obtained. gated .
[0094] Finally, the gated feature X gated Compared with the upsampled decoder features X up The features are stitched together along the channel dimension to form a feature map with double the number of channels that incorporates spatial attention information. This map is then fed into the decoder module at this decoder level for further processing.
[0095] (3) Decoder Module and Deep Supervision Mechanism. The decoder module in each decoder stage, like the encoder module, is an enhanced core module as described in step 2.3. It receives fused features from skip connections and performs deep feature extraction and refinement on them.
[0096] To mitigate the vanishing gradient problem in deep networks and guide intermediate layers to learn more discriminative features, this example introduces a deep supervision mechanism. Specifically, in layers 4, 3, and 2 of the decoder path, the output of the decoder module is passed through an independent 1x1 convolutional layer to generate an auxiliary segmentation prediction map at the corresponding resolution. During training, these auxiliary outputs are downsampled to the same size as the ground truth labels and used to calculate the loss. The loss values are then weighted and added to the total loss function, providing additional supervision signals to the network. During the model inference phase, these auxiliary outputs are discarded.
[0097] The complete data stream of the decoder path is as follows: the feature X(1024,14,14) from the bridging module is upsampled to obtain a feature map up4(512,28,28) with half the number of channels and doubled in size. d4 and e4(512,28,28) from the encoder are sent to the skip4 module to output fused features, and the number of channels becomes twice. It is then decoded to obtain feature d4(512,28,28). At the same time, the prediction map sup4 of this layer is generated through deep_sup4. d4 continues to be passed to the next decoding layer, and finally the output 224×224 and three segmentation prediction maps are obtained.
[0098] Step 2.6 applies a combined dice+focal loss function to the output image obtained in Step 2.5. The specific loss design is as follows:
[0099]
[0100] TotalLoss=1.2DiceLoss+1.5FocalLoss+0.4AuxLoss (12)
[0101] Step 3: Train the thyroid nodule segmentation network using the training set. The hardware environment for this experiment consisted of a GTX 3060 graphics card with 12GB of VRAM. The software environment used was PyTorch 3.8. Hyperparameter settings: learning rate was set to 0.0005, the Adamw optimizer was used, and the Dice metric was used to evaluate the model's performance during training. The model was trained five times, and the optimal solution was used as the final weight parameters.
[0102] Step four: Evaluate the model's segmentation ability. Load the model weights obtained in step three into the model, perform detection on the test set, and record the model data.
[0103] Specifically, the Dice and IoU metrics are used to demonstrate the model's segmentation ability, Precision and Sensitivity to demonstrate the model's segmentation accuracy and completeness, and ASD and HD95 to demonstrate the model's boundary segmentation ability. Images with ground truth mask pixel values less than 3000 are selected from the test set to construct a new test set to verify the model's nodule segmentation ability. The specific calculation formulas for each metric are as follows:
[0104]
[0105] Where A represents the positive class region predicted by the model (after binarization), B represents the positive class region of the true label, TP represents true positive, FP represents false positive, FN represents false negative, and S represents false negative. A ,S B The meaning is the set of surface points for predicted and true labels, d(a,S) B The meaning is the distance from point a to set S. B The nearest Euclidean distance. Point a to set S B The closest distance. percentile 95 This means taking the 95th percentile of the distance set (ignoring the largest 5% outliers).
[0106] This example specifically addresses the characteristics of ultrasound and the imaging characteristics of ultrasound thyroid nodules. It combines the UltrasoundConv module (which transforms the acoustic beam attenuation model into a convolutional kernel weight constraint) with the NoiseAdaptiveECA module (dedicated to denoising and enhancing feature extraction), along with sub-pixel convolution and spatial attention mechanisms, within the U-Net framework to significantly improve the segmentation capability of ultrasound thyroid nodules. Specific ablation experiments are shown in Table 1.
[0107] Table 1 Comparison of ablation experiments
[0108]
[0109]
[0110] As can be seen from Table 1, this example improved the Dice metric from 0.8249 to 0.8491 and the IoU metric from 0.7433 to 0.7692. This demonstrates that each improvement enhanced the model's segmentation ability. Furthermore, the PRE and SEN metrics improved by 1 and 3 points respectively, significantly improving both the model's segmentation accuracy and completeness. The HD95 decreased from 11.15 to 9.21, and the ASD metric decreased from 5.66 to 4.63, indicating a significant improvement in boundary accuracy. Overall, the model modifications achieved excellent optimization.
[0111] The model design is compared with other state-of-the-art (SOTA) models to observe its excellence, as shown in Table 2:
[0112] Table 2 Comparison of this example and different SOTA models
[0113] Dice IOU PRE SEN HD95 ASD This example 0.8491 0.7692 0.8651 0.8728 9.21 4.63 Swin-Unet 0.8457 0.7606 0.8905 0.8429 9.02 4.88 DeeplabV3+ 0.8499 0.7659 0.8584 0.8813 9.84 4.86 Transunet 0.8386 0.7601 0.8756 0.8412 9.46 4.89 Attentionunet 0.8281 0.7479 0.8490 0.8507 10.47 5.40 Unet++ 0.8301 0.7495 0.8554 0.8618 10.38 5.38 CMU-Net 0.8448 0.7622 0.8611 0.8712 9.72 4.81 Unet 0.8249 0.7433 0.8558 0.8411 11.15 5.66
[0114] As shown in Table 2, the overall performance of this example has reached the level of state-of-the-art (SOTA) models. In terms of segmentation ability, it surpasses models such as CMU-Net, Swin-Unet, and Transformer, and is comparable to DeeplabV3+ which uses ResNet101 as its backbone. Furthermore, in the specific task of ultrasound thyroid nodule segmentation, this example demonstrates significant advantages in ASD and HD95 metrics, effectively addressing the problem of inaccurate nodule boundaries. Below is a test set of images in the test set with a threshold of 3000 pixels, filtering images with a mask value less than 3000 pixels, to assess the segmentation ability of small nodules. The specific metrics for each model are shown in Table 3.
[0115] Table 3. Segmentation performance of each model in nodules.
[0116] Dice IOU PRE SEN HD95 ASD This example 0.8063 0.7165 0.7908 0.8693 10.19 4.07 Swin-Unet 0.7953 0.6945 0.7688 0.8786 10.57 4.59 DeeplabV3+ 0.8001 0.7101 0.7889 0.8711 11.13 4.79 Transunet 0.7911 0.6995 0.7881 0.8596 12.26 5.33 Attentionunet 0.7756 0.6865 0.7727 0.8311 13.04 5.44 Unet++ 0.7811 0.6885 0.7812 0.8636 12.99 5.73 CMU-Net 0.7901 0.6911 0.7712 0.8654 13.11 5.16 Unet 0.7757 0.6839 0.7665 0.8479 13.63 5.24
[0117] As shown in Table 3, segmenting thyroid nodules is extremely challenging. Each model lost nearly 5 Dice points. For example, models like Swin-Unet and DeepLabV3+ performed well in full dataset validation, but struggled to leverage their powerful feature extraction capabilities in nodule segmentation. In contrast, this example achieved relatively excellent results in nodule segmentation, becoming the most effective model and significantly outperforming the others.
[0118] Figure 5 The above method is shown to intuitively segment large nodules, multiple nodules, and small nodules. It can be seen that no matter the size, number, and shape of the nodules, the segmentation results obtained by the above method are more accurate, especially with obvious optimization at the boundaries.
[0119] The above example provides a physical guidance and noise-adaptive attention-based ultrasound thyroid nodule segmentation method. This addresses the problems in existing technologies where general-purpose deep learning models, when directly applied to ultrasound thyroid nodule segmentation, neglect inherent physical characteristics of ultrasound images (such as axial and lateral resolution differences) and speckle noise interference, resulting in low segmentation accuracy and insufficient robustness. This example enables high-precision and robust automatic segmentation of thyroid nodules in ultrasound images.
[0120] In this embodiment, an electronic device is provided, including a memory and a processor. The memory stores a computer program, and the processor is configured to run the computer program to perform the methods described in the above embodiments.
[0121] The aforementioned program can run on a processor or be stored in memory (or a computer-readable medium). Computer-readable media include both permanent and non-permanent, removable and non-removable media, and information storage can be achieved by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0122] These computer programs may also be loaded onto a computer or other programmable data processing equipment, causing a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes can be implemented using different modules, and different steps can be implemented using different modules.
[0123] This embodiment provides such an apparatus or system. The system is referred to as a thyroid nodule ultrasound image processing system, and is a software system used to perform the methods described above.
[0124] The system or apparatus is used to implement the functions of the methods in the above embodiments. Each module in the system or apparatus corresponds to each step in the method, as has been described in the method and will not be repeated here.
[0125] Through the above embodiments, the physical prior knowledge of ultrasound imaging is encoded into the network initialization by designing physically guided convolutional layers. This method guides the network to prioritize learning the more reliable axial structures in ultrasound images. Compared to standard convolution which treats all directions equally, it can more effectively capture and reconstruct the blurred boundaries of thyroid nodules, thereby improving segmentation accuracy.
[0126] The above embodiments also involve a noise-adaptive channel attention module, which establishes a novel attention paradigm of "cleaning first and then focusing". This module can explicitly learn and suppress speckle noise in ultrasound images, and then calculate channel importance based on the cleaned features. Compared with the traditional method of directly calculating attention on noisy features, it is more robust and can significantly reduce segmentation errors and internal holes caused by noise interference.
[0127] In the above embodiments, the aforementioned innovations are systematically integrated into the enhanced residual module to construct a complete U-shaped segmentation network, and a deep supervised training strategy is employed for optimized training. This systematic design, from the core module to the overall architecture and training strategy, forms a complete end-to-end high-performance segmentation solution capable of accurately and rapidly segmenting ultrasound thyroid nodules of different shapes, sizes, and noise levels.
[0128] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A method for processing ultrasound images of thyroid nodules, characterized in that, include: Acquire training data, wherein the training data is ultrasound images in which thyroid nodules have been identified; A segmentation network for segmenting thyroid nodules from ultrasound images is constructed. The segmentation network includes an encoder and a decoder. The encoder and decoder include a computation unit. The computation unit includes a physical prior module and a noise adaptive module. The physical prior module is used to process the weights of various parts in the ultrasound image. The noise adaptive module is used to generate a feature that replaces the noise in the ultrasound image with global features, thereby reducing the influence of the noise in the ultrasound image. The segmentation network is trained using the training data to obtain a converged segmentation network; The ultrasound image to be segmented is input into the segmentation network, and the segmentation network outputs the segmented thyroid nodules.
2. The method according to claim 1, characterized in that, Obtaining the training data includes: A collection of ultrasound images of thyroid nodules, wherein the collection includes multiple ultrasound images of thyroid nodules; The ultrasound images in the set are preprocessed, wherein the preprocessing includes at least one of the following: adjusting the size of the ultrasound images, horizontally flipping, vertically flipping, randomly rotating, adjusting contrast, and adjusting brightness; The preprocessed ultrasound images are divided into a training set, a test set, and a validation set, wherein the training set is used as the training data.
3. The method according to claim 1, characterized in that, The physical prior module is used to process ultrasound images. For ultrasound images, the weight of the axial center row is increased to more than 100%, the weight of the adjacent rows is decreased to less than 100%, and the weight of the four corners of the convolution kernel is reduced to less than 100%. The weight of the four corners of the convolution kernel is lower than the weight of the adjacent rows.
4. The method according to claim 3, characterized in that, The physical prior module is used to process ultrasound images. For ultrasound images, the weight of the axial center row is increased to 200%, the weight of the adjacent rows is decreased to 80%, and the weight of the four corners of the convolution kernel is reduced to 50%.
5. The method according to claim 3, characterized in that, The noise adaptive module employs a three-step cascade: the first layer generates a pixel-level noise intensity map; the middle layer dynamically fuses local details and global background features based on the noise intensity; and the final layer calculates attention weights based on the ultrasound image after replacing the noise with global features.
6. The method according to claim 4, characterized in that, The segmentation network includes four encoders that extract features through bridging; four decoders that recover features using skip connections; and both encoders and decoders use an enhancement residual module, which includes one or more of the physical prior modules and one or more of the noise adaptation modules.
7. The method according to claim 1, characterized in that, The segmentation network is trained using the training data to obtain a converged segmentation network, including: When training the segmentation network, a weighted sum of Dice loss and Focal loss is used as the loss function. When the loss function meets the requirements, the converged segmentation network is obtained. The Dice loss is a loss function based on set similarity measurement, and the Focal loss is a loss function with a coefficient factor added to the standard cross-entropy loss.
8. A thyroid nodule ultrasound image processing system, characterized in that, The system is a software system, which is used to execute the method according to any one of claims 1 to 7.
9. An electronic device comprising a memory and a processor; wherein, The memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the steps of the method according to any one of claims 1 to 7.
10. A readable storage medium having computer instructions stored thereon, wherein, When executed by a processor, the computer instructions implement the steps of the method described in any one of claims 1 to 7.