A three-dimensional reconstruction method of a medical image, a device, and a storage medium

By employing adaptive modulation of the feature encoding module and a cross-frame attention recovery mechanism, the problems of feature matching instability and trajectory drift in sensorless 3D ultrasound or photoacoustic reconstruction are solved, achieving high-precision 3D reconstruction without external hardware.

CN123181725APending Publication Date: 2026-11-27BEIJING CHAOYANG HOSPITAL CAPITAL MEDICAL UNIVERSITY +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611409542.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-11
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing sensorless 3D ultrasound or photoacoustic reconstruction methods suffer from problems such as feature matching instability in complex acoustic environments, long sequence trajectory drift, and increased system complexity due to reliance on external hardware.

Method used

An adaptive modulation and cross-frame attention recovery mechanism using a feature encoding module is employed. Channel attention weights are generated through a structure-aware channel decoupling module. Combined with a cross-frame attention matching module and a temporal modeling unit, the poses of adjacent frames are estimated and 3D reconstruction is performed.

Benefits of technology

It improves feature stability and cross-frame matching consistency, reduces long sequence trajectory drift, and lowers system hardware complexity, making it suitable for free-hand 3D reconstruction without external hardware assistance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123181725A_ABST
    Figure CN123181725A_ABST
Patent Text Reader

Abstract

The application discloses a three-dimensional reconstruction method and device of a medical image and a storage medium. The method comprises the following steps: acquiring a two-dimensional image sequence of a medical image and extracting intermediate features of a current frame and a neighboring reference frame; generating channel attention weights based on global spatial statistics of the intermediate features and modulating to obtain decoupled features; performing partial masking on the current frame decoupled features and performing cross-frame context aggregation with the neighboring reference frame features to obtain cross-frame enhanced features; estimating a time sequence pose parameter based on the cross-frame enhanced features; and fusing two-dimensional slices to a unified three-dimensional coordinate system based on pose accumulation to obtain a three-dimensional reconstruction result. The application effectively suppresses unstable acoustic features, establishes cross-frame global geometric correspondence, reduces long sequence accumulation drift, and realizes sensorless high-precision three-dimensional reconstruction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical field of medical image processing and three-dimensional medical imaging, specifically relating to a method, device and storage medium for three-dimensional reconstruction of medical images. Background Technology

[0002] In the fields of ultrasound and photoacoustic imaging, reconstructing two-dimensional free-handed scanning sequences into three-dimensional data is a crucial step in achieving spatial quantitative analysis. Ultrasound imaging, characterized by its real-time, non-invasive nature, relatively low cost, and wide clinical applicability, is widely used for tissue structure observation, lesion assessment, and interventional navigation. Photoacoustic imaging, combining optical absorption contrast and ultrasound detection, can reflect vascular, blood oxygenation, and related functional information, making it valuable in vascular network visualization and functional imaging. However, conventional two-dimensional ultrasound or photoacoustic images only represent a single section, lacking three-dimensional spatial context, making it difficult to fully express the spatial morphology of tissues, lesions, or vascular networks. Therefore, reconstructing two-dimensional free-handed scanning sequences into three-dimensional data is an important step for ultrasound and photoacoustic imaging to move from slice observation to spatial quantitative analysis.

[0003] Current handheld 3D ultrasound or 3D photoacoustic reconstruction methods typically rely on external tracking devices to obtain probe pose. However, external tracking systems have limitations such as high equipment cost, susceptibility to environmental interference, the need for additional calibration, and the potential for altering operating habits. Therefore, sensorless 3D reconstruction methods that estimate probe motion solely based on the image sequence itself, without requiring external tracking hardware, have attracted attention. Early methods primarily utilized the physical relationship between ultrasound speckle decorrelation and scanning plane motion to infer pose. In recent years, deep learning methods have been used to directly learn the pose of adjacent frames from 2D image sequences, improving reconstruction accuracy to some extent. However, trajectory drift issues still exist under conditions of complex out-of-plane motion, tissue compression, and acoustic noise.

[0004] From a technical perspective, existing sensorless image reconstruction methods have the following main shortcomings: First, existing methods often rely on coarse-grained macroscopic image features or local texture similarity, failing to effectively distinguish stable anatomical structures from unstable acoustic textures at the network feature level. Although ultrasound speckle and photoacoustic clutter contain certain motion information, they are also easily affected by out-of-plane motion, tissue compression, probe contact changes, and imaging noise. If they are directly involved in matching, it will lead to incorrect pose estimation. Second, during free-hand scanning, the out-of-plane motion of the probe relative to the tissue will change the spatial distribution of ultrasound microscatterers, causing speckle decorrelation. Dynamic acoustic clutter and nonlinear tissue contrast changes may also occur in photoacoustic imaging. First, physical degradation can cause depth feature matching between adjacent frames to get stuck in local optima. Second, in long sequence reconstruction, small pose errors between adjacent frames accumulate over time, eventually forming significant trajectory drift, causing spatial offset or distortion of the reconstructed volume data or vascular network. Third, in pure photoacoustic scenes, vascular cross-sections are usually sparse, with insufficient continuous directional information, and the reciprocating scanning trajectories of parts such as the palm are complex, making it more difficult for the network to stably determine the global spatial orientation from local images. Fourth, while introducing additional hardware such as inertial measurement units can improve trajectory stability, it increases system complexity and is not conducive to forming a free-hand 3D reconstruction process without any external hardware assistance.

[0005] Therefore, there is an urgent need to provide a method, device, and storage medium for three-dimensional reconstruction of medical images. Summary of the Invention

[0006] The main objective of this invention is to provide a method, device, and storage medium for three-dimensional reconstruction of medical images to overcome the shortcomings of the prior art.

[0007] To achieve the above-mentioned objectives, the present invention adopts the following technical solution: An embodiment of the present invention provides a method for three-dimensional reconstruction of medical images, the method comprising: A two-dimensional image sequence of medical images is obtained; the current frame and adjacent reference frames in the two-dimensional image sequence are extracted using a feature encoding module to obtain intermediate features; The structure-aware channel decoupling module generates channel attention weights based on the global spatial statistics of the intermediate features, and modulates the intermediate features element by element based on the channel attention weights to obtain decoupled features. In the feature space output by the feature encoding module, the decoupled features of the current frame are partially masked, and the masked features of the current frame and the features of the adjacent reference frames are input into the cross-frame attention matching module for cross-frame context aggregation to obtain cross-frame enhanced features. Based on the cross-frame enhancement features, the relative pose parameters between the current frame and the adjacent reference frame are estimated by a temporal modeling unit and a pose regression head. Pose accumulation is performed based on the relative pose parameters between adjacent frames, and the two-dimensional image slices in the two-dimensional image sequence are fused into a unified three-dimensional coordinate system to obtain the three-dimensional reconstruction result.

[0008] In a preferred embodiment, the step of generating channel attention weights based on the global spatial statistics of the intermediate features through the structure-aware channel decoupling module, and modulating the intermediate features element-wise based on the channel attention weights to obtain decoupled features, includes: Global average pooling and global max pooling are performed on the intermediate features respectively to obtain the channel average statistical description and the channel maximum statistical description; The average statistical description of the channel and the maximum statistical description of the channel are input into a shared weight network to obtain the channel attention weights. The intermediate features are modulated element-wise based on the channel attention weights to obtain the decoupled features.

[0009] In a preferred embodiment, the channel attention weight is obtained by performing nonlinear transformations on the average statistical description and the maximum statistical description of the channel respectively through a shared weight network, adding the two nonlinear transformation results and then processing them through a Sigmoid activation function; The decoupling feature is obtained by multiplying the channel attention weights and the intermediate features element-wise.

