A method and system for intelligent segmentation of transrectal ultrasound images of the prostate.

By combining the region adaptive Transformer module and the Patch fusion module, the time-consuming and accuracy problems of transrectal ultrasound image segmentation of the prostate are solved, achieving efficient and accurate prostate segmentation and enhancing the model's generalization ability.

CN120198447BActive Publication Date: 2025-11-14JINAN UNIVERSITY +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510108958.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-23
Publication Date
2025-11-14
Estimated Expiration
2045-01-23

AI Technical Summary

Technical Problem

Existing transrectal ultrasound image segmentation methods for the prostate are time-consuming and labor-intensive, lack objectivity, and the methods based on convolutional neural networks are not accurate enough in dealing with noise and artifacts, and have weak global modeling capabilities and are difficult to generalize.

Method used

A region-adaptive Transformer module is adopted, which performs adaptive self-attention calculation by calculating the scale coefficient τ of the feature sequence. Combining global and local self-attention, the segmentation capability is enhanced by skip connections and patch fusion modules, and an encoder and decoder are constructed to achieve efficient segmentation.

Benefits of technology

It improves the accuracy and generalization ability of prostate segmentation, reduces computational complexity, maintains the ability to recognize interference information and prostate shape, and outputs feature maps containing rich global and local information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120198447B_ABST
    Figure CN120198447B_ABST
Patent Text Reader

Abstract

This invention discloses an intelligent segmentation method and system for transrectal ultrasound images of the prostate (TRUS). The method includes: segmenting the TRUS image to be segmented and projecting it onto a channel; sequentially performing downsampling, normalization, and linear layer processing, repeating N-1 times to obtain N feature sequences; calculating the scaling factor τ of each feature sequence, and generating triples from the feature sequences to perform adaptive self-attention calculation; and sampling and concatenating the Nth feature sequence with the previous N-1 feature sequences passed through skip connections at each level, and inputting the concatenation into an upsampling layer and a convolutional layer to obtain the final segmentation result. This invention achieves adaptive operation by calculating the scaling factor τ of the current sequence complexity, avoiding loss of model flexibility, and utilizes a patch fusion module to receive global information from the encoder as additional input, avoiding continuous convolution from destroying the contextual information extracted by the converter, thus maintaining a high ability to recognize interference problems and various prostate shapes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical field of prostate ultrasound image segmentation, specifically relating to an intelligent segmentation method and system for transrectal ultrasound images of the prostate. Background Technology

[0002] Globally, prostate cancer is the fourth most common cancer and the second most common cancer in men. Transrectal ultrasound (TRUS) is one of the effective methods for early screening and diagnosis of prostate cancer. Accurate segmentation of the prostate from TRUS images is crucial for computer-aided prostate cancer diagnosis. However, manual prostate segmentation is time-consuming and labor-intensive, and the results lack objectivity. With the rapid development of convolutional neural networks, many deep learning-based prostate segmentation methods have been proposed.

[0003] Traditional segmentation methods are based on shallow features of the prostate gland, thus only extracting weak semantic information. This makes it difficult to handle issues such as speckle noise and various artifacts in TRUS images. Segmentation methods based on Convolutional Neural Networks (CNNs) utilize edge features in different channels to enhance the prostate's edge features, but they have limitations in recognizing interference information and various prostate shapes. Although CNNs can solve some problems (e.g., low signal-to-noise ratio and contrast), their global modeling capabilities are weak, making accurate gland segmentation challenging in the face of complex interference. Transformers possess powerful global modeling capabilities, and segmentation methods based on improved Transformers learn inductive biases in large-scale data. However, these methods require additional pre-trained models, leading to significant computational complexity and a loss of model flexibility, and they do not generalize well with small datasets. Summary of the Invention

[0004] The main objective of this invention is to overcome the shortcomings and deficiencies of the prior art and provide an intelligent segmentation method and system for transrectal ultrasound images of the prostate, which can accurately segment prostate TRUS images and effectively perform computer-aided diagnosis of prostate cancer.

[0005] To achieve the above objectives, the present invention adopts the following technical solution:

[0006] One aspect of the present invention provides a method for intelligent segmentation of transrectal ultrasound images of the prostate, comprising the following steps:

[0007] Encoding phase:

[0008] The TRUS image to be segmented is segmented and projected onto the channels;

[0009] The image projected onto the channel is sequentially downsampled, normalized, and processed by a linear layer, and this process is repeated N-1 times to obtain N feature sequences of different sizes.

[0010] Calculate the scaling factor τ for each feature sequence, and perform adaptive self-attention calculation on the generated triples of the feature sequences. When the scaling factor τ is lower than the threshold T, global self-attention calculation is performed, and when the scaling factor τ is higher than the threshold T, local self-attention calculation is performed.

[0011] The adaptive self-attention calculation results of the first N-1 feature sequences are passed to the corresponding level of the decoding stage through skip connections, and the adaptive self-attention calculation result of the Nth feature sequence is output as the encoding result.

[0012] Decoding phase:

[0013] Based on the encoding result and the adaptive self-attention calculation result of the first N-1 feature sequences passed through skip connections, the samples are sampled and concatenated level by level to reshape the feature map;

[0014] The feature map is sequentially input into the upsampling layer and the convolutional layer for feature extraction to obtain the final segmentation result.

[0015] As a preferred technical solution, the calculation of the scaling coefficient τ for each feature sequence is specifically as follows:

[0016] ;

[0017] Where τ is the scaling factor, used to characterize the ratio of computational complexity between global and local self-attention; H and W are the height and width of the feature map, C is the dimension of the feature map, and M is the window size.

[0018] As a preferred technical solution, the adaptive self-attention calculation specifically includes:

[0019] ;

[0020] ;

[0021] Where LN represents normalization, A-MSA(·) represents multi-head self-attention computation, and z i-1 This represents the feature output by the previous layer. The z represents the feature output by the multi-head self-attention layer, MLP(·) represents the computation performed by the multilayer perceptron module. i The features output by the multilayer perceptron module; the multi-head self-attention calculation specifically includes:

[0022] Generate triples {key, query, value} from the feature sequence and use three learnable parameter matrices W. q Wk and W v To calculate the triple {key, query, value}, use the following formula:

[0023] Q=z i-1 W q ;

[0024] K=z i-1 W k ;

[0025] V=z i-1 W v ;

[0026] ;

[0027] Where Q, K, and V are the calculated query matrix, key matrix, and value matrix, respectively; Softmax(·) is the Softmax activation function; d is the feature dimension; B is the relative position deviation; and T is the threshold.

[0028] As a preferred technical solution, when performing global self-attention calculation, Q,K,V,B∈R HW×d When performing local self-attention computation, Q,K,V,B∈R (M^2)×d M is the window size.

[0029] As a preferred technical solution, the adaptive self-attention calculation results based on the encoding result and the first N-1 feature sequences passed through skip connections are sampled and concatenated level by level to reshape a feature map, specifically as follows:

[0030] Repeat the following steps N-1 times to obtain the reshaped feature map:

[0031] The encoded result is upsampled and concatenated with the adaptive self-attention calculation result of the feature sequence of the previous dimension, which is passed through skip connections and whose sequence format has been transformed; the concatenated result is then convolved to match the dimension.

[0032] Another aspect of the present invention provides an intelligent segmentation system for transrectal ultrasound images of the prostate, comprising an encoder and a decoder. The encoder includes an embedding layer and N region adaptive Transformer modules. The decoder includes a Patch fusion module, an upsampling layer, and a convolutional layer connected in sequence.

[0033] The embedding layer is used to extract N feature sequences of different sizes from the TRUS image to be segmented, and connects them to N region adaptive Transformer modules respectively.

[0034] The region adaptive Transformer module includes sequentially connected multi-head self-attention and multilayer perceptron modules for adaptive self-attention calculation on feature sequences. The adaptive self-attention calculation results of the first N-1 feature sequences are passed to the corresponding level of the decoder through skip connections, and the adaptive self-attention calculation result of the Nth feature sequence is output as the encoding result. The adaptive self-attention calculation specifically involves: calculating the scale coefficient τ of the feature sequence; performing global self-attention calculation when the scale coefficient τ is lower than the threshold T; and performing local self-attention calculation when the scale coefficient τ is higher than the threshold T.

