A cardiac ultrasound spatiotemporal feature processing method based on federated learning and related device

By employing a federated learning-based spatiotemporal feature processing method for cardiac ultrasound, the contradiction between data privacy protection and collaborative training in multi-center ultrasound was resolved. This method focuses on key areas of the images, adapts to non-uniform sampling and low-quality images, improves the accuracy of cardiac amyloidosis identification and model robustness, and achieves stable cross-institutional assisted screening.

CN122636552BActive Publication Date: 2026-12-01PEKING UNION MEDICAL COLLEGE HOSPITAL +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610794288.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-06-03
Publication Date
2026-12-01
Estimated Expiration
2046-06-03

AI Technical Summary

Technical Problem

Existing cardiac amyloidosis screening technologies present a contradiction between protecting the privacy of multi-center medical ultrasound data and collaborative training. Data silos lead to poor model generalization performance. Traditional masking pre-training strategies cannot focus on key areas of ultrasound image diagnosis. Spatiotemporal feature extraction mechanisms are not suited to the temporal characteristics of non-uniform sampling in echocardiography. Furthermore, data heterogeneity caused by different ultrasound probe scanning modes results in poor robustness of models deployed across institutions. The models are poorly adaptable to low-quality clinical ultrasound images and struggle to cope with interference from real-world scenarios such as motion blur and noise.

Method used

A federated learning-based spatiotemporal feature processing method for cardiac ultrasound is adopted. By preprocessing multi-center distributed cardiac ultrasound images, unifying size, type and pixel normalization, and generating adaptive masks, a federated pre-training module is built for privacy-compliant feature extraction. Spatial features are extracted and sparse temporal coding is generated using pre-trained ViT. A two-branch spatiotemporal fusion network is constructed to adapt to linear and convex array scanning modes. Data augmentation is performed by simulating motion blur, Gaussian blur and salt-and-pepper noise to achieve a privacy architecture where data is usable but not visible. The combination of adaptive mask, sparse temporal coding and two-branch fusion accurately captures spatiotemporal features.

Benefits of technology

It achieves privacy-compliant collaborative modeling, focuses on key areas of the myocardium and valves, improves the accuracy of cardiac amyloidosis identification, adapts to low-quality images, enhances model robustness and cross-hospital deployment stability, supports multi-center collaborative modeling, and significantly improves the clinical applicability and promotional value of rare cardiomyopathy screening.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122636552B_ABST
    Figure CN122636552B_ABST
Patent Text Reader

Abstract

This invention provides a method and related apparatus for spatiotemporal feature processing of cardiac ultrasound based on federated learning, applied in the field of medical data processing technology. For multi-center cardiac ultrasound images, federated learning is used to achieve privacy-compliant modeling. First, the images are standardized and preprocessed to generate adaptive masks that focus on key regions; then, federated pre-training is performed using MAE to achieve feature extraction and privacy protection. Sparse sampling of temporal frames is performed, spatial features are extracted using ViT and sparse temporal codes are generated, and temporal correlation is enhanced using a Transformer; a dual-branch network is constructed to fuse global and fine-grained spatiotemporal features, and screening results are output through temporal aggregation and classification. Simultaneously, the scanning mode is adapted and data augmentation is performed to accurately assist in the screening of cardiac amyloidosis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical data processing technology, and in particular to a method and related apparatus for processing spatiotemporal features of cardiac ultrasound based on federated learning. Background Technology

[0002] This invention aims to address four core technical challenges in existing cardiac amyloidosis screening technologies: First, there is a contradiction between protecting the privacy of multi-center medical ultrasound data and collaborative training. Data silos lead to poor model generalization performance, while centralized training poses risks of privacy leakage and compliance.

[0003] Second, traditional mask pre-training strategies cannot focus on key areas of ultrasound image diagnosis, and the spatiotemporal feature extraction mechanism is not suitable for the temporal characteristics of non-uniform sampling in echocardiography, resulting in insufficient accuracy in auxiliary screening.

[0004] Third, the data heterogeneity caused by different ultrasound probe scanning modes results in poor robustness of the model when deployed across institutions.

[0005] Fourth, the model has a weak ability to adapt to low-quality clinical ultrasound images, and it is difficult to cope with interference from real-world scenarios such as motion blur and noise.

[0006] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0007] Other features and advantages of this application will become apparent from the following detailed description, or may be learned in part by practice of the invention.

[0008] According to one aspect of this application, a spatiotemporal feature processing method for cardiac ultrasound based on federated learning is provided, comprising: preprocessing multi-center distributed cardiac ultrasound images, unifying size, type, and pixel normalization, and outputting single-frame and temporal frame sequence data; dividing the single frame into blocks and performing Gaussian filtering for noise reduction, calculating texture scores using 3×3 Laplacian convolution, generating adaptive masks according to texture distribution, and outputting mask matrix and position index information; building a federated pre-training module, reconstructing mask image blocks using MAE encoding and decoding, updating local gradients according to MSE loss, and cropping; removing offline clients in a central server, iteratively updating the global model by weighting and aggregating local parameters according to data volume, and completing privacy-compliant federated pre-training feature extraction; for sparse sampling of temporal frames, extracting spatial features using pre-trained ViT, generating sine-cosine sparse temporal codes according to the acquisition index, fusing features, and then processing them using T... The ransformer multi-head self-attention enhancement method is used to enhance temporal correlation and output frame-level temporal feature sequences. A two-branch spatiotemporal fusion network is constructed, where 3D residual convolution combined with gated attention extracts global spatiotemporal features, and 2D residual convolution is fused with temporal encoding to generate fine-grained temporal features. The two types of features are concatenated to obtain spatiotemporal fusion feature information. Attention-weighted temporal aggregation is performed on the spatiotemporal fusion features, which are compressed into video-level features. The input is a fully connected classification head, which is then processed by softmax to output the class probability including cardiac amyloidosis. The polar coordinate bidirectional transformation is adapted to linear and convex matrix scanning modes, and motion blur, Gaussian blur, and salt-and-pepper noise are simulated for joint data augmentation to generate robust optimization information. Based on a federated learning privacy architecture, the data is made usable but not visible. Adaptive masking, sparse temporal encoding, and two-branch fusion are combined to accurately capture spatiotemporal features and generate cardiac amyloidosis auxiliary screening information.

[0009] Another aspect of this application is a federated learning-based spatiotemporal feature processing apparatus for cardiac ultrasound, used to execute executable instructions to perform the above-described federated learning-based spatiotemporal feature processing method for cardiac ultrasound.

[0010] According to another aspect of this application, an electronic device includes: a first processor; and a memory for storing executable instructions of the first processor; wherein the first processor is configured to execute the above-described federated learning-based spatiotemporal feature processing method for cardiac ultrasound by executing the executable instructions.

[0011] According to another aspect of this application, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a second processor, implements the above-described federated learning-based spatiotemporal feature processing method for cardiac ultrasound.

[0012] The beneficial technical effects of this application are as follows: Employing a federated learning architecture, the original ultrasound images from each medical institution remain locally, only exchanging model parameters, thus achieving privacy-compliant collaborative modeling. First, the ultrasound images are standardized, and adaptive masks are generated through texture scoring to focus on key areas of the myocardium and valves. Then, federated pre-training is performed to construct a global feature extraction model. In downstream tasks, temporal frames are sparsely sampled, and ViT is used to extract spatial features and generate sparse temporal codes. A dual-branch network is used to capture global motion and local fine features in parallel, followed by attention-based temporal aggregation and classification output. Simultaneously, the model adapts to linear and convex array probes and simulates low-quality interference, improving its robustness and enabling accurate assisted screening under multi-center, low-quality imaging conditions.

[0013] This application aims to achieve data usability without visibility through federated learning, avoiding the risk of original image leakage, adapting to medical data compliance requirements, adaptively masking to focus on lesion areas, and fully coupling spatiotemporal features to significantly improve the accuracy of cardiac amyloidosis identification. Furthermore, it employs a unified dual-probe scanning mode, is compatible with low-quality images such as blurred and noisy images, exhibits high stability in cross-hospital deployment, supports multi-center collaborative modeling, and effectively enhances the clinical applicability and promotional value of rare cardiomyopathy screening.

[0014] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0015] Figure 1 A flowchart of a method for processing spatiotemporal features of cardiac ultrasound based on federated learning, provided in an embodiment of this application, is shown. Figure 2 A diagram illustrating the architecture of a federated learning privacy modeling system for multicenter cardiac ultrasound images is provided. Figure 3 A complete internal flowchart of adaptive mask generation is shown; Figure 4 A flowchart of a two-branch spatiotemporal feature fusion method for cardiac ultrasound images is shown. Figure 5 A schematic diagram of a spatiotemporal feature processing device for cardiac ultrasound based on federated learning, provided in an embodiment of this application, is shown. Detailed Implementation

[0016] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.

[0017] In one implementation, Figure 1A schematic flowchart of a method for processing spatiotemporal features of cardiac ultrasound based on federated learning, according to an embodiment of this application, is shown.

[0018] S101 preprocesses multi-center distributed cardiac ultrasound images, unifying size, type, and pixel normalization, and outputs single-frame and time-series frame sequence data; after dividing the single frame into blocks, it performs Gaussian filtering for noise reduction, calculates texture scores using 3×3 Laplacian convolution, generates adaptive masks according to texture distribution, and outputs mask matrix and position index information.

[0019] In one implementation, to address the needs of privacy-focused collaborative modeling and feature extraction of multi-center distributed cardiac ultrasound images, image standardization is first performed. For raw cardiac ultrasound images distributed locally across different medical institutions and transmitted without inter-institutional transfer, image sizes are uniformly adjusted to eliminate resolution differences; data types are standardized, and image channel formats are unified; pixel values ​​are normalized, and numerical ranges are unified, forming standard single-frame images and time-series frame sequences. This eliminates imaging differences between different devices and ensures consistent input for subsequent texture scoring, mask generation, and feature calculation. For example, if a center's original image contains a 256×256 pixel grayscale single frame and a 512×512 pixel color time-series segment, standardization uniformly scales it to 224×224 pixels, converts the color image to grayscale, and maps pixel values ​​from 0–255 to the 0–1 range, outputting image data with consistent specifications, providing a unified basis for texture analysis.

[0020] The original cardiac ultrasound images are normalized to unify the spatial resolution, eliminate resolution differences acquired by different devices, and ensure that the temporal frames are aligned and consistent in spatial scale. For example, original images of different sizes, such as 256×256 and 512×512, are uniformly scaled to a standard size of 224×224 pixels, and each frame in the temporal sequence maintains this size synchronously to avoid scale interference.

[0021] The raw cardiac ultrasound images are standardized by converting color images to grayscale images and unifying the channel format to meet subsequent texture calculation requirements. For example, a three-channel color ultrasound image is converted into a single-channel grayscale image according to grayscale mapping rules, ensuring consistency with the original grayscale image format and guaranteeing uniformity in texture scoring calculation.

[0022] Pixel value normalization is performed on the raw echocardiogram images, mapping pixel values ​​to a fixed range to eliminate numerical offsets caused by differences in device brightness and gain. For example, the pixel values ​​of the original 8-bit image from 0 to 255 are uniformly divided by 255 and mapped to the range of 0 to 1. For instance, pixel 128 is normalized to 0.5 and pixel 200 is normalized to 0.78, ensuring consistent numerical benchmarks.