[0010] In a preferred embodiment, the step of partially masking the decoupled features of the current frame in the feature space output by the feature encoding module, and then inputting the masked current frame features and the features of the adjacent reference frames into the cross-frame attention matching module for cross-frame context aggregation to obtain cross-frame enhanced features includes: The decoupling features of the current frame are block-processed to obtain the current frame feature sequence, and the decoupling features of the adjacent reference frames are block-processed to obtain the adjacent reference frame feature sequence. Feature blocks are randomly selected from the current frame feature sequence according to a preset masking ratio for masking, and the masked feature blocks are replaced with learnable masking vectors. The masked current frame feature sequence and the adjacent reference frame feature sequence are input into the cross-frame attention matching module; The cross-frame enhanced features are obtained by modeling the internal structural relationships of a single frame through the self-attention layer in the cross-frame attention matching module, and by aggregating global context information from the adjacent reference frames through the cross-attention layer.

[0011] In a preferred embodiment, the preset masking ratio does not exceed 10%; the parameters of the cross-frame attention matching module are obtained by training based on the masking feature recovery loss, which is constructed based on the cosine similarity between the output features of each masked feature block after recovery by the cross-frame attention matching module and the original features before masking, and is used to constrain the recovered output features to maintain consistency with the original features before masking in semantic distribution.

[0012] In a preferred embodiment, after acquiring the two-dimensional image sequence of the medical image, the method further includes: Extract a continuous short sequence of a preset window length from the two-dimensional image sequence, the continuous short sequence covering the current frame and the adjacent reference frame; The step of extracting features from the current frame and adjacent reference frames in the two-dimensional image sequence through the feature encoding module includes: The feature encoding module extracts features from the continuous short sequence to obtain local structural features and global context features as intermediate features. The step of estimating the relative pose parameters between the current frame and the adjacent reference frames based on the cross-frame enhancement features, using a temporal modeling unit and a pose regression head, includes: The cross-frame enhancement features are input into the temporal modeling unit and the pose regression head, and the three-dimensional translation vector and three-dimensional rotation vector between the current frame and the adjacent reference frame are output as the relative pose parameters.

[0013] In a preferred embodiment, the parameters of the temporal modeling unit and the pose regression head are obtained by training based on the total loss function using a progressive joint optimization strategy. The total loss function is a weighted combination of temporal triplet loss, masking feature recovery loss, motion modulation mean absolute error, and bidirectional temporal consistency loss. The motion modulation mean absolute error is weighted based on the prior local motion weights extracted from the two-dimensional image sequence to weight the pose regression error; the bidirectional temporal consistency loss is constructed based on the geometric inverse transformation relationship or cumulative trajectory consistency between the forward transform estimated from the forward image sequence and the backward transform estimated from the backward image sequence; the weight coefficients of each loss term in the total loss function are dynamically adjusted according to whether the training data has real pose labels; when real pose labels are sufficient, the weight of the motion modulation mean absolute error is increased; when real pose labels are few, the weights of the masking feature recovery loss and the bidirectional temporal consistency loss are increased.

[0014] In a preferred embodiment, the step of accumulating pose based on the relative pose parameters between adjacent frames and fusing the two-dimensional image slices in the two-dimensional image sequence into a unified three-dimensional coordinate system to obtain the three-dimensional reconstruction result includes: The relative pose parameters between adjacent frames are converted into homogeneous transformation matrices and accumulated to the reference frame coordinate system; wherein, the two-dimensional image sequence includes a two-dimensional ultrasound image sequence or a two-dimensional photoacoustic image sequence; For the two-dimensional ultrasound image sequence, the two-dimensional ultrasound slices are mapped to the unified three-dimensional coordinate system by interpolation or voxel fusion to form three-dimensional ultrasound volume data; For the two-dimensional photoacoustic image sequence, the two-dimensional photoacoustic slices are projected onto the unified three-dimensional coordinate system, and combined with threshold segmentation, blood vessel enhancement or blood vessel centerline extraction, to obtain a three-dimensional photoacoustic blood vessel network.

[0015] Another embodiment of the present invention provides an electronic device, including a processor and a memory, wherein the memory stores a computer program, and the processor executes the computer program to implement the method described in any of the above-mentioned embodiments.

[0016] Another embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method described in any of the above embodiments.

[0017] Compared with existing technologies, the advantages of this invention are as follows: First, it can improve feature stability in complex acoustic environments. Through a structure-aware channel decoupling module, channel attention weights are adaptively generated based on global channel spatial statistics, reducing the weights of high-risk channels corresponding to ultrasound speckle decorrelation, photoacoustic transient clutter, and modality-specific artifacts, thus preserving stable structural features such as fascial interfaces, tissue boundaries, and vascular networks. Therefore, pose estimation in subsequent adjacent frames is less susceptible to interference from local noise and transient artifacts. Second, it can improve the consistency of cross-frame spatial matching. Simple local texture-dependent paths are disrupted by low-proportion random masking, and global geometric context is aggregated from adjacent reference frames through cross-frame cross-attention. The network needs to recover masked features based on stable cross-frame structures, thus enabling it to learn more generalized spatial correspondences. Third, it can reduce long-sequence cumulative trajectory drift. The continuity of features in adjacent frames is constrained by temporal triplet loss, higher training weights are assigned to frames with large displacements and strong out-of-plane motion using motion modulation mean absolute error, and scan direction bias is reduced through bidirectional temporal consistency. These training strategies can reduce trajectory drift caused by the accumulation of local errors along long sequences. Then, it is applicable to ultrasound and photoacoustic 3D reconstruction without external hardware assistance. It does not rely on optical trackers, electromagnetic trackers, or inertial measurement units; the pose of adjacent frames can be estimated using only two-dimensional ultrasound or two-dimensional photoacoustic image sequences, reducing system hardware complexity and clinical deployment difficulty. Finally, it is beneficial for pure photoacoustic 3D functional structure display. In photoacoustic images, vascular cross-sections are sparse and cluttered, making conventional pure image matching methods prone to instability. Through stable structural channel screening and cross-frame global geometric correspondence, continuous vascular network information can be better utilized for 3D reconstruction. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a schematic diagram of the network structure of a three-dimensional reconstruction method according to one embodiment of this application.

[0020] Figure 2 This is a comparison image of the three-dimensional reconstruction effect in one embodiment of this application.

[0021] Figure 3 This is a flowchart illustrating a three-dimensional reconstruction method for medical images according to one embodiment of this application. Detailed Implementation

[0022] The invention will be more fully understood through the following detailed description, which should be read in conjunction with the accompanying drawings. Detailed embodiments of the invention are disclosed herein; however, it should be understood that the disclosed embodiments are merely exemplary of the invention, which may be embodied in various forms. Therefore, the specific functional details disclosed herein should not be construed as limiting, but rather as the basis for the claims and as intended to teach those skilled in the art to employ the representative basis of the invention in different ways in any suitable detailed embodiment.

[0023] First, an overview of the prior art is provided to better understand the technical solution of this application.

[0024] In the field of handheld 3D ultrasound or 3D photoacoustic reconstruction, the relevant technologies are mainly divided into two categories: methods based on external tracking devices and sensorless methods based on image sequences.

[0025] External tracking methods typically rely on optical trackers, electromagnetic trackers, or inertial measurement units to obtain probe pose. While external tracking devices can provide probe motion information, they have several limitations in clinical use: First, external tracking systems increase equipment cost and system complexity; second, optical tracking is easily affected by line-of-sight obstruction, and electromagnetic tracking is easily affected by metal instruments or electromagnetic interference; third, additional calibration is required between the sensor and the probe, and calibration errors will directly affect the 3D reconstruction results; fourth, sensor installation may change doctors' operating habits and increase the setup burden of the surgical or examination site.

[0026] Sensorless methods based on image sequences do not rely on external hardware; instead, they infer probe motion from the image sequence itself. Early research primarily utilized the physical relationship between ultrasound speckle decorrelation and scanning plane motion, inferring scanning plane motion by analyzing the degree of speckle decorrelation. Based on this, a three-dimensional ultrasound frame localization method based on speckle decorrelation was developed, providing an early theoretical foundation for ultrasound frame localization without external tracking equipment. With the development of this technology, existing research has systematically summarized free-hand three-dimensional ultrasound imaging, pointing out that tracking, registration, calibration, and volume data fusion in three-dimensional free-hand ultrasound all affect the final reconstruction accuracy. Review studies on tracking-free three-dimensional free-hand ultrasound reconstruction further indicate that recovering a stable three-dimensional trajectory solely from image sequences is still affected by image quality, tissue deformation, and the accumulation of errors over long sequences.

