A MACE prediction method based on cross-source embedding alignment
By employing a trust domain curriculum mechanism and a prototype sketch distillation method, cross-source embedding alignment was achieved, resolving the issue of inconsistent feature distributions in multi-source medical data. This improved the accuracy and stability of MACE risk prediction, enhanced the model's interpretability, and increased the effectiveness of cross-institutional data fusion.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ANHUI HANXIN INTELLIGENT PROTECTION TECHNOLOGY CO LTD
- Filing Date
- 2025-12-19
- Publication Date
- 2026-05-29
AI Technical Summary
Existing medical big data analysis methods struggle to achieve unified expression and information alignment of cross-source features in multi-source heterogeneous medical data scenarios, leading to decreased model generalization performance, significant bias in prediction results, and a lack of effective cross-source embedding mechanisms and dynamic alignment strategies, which affects the accuracy and stability of MACE risk prediction.
The robustness of the model is improved by trust domain curriculum mechanism. Prototype sketch distillation and risk distribution integration are used to generate calibrated MACE risk scores, confidence intervals and feature interpretation results, achieve cross-source embedding alignment, dynamically adjust alignment and supervision strength, generate stage-stable embeddings and preliminary risk scores, and perform global prediction parameter calibration.
It significantly improves the accuracy, generalization and clinical interpretability of MACE prediction, solves the problem of inconsistent feature distribution of multi-source data, enhances the effectiveness of cross-institutional data fusion and the stability of prediction results, and enhances the model's risk assessment accuracy and interpretability in cross-domain scenarios.
Smart Images