[0023] The preprocessed single frame is segmented into image blocks. Gaussian low-pass filtering is first applied to suppress speckle noise, followed by 3×3 Laplacian convolution to calculate texture scores. This is then converted to a non-uniform sampling probability distribution and multinomial sampling is performed to generate an adaptive mask matrix and position recovery index, completing the screening of key regions in the ultrasound image. For the standardized single-frame ultrasound image, it is first uniformly segmented into image blocks according to a preset size. In this embodiment, a uniform size of 16×16 pixels is used, dividing the 224×224 standard image into 14×14 image blocks to ensure the block scale adapts to the myocardial texture features. Ultrasound images are prone to speckle noise, which can interfere with texture recognition. Therefore, Gaussian low-pass filtering is applied to each image block using a 3×3 window and a standard deviation of 1.0 to smooth and suppress high-frequency particle noise while preserving the edges and structural information of the myocardial texture. After noise suppression, 3×3 Laplacian convolution is used to calculate the texture complexity of each image block. The texture scoring formula is: In the formula, The Laplace second derivative response of the image patch. In response to the absolute mean score, a higher score indicates richer myocardial texture and higher diagnostic value. All image patch texture scores are normalized to the 0–1 range, generating a non-uniform sampling probability distribution, with richer texture areas corresponding to higher sampling probabilities. Core image patches are sampled and retained using a multinomial distribution at a preset mask ratio of 0.75, generating a binary mask matrix where 0 represents retention and 1 represents masking. Simultaneously, a position recovery index is generated to record the original order of the retained patches for decoder reconstruction, ultimately selecting key diagnostic regions such as myocardium and valves.

[0024] First, the entire image is uniformly divided into image blocks of a fixed size. In this embodiment, the fixed size is 16×16 pixels. The 224×224 standard image is uniformly divided into blocks to ensure that the scale of each block is adapted to the myocardial texture features. Gaussian low-pass filtering is used for smoothing, employing a 3×3 window and a standard deviation of 1.0 to suppress ultrasound-specific speckle noise and reduce particle interference. Then, 3×3 Laplacian convolution is used to extract texture edge information according to the formula... Calculate the texture score for each image patch. A higher score indicates richer myocardial texture and higher diagnostic value. Convert the texture score into a non-uniform sampling probability. Regions with rich texture have a higher sampling probability. Perform polynomial sampling at a mask ratio of 0.75 to retain core image patches and mask redundancy blocks. Generate a mask matrix and location recovery index to screen out key diagnostic regions such as myocardium and valves.

[0025] First, the entire image is uniformly divided into fixed-size image blocks, and smoothed by Gaussian low-pass filtering to suppress ultrasound-specific speckle noise. Then, 3×3 Laplacian convolution is used to extract texture edge information, and texture score is calculated for each image block. The higher the score, the richer the myocardial texture and the higher the diagnostic value. The score is converted into non-uniform sampling probability, with higher sampling probability for texture-rich areas. Multinomial sampling is used to retain core image blocks, generating a mask matrix and position recovery index to screen out key diagnostic areas such as myocardium and valves.

[0026] First, the 224×224 standard image is uniformly divided into 16×16 pixel image blocks. Then, a Gaussian low-pass filter is used for smoothing, employing a 3×3 window and a standard deviation of 1.0 to effectively suppress ultrasound speckle noise. Next, a 3×3 Laplacian convolution is used to extract texture edges, according to the formula... Texture scores are calculated, with the myocardial region scoring up to 0.85, the valve region around 0.60, and the background region around 0.10. After normalizing the scores, non-uniform sampling probabilities are generated, with higher probabilities for regions with rich textures. Polynomial sampling is performed at a mask ratio of 0.75 to retain high-scoring core blocks and mask redundancy blocks, generating a mask matrix and location recovery index to accurately screen key regions such as the myocardium and valves.

[0027] A standard 224×22 image is divided into 16×16 image blocks, and Gaussian filtering is used to remove granular noise. Texture is calculated using 3×3 convolution, with the myocardial region scoring high and the background region scoring low. Sampling is performed according to the scoring probability, retaining high-scoring core blocks and mask redundant blocks, generating a mask and recording the original position, and retaining only key regions for subsequent modeling. For example, a standard 224×22 pixel ultrasound image is uniformly divided into 16×16 pixel image blocks, and then Gaussian low-pass filtering with a 3×3 window and a standard deviation of 1.0 is used to remove granular speckle noise. Subsequently, texture is calculated using 3×3 Laplacian convolution, with the myocardial region scoring approximately 0.85 and the background region scoring approximately 0.10, showing a significant difference. The texture score is converted into sampling probability, and multinomial sampling is performed according to a mask ratio of 0.75, retaining 49 high-scoring core blocks and the remaining mask redundant blocks, generating a binary mask matrix and position recovery index, and retaining only key regions such as the myocardium and valves for federated pre-training modeling.

[0028] S102: Build a federated pre-training module. Reconstruct masked image blocks using MAE encoding and decoding, update local gradients according to MSE loss and crop them; remove offline clients from the central server, aggregate local parameters according to data volume, iteratively update the global model, and complete the privacy-compliant federated pre-training feature extraction.

[0029] In one implementation, combining the needs of privacy-focused collaborative modeling and feature pre-training in federated learning, four core rules are introduced: mask autoencoder (MAE) modeling, local gradient optimization, differential privacy enhancement, and federated aggregation. Standardized processes are defined for MAE encoding / decoding, mean squared error loss calculation, gradient pruning, optional differential privacy enhancement, data-weighted aggregation, and global iteration, forming a complete pre-training technical solution. Addressing the core needs of privacy-focused collaborative modeling and feature pre-training for multi-center cardiac ultrasound images, and to solve the problems of cross-institutional data privacy protection, model training consistency, and feature extraction effectiveness, the system introduces four core technical rules: mask autoencoder (MAE) modeling, local gradient optimization, differential privacy enhancement, and federated aggregation. The system uniformly specifies the MAE encoding / decoding architecture, mean squared error loss calculation method, gradient L2 norm pruning strategy, differential privacy noise addition conditions, client-side data-weighted aggregation algorithm, and global iteration termination conditions. A standardized and reusable federated pre-training process is established to ensure complete consistency in training logic, parameter definitions, and calculation standards across different medical institutions, supporting privacy-compliant collaborative modeling across institutions.

[0030] For example, in federated pre-training of multi-center cardiac ultrasound images, key parameters such as the hierarchical structure of the MAE encoder and decoder, the calculation method of mean squared error loss, the gradient L2 norm clipping threshold, the conditions for adding Gaussian difference privacy noise, the client weighting algorithm, and the maximum number of communication rounds are unified to ensure consistent training standards across institutions. In the example, the federated pre-training uniformly adopts the ViT-Base structure as the MAE encoder, containing 12 Transformer encoding blocks, 12 attention heads, and a 768-dimensional embedding dimension; the MAE decoder contains 8 Transformer decoding blocks, 16 attention heads, and a 768-dimensional decoding embedding dimension. The encoder output dimension is (49, 102), and the decoder reconstruction dimension is (196, 768), ensuring a unified encoding and decoding structure. The gradient L2 norm clipping threshold is fixed at 1.0. When the local gradient norm exceeds 1.0, the gradient is scaled proportionally to the threshold range to avoid gradient explosion. The differential privacy noise follows an N(0, σ²C²I) distribution, where C is the gradient L2 norm clipping threshold, σ is the noise multiplier, and I is the identity matrix. The noise multiplier σ can be determined based on a preset privacy budget ε, failure probability δ, client sampling rate, local training steps, and federated communication rounds. When this optional mechanism is not enabled, each medical institution still uses federated learning to ensure that the original data does not leave its local machine, only uploading model parameters or model update amounts.

[0031] Client-side weighted weights are calculated based on the proportion of local sample size, and the aggregation formula is as follows: ,in, Let be the set of clients participating in online training during round t of federated communications. For the first Local sample size per client This represents the total sample size of online clients in this round. For the first The model parameters trained locally on each client. This is a new round of global model parameters aggregated from the central server. The maximum number of federated communication rounds is set to 100, the number of local training rounds is fixed at 1, and all client parameters and calculation standards are consistent to ensure cross-institutional training consistency and model generalization ability.

[0032] MAE encoding and decoding reconstruction are performed on the masked image patches. The reconstruction error is calculated using mean squared error loss and the local gradient is updated accordingly. Gradient clipping is then performed uniformly. During the federated pre-training phase, MA encoding and decoding reconstruction are performed on the image patches after adaptive masking on the local clients of each medical institution. Based on the original complete image patch and the reconstructed image patch, the reconstruction error is calculated using mean squared error loss. The local model gradient is updated based on the reconstruction error through backpropagation, and then gradient clipping is performed uniformly to limit the gradient within a preset threshold range, ensuring the stability of local training.

[0033] The image patch after adaptive masking is input into the MAE encoder to generate a high-dimensional mask embedding feature; this feature is then input into the MAE decoder to reconstruct the complete image patch. Based on the original complete image patch and the reconstructed image patch, the reconstruction loss is calculated using the mean squared error loss formula, which is: In the formula, For the original image block pixel values, To reconstruct the pixel values ​​of the image patch, where N is the total number of pixels, the local model gradient is updated through backpropagation of the reconstruction loss, followed by gradient clipping. A gradient L2 norm clipping threshold C is preset to limit the gradient within the threshold range.

[0034] A 16×16 masked image patch is fed into the MAE encoder to extract features, and the decoder reconstructs the image patch. The mean squared error is calculated by comparing the original image and the reconstructed image, and the model gradient is updated in reverse. A fixed clipping threshold is set to scale gradients that exceed the limit, preventing gradient explosion during local training. For example, a 16×16 masked image patch is fed into the MAE encoder to extract high-dimensional embedding features of the mask, and then the MAE decoder reconstructs the complete image patch. The original image patch and the reconstructed image patch are substituted into the mean squared error formula to calculate the reconstruction error, and the local model gradient is updated in reverse based on the error. A fixed clipping threshold for the gradient L2 norm is set, and gradients that exceed the limit are scaled to prevent gradient explosion during local training.

[0035] The federated pre-training module consists of six functional units connected in series according to a fixed data flow direction, deployed in a collaborative system between clients in various medical institutions and the central server. The local model training unit, gradient update unit, differential privacy optional enhancement unit, and parameter upload unit are deployed on the client side; the federated weighted aggregation unit and global model distribution unit are deployed on the central server. Each unit is strictly connected sequentially according to the data flow direction, realizing a complete closed loop from local model training, privacy protection processing, parameter upload, global aggregation to model distribution, ensuring a coherent federated pre-training process, orderly data flow, and clear functional division.