[0027] In recent years, deep learning methods have been used to directly learn the poses of adjacent frames from two-dimensional image sequences. For example, networks learn contextual features between adjacent frames to estimate probe motion; other methods introduce three-dimensional context and contrastive learning to enhance the network's ability to express relationships between adjacent frames. For long sequence reconstruction, methods utilize sequence information over a longer time range through long-range dependency modeling to mitigate local inter-frame estimation errors; for the physical plausibility of pose estimation, physical priors are incorporated into deep network training to improve the plausibility of pose estimation results; and for tissue deformation, non-rigid reconstruction of free-hand ultrasound under tracking-free conditions is studied. Furthermore, evaluation results from publicly available challenge datasets for three-dimensional free-hand ultrasound reconstruction without external tracking show that stable three-dimensional reconstruction relying solely on image sequences remains challenging under conditions of different subjects, different scanning directions, different scanning trajectories, and differences in free-hand operation.

[0028] Furthermore, sensorless 3D reconstruction from photoacoustic images has also attracted attention. For example, deep networks are applied to free-hand 3D photoacoustic and ultrasound reconstruction scenarios to achieve 3D display of functional structures such as blood vessels; other methods introduce lightweight inertial measurement information through fine-grained context and multimodal alignment to improve the stability of free-hand 3D ultrasound reconstruction. While these methods have improved 3D reconstruction accuracy to some extent, multimodal methods still require additional hardware, and pure image methods still suffer from trajectory drift problems under complex out-of-plane motion, tissue compression, and acoustic noise conditions.

[0029] To address the aforementioned problems, this application proposes a method, device, and storage medium for three-dimensional reconstruction of medical images. Using a handheld two-dimensional ultrasound image sequence or a two-dimensional photoacoustic image sequence as input, it directly estimates the six-degree-of-freedom pose of adjacent frames from the image sequence without relying on external optical trackers, electromagnetic trackers, or inertial measurement units, and completes three-dimensional reconstruction based on the accumulated pose. The following detailed description, in conjunction with the accompanying drawings and embodiments, further illustrates this approach.

[0030] Example 1.

[0031] This embodiment provides a method for three-dimensional reconstruction of medical images. This method is suitable for high-precision three-dimensional reconstruction of two-dimensional ultrasound image sequences or two-dimensional photoacoustic image sequences without external tracking hardware. Through the synergistic effect of feature channel adaptive modulation and cross-frame attention recovery mechanism, this method effectively solves the problems of feature matching instability and long sequence trajectory drift in complex acoustic environments.

[0032] Specifically, see Figure 3 The method includes: S101, acquire a two-dimensional image sequence of medical images; extract features from the current frame and adjacent reference frames in the two-dimensional image sequence using a feature encoding module to obtain intermediate features; S102, through the structure-aware channel decoupling module, channel attention weights are generated based on the global spatial statistics of the intermediate features, and the intermediate features are modulated element by element based on the channel attention weights to obtain decoupled features; S103, in the feature space output by the feature encoding module, the decoupled features of the current frame are partially masked, and the masked current frame features and the features of the adjacent reference frames are input into the cross-frame attention matching module for cross-frame context aggregation to obtain cross-frame enhanced features; partial masking is, for example, low-proportion random masking; cross-frame context aggregation can be used to aggregate global context information; S104, Based on the cross-frame enhancement features, the relative pose parameters between the current frame and the adjacent reference frame are estimated by the temporal modeling unit and the pose regression head; S105, based on the relative pose parameters between adjacent frames, pose accumulation is performed, and the two-dimensional image slices in the two-dimensional image sequence are fused into a unified three-dimensional coordinate system to obtain the three-dimensional reconstruction result.

[0033] Specifically, the two-dimensional image sequence can be a continuous two-dimensional ultrasound slice or a two-dimensional photoacoustic slice acquired during a handheld free scanning process. When performing this step, the original image sequence is first preprocessed as necessary, such as grayscale normalization, size standardization, and invalid boundary cropping, to eliminate the influence of differences in the acquisition equipment.

[0034] Based on the structure-aware channel decoupling module, channel attention weights are generated through global spatial statistics and intermediate features are modulated element-wise. This adaptively distinguishes stable anatomical structures from unstable acoustic textures at the feature channel level, suppressing channel responses containing speckle and clutter while preserving or enhancing channel responses containing stable structures such as tissue boundaries and blood vessel walls. This solves the problem that existing methods fail to effectively distinguish between stable and unstable modes at the feature level, leading to incorrect pose estimation. At the same time, this channel decoupling mechanism weakens the interference of speckle decorrelation and photoacoustic clutter caused by out-of-plane motion on subsequent matching. By partially masking the decoupled features of the current frame and combining them with a cross-frame attention matching module, the network cannot rely solely on local textures within the current frame for matching. Instead, it must recover the masked information by modeling the internal structural relationships of a single frame through self-attention and aggregating global contextual information from adjacent reference frames through cross-attention. This establishes a global correspondence based on real anatomical geometry, effectively overcoming the problem of matching getting trapped in local optima due to physical degradation. Even in pure photoacoustic scenes where blood vessel cross-sections are sparse and continuous directional information is insufficient, this cross-frame attention mechanism can still achieve stable inter-frame correspondences through global context aggregation, improving the spatial direction judgment capability under complex reciprocating scanning trajectories. The temporal modeling unit can mine the continuity of motion between frames within short sequences and apply temporal smoothing constraints. Joint optimization with the pose regression head accurately captures the real motion trajectory of the probe while maintaining the smoothness of local motion, effectively reducing trajectory drift caused by the accumulation of small pose errors over time in long sequences. The relative pose parameters between adjacent frames are accumulated into a unified three-dimensional coordinate system and three-dimensional fusion is completed. The entire process relies only on the image sequence itself and does not require external hardware such as optical trackers, electromagnetic trackers or inertial measurement units. This achieves free-hand three-dimensional reconstruction without any external hardware assistance, avoiding additional equipment costs and system complexity.

[0035] Therefore, by using global spatial statistics to adaptively modulate features at the feature channel level, unstable acoustic modes such as ultrasonic speckle decorrelation and photoacoustic dynamic clutter are suppressed, while stable anatomical structural features are preserved. Furthermore, a partial masking mechanism is introduced into the latent feature space and combined with cross-frame attention aggregation, forcing the network to get rid of its dependence on local transient textures and instead use the global context information of adjacent frames to recover the masked features, thereby establishing a robust cross-frame geometric correspondence. Finally, by combining temporal modeling and pose regression, high-precision 3D reconstruction without external sensors is achieved.

[0036] As an example, the input, output, and overall workflow of a sensorless 3D reconstruction method for medical images (ultrasound and photoacoustic images) are illustrated: Using handheld two-dimensional ultrasound image sequences or two-dimensional photoacoustic image sequences as input, without relying on external optical trackers, electromagnetic trackers or inertial measurement units, it directly estimates the six-degree-of-freedom pose of adjacent frames from the image sequence and completes three-dimensional reconstruction based on the accumulated pose.

[0037] Let the image sequence obtained by one free-hand scan be... ,in This represents the i-th frame of a two-dimensional ultrasound image or a two-dimensional photoacoustic image. For any adjacent frames... and The network outputs relative pose parameters. . Including three-dimensional translation vectors and three-dimensional rotation vector Rotation parameters can be represented using Euler angles, rotation vectors, quaternions, or homogeneous transformation matrices. After obtaining the relative poses of all adjacent frames, any frame in the sequence is selected as a reference frame. The transformations of adjacent frames are accumulated into spatial transformations from each frame to the reference frame. Then, the two-dimensional image slices are fused into a unified three-dimensional coordinate system to obtain three-dimensional ultrasound body data or three-dimensional photoacoustic vascular structures.