[0035] The Patch fusion module is used to sample and concatenate the encoding result and the adaptive self-attention calculation result of the first N-1 feature sequences passed through skip connections level by level, and reshape them into a feature map;

[0036] The convolutional layer is used to extract features from the feature map to obtain the final segmentation result.

[0037] As a preferred technical solution, the embedding layer includes a segmentation layer, a linear projection layer, and N-1 feature sequence layers connected in sequence; the segmentation layer is used to uniformly segment the TRUS image to be segmented; the linear projection layer is used to project the image obtained by the segmentation layer onto the channel; the feature sequence layer includes a downsampling layer, a normalization layer, and a linear layer, used to extract feature sequences of different sizes.

[0038] As a preferred technical solution, the region adaptive Transformer module is configured to perform the following calculations:

[0039] ;

[0040] Where τ is the scaling factor, used to characterize the ratio of computational complexity between global and local self-attention; H and W are the height and width of the feature map, C is the dimension of the feature map, and M is the window size;

[0041] The multi-head self-attention is configured to perform the following calculations:

[0042] ;

[0043] ;

[0044] Where LN represents normalization, z i-1 This represents the feature output by the previous layer. This represents the feature output of the current layer's multi-head self-attention; A-MSA(·) represents the multi-head self-attention computation; Softmax(·) is the Softmax activation function; d is the feature dimension; B is the relative position bias; T is the threshold; Q, K, and V are the computed query matrix, key matrix, and value matrix, respectively, using three learnable parameter matrices W. q W k and W v The calculation is as follows:

[0045] Q=z i-1 W q ;

[0046] K=z i-1 W k ;

[0047] V=z i-1 W v ;

[0048] When the scaling factor τ is below the threshold T, and global self-attention is calculated, Q,K,V,B∈R HW×d When the scaling factor τ is higher than the threshold T, local self-attention is calculated, Q,K,V,B∈R. (M^2)×d ;

[0049] The multilayer perceptron module is configured to perform the following calculations:

[0050] ;

[0051] Where MLP(·) represents the computation performed by the multilayer perceptron module, z i Features output by the multilayer perceptron module.

[0052] As a preferred technical solution, the patch fusion module is configured with N-1 sequentially connected modules, and each patch fusion module is configured to perform the following steps:

[0053] The feature sequence of the encoding result or the output of the previous Patch fusion module is upsampled and concatenated with the adaptive self-attention calculation result of the feature sequence of the previous dimension from the encoder, which is passed through skip connections and the sequence format is transformed. The concatenated result is processed by a convolutional layer to match the dimension, and the output of the Patch fusion module at this level is obtained.

[0054] As a preferred technical solution, the convolutional layers all incorporate locality, spatial invariance, and inductive bias of the hierarchical structure.

[0055] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0056] (1) The Region Adaptive Transformer (RAT) module of the present invention realizes adaptive operation by calculating the scaling coefficient τ of the current sequence complexity. It adopts local self-attention for low computational complexity to reduce computational complexity and avoid loss of model flexibility.

[0057] (2) The present invention constructs a hierarchical structure of the corresponding encoder and introduces inductive biases such as locality and spatial invariance in convolutions at different levels, thereby enhancing the generalization ability of the entire model to TRUS image data.

[0058] (3) The present invention utilizes the Patch fusion module to receive global information from the encoder as additional input, avoiding continuous convolution from destroying the context information extracted by the converter, and ensuring that the network can not only reduce data requirements, but also maintain a high ability to identify interference problems and various prostate shapes. Attached Figure Description

[0059] Figure 1 This is an image segmentation flowchart of an intelligent segmentation method for transrectal ultrasound images of the prostate, according to an embodiment of the present invention.

[0060] Figure 2 This is a schematic diagram of the structure of a transrectal ultrasound image intelligent segmentation system for the prostate, according to an embodiment of the present invention.

[0061] Figure 3 This is a schematic diagram comparing the qualitative results of a transrectal ultrasound image intelligent segmentation system for the prostate with other segmentation models in a prostate segmentation task, according to an embodiment of the present invention. Detailed Implementation