[0036] The local training unit performs MAE encoding / decoding and parameter updates; the gradient update unit performs gradient clipping; the differential privacy unit adds Gaussian noise as needed; the parameter upload unit uploads local model parameters; the aggregation unit weights the data according to the client's data volume; and the distribution unit sends back the updated global model. All units collaborate to complete the entire pre-training process. For example, the local training unit receives adaptive masked image patches, performs MAE encoder feature extraction and decoder image patch reconstruction, and updates local model parameters based on mean squared error loss. The MAE encoder uses a 12-layer Transformer with a 768-dimensional embedding dimension, and the decoder uses an 8-layer Transformer with a 768-dimensional decoding dimension. The gradient update unit sets the gradient L2 norm clipping threshold to 1.0 and performs scaling on the updated gradient to prevent gradient explosion. The differential privacy unit can optionally add Gaussian noise following an N(0,σ²C²I) distribution, with a clipping threshold C=1.0 and a noise multiplier σ=0.1. The parameter upload unit only transmits the updated model parameters and does not leak the original image data. The federated weighted aggregation unit calculates weights according to the proportion of client samples, and the aggregation formula is... ,in, Let be the set of clients participating in online training during round t of federated communications. For the first Local sample size per client This represents the total sample size of online clients in this round. For the first The model parameters trained locally on each client. The central server aggregates the new round of global model parameters; the global model distribution unit sends the aggregated global model back to all clients, and the units work together to complete multiple rounds of iterative pre-training.

[0037] The masked image patch, reconstruction loss, and gradient parameters are input into the federated pre-training module. After local training, gradient clipping, optional addition of Gaussian difference privacy noise, parameter uploading, weighted aggregation, and global update, a pre-trained model is iteratively generated. The federated pre-training module is deployed in a multi-center federated learning system, consisting of client-side local units and a central server aggregation unit working together. Each medical institution's client inputs adaptive masked image patches, mean squared error reconstruction loss, and local model gradient parameters into the federated pre-training module. First, local model training is performed, utilizing the MAE encoding / decoding architecture to complete feature reconstruction and parameter updates. Then, gradient clipping is performed, with a pre-set L2 norm clipping threshold of 1.0. When the local gradient norm exceeds 1.0, the gradient is scaled proportionally to the threshold range to prevent training divergence. Optional Gaussian difference privacy noise is added, following an N(0, σ²C²I) distribution, where the clipping threshold C=1.0 and the noise multiplier σ=0.1, balancing privacy protection and model accuracy. After privacy processing, the client only uploads the updated model parameters, without transmitting any original ultrasound images or patient privacy data. The central server receives parameters from all online clients, removes offline clients, and aggregates them weighted according to the proportion of local samples from each client. After aggregation, the global model is sent back to each client, iterating until a preset maximum communication round of 10 is reached, ultimately generating a privacy-compliant, feature-accurate MAE pre-trained model.

[0038] Each medical institution inputs the masked image, reconstruction error, and gradient data into the module, first completing local training and gradient clipping, adding privacy noise as needed, and then uploading the parameters; the central server aggregates the parameters and updates the global model and distributes it, repeating the above steps to a preset number of rounds to generate a pre-trained model. For example, a top-tier hospital participating in federated training inputs a 16×16 size adaptive mask image patch, a mean squared error reconstruction loss value (0.025 in the example), and local model gradient parameters into the federated pre-training module. The client completes one round of training locally using the MAE architecture, setting the gradient clipping threshold to 1.0 and scaling the gradient norm from 1.8 to 1.0. Gaussian difference privacy noise with a noise multiplier of 0.1 is added as needed. Only the updated MAE encoder and decoder parameters are uploaded to the central server. The central server aggregates the parameters of 12 online medical institutions, removes 2 offline institutions, and aggregates them by sample size weight, with hospitals accounting for 30% of the sample size having a weight of 0.3 and those accounting for 20% having a weight of 0.2. After aggregation, the global model is updated and distributed to all clients. The above steps are repeated for 10 communication rounds to finally complete the federated pre-training and output a MAE pre-trained model adapted for cardiac ultrasound feature extraction.

[0039] A privacy-compliant global feature extraction model is generated from the weighted aggregation results of online and offline clients after removing offline clients. The federated aggregation process executes a dual logic of online client screening and weighted fusion, prioritizing the removal of medical institution clients with communication abnormalities or no offline response, and only retaining clients that are normally online and participating in training to enter the aggregation process. For online clients, the weighted aggregation weight is calculated based on the proportion of local cardiac ultrasound image samples, and the local model parameters of each client are fused using a data volume-weighted federated average algorithm. Finally, a privacy-compliant and parameter-balanced global feature extraction model is generated. Throughout the process, only model parameters are interacted with, and no original images are transmitted, ensuring data privacy and security.

[0040] During federated aggregation, offline clients are prioritized for elimination. Only online clients are weighted according to their local data volume ratio, and local model parameters are aggregated using a data-weighted federated average algorithm to generate a privacy-compliant global feature extraction model. The federated aggregation process consists of three standardized steps: client screening, weight calculation, and parameter fusion. First, the central server automatically identifies and eliminates offline clients to remove invalid parameter interference. Second, the local sample size of each online client is counted, and a weighted weight is calculated based on the single client sample size divided by the total online client sample size. Third, the parameters are aggregated using a data-weighted federated average algorithm, ultimately generating a privacy-compliant global feature extraction model adapted to multi-center data distributions.

[0041] A central server selects online medical institutions and assigns weights based on the number of local images from each institution. The weights are proportional to the amount of data. All online client parameters are then weighted and fused to generate a global feature extraction model, ensuring both privacy and model generalization performance. For example, in one round of federated training, 15 medical institutions participated, with 3 offline institutions removed, leaving 12 online clients. Institution A had 200 local samples, Institution B 150, and Institution C 100, for a total of 2000 online samples. Institution A's weight was 200 / 2000 = 0.1, Institution B's was 0.075, and Institution C's was 0.05. The central server fused all online client local model parameters according to their weights to generate a global feature extraction model. No original images were transmitted throughout the process, balancing privacy compliance with cross-institution generalization performance.

[0042] The federated pre-training module collaborates with distributed clients across various medical institutions and a central server to form a unified system. On the client side, local processing logic such as image preprocessing, adaptive mask generation, MAE encoding / decoding, and gradient updates is fixed, and the original image data transmission channel is not opened throughout the process. Only the model parameter interaction layer is reserved for secure data transfer. On the central server side, two core rules are strictly implemented: offline client elimination and online client data volume weighted aggregation. Global model iteration updates are carried out cyclically until the preset termination conditions are met, ultimately generating a federated pre-trained model adapted to cardiac ultrasound feature extraction, ensuring compliance, consistency, and effectiveness of cross-institutional modeling.

[0043] Each client only completes local data processing and model training, without transmitting original images, only uploading model parameters. The central server aggregates, updates, and distributes the global model according to rules, iterating through a preset number of rounds to complete federated pre-training and output feature extraction results. For example, a federated training system includes 20 medical institution clients. The local processing logic is unified as follows: image standardization, 16×16 image block adaptive mask generation, MAE encoding and decoding reconstruction, mean squared error loss calculation, and gradient clipping (threshold 1.0). The clients retain the original cardiac ultrasound images throughout the process, only uploading the updated MAE encoder and decoder parameters to the central server. The central server first removes 3 offline clients, and the remaining 17 online clients are aggregated based on their local sample size. Assuming institution A has 300 samples with a weight of 0.15 and institution B has 200 samples with a weight of 0.1, after parameter fusion, the updated global model is distributed. The above local training, parameter uploading, aggregation, and distribution process is repeated for 100 preset communication rounds to complete federated pre-training and output a global model result that can be used for cardiac ultrasound spatiotemporal feature extraction.

[0044] S103, for sparse sampling of time-series frames, uses pre-trained ViT to extract spatial features, generates sine-cosine sparse temporal codes according to the acquisition index, and after fusing features, enhances temporal correlation through Transformer multi-head self-attention, outputting a frame-level temporal feature sequence.

[0045] In one implementation, combining the core requirements of cardiac ultrasound temporal feature extraction and adapting to the actual characteristics of non-uniform frame acquisition in clinical practice, the system introduces four core technical mechanisms: sparse sampling, spatial feature extraction, sparse temporal coding, and temporal enhancement. It unifies frame selection standards, backbone network configuration, coding generation logic, and attention parameters to construct a standardized temporal feature extraction process, ensuring that the output features accurately match the dynamic temporal patterns of cardiac contraction and relaxation.

[0046] Timing frames are selected according to the clinical cardiac cycle pattern, without frame-by-frame redundancy processing. A uniform sampling number of 16 frames is used to cover the complete cardiac cycle, balancing the integrity of temporal information with computational efficiency. The ViT backbone network trained during the federated pre-training phase is reused, employing a ViT-Base structure containing 12 Transformer coding layers, 12 attention heads, and 768-dimensional embedding dimensions. A single frame image is input, and 768-dimensional spatial features are output, ensuring consistency in spatial detail extraction.

[0047] Based on the actual acquisition index of the time-series frames, a sine-cosine sparse time-series position code is generated, using the following formula: , In the formula, pos is the acquisition index of the time frame (representing the position of the time frame in the sequence), and i is the encoding dimension index (ranging from 0 to 1). ), For feature dimension, , These are the position encoding values ​​of the pos-th temporal frame in the 2i and 2i+1 dimensions, respectively.

[0048] By injecting temporal location information into spatial features and adapting to non-uniform sampling temporal correlations, a lightweight Transformer encoder with two coding layers and eight attention heads is employed. Multi-head self-attention is used to capture inter-frame contraction and relaxation correlations, enhancing the representation of temporal motion features and outputting a (B, 16, 768)-dimensional frame-level feature sequence. For example, in a center's clinical ultrasound non-uniform sampling, 18 frames are acquired within a cardiac cycle, and 16 key temporal frames are sparsely selected according to a unified standard. Each frame is input into a pre-trained ViT backbone, outputting 768-dimensional spatial features. A 768-dimensional sine-cosine temporal code is generated according to the frame acquisition index and fused element-by-element with the spatial features. This is then enhanced by two layers of Transformer multi-head self-attention, outputting standard (B, 16, 768)-dimensional frame-level features, ensuring consistent temporal feature extraction standards across different medical institutions and adapting to the dynamic temporal characteristics of ultrasound.

[0049] Sparse sampling of temporal frames according to clinical sampling patterns is performed, and the pre-trained ViT backbone network is used to extract single-frame spatial depth features. Sparse sampling of temporal frames according to clinical sampling patterns means that, considering the characteristics of clinical echocardiography acquisition, instead of using a frame-by-frame high-density processing method, key temporal frames are selected according to the physiological patterns of the cardiac cycle. Clinical echocardiography typically acquires continuous images in units of complete cardiac cycles. Each cardiac cycle includes key phases such as systole and diastole, and the number of high-frequency continuous video frames can reach over 100 frames. Frame-by-frame calculation would significantly increase redundant computation, and adjacent frames would have highly overlapping information. Therefore, sparse sampling is uniformly performed at cardiac cycle intervals, selecting key frame sequences. This preserves the complete temporal information of cardiac motion while reducing the burden of subsequent feature calculations, adapting to the model input requirements. For example, a clinical cardiac ultrasound high-frequency continuous video was collected in 120 frames per cardiac cycle. According to the physiological interval of the cardiac cycle, one frame was selected every 7 to 8 frames, and finally sparse sampling was used to obtain 16 continuous temporal image frames, covering the complete systolic and diastolic motion cycle. The number of temporal frames was adapted to the standard input specifications for subsequent feature extraction.