[0038] This 3D reconstruction method can be divided into two parts: the actual reconstruction process and the model building method. The actual reconstruction process is used to output the 3D reconstruction results of the scanned sequence to be processed; the model building method is used to explain how the network parameters are obtained through training. The two work together in engineering implementation.

[0039] In an exemplary embodiment, the method of generating channel attention weights based on the global spatial statistics of the intermediate features through the structure-aware channel decoupling module, and modulating the intermediate features element-wise based on the channel attention weights to obtain decoupled features, includes: Global average pooling and global max pooling are performed on the intermediate features respectively to obtain the channel average statistical description and the channel maximum statistical description; The average statistical description of the channel and the maximum statistical description of the channel are input into a shared weight network to obtain the channel attention weights. The intermediate features are modulated element-wise based on the channel attention weights to obtain the decoupled features.

[0040] Therefore, by extracting the average and maximum statistical descriptions in parallel, the overall response level and significant activation peak of the feature channel can be captured simultaneously. The channel attention weights generated by the shared weight network can more accurately identify and suppress high-frequency fluctuation channels caused only by noise, thereby improving the signal-to-noise ratio at the feature source.

[0041] In an exemplary embodiment, the channel attention weight is obtained by performing nonlinear transformations on the average statistical description and the maximum statistical description of the channel respectively through a shared weight network, adding the two nonlinear transformation results and then processing them through a Sigmoid activation function; The decoupling feature is obtained by multiplying the channel attention weights and the intermediate features element-wise.

[0042] Therefore, by using nonlinear transformation and Sigmoid normalization, the weight values ​​are smoothly distributed between 0 and 1, which makes the feature modulation process differentiable and adaptive, facilitating end-to-end joint optimization.

[0043] As an example, the structure-aware channel decoupling module is explained: In freehand scanning, out-of-plane probe movement, tissue compression, and changes in contact pressure alter the ultrasonic speckle distribution and introduce dynamic acoustic clutter into the photoacoustic image. If the network assigns the same weight to all deep feature channels, unstable acoustic textures may be mistaken for reliable matching cues, leading to pose estimation errors between adjacent frames.

[0044] To address this issue, this application establishes a structure-aware channel decoupling module. Let the intermediate feature input to this module be... Where C is the number of channels, and H and W are the spatial dimensions. Different characteristic channels can be regarded as different implicit acoustic mode filters. Some channels express ultrasound speckle decorrelation, photoacoustic transient clutter, or mode-specific artifacts, while others express stable structural geometry such as fascial interfaces, tissue boundaries, or vascular networks.

[0045] This module performs global average pooling and global max pooling on feature F respectively to obtain the channel average statistical description. Maximum Statistical Description of Channels Then and Input a shared weight network to obtain channel attention weights. : in, This represents the Sigmoid activation function. Let W1 and W2 represent the non-linear activation function, and W1 and W2 represent the learnable weights. Then, the original features are modulated element-wise: in, This indicates the robustness characteristics after decoupling. This represents element-wise multiplication. Through this operation, channels that are significantly affected by speckle decorrelation or clutter fluctuations are weighted less, while channels related to stable anatomical structures are preserved or enhanced, thus providing more reliable input for subsequent cross-frame matching.

[0046] The technical advantage of this module lies in the fact that it does not directly determine whether a pixel is noise based on manual rules, but rather performs adaptive weighting based on global spatial statistics at the deep feature channel level, enabling the network to dynamically select more stable structural features under different imaging modalities and different scanning qualities.

[0047] In an exemplary embodiment, the step of partially masking the decoupled features of the current frame in the feature space output by the feature encoding module, and then inputting the masked current frame features and the features of the adjacent reference frames into the cross-frame attention matching module for cross-frame context aggregation to obtain cross-frame enhanced features includes: The decoupling features of the current frame are block-processed to obtain the current frame feature sequence, and the decoupling features of the adjacent reference frames are block-processed to obtain the adjacent reference frame feature sequence. Feature blocks are randomly selected from the current frame feature sequence according to a preset masking ratio for masking, and the masked feature blocks are replaced with learnable masking vectors. The masked current frame feature sequence and the adjacent reference frame feature sequence are input into the cross-frame attention matching module; The cross-frame enhanced features are obtained by modeling the internal structural relationships of a single frame through the self-attention layer in the cross-frame attention matching module, and by aggregating global context information from the adjacent reference frames through the cross-attention layer.

[0048] Specifically, the self-attention layer is used to model the global structural relationship between different spatial regions within the current frame or the reference frame; the cross-attention layer is used to aggregate the global context between the current frame and the adjacent reference frames, so that the features of the current frame can use the stable structural information in the reference frames to recover the masked position and form a cross-frame spatial correspondence.

[0049] Therefore, the masking operation is limited to the block-based potential feature space rather than the original pixel space, thus avoiding damage to the underlying visual semantics. Through the synergistic effect of self-attention and cross-attention, the network can search for corresponding stable structures in adjacent reference frames to complete feature recovery when the masked position cannot obtain local cues.

[0050] In an exemplary embodiment, the preset masking ratio does not exceed 10%; the parameters of the cross-frame attention matching module are trained based on the masking feature recovery loss, which is constructed based on the cosine similarity between the output features of each masked feature block after recovery by the cross-frame attention matching module and the original features before masking, and is used to constrain the recovered output features to maintain consistency with the original features before masking in semantic distribution.

[0051] Thus, by using low-proportion masking to prevent excessive disruption of feature continuity, and by using cosine similarity constraints to ensure that the restored features are semantically aligned with the original structure, the cross-frame matching relationships learned by the network are based on real anatomical geometry rather than spurious texture correlations.

[0052] As an example, let's illustrate the cross-frame attention matching module: To reduce the network's over-reliance on local acoustic textures, a low proportion of random masking can be set in the latent feature space. Let the decoupled feature sequence of the current frame be... The feature sequences of adjacent reference frames are ,in Let D be the number of feature blocks after blockification, and D be the dimension of each feature block. Randomly select an index set M that satisfies... , For the masking ratio, the preferred method is... ≤10%. For The position is determined using learnable mask vectors. Replace the original feature; for The original features are preserved in the location.

[0053] Subsequently, the masked features of the current frame and the features of adjacent reference frames are input into the cross-frame attention matching module. This module includes at least a self-attention layer and a cross-attention layer. The self-attention layer is used to model the global structural relationship between different spatial regions within the current frame or reference frames; the cross-attention layer is used to aggregate the global context between the current frame and adjacent reference frames, enabling the current frame features to recover the masked position using stable structural information in the reference frames and form a cross-frame spatial correspondence.

[0054] In the auxiliary feature learning stage, the output features of the masked location are... Original features before concealment Apply cosine similarity constraints: This constraint enables the network to recover features that are semantically close to the original structural features. Since local acoustic noise is randomly masked and disrupted, the network needs to find stable structural support from the global context across frames, thus reducing its dependence on transient speckle, local clutter, and mode-specific artifacts.

[0055] In an exemplary embodiment, after acquiring the two-dimensional image sequence of the medical image, the method further includes: Extract a continuous short sequence of a preset window length from the two-dimensional image sequence, the continuous short sequence covering the current frame and the adjacent reference frame; The step of extracting features from the current frame and adjacent reference frames in the two-dimensional image sequence through the feature encoding module includes: The feature encoding module extracts features from the continuous short sequence to obtain local structural features and global context features as intermediate features. The step of estimating the relative pose parameters between the current frame and the adjacent reference frames based on the cross-frame enhancement features, using a temporal modeling unit and a pose regression head, includes: The cross-frame enhancement features are input into the temporal modeling unit and the pose regression head, and the three-dimensional translation vector and three-dimensional rotation vector between the current frame and the adjacent reference frame are output as the relative pose parameters.