[0062] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of the present application, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without creative effort are within the scope of protection of the present application.

[0063] Example 1:

[0064] like Figure 1 As shown, this embodiment provides an intelligent segmentation method for transrectal ultrasound images of the prostate, including the following steps:

[0065] S1, Encoding stage, such as Figure 1 The left half is shown.

[0066] S1.1 In the encoder, the embedding layer will segment the TRUS image to be segmented ( The data is evenly divided and then projected onto the channel through a linear projection layer. The current layer is the first layer. Based on this, downsampling is performed, and after normalization and linear layer processing, the second layer is constructed. Following the above method, an N-level hierarchical structure is constructed through N-1 downsampling layers to provide N feature sequences of different sizes for subsequent processing, thereby providing global context information.

[0067] S1.2 The present invention achieves adaptive operation through a simple but effective threshold constraint method. For the input feature sequence, the scaling coefficient τ of each feature sequence is first calculated, and then the feature sequence is used to generate triples to perform adaptive self-attention calculation. When the scaling coefficient τ is lower than the threshold T, global self-attention calculation is performed, and when the scaling coefficient τ is higher than the threshold T, local self-attention calculation is performed to achieve low computational complexity.

[0068] (1) Calculation of the scaling factor τ of the feature sequence:

[0069] ;

[0070] Where τ is the scaling factor, used to characterize the ratio of computational complexity between global and local self-attention; H and W are the height and width of the feature map, C is the dimension of the feature map, and M is the window size.

[0071] (2) Adaptive self-attention calculation:

[0072] ;

[0073] ;

[0074] Where LN represents normalization, z i-1 This represents the feature output by the previous layer. This represents the feature output by the multi-head self-attention layer; MLP(·) represents the computation performed by the multilayer perceptron module in the traditional Vision Transformer (VIT) module, z i The features output by the multilayer perceptron module; A-MSA(·) represents multi-head self-attention computation, which generates triples {key, query, value} on the feature sequence and uses three learnable parameter matrices W. q W k and W v To calculate the triple {key, query, value}, the interference problem in prostate segmentation is solved by establishing relationships between different objects (distinguishing between interference objects and the prostate) and different pixels within the target (identifying different prostate shapes), as shown in the following formula:

[0075] Q=z i-1 W q ;

[0076] K=z i-1 W k ;

[0077] V=z i-1 W v ;

[0078] ;

[0079] Where Q, K, and V are the calculated query matrix, key matrix, and value matrix, respectively, Softmax(·) is the Softmax activation function, d is the feature dimension, B is the relative position deviation, and T is the threshold.

[0080] Furthermore, when the scaling factor τ is below the threshold T, and global self-attention is calculated, Q,K,V,B∈R HW ×d When the scaling factor τ is higher than the threshold T, local self-attention is calculated, Q,K,V,B∈R. (M^2)×d .

[0081] S1.3. The adaptive self-attention calculation results of the first N-1 feature sequences (containing global context information) are passed to the corresponding level of the decoding stage through skip connections, and the adaptive self-attention calculation result of the Nth feature sequence is output as the encoding result.

[0082] S2, Decoding stage, such as Figure 1 The right half is shown:

[0083] S2.1. Based on the encoding result and the adaptive self-attention calculation result of the first N-1 feature sequences passed through skip connections, the samples are sampled and concatenated level by level to reshape the feature map, specifically as follows:

[0084] Repeat the following steps N-1 times to obtain the reshaped feature map:

[0085] The encoded result is upsampled and concatenated with the adaptive self-attention calculation result of the feature sequence of the previous dimension, which is passed through skip connections and whose sequence format has been transformed; the concatenated result is then convolved to match the dimension.

[0086] By leveraging the local advantages of multiple convolutional layers, rich local features can be extracted. However, to avoid the neglect and destruction of global contextual information by continuous convolution, and to ensure that the network can not only reduce data requirements but also maintain a high ability to identify interference problems and various prostate shapes, this invention adopts a skip connection approach. In the decoding stage, global information from the encoding stage is received as additional input for full fusion, and the fused feature dimension image is reduced, resulting in a feature map containing rich global and local information as output.

[0087] S2.2. Input the feature map obtained in step S2.1 into the upsampling layer and convolutional layer in sequence for feature extraction to obtain the final segmentation result.

[0088] Furthermore, the convolutional layers used to convolve the stitched results in step S2.1, as well as the convolutional layers in step S2.2, all introduce locality, spatial invariance, and hierarchical inductive bias. The inductive biases of different levels of convolutional layers are different to enhance the generalization ability of the entire model to TRUS image data.

[0089] As a preferred technical solution, N is set to 4.

[0090] Example 2:

[0091] like Figure 2 As shown in this embodiment, a transrectal ultrasound image intelligent segmentation system for the prostate is provided, which includes an encoder and a decoder.

[0092] (a) The encoder includes an embedding layer and N region adaptive Transformer modules (also known as region adaptive converter modules); the decoder includes N-1 patch fusion modules (also known as block fusion modules), an upsampling layer and a convolutional layer.

[0093] The embedding layer is used to extract N feature sequences of different sizes from the TRUS image to be segmented, and connects them to N region adaptive Transformer modules respectively.

[0094] Furthermore, the embedding layer includes a segmentation layer, a linear projection layer, and N-1 feature sequence layers connected in sequence; the segmentation layer is used to uniformly segment the TRUS image to be segmented; the linear projection layer is used to project the image obtained by the segmentation layer onto the channel; the feature sequence layer includes a downsampling layer, a normalization layer, and a linear layer, used to extract feature sequences of different sizes.

[0095] The region-adaptive Transformer module includes a multi-head self-attention (A-MSA) module and a multilayer perceptron (MLP) module, which are used to perform adaptive self-attention calculation on the feature sequences. The adaptive self-attention calculation results of the first N-1 feature sequences are passed to the corresponding level of the decoder through skip connections, and the adaptive self-attention calculation result of the Nth feature sequence is output as the encoding result. The adaptive self-attention calculation is specifically as follows: the scale coefficient τ of the feature sequence is calculated. When the scale coefficient τ is lower than the threshold T, global self-attention calculation is performed. When the scale coefficient τ is higher than the threshold T, local self-attention calculation is performed.

[0096] Furthermore, the region-adaptive Transformer module is configured to perform the following calculations:

[0097] ;

[0098] Where τ is the scaling factor, used to characterize the ratio of computational complexity between global and local self-attention; H and W are the height and width of the feature map, C is the dimension of the feature map, and M is the window size;

[0099] Furthermore, the multi-head self-attention is configured to perform the following calculations:

[0100] ;

[0101] ;

[0102] Where LN represents normalization, z i-1 This represents the feature output by the previous layer. This represents the feature output of the current layer's multi-head self-attention; A-MSA(·) represents the multi-head self-attention computation; Softmax(·) is the Softmax activation function; d is the feature dimension; B is the relative position bias; T is the threshold; Q, K, and V are the computed query matrix, key matrix, and value matrix, respectively, using three learnable parameter matrices W. q W k and W v The calculation is as follows:

[0103] Q=z i-1 W q ;

[0104] K=z i-1 W k ;

[0105] V=z i-1 W v ;

[0106] When the scaling factor τ is below the threshold T, and global self-attention is calculated, Q,K,V,B∈R HW×d When the scaling factor τ is higher than the threshold T, local self-attention is calculated, Q,K,V,B∈R. (M^2)×d ;

[0107] Furthermore, the multilayer perceptron module is configured to perform the following calculations:

[0108] ;

[0109] Where MLP(·) represents the computation performed by the multilayer perceptron module, z iFeatures output by the multilayer perceptron module.

[0110] (b) The Patch fusion module is used to sample and splice the encoding result and the adaptive self-attention calculation result of the first N-1 feature sequences passed through the skip connection level by level, and reshape them into a feature map.

[0111] Furthermore, the patch fusion module is configured with N-1 sequentially connected modules, and each patch fusion module is configured to perform the following steps:

[0112] The feature sequence of the encoding result or the output of the previous Patch fusion module is upsampled and concatenated with the adaptive self-attention calculation result of the feature sequence of the previous dimension from the encoder, which is passed through skip connections and the sequence format is transformed. The concatenated result is processed by a convolutional layer to match the dimension, and the output of the Patch fusion module at this level is obtained.

[0113] The convolutional layer is used to extract features from the feature map to obtain the final segmentation result.

[0114] Furthermore, each convolutional layer incorporates locality, spatial invariance, and hierarchical inductive bias, with different inductive biases at different levels of convolutional layers, to enhance the overall model's generalization ability to TRUS image data.

[0115] As a preferred technical solution, N is set to 4.

[0116] It should be noted that the system provided in this embodiment is only an example of the above-described division of functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure can be divided into different functional modules to complete all or part of the functions described above. This system can be applied to a transrectal ultrasound image intelligent segmentation method for the prostate in the above embodiment.

[0117] Example 3:

[0118] To enable those skilled in the art to better understand the technical solution and excellent results achieved in this application, this embodiment uses a clinical prostate TRUS image dataset collected by the First Affiliated Hospital of Jinan University to train and evaluate a transrectal ultrasound image intelligent segmentation system for the prostate described in the above embodiment.

[0119] The clinical prostate TRUS image dataset contains 1,000 TRUS images from 135 patients.

[0120] (1) Experimental operating environment, operating equipment and training parameter settings.

[0121] This embodiment was tested using Ubuntu 20.04.2, Python 3.8.12, and PyTorch 1.10.1. All training processes were run on an Nvidia GeForce RTX 2080Ti GPU with 11GB of memory. The learning rate was set to 0.01, the learning rate scheduler used a "Poly" decay policy with a power parameter of 0.9, the optimizer was SGD, the momentum was set to 0.99, the weight decay was set to 3e-5, the number of training epochs was 1500, and the batch size was 8 / GPU. This embodiment uses cross-entropy loss as the loss function.

[0122] (2) Comparison of experimental results.

[0123] This embodiment compares six advanced segmentation methods on a dataset to verify the segmentation performance of the present invention (hereinafter referred to as TCF-Net). CNN-based segmentation methods include U-Net, UNet++, and Attention U-Net (Att UNet). Transformer-based segmentation methods include UNext, TransUNet, and ScaleFormer.

[0124] (2.1) The comparative experimental results with other advanced segmentation methods are shown in Table 1. The indicators for measuring computational complexity are Params (parameters) and FLOPs (floating point operations). The performance indicators and results of the segmentation model are mIoU (mean intersection over union), DSC (Dice similarity coefficient) and PA (pixel accuracy). Among them, the TCF-Net of this invention has a mean intersection over union (mIoU) of 94.4%, a Dice similarity coefficient (DSC) of 95.5%, and a pixel accuracy (PA) of 97.9%, all of which are better than the six segmentation methods used for comparison.

[0125] ;

[0126] Table 1. Comparison of computational complexity and segmentation performance between the present invention and other segmentation methods.

[0127] (2.2) Visualization results. For example... Figure 3 As shown, the boxes highlight key regions in the TRUS image to better visualize the differences between different segmentation predictions.

[0128] The experimental results based on (2.1) and (2.2) were compared to verify the effectiveness of the present invention in segmenting prostate TRUS images.

[0129] Example 4:

[0130] This embodiment provides a storage medium storing a program. When the program is executed by a processor, it implements a method for intelligent segmentation of transrectal ultrasound images of the prostate, as described in the above embodiment. Specifically, the method is as follows:

[0131] Encoding phase:

[0132] The TRUS image to be segmented is segmented and projected onto the channels;

[0133] The image projected onto the channel is sequentially downsampled, normalized, and processed by a linear layer, and this process is repeated N-1 times to obtain N feature sequences of different sizes.

[0134] Calculate the scaling factor τ for each feature sequence, and perform adaptive self-attention calculation on the generated triples of the feature sequences. When the scaling factor τ is lower than the threshold T, global self-attention calculation is performed, and when the scaling factor τ is higher than the threshold T, local self-attention calculation is performed.

[0135] The adaptive self-attention calculation results of the first N-1 feature sequences are passed to the corresponding level of the decoding stage through skip connections, and the adaptive self-attention calculation result of the Nth feature sequence is output as the encoding result.

[0136] Decoding phase:

[0137] Based on the encoding result and the adaptive self-attention calculation result of the first N-1 feature sequences passed through skip connections, the samples are sampled and concatenated level by level to reshape the feature map;

[0138] The feature map is sequentially input into the upsampling layer and the convolutional layer for feature extraction to obtain the final segmentation result.

[0139] Example 5:

[0140] This embodiment provides a computer device, which includes a memory and at least one processor. The memory stores instructions, and the memory and the at least one processor are interconnected via a circuit. The at least one processor invokes the instructions in the memory to cause the computer device to execute a method for intelligent segmentation of transrectal ultrasound images of the prostate as described in the above embodiment.

[0141] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0142] The above embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above embodiments. Any changes, modifications, substitutions, combinations, or simplifications made without departing from the spirit and principle of the present invention shall be considered equivalent substitutions and shall be included within the protection scope of the present invention.