[0050] Each sparsely sampled frame is input into a pre-trained ViT backbone network to extract single-frame spatial depth features. This ViT backbone network, trained during the federated pre-training phase, employs a unified ViT-Base structure, containing 12 Transformer coding layers, 12 attention heads, and 768 embedding dimensions. Network parameters are globally aggregated and optimized through federated learning to meet the spatial feature extraction requirements of cardiac ultrasound images. The input is a standardized 224×224 pixel single-frame ultrasound image, and the output is 768-dimensional single-frame spatial depth features, accurately depicting key spatial details such as myocardial texture, valve morphology, and ventricular wall structure. For example, 16 sparsely sampled, 224×224 pixel standard ultrasound frames are input frame-by-frame into the pre-trained ViT backbone network; the network automatically learns spatial details such as myocardial texture density, valve edge contours, and ventricular wall thickness, outputting 768-dimensional spatial depth features per frame, ultimately forming a frame-level spatial feature sequence of dimensions (16, 768), providing a unified spatial feature input for subsequent temporal fusion.

[0051] Based on the actual acquisition index of the time-series frames, a sine-cosine sparse temporal position code is generated. This code is then fused with frame-level features and enhanced with multi-head self-attention using a Transformer encoder to capture the cardiac motion correlation features between adjacent frames. Addressing the non-uniform acquisition characteristics of cardiac ultrasound time-series frames, a sine-cosine sparse temporal position code is generated based on the actual acquisition index of each frame within the cardiac cycle, accurately characterizing the temporal positional relationships between frames. The encoding formula is: , In the formula, pos is the actual acquisition index of the time-series frame, and i is the encoding dimension index. For the feature dimension, a uniform value of 768 is used.

[0052] The generated temporal location code is fused element-wise with the frame-level spatial features output by the pre-trained ViT backbone network, injecting temporal location information into the spatial features to achieve spatiotemporal information coupling. The fused features are then input into a lightweight Transformer encoder, which contains two coding layers and eight attention heads. Through a multi-head self-attention mechanism, it calculates the association weights of features in adjacent frames, capturing the dynamic temporal association features of heart contraction and relaxation, and enhancing the ability to express temporal motion.

[0053] Temporal codes are generated according to the actual frame acquisition sequence, integrating temporal location information into spatial features. Through multi-head self-attention in a Transformer, the dynamic correlation between systole and diastole between frames is learned, enhancing the expression of temporal motion features. For example, in a clinical echocardiogram cycle, 18 frames are non-uniformly acquired, and 16 of them are selected as temporal frames, with acquisition indices pos as 1, 2, 4, 6, 8, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, and 25. The feature dimension dmodel is 768, and corresponding sine-cosine temporal codes are generated according to the formula. The 768-dimensional temporal codes are then fused element-wise with the 768-dimensional spatial features of each frame to obtain spatiotemporally coupled features. These are input into a 2-layer, 8-head Transformer encoder, which calculates inter-frame correlations through multi-head self-attention, focusing on capturing the dynamic correlation between adjacent frames during systole and diastole, enhancing the expression of cardiac motion temporal features, and outputting a (16, 768)-dimensional frame-level temporal feature sequence.

[0054] The sampling results, spatial features, temporal coding, and enhancement information are integrated to generate a target-dimensional frame-level feature sequence. The temporal frame sequence obtained from sparse sampling, the single-frame spatial depth features output by the ViT backbone, the sparse temporal coding generated according to the acquisition index, and the temporal correlation information enhanced by Transformer multi-head self-attention are uniformly integrated to ensure dimensional matching and temporal alignment of the four types of information, eliminate redundant information, form a regularized frame-level feature sequence, and output a unified target dimension to adapt to the input requirements of the subsequent dual-branch spatiotemporal fusion module.

[0055] For example, sparse sampling of clinical echocardiographic cycles yields 16 frames of temporal sequence. Each frame outputs 768-dimensional spatial features through the ViT backbone, generates 768-dimensional sparse temporal codes according to the acquisition index, and then enhances temporal correlation through a 2-layer 8-head Transformer. After integrating four types of information, the output is a standard frame-level feature sequence with dimensions (B, T, 768), where B is the batch size, T=16 is the number of sampled frames, and 768 is the feature dimension, which is directly used as the input for subsequent dual-branch fusion.

[0056] S104 constructs a dual-branch spatiotemporal fusion network. 3D residual convolution combined with gated attention extracts global spatiotemporal features, and 2D residual convolution is fused with temporal encoding to generate fine temporal features. The two types of features are then concatenated to obtain spatiotemporal fusion feature information.

[0057] In one implementation, combining the requirements of spatiotemporal feature fusion of cardiac ultrasound with the construction of a dual-branch parallel network, rules for global spatiotemporal extraction, fine spatial generation, temporal correlation, and feature stitching are introduced. The division of labor among parallel branches, convolutional configuration, and temporal fusion calculation rules are determined. Cardiac ultrasound images simultaneously carry spatial structural information such as myocardial texture and valve morphology, as well as dynamic temporal information of systole and diastole. These two types of features are coupled and indispensable. To accurately fuse spatial details and temporal motion features and adapt to the dynamic physiological laws of the heart, a dual-branch parallel spatiotemporal fusion network is constructed. The system introduces four core rules: global spatiotemporal extraction, fine spatial generation, temporal correlation, and feature stitching. The boundaries of parallel branch division of labor, convolutional layer parameter configuration, temporal feature fusion methods, and feature stitching dimension standards are clearly defined, forming a well-structured, clearly defined, and parameter-unified dual-branch spatiotemporal fusion overall technical framework. This ensures effective fusion, dimensional consistency, and information complementarity between global motion features and local fine features.

[0058] To address the characteristic of dynamic cardiac ultrasound images containing both spatial texture and temporal motion, two parallel branches are designed. One branch extracts global spatiotemporal motion features between consecutive frames, while the other first extracts fine spatial features from a single frame and then fuses temporal information. The convolution type, attention mechanism, and temporal fusion method are unified to ensure that the output features of the two branches are complementary and dimensionally matched.

[0059] For example, considering the combined spatial texture and temporal motion characteristics of dynamic cardiac ultrasound images, two parallel and independent processing branches are set up. The first branch is the global spatiotemporal feature branch, which uses 3D residual convolution and gated attention mechanisms, configuring 1×1×1, 3×3×3, and 1×1×1 three-dimensional convolutional layers with a stride of 1 and a padding value of 1. Combined with gated attention weighting, it extracts global motion correlation features between consecutive frames, with an output dimension of (B, 768). The second branch is the fine temporal feature branch, which uses 2D residual convolution to extract fine spatial features of the myocardium and valves in a single frame, and then fuses sparse temporal codes through linear mapping addition to generate fine temporal features, with an output dimension of (B, 768). The two branches use the same convolution type, attention mechanism, and temporal fusion method, and both output feature dimensions are 768. The global motion features and local fine features complement each other, ensuring the integrity of the spatiotemporal fusion information and dimensional alignment.

[0060] Extract frame-level temporal feature sequences and sparse temporal coding information, and divide the tasks according to a dual-branch parallel architecture, defining two types of processing intervals: global spatiotemporal and fine-grained spatial + temporal. Input frame-level temporal feature sequences and sparse temporal coding, and divide the tasks according to a dual-branch parallel architecture, dividing the global spatiotemporal feature processing interval and the fine-grained spatial + temporal feature processing interval, clarifying the data flow and computation range of each.

[0061] Before the two-branch spatiotemporal fusion, the frame-level temporal feature sequence output by the Transformer and the generated sparse temporal code are uniformly input into the two-branch parallel network. According to the network architecture design, the division of labor is clearly defined, dividing the network into a global spatiotemporal feature processing interval and a fine spatial + temporal feature processing interval. The data input, processing flow, and output range are defined for each interval. The two branches run independently and do not overlap, ensuring that global motion and local details are extracted in parallel without interference.

[0062] The frame-level feature sequence output by the Transformer and the sine-cosine sparse temporal code are fed into two branches respectively. The global spatiotemporal branch receives both continuous frame features and temporal information, while the fine-grained branch receives only single-frame features and temporal codes. The two branches are computed independently and in parallel without interference. For example, the frame-level temporal feature sequence output by the Transformer, with dimensions (B, 16, 768), and the sine-cosine sparse temporal code, with dimensions (B, 16, 768), are fed into two parallel branches respectively: For the global spatiotemporal branch, all 16 frames of temporal feature sequences and their corresponding temporal codes are received simultaneously, with an input data dimension of (B, 16, 768), used to extract cross-frame global motion features. For the fine spatial branch, single-frame features and their corresponding temporal codes are received frame by frame, with an input data dimension of (B, 768), used to extract single-frame fine spatial features of the myocardium and valves. The two branches are computed independently and in parallel, each performing convolution, attention, and feature transformation independently, without sharing intermediate results, ensuring that global motion and local detail information do not interfere with each other and are extracted in parallel.

[0063] Two types of computational logic are defined: 3D residual convolution with gated attention and 2D residual convolution, clearly defining the mapping relationship of fine spatial feature output. The dual-branch parallel network has a clear division of labor, respectively undertaking the tasks of global spatiotemporal feature extraction and fine spatial feature generation. Both types of branches adopt residual convolution structure to enhance feature representation ability and avoid degradation of deep networks. The computational logic is independent and complementary, and the output feature dimension is unified with a clear mapping relationship, ensuring the effectiveness of subsequent feature concatenation and fusion.

[0064] For example, the global branch consists of residual blocks composed of 1×1×1, 3×3×3, and 1×1×1 3D convolutions, batch normalization, and ReLU activation, superimposed with gated attention weighting to output global spatiotemporal features. The first branch is the global spatiotemporal feature branch. The complete computation logic is centered on 3D residual convolutional blocks, configured with three 3D convolutional layers of 1×1×1, 3×3×3, and 1×1×1 dimensions respectively. The convolution stride is uniformly set to 1, and the padding value is set to 1 to ensure the spatiotemporal dimension remains unchanged. After each convolutional layer, a batch normalization layer and a ReLU activation layer are sequentially connected to complete feature normalization and nonlinear transformation. Then, the convolutional output and input features are added as residuals and activated by ReLU to form a complete 3D residual block. The residual block output features are input to the gated attention mechanism, according to the formula... The attention weights are calculated, where U, V, and W are learnable parameters and ⊙ is an element-wise multiplication. The spatiotemporal features are weighted and aggregated, and the final output is a global spatiotemporal feature with dimensions (B, 768), which accurately captures the cross-frame motion correlation of heart contraction and relaxation.

[0065] The fine-grained branch uses 2D residual convolution to extract spatial detail features of the myocardium, valves, etc. from a single frame. The second branch is the fine-grained spatial feature branch. The complete computation logic adopts a 2D residual convolution structure, configured with a 3×3 two-dimensional convolutional layer, stride 1, padding 1, combined with a batch normalization layer and a ReLU activation layer to form a single-frame feature extraction residual unit. The single-frame spatial features are input, and the local fine structures such as myocardial texture, valve edges, and ventricular wall thickness are extracted through 2D convolution. The output is a fine-grained spatial feature with a dimension of (B, 768), which accurately depicts the key diagnostic details of a single-frame image.