[0056] Thus, local temporal motion information is preserved through short sequence input, making up for the shortcomings of single-frame matching; the temporal modeling unit further explores the motion continuity pattern within the sequence, assisting the pose regression head in outputting smoother and more accurate six-degree-of-freedom pose parameters in large displacement or weak texture regions.

[0057] In an exemplary embodiment, the parameters of the temporal modeling unit and the pose regression head are obtained by training based on the total loss function using a progressive joint optimization strategy. The total loss function is a weighted combination of temporal triplet loss, masking feature recovery loss, motion modulation mean absolute error, and bidirectional temporal consistency loss. The motion modulation mean absolute error is weighted based on the prior local motion weights extracted from the two-dimensional image sequence to weight the pose regression error; the bidirectional temporal consistency loss is constructed based on the geometric inverse transformation relationship or cumulative trajectory consistency between the forward transform estimated from the forward image sequence and the backward transform estimated from the backward image sequence; the weight coefficients of each loss term in the total loss function are dynamically adjusted according to whether the training data has real pose labels; when real pose labels are sufficient, the weight of the motion modulation mean absolute error is increased; when real pose labels are few, the weights of the masking feature recovery loss and the bidirectional temporal consistency loss are increased.

[0058] Therefore, by adopting the above-mentioned progressive joint optimization strategy, the time triplet loss constructs a feature space foundation with temporal continuity; the motion modulation mean absolute error strengthens the model's regression ability in drift-prone regions by assigning higher weights to challenging samples such as large displacements and strong out-of-plane motion; and the bidirectional temporal consistency loss eliminates the scanning direction bias, ensuring the geometric closure of forward and reverse inference trajectories, thereby significantly reducing the cumulative drift of long sequences.

[0059] As an example, the model building and optimization methods are explained: The network model used in this application can be obtained through training with labeled or weakly labeled scanning sequences. The training samples consist of two-dimensional ultrasound or photoacoustic scanning sequences, which can be subjected to size uniformity, grayscale normalization, sequence truncation, interval sampling, and sequence inverse amplification before training. Through the above processing, the model is exposed to samples with different scanning directions, different inter-frame intervals, and different motion amplitudes during training, thereby improving its adaptability to changes in free-hand scanning.

[0060] During training, the feature encoder, structure-aware channel decoupling module, cross-frame attention matching module, temporal modeling unit, and pose regression head are jointly optimized. To avoid the network only memorizing local speckle or photoacoustic clutter, a low-proportion mask can be introduced into the latent feature space, and consistency constraints are imposed on the recovered features at the masked locations. To ensure temporal continuity of features between adjacent frames, temporal triplet constraints can be introduced; to more fully optimize regions with large displacements and strong out-of-plane motion, motion modulation mean absolute error can be introduced; and to reduce scan direction bias, consistency constraints between forward and reverse sequences can be used.

[0061] After training, the network parameters are fixed and used in the actual reconstruction process. The actual reconstruction process does not require the participation of external pose sensors; it only needs to input a sequence of two-dimensional ultrasound or photoacoustic images to output the pose of adjacent frames and the three-dimensional reconstruction results.

[0062] As another example, the incremental joint optimization strategy is illustrated below: By adopting a progressive joint training strategy, the network can first learn a feature space with temporal continuity, and then optimize the pose regression accuracy.

[0063] The first stage is used to construct a latent feature space for temporal smoothing and physical perception. Anchor frame features are selected. Features of positive samples in time proximity and negative sample features from a longer time period Using time triplet loss: Where m is the interval parameter. This loss makes temporally neighboring frames closer in the feature space and non-neighboring frames farther apart, thus providing a continuous feature basis for the pose estimation of adjacent frames.

[0064] The second stage is used to optimize pose regression. Let the network prediction value be... The true value is y, the prior local motion weights extracted from the sequence are w, and the motion modulation mean absolute error is used: Where s is the numerical stability smoothing factor, and β is a hyperparameter controlling the sensitivity to motion priors. This loss assigns higher weights to large displacements, strong out-of-plane motion, or high dynamic regions, enabling the network to obtain stronger optimization constraints in frames prone to drift.

[0065] Simultaneously, forward and reverse image sequences can be constructed, and forward and reverse transforms can be estimated respectively. Furthermore, these sequences can be constrained to be geometrically inverse transforms or to maintain consistency on the cumulative trajectory, thus forming a bidirectional temporal consistency loss. The total loss can be expressed as: in, The weights for each loss term are defined above. These loss terms can be combined depending on whether the training data has true pose labels. When true pose labels are sufficient, the weight of pose regression loss can be increased. When true pose labels are scarce, the weights of masking feature recovery loss and bidirectional temporal consistency loss can be increased.

[0066] In an exemplary embodiment, the step of accumulating pose based on the relative pose parameters between adjacent frames and fusing the two-dimensional image slices in the two-dimensional image sequence into a unified three-dimensional coordinate system to obtain a three-dimensional reconstruction result includes: The relative pose parameters between adjacent frames are converted into homogeneous transformation matrices and accumulated to the reference frame coordinate system; wherein, the two-dimensional image sequence includes a two-dimensional ultrasound image sequence or a two-dimensional photoacoustic image sequence; For the two-dimensional ultrasound image sequence, the two-dimensional ultrasound slices are mapped to the unified three-dimensional coordinate system by interpolation or voxel fusion to form three-dimensional ultrasound volume data; For the two-dimensional photoacoustic image sequence, the two-dimensional photoacoustic slices are projected onto the unified three-dimensional coordinate system, and combined with threshold segmentation, blood vessel enhancement or blood vessel centerline extraction, to obtain a three-dimensional photoacoustic blood vessel network.

[0067] Therefore, a differentiated three-dimensional fusion strategy is provided for the physical characteristics of different modal data, which not only ensures the integrity of ultrasound body data, but also highlights the functional structure display of photoacoustic vascular networks, thus improving the closed loop of the entire process from pose estimation to clinical application output.

[0068] As an example, the actual reconstruction process of the 3D reconstruction method is explained: In actual reconstruction, the two-dimensional ultrasound or photoacoustic scan sequence to be reconstructed is first acquired, and the sequence images are then subjected to size unification, grayscale normalization, invalid boundary cropping, and necessary interval sampling. Subsequently, a continuous short sequence is formed from the original sequence according to a preset window length, where the short sequence length K can be 2 to 7, preferably 5. The short sequence can cover the current frame and adjacent reference frames, or it can cover multiple temporally adjacent frames before and after the current frame, in order to preserve local temporal motion information.

[0069] After the short sequence is input into the feature encoder (feature encoding module), local structural features and global contextual features are obtained. Local structural features are used to represent details such as tissue boundaries, blood vessel cross-sections, fascial interfaces, and local textures; global contextual features are used to represent tissue layout, blood vessel topology, and cross-frame geometric relationships over a larger range. For adjacent frames or adjacent feature maps, an initial inter-frame matching response can be obtained through a correlation calculation layer, which serves as auxiliary information for subsequent pose estimation.

[0070] After obtaining the intermediate features, they are used as input features to the structure-aware channel decoupling module. This module calculates channel attention weights based on the global spatial statistics of each feature channel, adaptively reducing the influence of channels related to ultrasound speckle decorrelation, photoacoustic transient clutter, or mode-specific artifacts, while preserving or enhancing channels related to stable structures such as fascial interfaces, tissue boundaries, and vascular networks. The resulting decoupling features serve as robust representations for cross-frame matching.

[0071] In the latent feature space, the decoupled features of the current frame are block-based, and some feature blocks can be randomly masked at a low proportion. The masked positions are replaced by learnable masking vectors, while the unmasked positions retain the original features. Subsequently, the features of the current frame and the features of adjacent reference frames are jointly input into the cross-frame attention matching module. The module models the internal structural relationships of a single frame through self-attention and aggregates global contextual information from adjacent reference frames through cross-attention, thereby establishing a spatial correspondence between the current frame and adjacent reference frames.