Claims

1. A method for intelligent segmentation of transrectal ultrasound images of the prostate, characterized in that, Includes the following steps: Encoding phase: The TRUS image to be segmented is segmented and projected onto the channels; The image projected onto the channel is sequentially downsampled, normalized, and processed by a linear layer, and this process is repeated N-1 times to obtain N feature sequences of different sizes. Calculate the scaling factor τ for each feature sequence, and perform adaptive self-attention calculation on the generated triples of the feature sequences. Specifically, global self-attention calculation is performed when the scaling factor τ is below a threshold T, and local self-attention calculation is performed when the scaling factor τ is above the threshold T. The calculation of the scaling factor τ for each feature sequence is as follows: Where τ is the scaling factor, used to characterize the ratio of computational complexity between global and local self-attention; H and W are the height and width of the feature map, C is the dimension of the feature map, and M is the window size; The adaptive self-attention calculation results of the first N-1 feature sequences are passed to the corresponding level of the decoding stage through skip connections, and the adaptive self-attention calculation result of the Nth feature sequence is output as the encoding result. Decoding phase: The encoding result and the adaptive self-attention calculation result of the first N-1 feature sequences passed through skip connections are sampled and concatenated level by level to reshape a feature map; The feature map is sequentially input into the upsampling layer and the convolutional layer for feature extraction to obtain the final segmentation result.