[0066] Based on feature dimension constraints, three types of processing rules are set: parallel extraction, temporal coding addition fusion, and feature concatenation, limiting the scope of feature construction. Bi-branch spatiotemporal fusion requires strict matching of feature dimensions to avoid information loss or fusion anomalies due to dimension mismatch. Based on the unified dimension constraint of cardiac ultrasound spatiotemporal feature extraction (single-branch output of 768-dimensional features), three standardized processing rules are clearly defined for parallel extraction, temporal coding addition fusion, and feature concatenation, limiting the feature dimension range and computational boundaries of each stage to ensure complete consistency of global spatiotemporal features and fine-grained temporal features, and to ensure complete and lossless information.

[0067] Three types of processing rules are set: parallel extraction, temporal coding addition fusion, and feature concatenation. The feature dimensions and fusion methods are strictly limited to ensure that the feature dimensions are consistent across branches and that information is not lost.

[0068] 1. Parallel Extraction Rule: Feature computation is performed synchronously in two branches, without dependence or interference, and runs independently throughout. The global spatiotemporal branch takes the temporal frame sequence as input and has a fixed output dimension of (B, 768); the fine spatial branch computes frame by frame, and its output dimension is also fixed at (B, 768). The feature dimensions of the two branches are completely aligned, laying the foundation for subsequent fusion.

[0069] 2. Temporal coding addition fusion rule: Fine spatial features need to be accurately fused with sparse temporal codes, using a linear mapping + element-wise addition method. First, the sparse temporal codes are fused through a linear mapping function. Mapped to 768 dimensions consistent with the fine-grained spatial features; then according to the formula Element-by-element addition and fusion, where... For the fine spatial features of the t-th frame, To correspond with the temporal encoding, the fused system retains 768 dimensions, ensuring the natural injection of temporal information and the complete preservation of spatial features. It is a linear mapping function used to map positional encoding to a dimension consistent with the fine spatial features of a single frame.

[0070] 3. Feature concatenation rules: Global spatiotemporal features and fine-grained temporal features are directly concatenated and concatenated without any additional transformations. Both branches are 768-dimensional features, and the output dimension after concatenation is unified to (B, 2×768), fully preserving global motion information and local fine-grained information without information compression or loss.

[0071] For example, in parallel extraction: the global spatiotemporal branch and the fine spatial branch are computed synchronously and independently. The global branch outputs (B, 768) global spatiotemporal features, and the fine branch outputs (B, 768) fine spatial features, which are independent of each other and have completely consistent dimensions. In temporal additive fusion: the fine spatial features are 768-dimensional, and the sparse temporal encoding is converted to 768-dimensionality after linear mapping. The two are added element-wise and fused, resulting in a 768-dimensional feature, achieving precise coupling between temporal information and spatial features. Feature concatenation: the 768-dimensional global spatiotemporal features and the 768-dimensional fine temporal features are directly concatenated, outputting a spatiotemporal fusion feature with a dimension of (B, 1536), ensuring the integrity and dimensional regularity of both types of information.

[0072] Based on a dual-branch logic, branch-by-branch computation and splicing are used to generate spatiotemporal fusion features of the target dimension. Each branch network independently completes feature extraction and temporal fusion according to its own computational logic, without interdependence and in parallel operation throughout the process. After the features of the two branches are generated, they are directly connected and integrated according to preset splicing rules to output target spatiotemporal fusion features with regular dimensions and complete information, ensuring effective coupling and dimensional uniformity of global motion information and local fine information.

[0073] The feature extraction, temporal fusion, and feature concatenation are performed separately according to the dual-branch logic to generate the final target spatiotemporal fusion feature. The global spatiotemporal branch adopts a 3D residual convolution combined with a gated attention mechanism. The input frame-level temporal feature sequence and sparse temporal encoding are processed by 1×1×1, 3×3×3, and 1×1×1 three-dimensional convolutional residual blocks and gated attention weighting, and the output is a global spatiotemporal feature with a fixed dimension of (B, 768), where B is the batch size and 768 is the feature dimension.

[0074] The fine temporal branch uses 2D residual convolution to extract fine spatial features of a single frame, and then uses linear mapping to fuse sparse temporal coding with spatial features element by element to output fine temporal features. The dimension is also fixed at (B, 768), which is completely aligned with the dimension of global spatiotemporal features.

[0075] Both feature branches have dimensions (B, 768). They are directly concatenated along the feature dimension to generate a spatiotemporal fusion feature of the target dimension, with dimensions (B, 2×768). This fully preserves the two complementary types of information: global motion and temporal sequence, and local spatial and temporal sequence, without information compression or loss. For example, the global branch outputs global motion features, and the fine branch outputs spatial features that fuse temporal information. The two are directly concatenated to output a spatiotemporal fusion feature that simultaneously contains spatial details and temporal motion, with dimensions (B, 2×768).

[0076] The global spatiotemporal branch takes as input (B, 16, 768) frame-level temporal features, and after 3D residual convolution and gated attention, outputs (B, 768) global motion features. The fine-temporal branch extracts single-frame fine-space features frame by frame and fuses them with temporal coding, outputting (B, 768) spatial features with fused temporal information. The two branches are then directly concatenated to output spatiotemporal fusion features with dimension (B, 1536), which include spatial details such as myocardial texture and valve morphology, as well as temporal information on cardiac contraction and relaxation across frames, adapting to the input requirements of subsequent temporal aggregation and classification.

[0077] S105 performs attention-weighted temporal aggregation on the spatiotemporal fusion features, compresses them into video-level features, inputs a fully connected classification head, and outputs a softmax function that includes the class probability of cardiac amyloidosis.

[0078] In one implementation, the spatiotemporal fusion features contain multi-frame temporal information within the cardiac cycle. Attention-weighted temporal aggregation is used to compress the sequence features into single-sample-level video features, enhancing the overall representation of cardiac motion. Temporal aggregation employs an attention-weighted strategy: first, an attention score is calculated for each frame's features; then, the scores are normalized to obtain weights; finally, a weighted sum is generated to produce video-level features. This precisely focuses on key frames of the cardiac cycle, reduces interference from redundant frames, and comprehensively extracts global information about the dynamic motion of the heart. The formula for calculating the temporal aggregation weights is as follows: ; ; ;in, For the temporal features of the t-th frame or the t-th time step, , , For learnable parameters, Rate attention To normalize attention weights, These are the aggregated video-level features.

[0079] For example, the spatiotemporal fusion feature dimension of the dual-branch fusion output is (B, 16, 1536), where B=8, T=16, and the feature dimension is 1536. Substituting into the formula, the attention weight of the key contraction frame is about 0.12, the diastolic frame is about 0.09, and the background redundancy frame is about 0.02. After weighted summation, the output dimension (B, 1536) is a video-level feature that fully represents the overall dynamic motion state of the heart's contraction and diastole.

[0080] The aggregated video-level features are input into a fully connected classification head. Linear transformations are used to adapt the feature dimensions and perform semantic conversion, outputting a classification feature vector. The video-level features undergo dimensionality adaptation and semantic mapping via the fully connected classification head, establishing associations between the features and screening categories such as cardiac amyloidosis. The classification head consists of multiple fully connected layers. Through linear transformations of the weight matrix and bias terms, it maps high-dimensional video features into fixed-dimensional classification feature vectors, adapting to subsequent probability output requirements.

[0081] Classification output formula: ; ;in, This is the classification weight matrix. For bias terms, For classifying logits, The predicted probabilities for each category are given. Optionally, the classification head can also adopt a multi-layer fully connected structure, with batch normalization layers and ReLU activation layers added in the middle layers. For example, the video-level feature dimensions are (8, 1536); the classification head has three fully connected layers: the first layer is 1536--512, the second layer is 512--128, and the third layer is 128--4; substituting into the formula, the output is a classification feature vector with dimensions (8, 4), corresponding to four screening categories: cardiac amyloidosis, healthy, heart failure, and hypertrophic cardiomyopathy.

[0082] The categorical feature vector is normalized using the softmax function, outputting the predicted probability for each category, covering screening categories such as cardiac amyloidosis, healthy individuals, heart failure, and hypertrophic cardiomyopathy. The normalized categorical feature vector outputs the category probability in the 0-1 interval, with a sum of probabilities equal to 1, directly providing the prediction results for screening categories such as cardiac amyloidosis, supporting clinical auxiliary diagnosis. For example, with a categorical feature vector o=[2.8,0.5,1.2,0.3], substituting it into the formula, the output probability p=[0.78,0.05,0.14,0.03]; the probability of cardiac amyloidosis is the highest at 0.78, which is the core result of the model-assisted screening and directly provides a reference for clinical cardiac amyloidosis screening.

[0083] S106 adapts to linear and convex array scanning modes through bidirectional polar coordinate transformation, simulates motion blur, Gaussian blur, and salt-and-pepper noise for joint data augmentation, and generates robust optimization information.

[0084] In one embodiment, to address the image morphology differences caused by linear scanning and convex array scanning ultrasound probes, polar coordinate mapping and inverse transformation techniques are employed to achieve bidirectional format conversion of images from the two scanning modes, thereby eliminating imaging heterogeneity.

[0085] Clinical ultrasound probes are commonly classified into two types: linear and convex arrays, resulting in significant differences in imaging morphology. Linear probes output rectangular images, while convex probes output fan-shaped images, directly affecting the consistency of model feature extraction. By performing bidirectional polar coordinate transformation (forward and inverse), the image format is unified, eliminating interference from equipment heterogeneity.

[0086] Convex matrix to linear inverse transformation: Let the coordinates of the center of the convex matrix image be... Inner circle radius =120, outer circle radius =240, Sector Angle Range [ =30 , =150 ]; Target linear image width =224, High =224. For linear image pixels (u,v), calculate: , Corresponding convex matrix sampling coordinates: , The pixel values ​​are obtained using bilinear interpolation, with zeros used to fill in any gaps beyond the boundaries, converting the sector-shaped convex array into a rectangular linear image. The rectangular linear image is then resampled into a sector-shaped convex array image using the same parameters, achieving bidirectional format unification and adaptability to different probe types in medical institutions.

[0087] This study simulates three typical quality degradation problems in clinical ultrasound acquisition: motion blur, Gaussian blur, and salt-and-pepper noise, constructing interference samples that closely resemble real-world scenarios. Clinical ultrasound often suffers from quality degradation due to handheld shaking, equipment deviation, and signal interference. This study specifically simulates these three types of interference to restore realistic image characteristics. For motion blur: it simulates random probe shaking, setting the blur kernel size to 5×5 and randomly generating motion angles from 0–180° to produce image trailing, closely matching the characteristics of handheld clinical acquisition. For Gaussian blur: it simulates slight equipment focusing deviation, randomly selecting the standard deviation of the Gaussian kernel to smooth blur edges and restore slightly out-of-focus images. For salt-and-pepper noise: it simulates signal transmission interference, setting the noise density to 0.01–0.05, randomly generating black and white noise points to match signal interference scenarios. The three types of interference are randomly combined and superimposed with a 50% probability to generate single blurred, noisy, or mixed degradation samples, highly replicating the characteristics of low-quality clinical ultrasound images.