[0072] After cross-frame enhanced features are input into the temporal modeling unit and pose regression head, the output is the 3D translation and 3D rotation between adjacent frames. The temporal modeling unit is used to constrain the continuity of motion changes within short sequences, and the pose regression head is used to map cross-frame features to six-DOF motion parameters of adjacent frames. During inference, random masking can be turned off, or a low proportion of masking can be retained and the robustness of pose estimation can be improved by averaging multiple predictions.

[0073] After obtaining the poses of each adjacent frame, they are converted into homogeneous transformation matrices and accumulated into a unified reference coordinate system. Let the reference frame be... The transformation from the k-th frame to the reference frame can be obtained by multiplying adjacent transformations in time order. For images before the reference frame, the inverse transformation of adjacent transformations can be used for reverse accumulation. After pose accumulation, each 2D image slice is mapped to a 3D coordinate system according to its corresponding spatial pose. For ultrasound images, 3D ultrasound volume data can be formed through nearest neighbor interpolation, linear interpolation, weighted voxel fusion, or volume rendering. For photoacoustic images, they can be first projected into 3D space, and then combined with threshold segmentation, vessel enhancement, surface extraction, or vessel centerline extraction to obtain a 3D photoacoustic vascular network. Finally, 3D volume data or a 3D vascular network is output, and the estimated scan path and pose matrix of each frame can be output simultaneously.

[0074] The technical solution provided in this embodiment differs from related technologies in that it utilizes global average pooling and global max pooling to construct attention weights for the structure-aware channel, distinguishing unstable acoustic textures from stable anatomical structures at the feature channel level; it employs a low-proportion random masking in the latent feature space and recovers the masked features through cross-attention between adjacent reference frames to establish a cross-frame global geometric correspondence; it adopts a progressive joint optimization strategy consisting of temporal triplet loss, masking feature recovery loss, motion modulation mean absolute error, and bidirectional temporal consistency; and it combines the above-mentioned structure-aware feature decoupling, cross-frame attention matching, and temporal optimization for ultrasound and photoacoustic 3D reconstruction without external tracking hardware, which is particularly suitable for pure photoacoustic reconstruction scenarios with strong photoacoustic clutter, sparse blood vessel cross-sections, and complex reciprocating scanning trajectories.

[0075] As an example, the 3D reconstruction and system implementation of this application are illustrated: The method provided in this embodiment can be implemented as a software method or as a sensorless 3D reconstruction system for ultrasound and photoacoustic images. This system includes at least an image acquisition module, a feature encoding module, a structure-aware channel decoupling module, a cross-frame attention matching module, a temporal pose estimation module (temporal modeling unit and pose regression head), and a 3D reconstruction module (used to accumulate pose to a unified coordinate system and fuse 2D slices to obtain the 3D reconstruction result).

[0076] The image acquisition module acquires two-dimensional ultrasound image sequences or two-dimensional photoacoustic image sequences. The feature encoding module extracts local structural features and global contextual features from adjacent frames or short sequences. The structure-aware channel decoupling module generates channel attention weights based on channel global statistics and outputs decoupling features. The cross-frame attention matching module performs low-scale masking on the features of the current frame and performs cross-attention matching with features from adjacent reference frames. The temporal pose estimation module estimates the 3D translation and 3D rotation of adjacent frames based on cross-frame enhancement features. The 3D reconstruction module fuses two-dimensional slices into 3D ultrasound volume data or a 3D photoacoustic vascular network based on the accumulated pose.

[0077] The aforementioned system can be deployed on medical imaging workstations, the computing units of ultrasound or photoacoustic imaging equipment, graphics processing unit servers, or edge computing platforms with deep learning inference capabilities. Model training can be completed on the graphics processing unit server, while clinical inference can be completed on the local workstation or device.

[0078] The purpose of this application is to provide a three-dimensional reconstruction method to address the problems of unstable pose estimation between adjacent frames, severe cumulative drift over long sequences, and insufficient accuracy in three-dimensional reconstruction under complex acoustic noise environments in two-dimensional ultrasound or two-dimensional photoacoustic free-hand scanning sequences without external pose sensors. Specifically, it aims to adaptively suppress unstable acoustic features such as ultrasound speckle decorrelation, photoacoustic dynamic clutter, and modality-specific artifacts at the network feature level; enhance relatively stable anatomical structural features such as fascial interfaces, tissue boundaries, and vascular networks; establish a global spatial geometric correspondence between the current frame and adjacent reference frames to reduce the impact of local acoustic texture mismatches on pose estimation; reduce cumulative trajectory drift under complex out-of-plane motion, large displacement, reciprocating scanning, and long sequence scanning conditions; and achieve three-dimensional ultrasound volume data reconstruction or three-dimensional photoacoustic vascular network reconstruction without relying on external optical, electromagnetic, or inertial tracking hardware.

[0079] To achieve the above objectives, see [link to relevant documentation]. Figure 1 The diagram below illustrates the network structure of this application, showing the overall network structure of the method, including image feature input, local feature branch, global feature branch, correlation layer, structure-aware channel decoupling module, cross-frame attention matching module, temporal modeling unit, forward / backward sequence branch, pose output, and 3D reconstruction (3D reconstructed volume data) output. This diagram also illustrates the core technical solution of the invention, including the architecture of two sub-modules: (a) the channel decoupling module and (b) the cross-frame attention matching module.

[0080] Reference Figure 1 The upper part is the main workflow, starting from the input two-dimensional image sequence (ultrasound image sequence), and sequentially going through feature encoding, channel decoupling, cross-frame matching, pose estimation, and finally outputting the three-dimensional reconstruction result. It also shows the training logic of forward and reverse sequence branches and loss function constraints.

[0081] The lower left sub-figure (a) shows the internal details of the channel decoupling module, illustrating two paths: a local branch and a global branch. Through average / max pooling, channel attention weights are generated via a shared weight network, and features are modulated to output decoupled features (decoupling features). The input consists of input features (intermediate features) and associated features (initial inter-frame matching response).

[0082] The lower right sub-figure (b) shows the internal details of the cross-frame attention matching module, demonstrating the process of masking the input, aggregating the context through self-attention and cross-attention, and finally outputting cross-frame enhanced features.

[0083] The network structure diagram has been described above and will not be repeated here.

[0084] In summary, the beneficial effects of this embodiment are as follows: First, it can improve the feature stability under complex acoustic environments. Through the structure-aware channel decoupling module, channel attention weights are adaptively generated based on the channel's global spatial statistics, reducing the weights of high-risk channels corresponding to ultrasound speckle decorrelation, photoacoustic transient clutter, and modality-specific artifacts, thus preserving stable structural features such as fascial interfaces, tissue boundaries, and vascular networks. Therefore, subsequent pose estimation in adjacent frames is less susceptible to interference from local noise and transient artifacts. Second, it can improve the consistency of cross-frame spatial matching. Simple local texture-dependent paths are disrupted by low-proportion random masking, and the global geometric context is aggregated from adjacent reference frames through cross-frame cross-attention. The network needs to recover masked features based on the stable cross-frame structure, thus enabling it to learn more generalized spatial correspondences. Third, it can reduce long-sequence cumulative trajectory drift. The continuity of features in adjacent frames is constrained by temporal triplet loss, higher training weights are assigned to frames with large displacements and strong out-of-plane motion using motion modulation mean absolute error, and scan direction bias is reduced through bidirectional temporal consistency. These training strategies can reduce trajectory drift caused by the accumulation of local errors along long sequences. Then, it is applicable to ultrasound and photoacoustic 3D reconstruction without external hardware assistance. It does not rely on optical trackers, electromagnetic trackers, or inertial measurement units; the pose of adjacent frames can be estimated using only two-dimensional ultrasound or two-dimensional photoacoustic image sequences, reducing system hardware complexity and clinical deployment difficulty. Finally, it is beneficial for pure photoacoustic 3D functional structure display. In photoacoustic images, vascular cross-sections are sparse and cluttered, making conventional pure image matching methods prone to instability. Through stable structural channel screening and cross-frame global geometric correspondence, continuous vascular network information can be better utilized for 3D reconstruction.