2. The intelligent segmentation method for transrectal ultrasound images of the prostate according to claim 1, characterized in that, The adaptive self-attention calculation specifically involves: ; ; Where LN represents normalization, A-MSA(·) represents multi-head self-attention computation, and z i-1 This represents the feature output by the previous layer. The z represents the feature output by the multi-head self-attention layer, MLP(·) represents the computation performed by the multilayer perceptron module. i The features output by the multilayer perceptron module; the multi-head self-attention calculation specifically includes: Generate triples {key, query, value} from the feature sequence and use three learnable parameter matrices W. q W k and W v To calculate the triple {key, query, value}, use the following formula: Q=z i-1 W q ; K=z i-1 IN k ; V=z i-1 W v ; ; Where Q, K, and V are the calculated query matrix, key matrix, and value matrix, respectively; Softmax(·) is the Softmax activation function; d is the feature dimension; B is the relative position deviation; and T is the threshold.

3. The intelligent segmentation method for transrectal ultrasound images of the prostate according to claim 2, characterized in that, When performing global self-attention calculations, Q,K,V,B∈R HW×d When performing local self-attention computation, Q,K,V,B∈R (M ^2)×d M is the window size.

4. The intelligent segmentation method for transrectal ultrasound images of the prostate according to claim 1, characterized in that, The adaptive self-attention calculation results based on the encoding result and the first N-1 feature sequences passed through skip connections are sampled and concatenated level by level to reshape a feature map, specifically: Repeat the following steps N-1 times to obtain the reshaped feature map: The encoded result is upsampled and concatenated with the adaptive self-attention calculation result of the feature sequence of the previous dimension, which is passed through skip connections and whose sequence format has been transformed; the concatenated result is then convolved to match the dimension.

