A method and system for three-dimensional reconstruction of medical ultrasound images based on SDF diffusion
By introducing the SDF diffusion model and cross-attention fusion technology into the three-dimensional reconstruction of ultrasound images, the problems of complex equipment and complex calculations in the existing technology are solved, and efficient and high-precision three-dimensional reconstruction effects are achieved.
Patent Information
- Application Number
- CN202410917497.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-10
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-07-10
AI Technical Summary
Existing three-dimensional reconstruction methods for ultrasound images have problems such as complex equipment, complex calculations, long time consumption, and average accuracy. In particular, additional equipment is required to determine the trajectory and direction of the probe, and the amount of data is large, which affects the efficiency and accuracy of reconstruction.
A three-dimensional reconstruction method of medical ultrasound images based on SDF (Signed Distance Field) diffusion is used to randomly initialize the SDF field, combine the diffusion model to perform forward and reverse diffusion processes, and use the state space model and cross attention to fuse ultrasound image features. Finally, The three-dimensional mesh model is extracted through the marching cube algorithm.
It achieves fast and high-precision three-dimensional reconstruction of ultrasound images, reduces dependence on additional equipment and complex algorithms, and improves reconstruction speed and accuracy.
Smart Images

Figure CN118470222B
Abstract
Description
Technical Field
[0001] The invention relates to a method and system for three-dimensional reconstruction of medical ultrasonic images based on SDF diffusion, and belongs to the technical field of computer vision. Background Art
[0002] Ultrasound image 3D reconstruction refers to the process of acquiring and processing a series of 2D ultrasound image data to ultimately generate 3D anatomical structure images or volume data, which has important clinical significance and application value. The 3D shape of an object can be expressed in a variety of forms, such as voxels, point clouds, grids, etc. Voxel-based representation methods can use 3D convolutional neural networks (CNNs), which can reconstruct objects with arbitrary topological structures. However, the huge memory requirements and computing time limit most methods to high-resolution reconstruction results, so ultra-high precision reconstruction cannot be achieved. Point cloud representation is relatively simple and highly flexible, but because point clouds are not regular structures, they cannot adapt well to traditional 3D CNN networks. Similarly, the network can represent 3D shapes with high precision, but it is also discrete and cannot be well represented by traditional neural networks.
[0003] Diffusion denoising probabilistic model is a class of generative models based on iterative inversion of Markov noise process. In vision, early works formulated the problem as learning variational lower bounds, or framed it as optimizing score-based generative models or discretization of continuous random processes. Many recent works have shown the great potential of diffusion models in content generation tasks, so using diffusion for 3D reconstruction tasks will also give full play to the advantages of the model.
[0004] In the field of three-dimensional reconstruction of ultrasound images, traditional methods include position sensor-based methods, which use position sensors (such as magnetic position sensors, optical position sensors, etc.) connected to the probe to track the position and posture of the probe in three-dimensional space in real time, and store the spatial position information of the two-dimensional ultrasound image when it is acquired. Then, based on this position information, multiple two-dimensional images are reconstructed into three-dimensional data. However, this method requires an external position sensor system, which greatly increases the complexity and cost of the system. There are also problems such as cable interference and probe occlusion that affect the accuracy. The method based on free hand scanning uses the motion trajectory of the operator's free movement of the ultrasound probe when scanning the human body surface and the scanning direction of the ultrasound beam to estimate the spatial position relationship of each two-dimensional image, thereby reconstructing three-dimensional data. However, it requires high-precision probe motion trajectory and beam direction estimation, which is not only complex in calculation but also has poor real-time performance. The method based on image registration extracts grayscale, gradient, feature and other information from a series of adjacent two-dimensional ultrasound images, performs registration through similarity measurement, estimates the geometric transformation relationship between images, and finally obtains three-dimensional data. However, it has high requirements on image quality and uniformity of grayscale distribution in the field of view, and its accuracy is easily affected and the calculation is complex.
[0005] By analyzing and summarizing the existing ultrasound 3D reconstruction methods, the existing methods have the following shortcomings: (1) Additional equipment or complex algorithms are required to determine the probe motion trajectory and direction, which increases the difficulty and cost of implementation. (2) The reconstruction process requires continuous ultrasound video or a series of continuous ultrasound images, which requires a large amount of data and complex calculations. (3) The reconstruction process is time-consuming and has average accuracy. Summary of the invention
[0006] The purpose of the present invention is to propose a medical ultrasound image three-dimensional reconstruction method based on SDF (Signed Distance Field) diffusion to improve the speed and accuracy of three-dimensional reconstruction of two-dimensional ultrasound images.
[0007] SDF is an implicit representation method of the three-dimensional shape of an object. The essence of SDF is to store the shortest distance from each point to the surface of the shape, that is, to draw a surface out of the model. The point values on the outside of the model surface are greater than 0, and the point values on the inside of the model surface are less than 0. SDF can be conveniently used in 3D convolutional networks, and can also be converted into a high-precision grid representation through the marching cube method.
[0008] In order to achieve the above-mentioned invention object, the specific technical scheme adopted by the present invention is as follows:
[0009] A method for three-dimensional reconstruction of medical ultrasound images based on SDF diffusion includes the following steps:
[0010] S1: Acquire medical ultrasound image data and extract features of the ultrasound image to guide the subsequent diffusion process;
[0011] S2: Randomly initialize the SDF field and set the SDF field Initialize randomly according to normal distribution. ;
[0012] S3: The diffusion model is used to perform the SDF diffusion process. The diffusion model includes two key processes: forward diffusion process and backward diffusion process. First, the state space model is used to fuse the voxel and ultrasound image features to obtain the voxel features after the fusion of ultrasound image features. Then, the cross attention is used to fuse the voxel features and ultrasound image features at a stage with a small voxel resolution.
[0013] S4: The mesh is extracted using marching cubes and the triangular mesh model guided by the ultrasound image is finally reconstructed.
[0014] Furthermore, in S1, a large amount of medical ultrasound image data is first used to train the visual model MedSAM (Medical Segment Anything Model), and then the trained MedSAM image encoder is used to extract features from the input single medical ultrasound image, and the output is mapped to a feature vector , which is used to guide the SDF to approach the image features in the subsequent diffusion process to achieve SDF 3D reconstruction of ultrasound images.
[0015] Furthermore, in S2, the SDF field is a continuous three-dimensional scene representation method, which regards a three-dimensional object or scene as a three-dimensional scalar field composed of distance values. Specifically, for any point in the scene, the SDF value is defined as the signed distance from the point to the surface of the object, that is, if the point is inside the object, the SDF value is the negative distance value from the point to the nearest surface; if the point is outside the object, the SDF value is the positive distance value from the point to the nearest surface; if the point is exactly on the surface of the object, the SDF value is 0.
[0016] Furthermore, the S3 specifically includes:
[0017] S3-1: The forward diffusion process is a process used during training. It gradually adds Gaussian noise to the data until it is completely destroyed and becomes pure noise with Gaussian distribution. This process can be represented by a Markov chain. A certain amount of Gaussian noise is added at each time step t until the final moment T, when the original data becomes pure noise. Given a data sample , forward process It gradually transforms the data samples into pure Gaussian noise:
[0018] (1);
[0019] in represents the sample at time step t, represents the sample of the previous time step, is the Gaussian transition probability:
[0020] (2);
[0021] in represents a normal distribution, represents the noise scheduling hyperparameter, which is a learnable coefficient or set to a constant; the forward process allows sampling at any time step t in a closed form :
[0022] (3);
[0023] in , ;therefore, Directly sample through the following formula:
[0024] (4);
[0025] Among them is a noise randomly sampled from a normal distribution.
[0026] S3-2: The reverse diffusion process occurs at the time of generation and aims to reconstruct the original data from pure noise samples, that is, the joint distribution , the reverse process is defined as a Markov chain with learned Gaussian transitions:
[0027] (5);
[0028] (6);
[0029] in is the standard normal distribution, Indicated by Parameterized denoising function, is a time step dependent variance, set to ;from Then, we draw the for:
[0030] (7);
[0031] (8);
[0032] in is a A parameterized neural network that starts with a noisy input By repeating this process, we can eventually generate ;
[0033] Therefore, the objective function compares the prediction noise With applied noise The difference between:
[0034] (9);
[0035] In addition, the neural network prediction Rather than noise To modify :
[0036] (10);
[0037] in, , , Is A parameterized neural network that predicts noise-free data ; In this case, the objective function becomes:
[0038] (11);
[0039] Specifically, given a clean data sample , according to formula (4) in the forward process, we sample the same shape :
[0040] (12);
[0041] Then, train a network To predict noise-free data, the MSE objective function is as follows:
[0042] (13);
[0043] Among them That is, the ultrasound image features extracted in S1;
[0044] During inference, the trained neural network is used go through The process of gradually predicting smaller noise samples according to formula (14) To generate new SDF voxels:
[0045] (14);
[0046] S3-3: The diffusion process uses a U-shaped network, where the voxel feature resolution of each layer is halved (for example: 64→32→16) and the channels are doubled; in order to make the object represented by the generated SDF field consistent with the ultrasound image, it is necessary to fuse the SDF features and the ultrasound image features during the diffusion process, so that the ultrasound image features guide the SDF diffusion process; at the top of the model, due to the large feature resolution, the voxel features are kept at a large order of magnitude, and the cross-attention cannot be directly used to fuse the voxel and ultrasound image features, so the state space model is used to process them;
[0047] The state space model is a mathematical model framework commonly used in time series analysis and control theory. It describes the evolution of a dynamic system as a combination of a state equation and an observation equation. Through a hidden state Map to , this system uses A as the evolution parameter, and B and C as the projection parameters:
[0048] (15);
[0049] (16);
[0050] The Mamba used is a discrete version of the continuous system, which includes a time scale parameter Convert continuous parameters A and B into discrete parameters , ; The commonly used transformation method is zero-order hold (ZOH), which is defined as follows:
[0051] (17);
[0052] (18);
[0053] exist , After discretization, formulas (15) and (16) can be expressed as:
[0054] (19);
[0055] (20);
[0056] Finally, the model calculates the output through global convolution:
[0057] (twenty one);
[0058] (twenty two);
[0059] where M is the length of the input sequence x, is a structured convolution kernel.
[0060] In order to apply it to the SDF diffusion process, the voxel features are expanded into one-dimensional features, and the time step t in S3-1 is linearly mapped to a one-dimensional feature of the same size as the voxel feature after sine and cosine transformation and added to the voxel feature. After linear mapping to the same number of channels as the voxel feature, it is connected with the voxel feature to obtain the input x of the SSM.
[0061] After the above-mentioned calculation by Mamba, the output y is obtained. After the voxel feature part is taken out, the one-dimensional sequence is reshaped back to the original shape of the voxel feature to obtain the voxel feature after fusion of the ultrasound image feature.
[0062] S3-4: After the voxel feature passes through the top of the model, it is downsampled to reduce the resolution of the voxel feature, increase the number of channels, and reduce the overall data volume. At the stage with smaller voxel resolution, cross attention is used to fuse the voxel feature and ultrasound image feature.
[0063] The attention function is described as mapping a query and a set of key-value pairs to an output, where the query, key, value, and output are all vectors, and the output is the weighted sum of the values. In practice, the attention function of a set of queries is calculated simultaneously, packaged into a matrix Q, and the keys and values are also packaged into matrices K and V; the output matrix is calculated as:
[0064] (twenty three);
[0065] Multi-head attention allows the model to jointly focus on information in different representation subspaces at different positions; its formula is as follows:
[0066] (twenty four);
[0067] (25);
[0068] Where concat represents the concatenation operation. are all learnable weight matrices.
[0069] For voxels in the grid , project its center onto the image and get the projection coordinates ; Select Close The adjacent image blocks are interactions, because their characteristics are likely to affect Controlled local geometry; neighborhood image patch sets are used Indicates that the selection is as follows: If and The distance between centers is less than the distance threshold , then the patch belong .
[0070] Use multi-head self-attention Voxel features at and belongs to Ultrasound image patch feature set of patches in The feature interactions between are modeled as follows:
[0071] (26);
[0072] (27);
[0073] here, It is a standard multi-head attention operation. , , is a learnable matrix, M is the mask for attention computation induced by view projection, and uses absolute position encoding for voxels and ultrasound image patches.
[0074] After cross attention, the ultrasound image features are further fused with the voxel features. At this time, the output voxel features are high-precision SDF fields.
[0075] Furthermore, the marching cube algorithm in S4 is a classic algorithm for extracting isosurfaces (isosurfaces) from three-dimensional scalar fields, which is widely used in volume data visualization, geometric reconstruction and other fields. Algorithm steps: Set an isosurface threshold T and traverse all cube cells C in the SDF field:
[0076] (1) Calculate the vertex state code index based on the relationship between the 8 vertex scalar values of C and T;
[0077] (2) Search the corresponding intersection configuration pattern in the predefined situation table according to the index;
[0078] (3) Use linear interpolation to calculate the intersection points with the isosurfaces on the 12 edges of the cube;
[0079] (4) Connect the corresponding intersection points according to the pattern to form one or more triangles;
[0080] (5) Add triangles to the mesh surface data.
[0081] A medical ultrasound image 3D reconstruction system based on SDF diffusion, which consists of an ultrasound image feature extraction module, an SDF diffusion module, and a grid generation module;
[0082] The ultrasound image feature extraction module: This module is used to extract the features of the input ultrasound image, and uses the image encoder of the visual model SAM-Med2D that has been pre-trained with a large amount of medical image data to extract features from the input ultrasound image, providing rich and accurate feature guidance for the subsequent diffusion process.
[0083] The SDF diffusion module: This module consists of a U-shaped neural network embedded with a state space model and cross attention, which is used to perform the SDF diffusion process, starting from random noise and gradually denoising to obtain a clean SDF field. During the diffusion process, the state space model and cross attention are used to fuse the voxel features and the ultrasound image features to achieve the purpose of keeping the reconstructed grid consistent with the ultrasound image features.
[0084] The mesh generation module: This module executes the marching cubes algorithm to extract a high-precision three-dimensional mesh from the reconstructed SDF field.
[0085] Advantages and beneficial effects of the present invention:
[0086] The present invention introduces the state space model and cross attention into the SDF diffusion process, fully integrates the ultrasound image features with the SDF features, and realizes an end-to-end fast and accurate ultrasound image 3D reconstruction. To a certain extent, it solves the problems that ultrasound image 3D reconstruction requires additional equipment or complex algorithms to determine the probe motion trajectory and direction, and takes a long time.
[0087] Practical verification has shown that the ultrasonic image three-dimensional reconstruction method provided by the present invention has the characteristics of high efficiency and high precision. BRIEF DESCRIPTION OF THE DRAWINGS
[0088] Figure 1 It is the overall flow chart of the present invention.
[0089] Figure 2 It is a framework diagram of the present invention.
[0090] Figure 3 It is the result diagram of the present invention. DETAILED DESCRIPTION
[0091] The following will be combined with the attached Figure 1-3 The present invention is further described with specific embodiments.
[0092] Embodiment 1:
[0093] A 3D reconstruction method for medical ultrasound images based on SDF diffusion. The overall process is as follows: Figure 1 As shown, the following steps are included:
[0094] S1: Use the image encoder of SAM-Med2D, a visual model pre-trained with a large amount of medical image data, to extract features from the input single view and output a feature vector , in the subsequent diffusion process, it is fused with the SDF features in the state space model and cross attention to achieve the purpose of guiding 3D reconstruction, so as to realize 3D reconstruction of ultrasound images.
[0095] S2: Randomly initialize the voxel SDF field, where SDF stands for Signed Distance Function. The SDF field is a continuous three-dimensional scene representation that treats a three-dimensional object or scene as a three-dimensional scalar field composed of distance values. Specifically, for any point in the scene, the value of SDF is defined as the signed distance from the point to the surface of the object, that is: if the point is inside the object, the SDF value is the negative distance from the point to the nearest surface; if the point is outside the object, the SDF value is the positive distance from the point to the nearest surface; if the point is exactly on the surface of the object, the SDF value is 0. During initialization, the SDF field is initialized. Initialize randomly according to normal distribution. .
[0096] S3: Perform a diffusion process on the SDF field. Diffusion Models is an emerging deep generative model that uses a reversible diffusion process to train a neural network to generate the required data from the noise distribution. The generative diffusion model contains two key processes: forward diffusion process and reverse diffusion process. Specifically, it includes:
[0097] S3-1: The forward diffusion process is a process used during training. It gradually adds Gaussian noise to the data until it is completely destroyed and becomes pure noise with Gaussian distribution. This process can be represented by a Markov chain. A certain amount of Gaussian noise is added at each time step t until the final moment T, when the original data becomes pure noise. Given a data sample , forward process It gradually transforms the data samples into pure Gaussian noise:
[0098] (1);
[0099] in represents the sample at time step t, represents the sample of the previous time step, is the Gaussian transition probability:
[0100] (2);
[0101] in represents a normal distribution, represents the noise scheduling hyperparameter, which is a learnable coefficient or set to a constant; the forward process allows sampling at any time step t in a closed form :
[0102] (3);
[0103] in , ;therefore, Directly sample through the following formula:
[0104] (4);
[0105] Among them is a noise randomly sampled from a normal distribution.
[0106] S3-2: The reverse diffusion process occurs at the time of generation and aims to reconstruct the original data from pure noise samples, that is, the joint distribution , the reverse process is defined as a Markov chain with learned Gaussian transitions:
[0107] (5);
[0108] (6);
[0109] in is the standard normal distribution, Indicated by Parameterized denoising function, is a time step dependent variance, set to ;from Then, we draw the for:
[0110] (7);
[0111] (8);
[0112] in is a A parameterized neural network that starts with a noisy input By repeating this process, we can eventually generate ;
[0113] Therefore, the objective function compares the prediction noise With applied noise The difference between:
[0114] (9);
[0115] In addition, the neural network prediction Rather than noise To modify :
[0116] (10);
[0117] in, , , Is A parameterized neural network that predicts noise-free data ; In this case, the objective function becomes:
[0118] (11);
[0119] Specifically, given a clean data sample , according to formula (4) in the forward process, we sample the same shape :
[0120] (12);
[0121] Then, train a network To predict noise-free data, the MSE objective function is as follows:
[0122] (13);
[0123] Among them That is, the ultrasound image features extracted in S1;
[0124] During inference, the trained neural network is used go through The process of gradually predicting smaller noise samples according to formula (14) To generate new SDF voxels:
[0125] (14);
[0126] S3-3: The diffusion process uses a U-shaped network, where the voxel feature resolution of each layer is halved (for example: 64→32→16) and the channels are doubled; in order to make the object represented by the generated SDF field consistent with the ultrasound image, it is necessary to fuse the SDF features and the ultrasound image features during the diffusion process, so that the ultrasound image features guide the SDF diffusion process; at the top of the model, due to the large feature resolution, the voxel features are kept at a large order of magnitude, and the cross-attention cannot be directly used to fuse the voxel and ultrasound image features, so the state space model is used to process them;
[0127] The state space model is a mathematical model framework commonly used in time series analysis and control theory. It describes the evolution of a dynamic system as a combination of a state equation and an observation equation. Through a hidden state Map to , this system uses A as the evolution parameter, and B and C as the projection parameters:
[0128] (15);
[0129] (16);
[0130] The Mamba used is a discrete version of the continuous system, which includes a time scale parameter Convert continuous parameters A and B into discrete parameters , ; The commonly used transformation method is zero-order hold (ZOH), which is defined as follows:
[0131] (17);
[0132] (18);
[0133] exist , After discretization, formulas (15) and (16) can be expressed as:
[0134] (19);
[0135] (20);
[0136] Finally, the model calculates the output through global convolution:
[0137] (twenty one);
[0138] (twenty two
[0139] where M is the length of the input sequence x, is a structured convolution kernel.
[0140] In order to apply it to the SDF diffusion process, the voxel features are expanded into one-dimensional features, and the time step t in S3-1 is linearly mapped to a one-dimensional feature of the same size as the voxel feature after sine and cosine transformation and added to the voxel feature. After linear mapping to the same number of channels as the voxel feature, it is connected with the voxel feature to obtain the input x of the SSM.
[0141] After the above-mentioned calculation by Mamba, the output y is obtained. After the voxel feature part is taken out, the one-dimensional sequence is reshaped back to the original shape of the voxel feature to obtain the voxel feature after fusion of the ultrasound image feature.
[0142] S3-4: After the voxel feature passes through the top of the model, it is downsampled to reduce the resolution of the voxel feature, increase the number of channels, and reduce the overall data volume. At the stage with smaller voxel resolution, cross attention is used to fuse the voxel feature and ultrasound image feature.
[0143] The attention function is described as mapping a query and a set of key-value pairs to an output, where the query, key, value, and output are all vectors, and the output is the weighted sum of the values. In practice, the attention function of a set of queries is calculated simultaneously, packaged into a matrix Q, and the keys and values are also packaged into matrices K and V; the output matrix is calculated as:
[0144] (twenty three);
[0145] Multi-head attention allows the model to jointly focus on information in different representation subspaces at different positions; its formula is as follows:
[0146] (twenty four);
[0147] (25);
[0148] Where concat represents the concatenation operation. are all learnable weight matrices.
[0149] For voxels in the grid , project its center onto the image and get the projection coordinates ; Select Close The adjacent image blocks are interactions, because their characteristics are likely to affect Controlled local geometry; neighborhood image patch sets are used Indicates that the selection is as follows: If and The distance between centers is less than the distance threshold , then the patch belong .
[0150] Use multi-head self-attention Voxel features at and belongs to Ultrasound image patch feature set of patches in The feature interactions between are modeled as follows:
[0151] (26);
[0152] (27);
[0153] here, It is a standard multi-head attention operation. , , is a learnable matrix, M is the mask for attention computation induced by view projection, and uses absolute position encoding for voxels and ultrasound image patches.
[0154] After cross attention, the ultrasound image features are further fused with the voxel features. At this time, the output voxel features are high-precision SDF fields.
[0155] S4: Execute the marching cube algorithm to extract the grid from the SDF field. Algorithm steps: Set an isosurface threshold T and traverse all cube cells C in the SDF field:
[0156] (1) Calculate the vertex state code index based on the relationship between the 8 vertex scalar values of C and T;
[0157] (2) Search the corresponding intersection configuration pattern in the predefined situation table according to the index;
[0158] (3) Use linear interpolation to calculate the intersection points with the isosurfaces on the 12 edges of the cube;
[0159] (4) Connect the corresponding intersection points according to the pattern to form one or more triangles;
[0160] (5) Add triangles to the mesh surface data;
[0161] The final reconstruction is completed with a high-precision triangular mesh model guided by the ultrasound image.
[0162] Embodiment 2: This embodiment uses embodiment 1 as the basic method to carry out module design.
[0163] A medical ultrasound image 3D reconstruction system based on SDF diffusion is composed of an ultrasound image feature extraction module, an SDF diffusion module, and a grid generation module. Figure 2 As shown, each part is described in detail below:
[0164] Ultrasound image feature extraction module: This module is used to extract the features of the input ultrasound image. It uses the image encoder of the visual model SAM-Med2D, which has been pre-trained with a large amount of medical image data, to extract features from the input ultrasound image, providing rich and accurate feature guidance for the subsequent diffusion process.
[0165] SDF diffusion module: This module consists of a U-shaped neural network embedded with a state-space model and cross-attention, which is used to perform the SDF diffusion process, starting from random noise and gradually denoising to obtain a clean SDF field. During the diffusion process, the state-space model and cross-attention are used to fuse the voxel features and ultrasound image features to achieve the purpose of keeping the reconstructed grid consistent with the ultrasound image features.
[0166] Mesh Generation Module: This module executes the marching cubes algorithm to extract a high-precision 3D mesh from the reconstructed SDF field.
[0167] Embodiment 3: This embodiment is verified by example based on the above method and system:
[0168] In order to verify the accuracy and efficiency of the three-dimensional reconstruction of ultrasound images of the present invention, experiments were conducted on the USOVA3D dataset.
[0169] This embodiment is based on the above method and system for example verification. In order to verify the accuracy of the ultrasound image SDF three-dimensional reconstruction proposed by the present invention, a test is conducted on the USOVA3D dataset. Figure 3 The results shown in FIG. 4 show that the method of the present invention (Unet-mamba) can generate three-dimensional shapes based on the input ultrasound image better and the output time is shorter. The model constructed by the present invention has high accuracy and fast speed in SDF three-dimensional reconstruction of ultrasound images.
[0170] The above plans are only implementation methods of the present invention, but the protection scope of the present invention is not limited thereto. All replacements or changes that can be understood and thought of by persons familiar with the technology within the technical scope disclosed in the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A method for three-dimensional reconstruction of medical ultrasound images based on SDF diffusion, characterized in that: The following steps are involved: S1: Acquire medical ultrasound image data and extract features of the ultrasound image to guide the subsequent diffusion process; S2: Randomly initialize the SDF field. The SDF field V is randomly initialized according to the normal distribution. S3: Use the diffusion model to perform the SDF diffusion process. The diffusion model includes two key processes: forward diffusion process and reverse diffusion process. First, use the state space model to fuse the voxel and ultrasound image features to obtain the voxel features after the fusion of ultrasound image features. Then, use cross attention to fuse the voxel features and ultrasound image features at a stage with a small voxel resolution. Specifically, it includes: S3-1: The forward diffusion process is represented by a Markov chain. A certain amount of Gaussian noise is added at each time step t until the final moment T, when the original data becomes pure noise. Given a data sample X0~q(X0), the forward process q(X0:t) gradually converts the data sample into pure Gaussian noise: where x t represents the sample at time step t, x t-1 represents the sample of the previous time step, q(x t ∣x t-1 ) is the Gaussian transition probability: in represents normal distribution, β t represents the noise scheduling hyperparameter, which is a learned coefficient or set to a constant; the forward process samples x at any time step t in a closed form t : where a t =1-β t , Therefore, x t Directly sample through the following formula: where ∈ is a noise randomly sampled from a normal distribution; S3-2: The back-diffusion process is defined as a Markov chain with learned Gaussian transitions: in is the standard normal distribution, μ θ (x t ,t) represents the denoising function parameterized by θ, is a time step dependent variance, set to From p(x T ), and then plot x using formula (6) t-1 ~p θ (x t-1 ∣x t )for: where ∈ θ (x t ,t) is a neural network parameterized by θ, which starts from the noisy input x T Predict the noise; by repeating this process, X0 is finally generated; Therefore, the objective function compares the prediction noise ∈ θ (x t ,t) and the difference between the applied noise ε: In addition, μ is modified by predicting x0 instead of the noise ε through the neural network θ (x t ,t): m θ (x t ,t)=γ t f θ (x t ,t)+δ t x t (10) in, f θ (x t ,t) is a neural network parameterized by θ that predicts the noise-free data x0; in this case, the objective function becomes: Specifically, given a clean data sample According to formula (4) in the forward process, samples with the same shape Then, train a network To predict noise-free data, the MSE objective function is as follows: Among them, F p That is, the ultrasound image features extracted in S1; During inference, the trained neural network is used After t=T,…,1, the smaller noise samples are gradually predicted according to formula (14). To generate new SDF voxels: S3-3: The diffusion process uses a U-shaped network, where the voxel feature resolution of each layer is halved and the channels are doubled; in order to make the object represented by the generated SDF field consistent with the ultrasound image, it is necessary to fuse the SDF features and the ultrasound image features during the diffusion process, so that the ultrasound image features guide the SDF diffusion process; The state space model maps a one-dimensional sequence x(t) to y(t) through a hidden state h(t). This system uses A as the evolution parameter and B and C as the projection parameters: h′(t)=Ah(t)+Bx(t) (15) y(t)=Ch(t) (16) Mamba includes a time scale parameter Δ to convert continuous parameters A and B into discrete parameters The commonly used transformation method is zero-order hold, which is defined as follows: exist After discretization, formulas (15) and (16) are expressed as: the t =Ch t (20) Finally, the model calculates the output through global convolution: Where M is the length of the input sequence x, is a structured convolution kernel; In order to fuse the ultrasound image features with the voxel features, the ultrasound image features F p After linear mapping to the same number of channels as the voxel feature, it is connected with the voxel feature to obtain the input x of the SSM; After the above calculation by Mamba, the output y is obtained, and the voxel feature part is taken out and the one-dimensional sequence is reshaped back to the original shape of the voxel feature to obtain the voxel feature after fusion of the ultrasound image feature; S3-4: After the voxel features pass through the top of the model, they are downsampled to reduce the resolution of the voxel features, increase the number of channels, and reduce the overall data volume. At the stage where the voxel resolution is small, cross attention is used to fuse the voxel features and ultrasound image features; at the same time, the attention function of a set of queries is calculated and packaged into a matrix Q, and the keys and values are also packaged into matrices K and V; the output matrix is calculated as: The formula used is as follows: MultiHead(Q,K,V)=Concat(head1,...,head h )W O (24) head i =Attention(QW i Q ,KW i K ,VW i V ) (25) Where concat represents the concatenation operation, W O , W i Q , W i K , W i V are all learnable weight matrices; For a voxel v in the grid, project its center onto the image to obtain the projection coordinate P; select the adjacent image patch close to P to interact with v, and the neighborhood image patch set is represented by N V Indicates that the choice is as follows: If P and P j The distance between the centers is less than the distance threshold d δ , then the patch P j Belong to N V ; Use multi-head self-attention to the voxel feature f at v V and belongs to N V The ultrasound image patch feature set f I The feature interactions between are modeled as follows: Q=f V W Q ,K=f N W K ,V=f N W V (26) Here, MultiHead(·) is the standard multi-head attention operation, W Q , W K , W V is a learnable matrix, M is the mask for attention calculation caused by view projection, using absolute position encoding for voxels and ultrasound image patches; S3-5: After cross attention, the ultrasound image features are further fused with the voxel features. At this time, the output voxel features are high-precision SDF fields; S4: The mesh is extracted using marching cubes and the triangular mesh model guided by the ultrasound image is finally reconstructed.
2. The method for three-dimensional reconstruction of medical ultrasound images based on SDF diffusion as claimed in claim 1, characterized in that: In S1, the visual model MedSAM is first trained using medical ultrasound image data, and then the trained MedSAM image encoder is used to extract features from the input single medical ultrasound image, and the output is mapped to a feature vector In the subsequent diffusion process, it is used to guide the SDF to approach the image features to achieve SDF three-dimensional reconstruction of the ultrasound image.
3. The method for three-dimensional reconstruction of medical ultrasound images based on SDF diffusion as claimed in claim 1, characterized in that: The steps of the marching cube algorithm in S4 are: set an isosurface threshold T and traverse all cube cells C in the SDF field: (1) Calculate the vertex state code index based on the relationship between the 8 vertex scalar values of C and T; (2) Find the corresponding intersection configuration pattern in the predefined situation table according to the index; (3) Use linear interpolation to calculate the intersection points with the isosurfaces on the 12 edges of the cube; (4) Connect the corresponding intersection points according to the pattern to form one or more triangles; (5) Add triangles to the mesh surface data.
4. A system based on the SDF diffusion-based medical ultrasound image 3D reconstruction method according to claim 1, characterized in that: It includes ultrasonic image feature extraction module, SDF diffusion module and grid generation module; The ultrasound image feature extraction module: This module is used to extract the features of the input ultrasound image, and uses the image encoder of the visual model SAM-Med2D pre-trained with a large amount of medical image data to extract features from the input ultrasound image; The SDF diffusion module: This module consists of a U-shaped neural network embedded with a state space model and cross attention, and is used to perform the SDF diffusion process, starting from random noise and gradually denoising to obtain a clean SDF field. During the diffusion process, the state space model and cross attention are used to fuse the voxel features and the ultrasound image features, so as to achieve the purpose of keeping the reconstructed grid consistent with the ultrasound image features; The mesh generation module: This module executes the marching cubes algorithm to extract a high-precision three-dimensional mesh from the reconstructed SDF field.
Citation Information
Cited By
Three-dimensional medical image generation method based on cross attention mechanism
CN121170146A