[0085] See Figure 2 The figure shows a comparison of 3D reconstruction results, comprising two parts: (a) a comparison of 3D reconstruction results on a forearm ultrasound dataset, demonstrating the differences between different methods and the actual results under straight, C-shaped, and S-shaped scanning trajectories; and (b) a comparison of reconstruction results on a palm photoacoustic dataset, showing the scanning path and the reconstructed 3D vascular network. To verify the beneficial effects of this embodiment, the following explanations are provided regarding data sources, experimental conditions, evaluation indicators, comparison methods, quantitative results, qualitative results, and technical reasons: In terms of data sources, two datasets were used: a forearm ultrasound dataset and a palm photoacoustic dataset. The forearm ultrasound dataset contains transverse and longitudinal scans of 50 subjects, with an image resolution of 480×640 and a frame rate of 20 frames per second. Scan trajectories include straight lines, C-shapes, and S-shapes, and scan directions include parallel to the forearm, perpendicular to the forearm, and forward and reverse movements, totaling 1200 scan sequences, averaging approximately 400 frames per sequence, with a physical scan length of approximately 180 to 200 mm. The palm photoacoustic dataset contains palm scans of 18 subjects, totaling 249 trajectories, with an image resolution of 420×420. Due to the reciprocating nature of the scanning process, the data for each subject was divided into 13 to 14 trajectories and stitched together during reconstruction. The training, validation, and test sets were divided according to subject identity, with the ultrasound dataset having a ratio of 3:1:1 and the photoacoustic dataset a ratio of 10:4:4.

[0086] Regarding experimental conditions, to reduce overfitting and simulate complex free-hand scanning scenarios, sequence inversion and interval sampling were performed on the scanning sequences. The input sequence length was set to 5 frames. During training, each training scan was randomly expanded to 50 sequences, and during testing, each test scan was expanded to 10 sequences. The optimizer used was AdamW, with an initial learning rate of... The learning rate decreases to 0.8 every 50 epochs, for a total of 500 epochs; the learning rate during the course learning phase is... The training was conducted for 1000 epochs; the batch size was 8; and the training hardware was an NVIDIA RTX 4090 GPU.

[0087] For evaluation metrics, relative translation error (RTE), relative rotation error (RRE), absolute trajectory error (ATE), and final drift rate (FDR) were used to assess the accuracy of pose estimation and trajectory reconstruction. FDR is obtained by dividing the final drift by the total trajectory length. For the forearm ultrasound dataset, the final drift (F-Drift) was further reported; for the palm photoacoustic dataset with complex reciprocating paths, the Fréchet distance (F-Dist) was further used to evaluate the spatial curve similarity between the estimated trajectory and the reference trajectory, in order to reduce the impact of scanning speed or local stride differences on the evaluation results.

[0088] Regarding the comparison methods, under the same experimental settings, the method corresponding to this embodiment is compared with DCL-Net and DC. 2 Compare with existing methods such as -Net, PLPPI, LongTerm, and MoGLo.

[0089] In terms of quantitative experimental results, on the forearm ultrasound dataset, the relative translational error (RTE) of this method was 0.179 mm, the relative rotational error (RRE) was 0.067 degrees, the absolute trajectory error (ATE) was 21.53 mm, the final drift (F-Drift) was 31.49 mm, and the final drift rate (FDR) was 16.29%. In comparison, the MoGLo method had an ATE of 25.12 mm and an FDR of 18.88%. Therefore, compared to the MoGLo method, this method reduced the ATE from 25.12 mm to 21.53 mm (a reduction of approximately 14.29%) and the FDR from 18.88% to 16.29% (a reduction of approximately 13.72%).

[0090] On the hand photoacoustic dataset, our proposed method achieves an RTE of 0.197 mm, an RRE of 0.073 degrees, an ATE of 22.25 mm, a Fréchet distance of 35.51 mm, and an FDR of 25.75%. In comparison, the MoGLo method achieves an ATE of 24.35 mm, a Fréchet distance of 43.52 mm, and an FDR of 28.31%. Therefore, our proposed method also reduces absolute trajectory error, spatial curve differences, and final drift rate in purely photoacoustic scenarios.

[0091] See Table 1 below, which is a quantitative comparison table for 3D trajectory reconstruction, comparing our method (SCC-Net) with DCL-Net and DC. 2 The relative translation error, relative rotation error, absolute trajectory error, final drift or Fréchet distance, and final drift rate of methods such as Net, PLPPI, LongTerm, and MoGLo on forearm ultrasound datasets and palm photoacoustic datasets are compared. All of the methods mentioned above are publicly available in this field.

[0092] Table 1 The technical solution of this embodiment will be described below through several examples: Example 1: Sensorless 3D Reconstruction of Forearm Ultrasound Images Two-dimensional ultrasound image sequences of the forearm were acquired at a resolution of 480×640 pixels and a frame rate of 20 frames per second. Scan trajectories could be linear, C-shaped, or S-shaped, and could be performed in forward or reverse directions parallel or perpendicular to the forearm. Each scan sequence averaged approximately 400 frames, with a physical scan length of approximately 180 to 200 mm.

[0093] The specific implementation steps are as follows: 1. Perform grayscale normalization and size unification on the acquired two-dimensional ultrasound images; 2. Construct a short input sequence of length 5 frames from a continuous scan sequence; 3. Extract local structural features and global contextual features from short sequences using a feature encoder (feature encoding module); 4. Input the intermediate features obtained from encoding into the structure-aware channel decoupling module, and generate channel attention weights through global average pooling and global max pooling to reduce the influence of speckle decorrelation on related channels; 5. Block the decoupled features of the current frame and randomly mask them at a rate not exceeding 10%; 6. Input the masked current frame features and the features of adjacent reference frames into the cross-frame attention matching module to obtain cross-frame enhanced features; 7. Input the cross-frame enhanced features into the temporal modeling unit and pose regression head, and output the 3D translation and 3D rotation of adjacent frames; 8. Accumulate the poses of adjacent frames to the reference frame coordinate system, and fuse the two-dimensional ultrasound slices into three-dimensional ultrasound volume data.

[0094] During training, sequence inversion and interval sampling can be used for data augmentation. In the experiment, the optimizer AdamW was used with an initial learning rate of 1×10^-4, which decayed to 0.8 of the original rate every 50 epochs, for a total of 500 epochs. During the course learning phase, the learning rate was set to 1×10^-5, and the training lasted for 1000 epochs. The batch size was 8, and the training hardware was an NVIDIA RTX 4090 GPU.

[0095] Example 2: Sensorless 3D Vascular Reconstruction from Photoacoustic Images of the Palm A sequence of two-dimensional photoacoustic images of the palm was acquired, with an image resolution of 420×420. Since photoacoustic scanning of the palm can include reciprocating motion, the data of each subject can be divided into multiple trajectories, which are then stitched together into the same three-dimensional coordinate system based on the cumulative pose during the reconstruction stage.

[0096] The specific implementation steps are as follows: 1. Input a sequence of two-dimensional photoacoustic images of a palm, and perform normalization, sequence truncation, and short sequence construction; 2. Extract local vascular structure features and global contextual features from photoacoustic images using a feature encoder; 3. Suppress photoacoustic transient acoustic clutter and mode-specific artifacts through a structure-sensing channel decoupling module; 4. Perform low-proportion random masking on the features of the current frame, and use features from adjacent reference frames to perform cross-frame attention matching; 5. Output the six-DOF pose of adjacent frames through the temporal modeling unit; 6. Stitch together multiple reciprocating scan trajectories based on the accumulated pose; 7. Project the two-dimensional photoacoustic slices onto a unified three-dimensional coordinate system to reconstruct the three-dimensional photoacoustic vascular network of the palm.

[0097] This example is suitable for scenarios where the cross-section of blood vessels in photoacoustic images is sparse, dynamic clutter is obvious, the scanning trajectory is complex and reciprocating, and it is inconvenient to install external tracking hardware.