Figure CN122117434A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical artificial intelligence technology, and in particular to a MACE prediction method based on cross-source embedding alignment. Background Technology
[0002] Existing medical big data analytics methods for predicting major adverse cardiovascular events (MACE) risk primarily rely on single-source feature inputs, such as single-modal data like electronic medical records, laboratory test results, or electrocardiogram signals. These methods typically employ traditional machine learning models or deep learning networks for risk assessment, but they suffer from significant limitations in multi-source, heterogeneous medical data scenarios. Due to differences in data collection standards, coding systems, temporal granularity, and feature distributions across different medical institutions, traditional models struggle to achieve unified representation and information alignment of cross-source features, leading to decreased model generalization performance and significant bias in prediction results. Furthermore, existing feature alignment methods often employ single-layer mapping or linear projection, failing to capture the high-dimensional semantic relationships between embeddings from different sources and hindering robust feature transfer across multiple institutions.
[0003] On the other hand, existing cross-source learning research mainly focuses on distribution alignment in fields such as image and speech. However, in multi-source medical scenarios, there is a lack of a unified embedding mechanism and dynamic alignment strategy for heterogeneous clinical data. Furthermore, existing methods typically use global thresholds or fixed weights to handle sample confidence, ignoring the differences in confidence levels between different sources. This can easily lead to low-confidence samples interfering with the training process, reducing alignment stability and prediction accuracy. In addition, traditional model distillation and risk calibration methods are mostly performed under a single distribution, failing to effectively utilize cross-source prototype information for risk distribution integration and global parameter extraction, resulting in increased uncertainty in prediction results when transferred across institutions.
[0004] Therefore, how to provide a MACE prediction method based on cross-source embedding alignment is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] One objective of this invention is to propose a MACE prediction method based on cross-source embedding alignment. This invention improves model robustness through a trust domain curriculum mechanism and completes cross-institutional knowledge transfer by utilizing prototype sketch distillation and risk distribution integration to generate calibrated MACE risk scores, confidence intervals, and feature interpretation results, thereby significantly improving the accuracy, generalization, and clinical interpretability of MACE prediction.
[0006] A MACE prediction method based on cross-source embedding alignment according to an embodiment of the present invention includes the following steps:
[0007] Collect comprehensive clinical data from medical centers, including electronic medical records, laboratory tests, physiological timelines, electrocardiograms, and text data, and perform data standardization and time alignment to obtain standardized data with consistent structure.
[0008] Based on standardized data, clinical features are extracted one by one and corresponding initial embedding representations are generated, and a multi-source initial embedding set is output.
[0009] Using a multi-source initial embedding set as input, weighted fusion and scale unification are performed according to the patient dimension to generate a patient-level comprehensive embedding, which serves as the alignment representation to be aligned across sources.
[0010] The patient-level integrated embedding is divided into source domain and target domain according to its source. Embedding space alignment is performed based on sample similarity constraints and distribution consistency constraints. The aligned unified embedding is output to establish cross-source correspondence.
[0011] Based on the unified embedding, the pairwise similarity of cross-source samples is calculated and a one-to-one or one-to-many correspondence mapping is determined to form a cross-source feature correspondence table and a similarity matrix;
[0012] The cross-source feature correspondence table and similarity matrix are aligned with the trust domain curriculum. The alignment and supervision strength are set hierarchically according to the reliability of the samples. The samples are included in the training in stages from high to low, and the stage stable embedding and preliminary risk score are output.
[0013] Based on the stage-stable embedding and preliminary risk score, risk prototype sketches and quantitative risk histograms are generated from each source, and prototype sketch distillation and risk distribution integration are performed to output global prediction parameters.
[0014] The global prediction parameters are calibrated together with the standardized data of the target patients to generate temperature-scaled and threshold-calibrated MACE risk scores, confidence intervals, and feature-level interpretations.
[0015] Optionally, obtaining the standardized data specifically includes:
[0016] The scope of medical centers and patients participating in data collection is determined, and a unique identifier is established for each center and patient. The comprehensive clinical data from each center is uniformly coded and desensitized, and fields that can identify individuals are deleted. The variable names, value units and encoding methods of each center are unified into the same data dictionary to form an aligned set of raw data. The comprehensive clinical data comes from different medical centers and contains the same signal from different precision acquisition devices. The acquisition devices include static 12-lead ECG and dynamic 12-lead ECG acquisition devices.
[0017] Data cleaning is performed on the original dataset. Outliers are handled according to the valid value range of each type of variable. Missing data is filled by interpolation of adjacent time or representative value of the same variable. Text information is formatted. All time fields are standardized to the standard time zone and time format to obtain a standardized cleaned dataset.
[0018] Establish a unified global timeline and perform time alignment. Rearrange various modal data in the cleaned dataset according to the timeline order. Use linear interpolation to fill continuous variables and keep the most recent valid values for categorical variables. Select multiple records at the same time point according to their time sequence and output standardized data with a consistent structure.
[0019] Optionally, the output process of the multi-source initial embedding set specifically includes:
[0020] Using standardized data as input, records are read one by one in a fixed order of center, patient, modality, and global time point. For structured and laboratory test items, numerical values and enumeration codes are extracted in the order of fields to form fixed-length features. For physiological time series and electrocardiogram items, statistical, morphological quantitative features and quality markers within the corresponding time window are extracted to form fixed-length features. For text items, standardized terms, entities and negation markers are extracted to form fixed-length features. Availability markers are generated for each modality at the current time point. The modality features and availability markers are concatenated in a preset order to obtain the patient's cross-modality feature vector at the current time point.
[0021] The cross-modal feature vector is taken as input and converted into an initial embedding representation of uniform dimension through a linear mapping operation. Corresponding time position information is added to each time point and concatenated with the current initial embedding in a fixed order. The amplitude pruning and length verification are performed on the concatenation result to form the initial embedding entry of the current patient at the current time point. Each initial embedding entry is attached with a center identifier, a patient identifier and a global time point.
[0022] The initial embedding entries are aggregated by center and patient. An initial embedding set for patient-time series is established for each center and sorted in ascending order by global time point. The initial embedding sets of all centers are merged into a multi-source initial embedding set in a fixed order of center identifiers.
[0023] Optionally, the process of generating the patient-level comprehensive embedding specifically includes:
[0024] Align the multi-source initial embedding set according to the index keys of center, patient, and global time point. Create a list of initial embeddings from different centers for the same patient at the same time point and record missing marks for entries that cannot be aligned while retaining the original index.
[0025] For each patient's fusion list at each time point, the initial embeddings of each center are scaled according to a fixed dimensional scaling factor. The embeddings from different centers at the same time point are weighted and summed to obtain the cross-source fusion embedding at the current time point. The cross-source fusion embeddings of each patient at each time point are aggregated according to time weight to form the initial time aggregate representation of the current patient. The source weight and time weight records for quality auditing are output simultaneously.
[0026] The initial temporal aggregation representation is subjected to cross-patient scale normalization, and the normalized result is the patient-level comprehensive embedding for the current patient.
[0027] Optionally, the unified embedding output process specifically includes:
[0028] The patient-level comprehensive embedding is divided according to the source center. The embedding subset of each center is defined as the source domain or the target domain. The center with the most samples is defined as the source domain, and the remaining centers are defined as the target domain. A domain identifier is added to each sample, and the consistency between the patient identifier and the global time index is maintained to form the source domain and target domain embedding list.
[0029] Mean centering and variance normalization are performed on the embedding spaces of the source and target domains to ensure that the embeddings of different domains have a uniform numerical range. Using the patient identifier as the key, the embedding samples of the same patient in different domains are paired. For samples that cannot be directly paired, pseudo-pairing labels are generated and the corresponding confidence weights are recorded to obtain the pairing results.
[0030] Based on the pairing results, an embedding space alignment operation is performed on each pair of source domain embeddings and target domain embeddings. The solution is based on the dual objectives of maximizing similarity and minimizing distribution consistency. The spatial mapping relationship between the source domain and the target domain is updated iteratively. In each iteration, high-confidence pairs are selected according to the similarity threshold and the average offset is calculated. The target domain embedding is linearly translated and proportionally adjusted using the average offset, while keeping the distance structure between embeddings unchanged. After all iterations are completed, the aligned unified embedding is obtained.
[0031] Optionally, the formation of the cross-source feature correspondence table and the similarity matrix specifically includes:
[0032] Based on the unified embedding, the data is divided into a source domain list and a target domain list according to the source center. Each embedded sample is labeled with a patient identifier and a global time index. The global time index is used as the primary key to perform preliminary pairing of the source domain and target domain embeddings. Only sample pairs with a time difference within a preset time window are retained to form a candidate sample pair set.
[0033] For each candidate sample set, calculate the pairwise similarity. Normalize the length of the embedding vectors of the source and target domains. Calculate the ratio of the inner product of the two vectors to their respective lengths to obtain a cosine similarity value between -1 and 1, and fill it into the similarity matrix table. Use the source domain samples as the row index and the target domain samples as the column index. Then sort the similarity of each row from high to low. Only retain the target domain samples that are above the similarity threshold and are in the first few rows. The rest are marked as invalid in the matrix.
[0034] Based on the filtered similarity matrix table, the corresponding mapping is determined. Entries with the same patient identifier and a time index difference not exceeding the threshold are confirmed as one-to-one correspondences. For sample entries that do not match directly, a one-to-many relationship is established based on the target domain sample with the highest similarity. The upper limit of the number of source domain samples that each target domain sample can correspond to is limited. All valid corresponding entries are summarized to generate a cross-source feature correspondence table. Each entry includes the center identifier of the source domain and the target domain, the patient identifier, the time index, the correspondence type, the similarity value, and the confidence weight. At the same time, the filtered similarity matrix is output.
[0035] Optionally, the process of staged stable embedding and outputting the initial risk score specifically includes:
[0036] Based on the cross-source feature correspondence table and similarity matrix, the reliability of all sample pairs is evaluated according to the similarity value and confidence weight. The reliability results are divided into three trust domains: high, medium and low according to the threshold. Independent alignment strength coefficient and supervision strength coefficient are set for each trust domain sample. The high trust domain sample has the highest weight and the low trust domain sample has the lowest weight. The hierarchical order of the trust domain remains unchanged.
[0037] Using high-trust domain samples as the initial training set, the first stage of trust domain course alignment training is performed. In each iteration, the mapping parameters are updated according to the similarity improvement and embedding stability, and the trend of alignment loss is monitored. When the loss decreases below a preset threshold for consecutive preset rounds, medium-trust domain samples are included and the alignment and supervision strength are adjusted simultaneously. In the second stage of training, the distribution consistency index between medium-trust domain samples and high-trust domain samples is continuously calculated, and the learning step size is dynamically adjusted according to the index change.
[0038] After the second stage of training converges, low-confidence samples are introduced to perform the third stage of course alignment. The embedding results output from the previous stage are used as the initial state. Low-confidence samples are incorporated in a stepwise expansion manner, and the maximum weight increase is limited. After all stages of training are completed, the stability of the final embedding results is tested to remove abnormal samples whose changes exceed the threshold. A linear risk score is calculated for the stable embeddings, and the stage stable embeddings and their corresponding preliminary risk scores are output.
[0039] Optionally, the output process of the global prediction parameters specifically includes:
[0040] Based on stage-stable embeddings and preliminary risk scores, samples are divided into ordered risk bins according to a preset risk threshold sequence within each source center. The embedding sets within each bin are summarized one by one, and the embedding mean of the current bin is calculated as the prototype mean. Robust covariance is obtained by logarithmic domain shrinkage, that is, the sample covariance is logarithmically mapped, combined with the logarithm of the identity matrix by the shrinkage coefficient, and mapped back to the covariance space. At the same time, the sample count and normalized frequency within each bin are counted to form the quantitative risk histogram of the current center. The prototype mean of the bin and the shrinkage covariance are combined to form a prototype sketch.
[0041] At the aggregation end, the prototype sketches and quantitative risk histograms of each center are integrated. For the prototype sketches, weighted summation is performed according to the weights obtained by normalizing the frequency of each center in the corresponding bucket. The mean is directly weighted and summed. The covariance is converged to the global covariance using the fixed-point iterative method of the Bress-Wasselstein centroid. For the quantitative risk histogram, the cost matrix and entropy regularization parameters between buckets are constructed. The coupling of the global histogram is obtained by solving through alternating scaling. The obtained divergence measure is used as the evaluation basis for distribution consistency. The global prototype mean, global covariance and global risk histogram are output.
[0042] Using the global prototype mean, global covariance, and the global risk histogram corresponding to each bucket as teacher signals, a prototype sketch distillation objective is constructed. This objective minimizes the weighted deviation between the global prototype mean after parameter mapping and the midpoint of the current bucket's target risk scale, the entropy-normalized transport divergence between the predicted risk histograms of each center induced by parameters and the global histogram, and the matrix distance between the parameter-induced bucket covariance and the global covariance in log-Euclidean space. In each round, the parameters and histograms are updated alternately. Figure 1 Consistency constraints are applied until the relative improvement of the objective function falls below a predetermined threshold, at which point global prediction parameters are output.
[0043] Optionally, the generation of the MACE risk score, confidence interval, and feature-level interpretation results specifically includes:
[0044] After loading the global prediction parameters, read the standardized data of the target patient, input and calculate the data one by one in chronological order, add the corresponding time index and patient identifier, and keep the input order consistent.
[0045] For each input data, risk calculation is performed sequentially. The inner product of the global prediction parameter and the current input data is calculated as the original risk value. The value is scaled by the corresponding temperature parameter, and the result is logically transformed to obtain the risk probability. The risk probability is compared with the preset risk threshold to determine the risk level label and record the result. The MACE risk score is then output.
[0046] After obtaining the risk probabilities at all time points, the risk confidence interval and feature-level interpretation are calculated. The variance metric is calculated based on the global covariance. The upper and lower confidence boundaries of the risk probability are determined according to the normal approximation method. The gradient sensitivity and contribution product of each feature are calculated. The results are normalized to obtain the feature-level interpretation results.
[0047] The beneficial effects of this invention are:
[0048] 1. This invention introduces a cross-source embedding spatial alignment mechanism to achieve unified semantic mapping of multi-source clinical data from different medical centers, such as electronic medical records, laboratory tests, physiological time series, electrocardiograms, and text. This solves the problems of inconsistent feature distribution, information redundancy, and feature drift in traditional methods, thereby significantly improving the effectiveness of cross-institutional data fusion and the stability of prediction results.
[0049] 2. This invention introduces a trust domain curriculum alignment strategy in the embedding alignment stage. By dynamically stratifying the reliability of samples, it prioritizes training high-confidence samples and gradually expands to medium- and low-confidence samples, enabling the model to have adaptive learning capabilities during training. This avoids the interference of low-quality data on model stability, accelerates the convergence of the alignment space, and improves the robustness and generalization performance of the embedding representation.
[0050] 3. By generating risk prototypes at various source centers and performing global distillation, this invention can capture the differences and common characteristics of risk patterns in different medical institutions, form a transferable risk expression structure, and complete the consistency calibration of risk histograms at the aggregation end, thereby improving the accuracy and interpretability of the model's risk assessment in cross-domain scenarios. Attached Figure Description
[0051] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0052] Figure 1 This is a flowchart of a MACE prediction method based on cross-source embedding alignment proposed in this invention;
[0053] Figure 2 This is a schematic diagram of the algorithm structure of a MACE prediction method based on cross-source embedding alignment proposed in this invention. Detailed Implementation
[0054] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0055] refer to Figure 1-2A MACE prediction method based on cross-source embedding alignment includes the following steps:
[0056] Collect comprehensive clinical data from medical centers, including electronic medical records, laboratory tests, physiological timelines, electrocardiograms, and text data, and perform data standardization and time alignment to obtain standardized data with consistent structure.
[0057] Based on standardized data, clinical features are extracted one by one and corresponding initial embedding representations are generated, and a multi-source initial embedding set is output.
[0058] Using a multi-source initial embedding set as input, weighted fusion and scale unification are performed according to the patient dimension to generate a patient-level comprehensive embedding, which serves as the alignment representation to be aligned across sources.
[0059] The patient-level integrated embedding is divided into source domain and target domain according to its source. Embedding space alignment is performed based on sample similarity constraints and distribution consistency constraints. The aligned unified embedding is output to establish cross-source correspondence.
[0060] Based on the unified embedding, the pairwise similarity of cross-source samples is calculated and a one-to-one or one-to-many correspondence mapping is determined to form a cross-source feature correspondence table and a similarity matrix;
[0061] The cross-source feature correspondence table and similarity matrix are aligned with the trust domain curriculum. The alignment and supervision strength are set hierarchically according to the reliability of the samples. The samples are included in the training in stages from high to low, and the stage stable embedding and preliminary risk score are output.
[0062] Based on the stage-stable embedding and preliminary risk score, risk prototype sketches and quantitative risk histograms are generated from each source, and prototype sketch distillation and risk distribution integration are performed to output global prediction parameters.
[0063] The global prediction parameters are calibrated together with the standardized data of the target patients to generate temperature-scaled and threshold-calibrated MACE risk scores, confidence intervals, and feature-level interpretations.
[0064] This invention collects multi-source heterogeneous clinical comprehensive data and performs standardization and time alignment, enabling the fusion of electronic medical records, laboratory tests, physiological time series, electrocardiograms, and text data from different medical centers under a unified structure. This effectively solves the problems of inconsistent data formats, differences in time granularity, and inconsistent handling of missing values in traditional methods, thereby significantly improving the integrity and temporal continuity of data input.
[0065] In this embodiment, obtaining the standardized data specifically includes:
[0066] The scope of medical centers and patients participating in data collection is determined, and a unique identifier is established for each center and patient. The comprehensive clinical data from each center is uniformly coded and desensitized, and fields that can identify individuals are deleted. The variable names, value units and encoding methods of each center are unified into the same data dictionary to form an aligned set of raw data. The comprehensive clinical data comes from different medical centers and contains the same signal from different precision acquisition devices. The acquisition devices include static 12-lead ECG and dynamic 12-lead ECG acquisition devices.
[0067] Data cleaning is performed on the original dataset. Outliers are handled according to the valid value range of each type of variable. Missing data is filled by interpolation of adjacent time or representative value of the same variable. Text information is formatted. All time fields are standardized to the standard time zone and time format to obtain a standardized cleaned dataset.
[0068] Establish a unified global timeline and perform time alignment. Rearrange various modal data in the cleaned dataset according to the timeline order. Use linear interpolation to fill continuous variables and keep the most recent valid values for categorical variables. Select multiple records at the same time point according to their time sequence and output standardized data with a consistent structure.
[0069] This invention constructs a multi-source initial embedding set by extracting clinical features one by one from standardized data and generating initial embedding representations. This achieves semantic unity and spatial compatibility of embedding representations among different modal features, effectively reduces information loss caused by dimensionality mismatch between features, and significantly improves the expressive power and stability of multimodal data in subsequent modeling processes.
[0070] In this embodiment, the output process of the multi-source initial embedding set specifically includes:
[0071] Using standardized data as input, records are read one by one in a fixed order of center, patient, modality, and global time point. For structured and laboratory test items, numerical values and enumeration codes are extracted in the order of fields to form fixed-length features. For physiological time series and electrocardiogram items, statistical, morphological quantitative features and quality markers within the corresponding time window are extracted to form fixed-length features. For text items, standardized terms, entities and negation markers are extracted to form fixed-length features. Availability markers are generated for each modality at the current time point. The modality features and availability markers are concatenated in a preset order to obtain the patient's cross-modality feature vector at the current time point.
[0072] The cross-modal feature vector is taken as input and converted into an initial embedding representation of uniform dimension through a linear mapping operation. Corresponding time position information is added to each time point and concatenated with the current initial embedding in a fixed order. The amplitude pruning and length verification are performed on the concatenation result to form the initial embedding entry of the current patient at the current time point. Each initial embedding entry is attached with a center identifier, a patient identifier and a global time point.
[0073] The initial embedding entries are aggregated by center and patient. An initial embedding set for patient-time series is established for each center and sorted in ascending order by global time point. The initial embedding sets of all centers are merged into a multi-source initial embedding set in a fixed order of center identifiers.
[0074] This invention generates patient-level comprehensive embeddings by weighting and unifying the initial multi-source embedding set according to the patient dimension. This achieves dynamic weighted integration of cross-source features at a unified scale, effectively avoiding single-source bias and data dominance issues, improving the expressive integrity and temporal consistency of individual-level embeddings, and providing high-quality input for subsequent cross-source alignment.
[0075] In this embodiment, the process of generating the patient-level comprehensive embedding specifically includes:
[0076] Align the multi-source initial embedding set according to the index keys of center, patient, and global time point. Create a list of initial embeddings from different centers for the same patient at the same time point and record missing marks for entries that cannot be aligned while retaining the original index.
[0077] For each patient's fusion list at each time point, the initial embeddings of each center are scaled according to a fixed dimensional scaling factor. The embeddings from different centers at the same time point are weighted and summed to obtain the cross-source fusion embedding at the current time point. The cross-source fusion embeddings of each patient at each time point are aggregated according to time weight to form the initial time aggregate representation of the current patient. The source weight and time weight records for quality auditing are output simultaneously.
[0078] The initial temporal aggregation representation is subjected to cross-patient scale normalization, and the normalized result is the patient-level comprehensive embedding for the current patient.
[0079] This invention divides patient-level integrated embedding into source and target domains and performs embedding space alignment, enabling data from different medical centers to establish a correspondence in a unified semantic space. This solves the problem of insufficient model generalization caused by differences in cross-institutional data distribution, thereby improving the model's transferability and robustness in different medical scenarios.
[0080] In this embodiment, the unified embedding output process specifically includes:
[0081] The patient-level comprehensive embedding is divided according to the source center. The embedding subset of each center is defined as the source domain or the target domain. The center with the most samples is defined as the source domain, and the remaining centers are defined as the target domain. A domain identifier is added to each sample, and the consistency between the patient identifier and the global time index is maintained to form the source domain and target domain embedding list.
[0082] Mean centering and variance normalization are performed on the embedding spaces of the source and target domains to ensure that the embeddings of different domains have a uniform numerical range. Using the patient identifier as the key, the embedding samples of the same patient in different domains are paired. For samples that cannot be directly paired, pseudo-pairing labels are generated and the corresponding confidence weights are recorded to obtain the pairing results.
[0083] Based on the pairing results, an embedding space alignment operation is performed on each pair of source domain embeddings and target domain embeddings. The solution is based on the dual objectives of maximizing similarity and minimizing distribution consistency. The spatial mapping relationship between the source domain and the target domain is updated iteratively. In each iteration, high-confidence pairs are selected according to the similarity threshold and the average offset is calculated. The target domain embedding is linearly translated and proportionally adjusted using the average offset, while keeping the distance structure between embeddings unchanged. After all iterations are completed, the aligned unified embedding is obtained.
[0084] This invention calculates the similarity between samples based on unified embedding and determines the cross-source mapping relationship, forming a cross-source feature correspondence table and a similarity matrix. This achieves accurate matching between patient samples from different sources, effectively reducing semantic offset and mismatch problems during cross-source data fusion, thereby improving the accuracy of data alignment and feature fusion.
[0085] In this embodiment, the formation of the cross-source feature correspondence table and the similarity matrix specifically includes:
[0086] Based on the unified embedding, the data is divided into a source domain list and a target domain list according to the source center. Each embedded sample is labeled with a patient identifier and a global time index. The global time index is used as the primary key to perform preliminary pairing of the source domain and target domain embeddings. Only sample pairs with a time difference within a preset time window are retained to form a candidate sample pair set.
[0087] For each candidate sample set, calculate the pairwise similarity. Normalize the length of the embedding vectors of the source and target domains. Calculate the ratio of the inner product of the two vectors to their respective lengths to obtain a cosine similarity value between -1 and 1, and fill it into the similarity matrix table. Use the source domain samples as the row index and the target domain samples as the column index. Then sort the similarity of each row from high to low. Only retain the target domain samples that are above the similarity threshold and are in the first few rows. The rest are marked as invalid in the matrix.
[0088] Based on the filtered similarity matrix table, the corresponding mapping is determined. Entries with the same patient identifier and a time index difference not exceeding the threshold are confirmed as one-to-one correspondences. For sample entries that do not match directly, a one-to-many relationship is established based on the target domain sample with the highest similarity. The upper limit of the number of source domain samples that each target domain sample can correspond to is limited. All valid corresponding entries are summarized to generate a cross-source feature correspondence table. Each entry includes the center identifier of the source domain and the target domain, the patient identifier, the time index, the correspondence type, the similarity value, and the confidence weight. At the same time, the filtered similarity matrix is output.
[0089] This invention employs a trust domain curriculum alignment mechanism to train cross-source feature correspondence tables and similarity matrices in stages, dynamically adjusting alignment and supervision strength. This achieves a robust training process that prioritizes high-confidence samples and gradually introduces low-confidence samples, effectively reducing the impact of low-quality sample interference on model convergence and improving the stability and predictive performance of embedding alignment.
[0090] In this embodiment, the process of staged stable embedding and outputting the preliminary risk score specifically includes:
[0091] Based on the cross-source feature correspondence table and similarity matrix, the reliability of all sample pairs is evaluated according to the similarity value and confidence weight. The reliability results are divided into three trust domains: high, medium and low according to the threshold. Independent alignment strength coefficient and supervision strength coefficient are set for each trust domain sample. The high trust domain sample has the highest weight and the low trust domain sample has the lowest weight. The hierarchical order of the trust domain remains unchanged.
[0092] Using high-trust domain samples as the initial training set, the first stage of trust domain course alignment training is performed. In each iteration, the mapping parameters are updated according to the similarity improvement and embedding stability, and the trend of alignment loss is monitored. When the loss decreases below a preset threshold for consecutive preset rounds, medium-trust domain samples are included and the alignment and supervision strength are adjusted simultaneously. In the second stage of training, the distribution consistency index between medium-trust domain samples and high-trust domain samples is continuously calculated, and the learning step size is dynamically adjusted according to the index change.
[0093] After the second stage of training converges, low-confidence samples are introduced to perform the third stage of course alignment. The embedding results output from the previous stage are used as the initial state. Low-confidence samples are incorporated in a stepwise expansion manner, and the maximum weight increase is limited. After all stages of training are completed, the stability of the final embedding results is tested to remove abnormal samples whose changes exceed the threshold. A linear risk score is calculated for the stable embeddings, and the stage stable embeddings and their corresponding preliminary risk scores are output.
[0094] This invention generates risk prototype sketches and quantified risk histograms from various sources, and performs prototype sketch distillation and risk distribution integration. This enables global distillation of cross-institutional knowledge and consistent fusion of risk information, improving the model's risk transfer capability and distribution calibration accuracy across different data sources, and enhancing the consistency and reliability of prediction results.
[0095] In this embodiment, the output process of the global prediction parameters specifically includes:
[0096] Based on stage-stable embeddings and preliminary risk scores, samples are divided into ordered risk bins according to a preset risk threshold sequence within each source center. The embedding sets within each bin are summarized one by one, and the embedding mean of the current bin is calculated as the prototype mean. Robust covariance is obtained by logarithmic domain shrinkage, that is, the sample covariance is logarithmically mapped, combined with the logarithm of the identity matrix by the shrinkage coefficient, and mapped back to the covariance space. At the same time, the sample count and normalized frequency within each bin are counted to form the quantitative risk histogram of the current center. The prototype mean of the bin and the shrinkage covariance are combined to form a prototype sketch.
[0097] At the aggregation end, the prototype sketches and quantitative risk histograms of each center are integrated. For the prototype sketches, weighted summation is performed according to the weights obtained by normalizing the frequency of each center in the corresponding bucket. The mean is directly weighted and summed. The covariance is converged to the global covariance using the fixed-point iterative method of the Bress-Wasselstein centroid. For the quantitative risk histogram, the cost matrix and entropy regularization parameters between buckets are constructed. The coupling of the global histogram is obtained by solving through alternating scaling. The obtained divergence measure is used as the evaluation basis for distribution consistency. The global prototype mean, global covariance and global risk histogram are output.
[0098] Using the global prototype mean, global covariance, and the global risk histogram corresponding to each bucket as teacher signals, a prototype sketch distillation objective is constructed. This objective minimizes the weighted deviation between the global prototype mean after parameter mapping and the midpoint of the current bucket's target risk scale, the entropy-normalized transport divergence between the predicted risk histograms of each center induced by parameters and the global histogram, and the matrix distance between the parameter-induced bucket covariance and the global covariance in log-Euclidean space. In each round, the parameters and histograms are updated alternately. Figure 1 Consistency constraints are applied until the relative improvement of the objective function falls below a predetermined threshold, at which point global prediction parameters are output.
[0099] This invention generates a temperature-scaled and threshold-calibrated MACE risk score and confidence interval by calibrating global prediction parameters in conjunction with standardized data of the target patient. This achieves probability calibration and feature-level interpretation of the prediction output, thereby improving the clinical credibility and interpretability of the risk assessment results.
[0100] In this embodiment, the generation of the MACE risk score, confidence interval, and feature-level interpretation results specifically includes:
[0101] After loading the global prediction parameters, read the standardized data of the target patient, input and calculate the data one by one in chronological order, add the corresponding time index and patient identifier, and keep the input order consistent.
[0102] For each input data, risk calculation is performed sequentially. The inner product of the global prediction parameter and the current input data is calculated as the original risk value. The value is scaled by the corresponding temperature parameter, and the result is logically transformed to obtain the risk probability. The risk probability is compared with the preset risk threshold to determine the risk level label and record the result. The MACE risk score is then output.
[0103] After obtaining the risk probabilities at all time points, the risk confidence interval and feature-level interpretation are calculated. The variance metric is calculated based on the global covariance. The upper and lower confidence boundaries of the risk probability are determined according to the normal approximation method. The gradient sensitivity and contribution product of each feature are calculated. The results are normalized to obtain the feature-level interpretation results.
[0104] The overall method of this invention, through multi-stage design including cross-source embedding alignment, trust domain curriculum alignment, and prototype sketch distillation, realizes a complete closed-loop process from multi-source heterogeneous data fusion to global risk prediction. It overcomes the shortcomings of traditional single-source modeling in terms of generalization, stability, and interpretability, and significantly improves the accuracy, transferability, and clinical application value of MACE prediction.
[0105] Example 1:
[0106] To verify the feasibility of this invention in practice, it was applied to a major adverse cardiovascular event (MACE) prediction task using multi-source heterogeneous medical data. This task involved comprehensive clinical data from three independent medical centers, including electronic medical records, laboratory test data, physiological monitoring time-series data, static 12-lead and dynamic 12-lead electrocardiogram data, and unstructured text medical records, totaling approximately 42,000 patient samples. Each data source had different collection standards and time scales, and traditional models exhibited significant distribution shifts and generalization instability in this scenario.
[0107] In the initial stage of the experiment, the raw data from various centers were first structurally integrated. Semantic mapping was completed through a unified standard coding system, and the feature items from different hospitals were named and aligned with time windows. For example, time-series data such as heart rate, blood pressure, and blood glucose were adjusted to the same time resolution, and text medical records were transformed into numerical vector features after medical named entity recognition and keyword extraction.
[0108] During the model implementation phase, the multi-source embedding generation mechanism of this invention is used to train initial embedding representations separately for each data source. Subsequently, weighted fusion and scale unification are performed on a patient-by-patient basis to generate a unified patient-level comprehensive embedding. Next, using the cross-source embedding alignment mechanism proposed in this invention, the patient-level embeddings are divided into source and target domains, and the unification of the cross-center feature space is achieved through sample similarity and distribution consistency constraints. In traditional linear projection methods, feature mapping deviations between different centers are significant. However, this method gradually introduces high, medium, and low confidence samples through a trust domain curriculum alignment strategy, enabling the model to exhibit stronger robustness and stability during the alignment phase.
[0109] To further verify the effectiveness of this invention in risk prediction, trust domain curriculum alignment training was performed on the aligned data to generate stage-stable embeddings and preliminary risk scores. Subsequently, a prototype sketch distillation mechanism was used to generate risk prototypes and risk histograms at each source center, and knowledge integration was achieved through global distillation.
[0110] During the model evaluation phase, this invention was compared with three mainstream methods: single-source deep neural networks (DNNs), multimodal fusion networks (MMFNs), and cross-domain adaptive networks (DANNs). The comparison results are shown in Table 1.
[0111] Table 1. Performance comparison results of the method of the present invention and the prior art
[0112] Model type AUC (Prediction Accuracy) F1 score Calibration error (ECE) Cross-domain migration score Model convergence rounds Average Explanation Confidence Single-source DNN 0.812 0.734 0.094 0.61 88 0.67 Multimodal MMFN 0.845 0.761 0.078 0.68 92 0.72 Cross-domain DANN 0.869 0.783 0.063 0.73 95 0.75 Method of the present invention 0.912 0.826 0.041 0.81 64 0.88
[0113] As shown in Table 1, this invention significantly outperforms the comparative methods in terms of prediction accuracy, model stability, and cross-institutional transfer performance. Specifically, the AUC is improved by approximately 4.9%, the F1 score by approximately 5.5%, and the calibration error is reduced by over 45%. Simultaneously, the number of training convergence epochs is reduced by approximately one-third, indicating that the model has faster optimization efficiency and better generalization performance. Furthermore, in multi-source data transfer scenarios, the consistency of the risk interpretation results output by this invention is significantly improved, enabling physicians to make individualized intervention decisions based on high-confidence feature contributions.
[0114] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A MACE prediction method based on cross-source embedding alignment, characterized in that, Includes the following steps: Collect comprehensive clinical data from medical centers, and perform data standardization and time alignment to obtain standardized data with consistent structure; Based on standardized data, clinical features are extracted one by one and corresponding initial embedding representations are generated, and a multi-source initial embedding set is output. Using a multi-source initial embedding set as input, weighted fusion and scale unification are performed to generate a patient-level comprehensive embedding; The patient-level integrated embedding is divided into source domain and target domain according to its source, and the embedding space alignment is performed to output the aligned unified embedding. Based on the unified embedding, the pairwise similarity of cross-source samples is calculated and the corresponding mapping is determined, forming a cross-source feature correspondence table and a similarity matrix; The cross-source feature correspondence table and similarity matrix are aligned with the trust domain curriculum. The alignment and supervision strength are set hierarchically according to the reliability of the samples. The samples are included in the training in stages from high to low, and the stage stable embedding and preliminary risk score are output. Based on the stage-stable embedding and preliminary risk score, risk prototype sketches and quantitative risk histograms are generated from each source, and prototype sketch distillation and risk distribution integration are performed to output global prediction parameters. The global prediction parameters are calibrated together with the standardized data of the target patients to generate temperature-scaled and threshold-calibrated MACE risk scores, confidence intervals, and feature-level interpretations.
2. The MACE prediction method based on cross-source embedding alignment according to claim 1, characterized in that, The standardization data is obtained specifically in the following ways: The scope of medical centers and patients participating in data collection was determined, a unique identifier was established for each center and patient, and the comprehensive clinical data from each center was uniformly coded and desensitized to form an aligned set of raw data. Data cleaning is performed on the original dataset, text information is formatted, and all time fields are standardized to the standard time zone and time format, resulting in a standardized cleaned dataset. Establish a unified global timeline and perform time alignment. Rearrange various modal data in the cleaned dataset according to the timeline order. Select multiple records at the same time point according to their chronological order and output standardized data with consistent structure.
3. The MACE prediction method based on cross-source embedding alignment according to claim 1, characterized in that, The output process of the multi-source initial embedding set specifically includes: Using standardized data as input, records are read one by one in a fixed order, and an availability tag is generated for each modality at the current time point. The modality features and availability tags are concatenated in a preset order to obtain the patient's cross-modality feature vector at the current time point. The cross-modal feature vector is taken as input and transformed into an initial embedding representation of uniform dimension through a linear mapping operation. Corresponding time location information is added to each time point to form the initial embedding entry of the current patient at the current time point. The initial embedding entries are aggregated by center and patient. An initial embedding set for patient-time series is established for each center and sorted in ascending order by global time point. The initial embedding sets of all centers are merged into a multi-source initial embedding set in a fixed order of center identifiers.
4. The MACE prediction method based on cross-source embedding alignment according to claim 1, characterized in that, The process of generating the patient-level comprehensive embedding specifically includes: Align the multi-source initial embedding set according to the index keys of center, patient, and global time point, and create a list of initial embeddings from different centers for the same patient at the same time point to be fused. For each patient's fusion list at each time point, the initial embeddings of each center are scaled and uniformly scaled. The embeddings from different centers at the same time point are weighted and summed to obtain the cross-source fusion embedding at the current time point. The cross-source fusion embeddings of each patient at each time point are aggregated according to the time weight to form the initial time aggregate representation of the current patient. The source weight and time weight records are output simultaneously. The initial temporal aggregation representation is subjected to cross-patient scale normalization, and the normalized result is the patient-level comprehensive embedding for the current patient.
5. The MACE prediction method based on cross-source embedding alignment according to claim 1, characterized in that, The unified embedding output process specifically includes: The patient-level comprehensive embeddings are divided according to the source center. The embedding subset of each center is defined as the source domain or the target domain. A domain identifier is added to each sample, and the consistency between the patient identifier and the global time index is maintained to form a source domain and target domain embedding list. Mean centering and variance normalization are performed on the embedding spaces of the source and target domains to ensure that the embeddings of different domains have a uniform numerical range. Using the patient identifier as the key, the embedding samples of the same patient in different domains are paired to obtain the pairing results. Based on the pairing results, an embedding space alignment operation is performed on each pair of source domain embeddings and target domain embeddings. The spatial mapping relationship between the source domain and the target domain is updated iteratively. In each iteration, high-confidence pairs are selected according to the similarity threshold and the average offset is calculated. The target domain embedding is linearly translated and scaled using the average offset. After all iterations are completed, the aligned unified embedding is obtained.
6. The MACE prediction method based on cross-source embedding alignment according to claim 1, characterized in that, The formation of the cross-source feature correspondence table and similarity matrix specifically includes: Based on the unified embedding, the data is divided into a source domain list and a target domain list according to the source center. Each embedded sample is labeled with a patient identifier and a global time index. Using the global time index as the primary key, the source domain and target domain embeddings are initially paired to form a candidate sample pair set. For each candidate sample pair, calculate the pairwise similarity. Normalize the length of the embedding vectors of the source and target domains, calculate the ratio of the inner product of the two vectors to their respective lengths, obtain the similarity value, and fill it into the similarity matrix table. Based on the filtered similarity matrix table, the corresponding mapping is determined, and the upper limit of the number of source domain samples that each target domain sample can correspond to is limited. All valid corresponding entries are summarized to generate a cross-source feature correspondence table. Each entry contains a similarity value and a confidence weight. At the same time, the filtered similarity matrix is output.
7. The MACE prediction method based on cross-source embedding alignment according to claim 1, characterized in that, The process of stabilizing the embedding and outputting the initial risk score specifically includes: Based on the cross-source feature correspondence table and similarity matrix, the reliability of all sample pairs is evaluated according to the similarity value and confidence weight. The reliability results are divided into three trust domains: high, medium and low according to the threshold. Independent alignment strength coefficient and supervision strength coefficient are set for each trust domain sample, and the high trust domain sample has the highest weight and the low trust domain sample has the lowest weight. Using high-trust domain samples as the initial training set, the first stage of trust domain course alignment training is performed. In each iteration, the mapping parameters are updated according to the similarity improvement and embedding stability, and the trend of alignment loss is monitored. When the loss decreases below a preset threshold for consecutive preset rounds, medium-trust domain samples are included and the alignment and supervision strength are adjusted simultaneously. In the second stage of training, the distribution consistency index between medium-trust domain samples and high-trust domain samples is continuously calculated. After the second stage of training converges, low-confidence samples are introduced to perform the third stage of course alignment. The embedding results output from the previous stage are used as the initial state. Low-confidence samples are incorporated in a stepwise expansion manner, and the maximum weight increase is limited. After all stages of training are completed, the stability of the final embedding results is tested to remove abnormal samples whose changes exceed the threshold. A linear risk score is calculated for the stable embeddings, and the stage stable embeddings and their corresponding preliminary risk scores are output.
8. The MACE prediction method based on cross-source embedding alignment according to claim 1, characterized in that, The output process of the global prediction parameters specifically includes: Based on stage-stable embeddings and preliminary risk scores, samples are divided into ordered risk bins according to a preset risk threshold sequence within each source center. The embedding sets within each bin are summarized one by one, and the embedding mean of the current bin is calculated as the prototype mean. Robust covariance is obtained by logarithmic domain shrinkage, that is, the sample covariance is logarithmically mapped, combined with the logarithm of the identity matrix by the shrinkage coefficient, and mapped back to the covariance space. At the same time, the sample count and normalized frequency within each bin are counted to form the quantitative risk histogram of the current center. The prototype mean of the bin and the shrinkage covariance are combined to form a prototype sketch. At the aggregation end, the prototype sketches and quantitative risk histograms of each center are integrated. For the prototype sketches, weighted summation is performed according to the weights obtained by normalizing the frequency of each center in the corresponding bucket. The mean is directly weighted and summed. The covariance is converged to the global covariance using the fixed-point iterative method of the Bress-Wasselstein centroid. For the quantitative risk histogram, the cost matrix and entropy regularization parameters between buckets are constructed. The coupling of the global histogram is obtained by solving through alternating scaling. The obtained divergence measure is used as the evaluation basis for distribution consistency. The global prototype mean, global covariance and global risk histogram are output. Using the global prototype mean, global covariance, and the global risk histogram corresponding to each bucket as teacher signals, a prototype sketch distillation objective is constructed. The objective minimizes the weighted deviation between the global prototype mean after parameter mapping and the midpoint of the target risk scale of the current bucket, the entropy regularized transport divergence between the predicted risk histograms of each center and the global histogram, and the matrix distance between the bucket covariance and the global covariance in log-Euclidean space. In each round, the parameters and histogram consistency constraints are alternately updated until the relative improvement of the objective function is lower than a predetermined threshold, and then the global prediction parameters are output.
9. The MACE prediction method based on cross-source embedding alignment according to claim 1, characterized in that, The generation of the MACE risk score, confidence interval, and feature-level interpretation results specifically includes: After loading the global prediction parameters, read the standardized data of the target patient, input and calculate the data one by one in chronological order, add the corresponding time index and patient identifier, and keep the input order consistent. For each input data, risk calculation is performed sequentially. The inner product of the global prediction parameter and the current input data is calculated as the original risk value. The value is scaled by the corresponding temperature parameter, and the result is logically transformed to obtain the risk probability. The risk probability is compared with the preset risk threshold to determine the risk level label and record the result. The MACE risk score is then output. After obtaining the risk probabilities at all time points, the risk confidence interval and feature-level interpretation are calculated. The variance metric is calculated based on the global covariance. The upper and lower confidence boundaries of the risk probability are determined according to the normal approximation method. The gradient sensitivity and contribution product of each feature are calculated. The results are normalized to obtain the feature-level interpretation results.