[0088] By combining scanning mode adaptation with quality degradation simulation, joint data augmentation is performed to generate diverse training samples and improve the model's generalization robustness across devices and low-quality images. First, a bidirectional format conversion between linear and convex arrays is performed to obtain images in a unified format. Then, one or two types of interference from motion blur, Gaussian blur, and salt-and-pepper noise are randomly superimposed to construct a hybrid augmentation sample set. For example, convex array to linear images are superimposed with σ=1.0 Gaussian blur + 0.03 salt-and-pepper noise; linear to convex array images are superimposed with 5×5 motion blur, forming diverse training data. The augmented samples are used for model training, allowing the model to adapt to both linear and convex array probe images, as well as low-quality scenarios with blur and noise, effectively improving cross-institutional deployment stability and clinical image adaptation capabilities, and outputting robust optimized feature information.

[0089] S107, relying on a federated learning privacy architecture, achieves data availability without visibility. It combines adaptive masking, sparse temporal coding, and dual-branch fusion to accurately capture spatiotemporal features and generate auxiliary screening information for cardiac amyloidosis.

[0090] In one implementation, a technology chain based on federated learning privacy architecture, adaptive masking, sparse temporal coding, bi-branch spatiotemporal fusion, and temporal aggregation inference is used to perform privacy-compliant spatiotemporal feature extraction and assisted screening modeling on multi-center cardiac ultrasound images, generating basic data that is compliant, feature-accurate, and reliable for screening. This technology chain runs through the entire process of privacy compliance, feature focusing, temporal adaptation, spatiotemporal fusion, and result inference, and is designed for privacy-compliant modeling of multi-center distributed cardiac ultrasound images. The federated learning privacy architecture serves as the underlying support, ensuring that the original images do not leave the local machine and that the data is usable but not visible; adaptive masking focuses on key diagnostic areas such as the myocardium and valves, eliminating redundant background; sparse temporal coding adapts to the non-uniform sampling characteristics of ultrasound, accurately depicting the temporal regularity of the cardiac cycle; bi-branch spatiotemporal fusion captures global motion and local fine features in parallel; and temporal aggregation inference completes feature extraction and category determination, ultimately generating basic modeling data that is compliant, feature-accurate, and reliable for screening, suitable for assisted screening scenarios of rare cardiomyopathy such as cardiac amyloidosis.

[0091] This method combines echocardiogram images from multiple medical institutions, without transmitting original patient images throughout the process. Model parameters are only exchanged via a federated architecture. The process sequentially employs adaptive masking to screen key diagnostic regions, sparse temporal coding to characterize the cardiac cycle timeline, a two-branch network to fuse spatiotemporal features, and temporal aggregation to refine features, ultimately producing compliant and standard data suitable for modeling. For example, modeling was conducted using echocardiogram images from 15 different medical institutions, strictly adhering to medical data privacy protection requirements throughout. Original echocardiogram images from each institution are stored on local servers, without cross-institutional transmission or centralized storage. Model parameters are only exchanged via a federated learning architecture, mitigating the risk of privacy leaks.

[0092] The first step involves each institution performing adaptive masking locally: the 224×224 standard ultrasound image is divided into 16×16 image blocks, and speckle noise is suppressed by a 3×3 window and a Gaussian filter with a standard deviation of 1.0. Then, a texture score is calculated using a 3×3 Laplacian convolution (formula: score=mean(∣Laplacian(patch)∣)). The score for the myocardial region is approximately 0.85, for the valve region approximately 0.60, and for the background region approximately 0.10. Polynomial sampling is performed at a mask ratio of 0.75, and 49 high-scoring core blocks are retained to select key diagnostic regions.

[0093] The second step is to generate sparse temporal codes: For the 16 temporal frames sampled non-uniformly within the cardiac cycle, generate sine-cosine codes according to the actual acquisition index pos (formula: , ), adapted to non-uniform sampling timing characteristics.

[0094] The third step is the two-branch spatiotemporal fusion: the global branch uses 1×1×1, 3×3×3, and 1×1×1 three-dimensional convolutions combined with gated attention to extract global spatiotemporal features; the fine branch uses 2D residual convolutions to extract single-frame spatial features, which are then fused with temporal coding to output (B,768) features. The two branches are then concatenated to form (B,1536) spatiotemporal fusion features.