5. A transrectal ultrasound image intelligent segmentation system for the prostate, comprising an encoder and a decoder, characterized in that, The encoder includes an embedding layer and N region adaptive Transformer modules; the decoder includes a Patch fusion module, an upsampling layer and a convolutional layer connected in sequence. The embedding layer is used to extract N feature sequences of different sizes from the TRUS image to be segmented, and connects them to N region adaptive Transformer modules respectively. The region-adaptive Transformer module includes sequentially connected multi-head self-attention and multi-layer perceptron modules for adaptive self-attention calculation on the feature sequences. The adaptive self-attention calculation results of the first N-1 feature sequences are passed to the corresponding level of the decoder via skip connections, and the adaptive self-attention calculation result of the Nth feature sequence is output as the encoding result. Specifically, the adaptive self-attention calculation involves calculating the scale coefficient τ of the feature sequences. When the scale coefficient τ is lower than a threshold T, global self-attention calculation is performed; when the scale coefficient τ is higher than the threshold T, local self-attention calculation is performed. The calculation of the scale coefficient τ of the feature sequences is specifically as follows: Where τ is the scaling factor, used to characterize the ratio of computational complexity between global and local self-attention; H and W are the height and width of the feature map, C is the dimension of the feature map, and M is the window size; The Patch fusion module is used to sample and concatenate the encoding result and the adaptive self-attention calculation result of the first N-1 feature sequences passed through skip connections level by level, and reshape them into a feature map; The convolutional layer is used to extract features from the feature map to obtain the final segmentation result.