[0098] In addition, in specific applications, the feature encoder can be replaced by a convolutional neural network, a residual network, a visual Transformer, a state-space visual model, or a combination of the above models; the statistics in the structure-aware channel decoupling module can include the mean, maximum, variance, standard deviation, temporal variance, or a combination of the above statistics; the cross-frame matching module can adopt a single-layer or multi-layer self-attention, cross-attention, multi-head attention, or an equivalent cross-frame context aggregation structure; the temporal modeling unit can adopt ConvLSTM, GRU, temporal convolutional network, Transformer temporal module, state-space model, or a combination thereof; the pose parameters can be represented by Euler angles, rotation vectors, quaternions, or transformation matrices; the 3D fusion method can adopt nearest neighbor interpolation, linear interpolation, voxel fusion, point cloud fusion, surface reconstruction, vascular centerline extraction, or 3D representation based on implicit fields; the input image can be a 2D ultrasound image, a 2D photoacoustic image, or a single-modal / dual-modal sequence of both in the same scanning process.

[0099] Example 2.

[0100] This embodiment provides an electronic device, including a processor and a memory, wherein the memory stores a computer program, and the processor executes the computer program to implement the three-dimensional reconstruction method of medical images as described in Embodiment 1.

[0101] Example 3.

[0102] This embodiment provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the three-dimensional reconstruction method of medical images as described in Embodiment 1.

[0103] Although the invention has been described with reference to illustrative embodiments, those skilled in the art will understand that various other changes, omissions, and / or additions can be made without departing from the spirit and scope of the invention, and that elements of the described embodiments can be substituted with substantially equivalents. Furthermore, many modifications can be made without departing from the scope of the invention to adapt particular situations or materials to the teachings of the invention. Therefore, this document is not intended to limit the invention to the specific embodiments disclosed for carrying out the invention, but rather to include all embodiments falling within the scope of the appended claims.

Claims

1. A method for three-dimensional reconstruction of medical images, characterized in that, The method includes: A two-dimensional image sequence of medical images is obtained; the current frame and adjacent reference frames in the two-dimensional image sequence are extracted using a feature encoding module to obtain intermediate features; The structure-aware channel decoupling module generates channel attention weights based on the global spatial statistics of the intermediate features, and modulates the intermediate features element by element based on the channel attention weights to obtain decoupled features. In the feature space output by the feature encoding module, the decoupled features of the current frame are partially masked, and the masked features of the current frame and the features of the adjacent reference frames are input into the cross-frame attention matching module for cross-frame context aggregation to obtain cross-frame enhanced features. Based on the cross-frame enhancement features, the relative pose parameters between the current frame and the adjacent reference frame are estimated by a temporal modeling unit and a pose regression head. Pose accumulation is performed based on the relative pose parameters between adjacent frames, and the two-dimensional image slices in the two-dimensional image sequence are fused into a unified three-dimensional coordinate system to obtain the three-dimensional reconstruction result.

2. The method according to claim 1, characterized in that, The structure-aware channel decoupling module generates channel attention weights based on the global spatial statistics of the intermediate features, and modulates the intermediate features element-wise based on the channel attention weights to obtain decoupled features, including: Global average pooling and global max pooling are performed on the intermediate features respectively to obtain the channel average statistical description and the channel maximum statistical description; The average statistical description of the channel and the maximum statistical description of the channel are input into a shared weight network to obtain the channel attention weights. The intermediate features are modulated element-wise based on the channel attention weights to obtain the decoupled features.

3. The method according to claim 2, characterized in that, The channel attention weights are obtained by performing nonlinear transformations on the average statistical description and the maximum statistical description of the channel using a shared weight network, and then adding the two nonlinear transformation results and processing them with a Sigmoid activation function. The decoupling feature is obtained by multiplying the channel attention weights and the intermediate features element-wise.

4. The method according to claim 1, characterized in that, The process involves partially masking the decoupled features of the current frame in the feature space output by the feature encoding module, and then inputting the masked current frame features and the features of the adjacent reference frames into the cross-frame attention matching module for cross-frame context aggregation to obtain cross-frame enhanced features, including: The decoupling features of the current frame are block-processed to obtain the current frame feature sequence, and the decoupling features of the adjacent reference frames are block-processed to obtain the adjacent reference frame feature sequence. Feature blocks are randomly selected from the current frame feature sequence according to a preset masking ratio for masking, and the masked feature blocks are replaced with learnable masking vectors. The masked current frame feature sequence and the adjacent reference frame feature sequence are input into the cross-frame attention matching module; The cross-frame enhanced features are obtained by modeling the internal structural relationships of a single frame through the self-attention layer in the cross-frame attention matching module, and by aggregating global context information from the adjacent reference frames through the cross-attention layer.

5. The method according to claim 4, characterized in that, The preset masking ratio does not exceed 10%; the parameters of the cross-frame attention matching module are obtained by training based on the masking feature recovery loss. The masking feature recovery loss is constructed based on the cosine similarity between the output features of each masked feature block after recovery by the cross-frame attention matching module and the original features before masking, and is used to constrain the output features after recovery to be consistent with the original features before masking in semantic distribution.

6. The method according to claim 1, characterized in that, After acquiring the two-dimensional image sequence of the medical image, the method further includes: Extract a continuous short sequence of a preset window length from the two-dimensional image sequence, the continuous short sequence covering the current frame and the adjacent reference frame; The step of extracting features from the current frame and adjacent reference frames in the two-dimensional image sequence through the feature encoding module includes: The feature encoding module extracts features from the continuous short sequence to obtain local structural features and global context features as intermediate features. The step of estimating the relative pose parameters between the current frame and the adjacent reference frames based on the cross-frame enhancement features, using a temporal modeling unit and a pose regression head, includes: The cross-frame enhancement features are input into the temporal modeling unit and the pose regression head, and the three-dimensional translation vector and three-dimensional rotation vector between the current frame and the adjacent reference frame are output as the relative pose parameters.

7. The method according to claim 6, characterized in that, The parameters of the temporal modeling unit and the pose regression head are obtained by training based on the total loss function using a progressive joint optimization strategy. The total loss function is a weighted combination of temporal triplet loss, masking feature recovery loss, motion modulation mean absolute error, and bidirectional temporal consistency loss. The motion modulation mean absolute error is weighted based on the prior local motion weights extracted from the two-dimensional image sequence to weight the pose regression error; the bidirectional temporal consistency loss is constructed based on the geometric inverse transformation relationship or cumulative trajectory consistency between the forward transform estimated from the forward image sequence and the backward transform estimated from the backward image sequence; the weight coefficients of each loss term in the total loss function are dynamically adjusted according to whether the training data has real pose labels; when real pose labels are sufficient, the weight of the motion modulation mean absolute error is increased; when real pose labels are few, the weights of the masking feature recovery loss and the bidirectional temporal consistency loss are increased.

8. The method according to claim 1, characterized in that, The process of accumulating pose based on the relative pose parameters between adjacent frames and fusing two-dimensional image slices from the two-dimensional image sequence into a unified three-dimensional coordinate system to obtain a three-dimensional reconstruction result includes: The relative pose parameters between adjacent frames are converted into homogeneous transformation matrices and accumulated to the reference frame coordinate system; wherein, the two-dimensional image sequence includes a two-dimensional ultrasound image sequence or a two-dimensional photoacoustic image sequence; For the two-dimensional ultrasound image sequence, the two-dimensional ultrasound slices are mapped to the unified three-dimensional coordinate system by interpolation or voxel fusion to form three-dimensional ultrasound volume data; For the two-dimensional photoacoustic image sequence, the two-dimensional photoacoustic slices are projected onto the unified three-dimensional coordinate system, and combined with threshold segmentation, blood vessel enhancement or blood vessel centerline extraction, to obtain a three-dimensional photoacoustic blood vessel network.

9. An electronic device comprising a processor and a memory, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 8.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 8.