[0095] Step 4, Temporal Aggregation Reasoning: Through attention-weighted temporal aggregation (formula: ; ; This method compresses multi-frame features into video-level features, inputs them into a fully connected classification head, and outputs four probabilities: cardiac amyloidosis, healthy, heart failure, and hypertrophic cardiomyopathy. The entire process involves only interacting with model parameters, without disclosing the original images, ultimately generating standard data that is privacy-compliant, feature-accurate, and directly usable for auxiliary screening and modeling of cardiac amyloidosis.

[0096] This application integrates five core technical elements—federated privacy protection, masking for key regions, sparse temporal coding, bi-branch feature coupling, and attention-based temporal aggregation—to match privacy compliance, feature accuracy, cross-institutional robustness, and screening accuracy goals, forming spatiotemporal feature extraction constraints. Each element has a clearly defined function and corresponding goals, forming a closed-loop constraint standard. The federated privacy protection element relies on a federated learning architecture to ensure that multi-center data is usable but not visible, matching the privacy compliance goal. The masking for key regions element uses texture scoring adaptive masking, prioritizing the preservation of core diagnostic regions such as myocardium and valves, matching the feature accuracy goal. The sparse temporal coding element adapts to the non-uniform sampling characteristics of ultrasound, accurately depicting the temporal regularity of the cardiac cycle, matching the cross-institutional robustness goal. The bi-branch feature coupling element captures global motion and local fine features in parallel, enhancing the spatiotemporal information fusion capability. The attention-based temporal aggregation element focuses on key frames and weakens redundant interference, ultimately matching the screening accuracy goal, forming standardized spatiotemporal feature extraction constraints, providing clear technical boundaries and quality benchmarks for model training.

[0097] For example, by integrating five core technologies—federal privacy, masked region selection, temporal coding, dual-branch fusion, and attention aggregation—these technologies correspond to four major goals: data compliance, feature accuracy, cross-institutional adaptation, and accurate screening, providing clear constraints and standards for feature extraction.

[0098] For example, the five core technologies are precisely linked to the four objectives, forming a one-to-one constraint relationship: Federated privacy technology: In line with data compliance goals, it adopts a federated learning architecture. The original ultrasound images of each medical institution are stored locally throughout the process, without being transmitted across institutions or disclosing patient privacy. Only the model parameters are interacted, which meets the requirements of medical data privacy protection regulations and strengthens the compliance constraints for feature extraction. Masking selection technique: For precise target features, 16×16 image block segmentation, 3×3 Laplacian convolution texture scoring (formula: score=mean(∣Laplacian(patch)∣)), and adaptive masking with a 0.75 mask ratio are used to prioritize the preservation of key areas such as the myocardial region (score approximately 0.85) and the valve region (score approximately 0.60), while removing redundant background information to ensure that features focus on the core of the lesion and constrain the lower limit of feature extraction accuracy; To meet the cross-departmental adaptation target, sine-cosine sparse temporal coding is adopted (formula: , It adapts to the non-uniform frame sampling differences of different medical institutions, eliminates interference from equipment acquisition modes, and constrains the consistency of features across institutions. As an intermediate coupling element, the connection features are accurate and cross-departmental adaptation targets are achieved. The global branch uses 3D residual convolution to extract inter-frame motion features, and the fine branch uses 2D residual convolution to extract single-frame details. After splicing, the (B,1536) fusion features are output to enhance the complementarity of spatiotemporal information. To accurately screen targets, attention-weighted temporal aggregation should be used (formula: ; ; The temporal features of the 16 frames were weighted, with key frames having a weight of approximately 0.12 and redundant frames having a weight of approximately 0.02, to extract core motion features and constrain the upper limit of the accuracy of the final screening results.

[0099] Through the above integration, a quantifiable and implementable spatiotemporal feature extraction constraint standard is formed, ensuring that the model, under the premise of compliance, takes into account accuracy, robustness and screening reliability, and adapts to the actual needs of clinical cardiac amyloidosis auxiliary screening.

[0100] Based on federated collaboration, adaptive masking, temporal enhancement, dual-branch parallel fusion, and temporal aggregation reasoning mechanisms, this system completes privacy protection, key feature enhancement, temporal capture, spatiotemporal fusion, and result reasoning to form highly robust feature optimization information. Relying on the synergistic interaction of five core mechanisms, a complete technical chain from data compliance to feature optimization is constructed. Federated collaboration serves as the underlying support, ensuring data privacy and compliance collaboration across multiple centers; adaptive masking focuses on key diagnostic areas such as the myocardium and valves, enhancing core lesion features; temporal enhancement adapts to the non-uniform sampling characteristics of ultrasound, accurately capturing dynamic temporal correlations of the cardiac cycle; dual-branch parallel fusion considers both global motion and local fine features, achieving complementary coupling of spatiotemporal information; and temporal aggregation reasoning completes feature extraction and category determination, ultimately generating highly robust feature optimization information adapted to multiple devices and low-quality images, meeting the high stability requirements of clinical auxiliary screening.

[0101] For example, relying on federated collaboration to achieve cross-institutional data collaboration, enhancing myocardial valve features through masking, enhancing temporal correlation with Transformer, extracting global and fine features in parallel through dual branches, completing feature integration through temporal aggregation, and finally outputting robust features adapted to various types of images.

[0102] For example, relying on a federal collaborative mechanism, medical institutions retain the original cardiac ultrasound images locally without transmitting them across institutions, only exchanging model parameters to achieve compliant cross-institutional data collaboration. Locally, 16×16 image block segmentation, 3×3 Laplacian convolution texture scoring (formula: score=mean(∣Laplacian(patch)∣)), and an adaptive mask with a 0.75 mask ratio are used, resulting in a score of approximately 0.85 for the myocardial region and approximately 0.60 for the valvular region, prioritizing the preservation of core areas and enhancing myocardial and valvular lesion features. Temporal frames are enhanced with multi-head self-attention by a 2-layer, 8-head Transformer encoder to capture the dynamic correlation between systolic and diastolic frames, enhancing temporal motion features. In a dual-branch parallel architecture, the global branch uses 1×1×1, 3×3×3, and 1×1×1 3D convolutions combined with gated attention to extract global motion features, while the fine branch uses 2D residual convolutions to extract single-frame detail features. Both types of features are 768-dimensional, stitched together to form 1536-dimensional spatiotemporal features. Finally, attention-weighted temporal aggregation (formula: ...) is performed. ; ; The keyframe weight is approximately 0.12, and the redundant frame weight is approximately 0.02. It integrates 16 frames of features to output video-level robust features, which are suitable for various clinical ultrasound imaging scenarios such as linear / convex array probes, blurry / noisy images, etc.

[0103] This system integrates privacy, masking, temporal sequence, fusion, and inference information, streamlining the process to achieve federated privacy modeling, masking focusing, temporal coding, bi-branch fusion, and temporal aggregation inference. It generates auxiliary screening results for cardiac amyloidosis adapted to multi-center, low-quality images. The core technologies are federated privacy, adaptive masking, sparse temporal coding, bi-branch spatiotemporal fusion, and attention-based temporal aggregation, linked together to form a complete processing flow covering all aspects of data security, feature selection, temporal characterization, spatiotemporal coupling, and result inference. Federated privacy modeling ensures the compliance and usability of multi-center data; adaptive masking focuses on key areas of the myocardium and valves; sparse temporal coding adapts to non-uniform sampling; bi-branch fusion considers both global motion and local details; and temporal aggregation extracts overall dynamic features. The entire process is adaptable to different medical institutions, different probes, and low-quality cardiac ultrasound images with blurriness or noise, ultimately generating auxiliary screening results for categories such as cardiac amyloidosis, healthy individuals, heart failure, and hypertrophic cardiomyopathy. The results are reliable and can directly support clinical auxiliary judgment.

[0104] This system integrates privacy protection, masking, temporal encoding, spatiotemporal fusion, and temporal inference throughout the entire process. It adapts to low-quality ultrasound images from different hospitals and those with blurred or noisy images, ultimately outputting auxiliary screening conclusions for categories such as cardiac amyloidosis. For example, in the privacy protection stage: original cardiac ultrasound images from multiple tertiary hospitals are not transmitted within the hospital or across hospitals; only model parameters are uploaded and aggregated based on data volume, ensuring full compliance and privacy control. In the masking stage: the 224×224 image is sliced ​​into 16×16 image blocks, denoised using a 3×3 Gaussian filter, and texture scoring is calculated using a 3×3 Laplacian convolution (score=mean(∣Laplacian(patch)∣). The scores are approximately 0.85 for the myocardial region, 0.60 for the valve region, and 0.10 for the background region, with a mask ratio of 0.75, retaining 49 core blocks for precise focusing on lesion areas. In the temporal encoding stage: 16 frames of cardiac cycle are sparsely sampled, and sine-cosine sparse temporal encoding is generated based on the actual index (sine-cosine sparse temporal encoding). , Adapting to non-uniform sampling; Spatiotemporal fusion stage: Global branch 3D residual convolution (1×1×1, 3×3×3, 1×1×1) + gated attention outputs 768-dimensional global features, fine branch 2D residual convolution extracts spatial features and adds them with temporal encoding to output 768-dimensional fine features, which are concatenated into (B, 1536) spatiotemporal features; Temporal inference stage: Attention-weighted aggregation, formula: ; ; Keyframes have a weight of approximately 0.12, and redundant frames have a weight of approximately 0.02. These are aggregated into video-level features, which are then processed through a three-layer fully connected layer (1536→512→128→4) and softmax to output four types of probabilities. The highest probability of cardiac amyloidosis is the screening conclusion. The entire process is adaptable to low-quality images such as linear / convex array probes, motion blur, Gaussian blur (σ=1.0), and salt-and-pepper noise (density 0.03), and stably outputs screening conclusions.

[0105] like Figure 2 As shown, Figure 2This paper demonstrates the architecture of a federated learning privacy-preserving modeling system for multi-center cardiac ultrasound images. The system is divided into two main parts: a federated central server and a cluster of medical institution clients. The functions and interaction logic of each module are as follows: The Central Server contains a central server module with two core units: The Online Client Management Unit is responsible for managing the client status during federated training, prioritizing the removal of medical institution clients with communication abnormalities or offline unresponsiveness, and retaining only online clients to participate in subsequent aggregation processes to avoid interference from invalid parameters. The Federated Weighted Aggregation Unit (FedAvg) uses a data-weighted federated averaging algorithm, calculating weights based on the proportion of local cardiac ultrasound image samples from each online client, aggregating the noisy model parameters uploaded by each client, and generating updated global model parameters. The interaction rule between the server and clients is: clients upload noisy local model parameters to the server; the server sends updated global model parameters to the clients.

[0106] The medical institution clients (A, B, ..., N) are each configured with an independent client function module. The internal data and calculation process are completely localized, and the raw data is never transmitted across institutions. The module consists of the following: Local data storage unit (privacy protection module): The stored content includes raw cardiac ultrasound images; the privacy constraint clearly states "raw data is not transmitted across institutions". All raw images are only stored locally at the medical institution and are not disclosed to external servers or other clients.

[0107] The data preprocessing unit performs standardized preprocessing on the raw local echocardiogram images, including size normalization, format conversion, and pixel value normalization, providing input data in a unified format for subsequent model training. The adaptive mask generation and MAE pre-training unit generates adaptive masks based on the preprocessed images and performs local pre-training using the MAE (Mask Autoencoder) architecture, focusing on key diagnostic areas such as the myocardium and valves to enhance lesion feature extraction. The local model training and parameter update unit trains the model based on global model parameters and local image data, calculating and updating local model parameters. The differential privacy protection unit (gradient clipping and noise addition) performs privacy enhancement processing on the updated model gradients / parameters, including gradient clipping (setting an L2 norm threshold, such as 1.0) and Gaussian noise addition (noise multiplier, such as 0.1), generating noisy local model parameters before uploading them to the federated central server to further ensure data privacy and security.

[0108] Each medical institution's client completes local data preprocessing, MAE pretraining, model parameter updates, and differential privacy protection. The client uploads the local model parameters with added noise to the federated central server. After removing offline clients, the federated central server aggregates the parameters of online clients by data volume weighting to generate updated global model parameters. The server distributes the global model parameters to each client, and the client starts the next round of local training based on the new global parameters. The above process iterates until the preset maximum number of communication rounds is reached, ultimately generating a privacy-compliant global model that adapts to multi-center data distribution.

[0109] like Figure 3 The diagram illustrates the complete internal workflow of adaptive mask generation. Taking preprocessed echocardiogram images as input, it ultimately outputs a binary mask matrix and a location recovery index. The core steps are as follows: Starting with the preprocessed cardiac ultrasound image frame, the image is first divided into a 16×16 image block sequence to form an independently processable example image block (Patch Example), providing a standardized unit for subsequent texture analysis and mask generation.

[0110] For noise suppression, Gaussian low-pass filtering is performed on the image blocks to suppress speckle noise in ultrasound images and improve the stability of subsequent texture analysis.

[0111] For Laplacian texture feature extraction, a 3×3 Laplacian convolution kernel (kernel value is...) is used. The filtered image patch is convolved to generate a Laplacian response map, capturing edge and texture details in the image.

[0112] For texture scoring, a texture scoring unit calculates a texture score for each image patch using the formula: score = mean(|Laplacian(patch)|). The score is the mean absolute value of the response map; a higher score indicates richer texture information. In the example, the core region (such as myocardium and valves) achieves a score of 0.85, while the background region scores significantly lower.

[0113] For the generation of sampling probability distribution, a non-uniform sampling probability distribution is generated based on the texture score results. The image patch with the higher texture score has a higher probability of being sampled and retained, thus achieving non-uniform sampling with "core area priority and background area weakening".

[0114] For multinomial distribution sampling, a preset mask ratio (e.g., 0.75, meaning 75% of image blocks are masked, and 25% are retained) is used to filter out high-scoring core blocks through multinomial distribution sampling. In the example, a 16×16 sequence (256 blocks in total) ultimately retains 49 core blocks.

[0115] Mask and Index Generation: Generates two key outputs, as follows: Binary mask matrix: 0 represents preservation and 1 represents mask, intuitively representing the preservation / mask state of each image block; Position recovery index: records the original position of the preserved block (e.g., [12,34,55,...]), which is used for subsequent image reconstruction by the decoder.

[0116] The process ultimately outputs a binary mask matrix and a location recovery index, providing mask information for accurate focusing and diagnosis of key regions for subsequent MAE pre-training, while ensuring that the decoder can recover the complete image structure during reconstruction.

[0117] like Figure 4 As shown, the two-branch spatiotemporal feature fusion process of cardiac ultrasound images is illustrated. It takes the frame-level temporal feature sequence output by the Transformer encoder and the sparse temporal position code as input, and finally outputs the spatiotemporal fused features for subsequent inference. The functional logic of each branch and unit is as follows: The process includes two types of inputs: the Transformer encoder outputs a frame-level temporal feature sequence with dimensions (B, T, 768), where B is the batch size, T is the number of temporal frames, and 768 is the feature dimension of a single frame, containing frame-level spatial and temporal correlation information of cardiac ultrasound images. Sparse Temporal Position Coding (PEpos): Employs sin-cosine temporal position coding to characterize the temporal positional relationships between frames, adapting to the non-uniform sampling characteristics of ultrasound.

[0118] The system employs a dual-branch parallel feature extraction approach. Specifically, branch one is the global spatiotemporal feature branch: ① 3D residual convolutional block: Receives frame-level temporal feature sequences and captures the global spatiotemporal motion correlations between consecutive frames through 3D convolution, extracting cross-frame dynamic features of cardiac contraction and relaxation. ② Gated attention mechanism: Weighted aggregation of the spatiotemporal features output by the 3D convolution enhances the expression of key motion features. The final output is a global spatiotemporal feature with dimensions (B, 768), fully representing the overall motion pattern within the cardiac cycle.

[0119] Branch 2 is the fine-grained temporal feature branch: ① Feature Fusion Unit (PE Injection): This unit fuses sparse temporal positional encoding with frame-level temporal feature sequences element-by-element, injecting temporal positional information into spatial features to achieve spatiotemporal information coupling. ② 2D Residual Convolutional Block: This extracts fine-grained spatial features from single-frame images, characterizing local details such as myocardial texture, valve morphology, and ventricular wall thickness. ③ Temporal Correlation Module: This module further strengthens inter-frame temporal correlation, adapting to the temporal patterns of cardiac dynamics. ④ Fine-grained Feature Aggregation Unit: This unit integrates single-frame details and temporal information, outputting fine-grained temporal features with dimensions (B, 768), perfectly aligned with the global spatiotemporal feature dimensions. The Concatenation Unit directly concatenates global spatiotemporal features with fine-grained temporal features to generate spatiotemporal fusion features with dimensions (B, 2×768), fully preserving both global motion and local fine-grained complementary information. The spatiotemporal fusion features are input to the temporal feature aggregation and etiological classification inference stages, providing normalized feature input for subsequent temporal aggregation and disease classification.

[0120] In one implementation, such as Figure 5 As shown, this application also provides a spatiotemporal feature processing device for cardiac ultrasound based on federated learning, comprising: The image preprocessing module 501 is used to perform size, type, and pixel normalization preprocessing on multi-center distributed cardiac ultrasound images, and output single frames and time-series frames. After the single frame is divided into blocks, it is subjected to Gaussian filtering for noise reduction, 3×3 Laplacian convolution for texture scoring, and adaptive mask and position index are generated. The federated pre-training module 502 is used to reconstruct masked image patches using MAE encoding and decoding, update local gradients according to MSE loss and crop local gradients; the central server removes offline clients, iterates the global model by weighting parameters according to data volume, and completes privacy-compliant feature extraction. The temporal feature extraction module 503 is used for sparse sampling of temporal frames. It extracts spatial features through pre-trained ViT; generates sine-cosine temporal codes according to the acquisition index; enhances temporal correlation through Transformer; and outputs frame-level feature sequences. The dual-branch fusion module 504 is used to extract global spatiotemporal features by combining 3D residual convolution with gated attention; 2D residual convolution is fused with temporal coding to generate fine features, and the spatiotemporal fusion features are spliced ​​together to output the spatiotemporal fusion features. The temporal aggregation inference module 505 is used to generate video features through attention-weighted aggregation. It takes a fully connected classification head as input, and outputs the probability of categories such as cardiac amyloidosis after softmax. The data augmentation and adaptation module 506 is used for bidirectional polar coordinate transformation to adapt to the scanning mode, and simulates motion blur, Gaussian blur, and salt-and-pepper noise for joint enhancement to improve the robustness of the model. The auxiliary screening output module 507 is used to generate cardiac amyloidosis auxiliary screening information by relying on the federal privacy architecture, integrating masking, temporal coding, and dual-branch fusion capabilities to accurately capture spatiotemporal features.

[0121] The computer-readable storage medium provided in the above embodiments of this application and the cardiac ultrasound spatiotemporal feature processing method based on federated learning provided in the embodiments of this application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the applications stored therein.

[0122] The various embodiments in this application are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments for evaluating the method, system, electronic device, and readable storage medium for processing spatiotemporal features of cardiac ultrasound based on federated learning are basically similar to the embodiments of the above-described method for processing spatiotemporal features of cardiac ultrasound based on federated learning, and therefore are described relatively simply. Relevant parts can be referred to in the descriptions of the embodiments of the above-described method for processing spatiotemporal features of cardiac ultrasound based on federated learning.

Claims

1. A cardiac ultrasound spatio-temporal feature processing method based on federated learning, characterized in that, include: Preprocessing of multicenter distributed cardiac ultrasound images, unifying size, type and pixel normalization, and outputting single frame and time sequence data; After dividing a single frame into blocks, it is denoised by Gaussian filtering, texture score is calculated by 3×3 Laplacian convolution, adaptive mask is generated according to texture distribution, and mask matrix and position index information are output. A federated pre-training module is built. Masked image patches are reconstructed using MAE encoding and decoding. Local gradients are updated and cropped according to MSE loss. The central server removes offline clients, aggregates local parameters according to data volume, and iteratively updates the global model to complete the privacy-compliant federated pre-training feature extraction. For sparse sampling of time-series frames, spatial features are extracted using pre-trained ViT, and sine-cosine sparse temporal codes are generated based on the acquisition index. After feature fusion, the temporal correlation is enhanced by multi-head self-attention in a Transformer encoder, outputting a frame-level temporal feature sequence. This includes: combining the requirements of ultrasound temporal feature extraction with the adaptation logic of non-uniform frame sampling, introducing sparse sampling rules, spatial feature extraction, and temporal coding mechanisms, and determining a standardized processing scheme for frame sampling, spatial feature extraction, temporal coding, and temporal feature enhancement; sparsely sampling the temporal frames according to clinical sampling patterns, inputting them into a pre-trained ViT backbone network to extract single-frame spatial depth features; generating sine-cosine sparse temporal position codes based on the actual acquisition index of the temporal frames, fusing the codes with frame-level features, and then enhancing them with multi-head self-attention in a Transformer encoder to capture cardiac motion correlation features between adjacent frames; and integrating the sampling results, spatial features, temporal coding, and enhancement information to generate a target-dimensional frame-level feature sequence. A dual-branch spatiotemporal fusion network is constructed. 3D residual convolution combined with gated attention extracts global spatiotemporal features, while 2D residual convolution fuses temporal encoding to generate fine-grained temporal features. The two types of features are then concatenated to obtain spatiotemporal fusion feature information. This includes: combining the spatiotemporal feature fusion requirements of cardiac ultrasound with the construction of a dual-branch parallel network, introducing global spatiotemporal extraction, fine-grained spatial generation, temporal correlation, and feature concatenation rules; determining the parallel branch division of labor, convolution configuration, and temporal fusion calculation rules; extracting frame-level temporal feature sequences and sparse temporal encoding information; dividing labor according to the dual-branch parallel architecture; defining two types of processing intervals: global spatiotemporal and fine-grained spatial + temporal; defining the computation logic of two types of branches: 3D residual convolution + gated attention and 2D residual convolution; clarifying the mapping relationship of fine-grained spatial feature output; setting three types of processing rules—parallel extraction, temporal encoding addition fusion, and feature concatenation—based on feature dimension constraints to limit the feature construction range; and calculating and concatenating branch by branch based on the dual-branch logic to generate spatiotemporal fusion features of the target dimension. Attention-weighted temporal aggregation is performed on the spatiotemporal fusion features, which are then compressed into video-level features. The input is a fully connected classification head that is processed by softmax to output the class probabilities, including cardiac amyloidosis. By adapting to linear and convex matrix scanning modes through bidirectional polar coordinate transformation, motion blur, Gaussian blur, and salt-and-pepper noise are simulated for joint data augmentation to generate robust optimization information. By leveraging a federated learning privacy architecture to achieve data usability without visibility, and combining adaptive masking, sparse temporal coding, and dual-branch fusion to accurately capture spatiotemporal features, information for auxiliary screening of cardiac amyloidosis is generated.

2. The method as described in claim 1, characterized in that, Multicenter distributed cardiac ultrasound images are preprocessed to unify size, type, and pixel normalization, outputting single-frame and time-series frame data. Single frames are then segmented and denoised using Gaussian filtering. Texture scoring is calculated using 3×3 Laplacian convolution, and adaptive masks are generated according to texture distribution. The mask matrix and position index information are output, including: Combining the needs of multi-center distributed cardiac ultrasound image privacy collaborative modeling and feature extraction logic, image standardization rules, non-uniform sampling probability generation and texture scoring mechanism are introduced to perform size, type and pixel normalization preprocessing on local distributed raw ultrasound images, and output single frame and time frame sequence. The preprocessed single frame is segmented into image blocks. Gaussian low-pass filtering is first used to suppress speckle noise, and then 3×3 Laplacian convolution is used to calculate texture score. The result is converted into a non-uniform sampling probability distribution and multinomial sampling to generate an adaptive mask matrix and position recovery index, thus completing the screening of key regions in ultrasound images.

3. The method as described in claim 1, characterized in that, A federated pre-training module is built. Masked image patches are reconstructed using MAE encoding and decoding, and local gradients are updated and cropped according to MSE loss. The central server removes offline clients, iteratively updates the global model by aggregating local parameters weighted by data volume, and completes privacy-compliant federated pre-training feature extraction, including: Combining the requirements of privacy-preventing collaborative modeling and feature pre-training in federated learning, we introduce mask autoencoder modeling, local gradient optimization, differential privacy enhancement and federated aggregation rules, and determine standardized processing schemes for MAE encoding and decoding, loss calculation, gradient processing, privacy enhancement, parameter aggregation and global iteration. MAE encoding and decoding reconstruction are performed on the masked image blocks. The reconstruction error is calculated based on the mean squared error loss and the local gradient is updated to complete the gradient clipping in a unified manner. A federated pre-training module is built, consisting of local model training, gradient update, differential privacy optional enhancement, parameter upload, federated weighted aggregation, and global model distribution. The masked image patch, reconstruction loss, and gradient parameters are input into the federated pre-training module. After local training, gradient clipping, optional addition of Gaussian difference privacy noise, parameter uploading, weighted aggregation, and global update, a pre-trained model is generated iteratively. A privacy-compliant global feature extraction model is generated from the weighted aggregation results of offline and online client data after removing offline clients. The federated pre-training module works in conjunction with the distributed client and the central server. The local processing logic of the client is fixed, and only the parameter interaction layer is exposed. The global iteration is completed by offline elimination and data volume weighted aggregation to generate federated pre-trained feature extraction results.

4. The method as described in claim 1, characterized in that, Leveraging a federated learning privacy architecture to achieve data usability without visibility, and combining adaptive masking, sparse temporal coding, and dual-branch fusion to accurately capture spatiotemporal features, information for auxiliary screening of cardiac amyloidosis is generated, including: Based on federated learning privacy architecture, adaptive masking, sparse temporal coding, dual-branch spatiotemporal fusion, and temporal aggregation inference technology, we conduct privacy-preserving spatiotemporal feature extraction and assisted screening modeling on multi-center cardiac ultrasound images to generate basic data that is compliant, accurate in features, and reliable in screening. By integrating core elements such as federal privacy protection, masking to focus on key areas, sparse temporal coding, dual-branch feature coupling, and attention temporal aggregation, and matching the goals of privacy compliance, feature accuracy, cross-institutional robustness, and screening accuracy, spatiotemporal feature extraction constraint information is formed. Based on federated collaboration, adaptive mask filtering, temporal enhancement, dual-branch parallel fusion, and temporal aggregation reasoning mechanisms, privacy protection, key feature enhancement, temporal capture, spatiotemporal fusion, and result reasoning are completed to form highly robust feature optimization information. By integrating privacy, masking, temporal, fusion, and inference information, a streamlined process is implemented to achieve federated privacy modeling, masking focusing, temporal encoding, bi-branch fusion, and temporal aggregation inference, generating cardiac amyloidosis auxiliary screening results adapted to multi-center, low-quality images.

5. A spatiotemporal feature processing device for cardiac ultrasound based on federated learning, used to implement the method of claim 1, characterized in that, The device includes: The image preprocessing module is used to perform size, type, and pixel normalization preprocessing on multi-center distributed cardiac ultrasound images, and output single frames and time-series frames. After single-frame block processing, Gaussian filtering is used for noise reduction, and 3×3 Laplacian convolution is used to calculate texture score, generating adaptive mask and position index. The federated pre-training module is used to reconstruct masked image patches using MAE encoding and decoding, update local gradients according to MSE loss, and crop local gradients; the central server removes offline clients, iterates the global model by weighting parameters according to data volume, and completes privacy-compliant feature extraction. The temporal feature extraction module is used for sparse sampling of temporal frames. It extracts spatial features through pre-trained ViT; generates sine-cosine temporal codes according to the acquisition index; enhances temporal correlation through Transformer; and outputs frame-level feature sequences. The dual-branch fusion module is used to extract global spatiotemporal features by combining 3D residual convolution with gated attention; 2D residual convolution is fused with temporal encoding to generate fine features, and the spatiotemporal fusion features are spliced ​​together to output the spatiotemporal fusion features. The temporal aggregation inference module is used to generate video features through attention-weighted aggregation. It takes a fully connected classification head as input and outputs the probability of cardiac amyloidosis category after softmax. The data augmentation and adaptation module is used for bidirectional polar coordinate transformation to adapt to the scanning mode, and simulates motion blur, Gaussian blur, and salt-and-pepper noise for joint enhancement to improve the robustness of the model. The auxiliary screening output module is used to accurately capture spatiotemporal features and generate auxiliary screening information for cardiac amyloidosis by relying on the federal privacy architecture and integrating masking, temporal coding, and dual-branch fusion capabilities.

6. An electronic device, characterized in that, include: First processor; And a memory for storing executable instructions of the first processor; wherein the first processor is configured to execute the spatiotemporal feature processing method for cardiac ultrasound based on any one of claims 1 to 4 by executing the executable instructions.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the second processor, it implements the spatiotemporal feature processing method for cardiac ultrasound based on any one of claims 1 to 4.