6. The intelligent segmentation system for transrectal ultrasound images of the prostate according to claim 5, characterized in that, The embedding layer includes a segmentation layer, a linear projection layer, and N-1 feature sequence layers connected in sequence; the segmentation layer is used to uniformly segment the TRUS image to be segmented; the linear projection layer is used to project the image obtained by the segmentation layer onto the channel; the feature sequence layer includes a downsampling layer, a normalization layer, and a linear layer, used to extract feature sequences of different sizes.

7. The intelligent segmentation system for transrectal ultrasound images of the prostate according to claim 5, characterized in that, The multi-head self-attention is configured to perform the following calculations: ; ; Where LN represents normalization, z i-1 This represents the feature output by the previous layer. This represents the feature output of the current layer's multi-head self-attention; A-MSA(·) represents the multi-head self-attention computation; Softmax(·) is the Softmax activation function; d is the feature dimension; B is the relative position bias; T is the threshold; Q, K, and V are the computed query matrix, key matrix, and value matrix, respectively, using three learnable parameter matrices W. q W k and W v The calculation is as follows: Q=z i-1 W q ; K=z i-1 IN k ; V=z i-1 W v ; When the scaling factor τ is below the threshold T, and global self-attention is calculated, Q,K,V,B∈R HW×d When the scaling factor τ is higher than the threshold T, local self-attention is calculated, Q,K,V,B∈R. (M^2)×d ; The multilayer perceptron module is configured to perform the following calculations: ; Where MLP(·) represents the computation performed by the multilayer perceptron module, z i Features output by the multilayer perceptron module.

8. The intelligent segmentation system for transrectal ultrasound images of the prostate according to claim 5, characterized in that, The patch fusion module is configured to have N-1 sequentially connected modules, and each patch fusion module is configured to perform the following steps: The feature sequence of the encoding result or the output of the previous Patch fusion module is upsampled and concatenated with the adaptive self-attention calculation result of the feature sequence of the previous dimension from the encoder, which is passed through skip connections and the sequence format is transformed. The concatenated result is processed by a convolutional layer to match the dimension, and the output of the Patch fusion module at this level is obtained.

9. A transrectal ultrasound image intelligent segmentation system for the prostate according to claim 8, characterized in that, The convolutional layers all incorporate locality, spatial invariance, and inductive bias of the hierarchical structure.

Citation Information

Patent Citations

  • Lightweight multi-scale feature fusion real-time image semantic segmentation method and system

    CN114445430A

  • Prostate MRI (Magnetic Resonance Imaging) image segmentation method and system based on adaptive multi-scale Transform optimization

    CN115272170A