Intelligent monitoring and prevention system for acute myocardial infarction

By using an improved Transformer network and dual-modal signal fusion with individualized baseline correction, the problem of existing technologies being unable to effectively capture the long-term pathological evolution characteristics of myocardial infarction and individual heterogeneity adaptation is solved, achieving highly accurate early warning of AMI.

CN122494239APending Publication Date: 2026-07-31FOSHAN MICROWONDERS BIOTECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
FOSHAN MICROWONDERS BIOTECHNOLOGY CO LTD
Filing Date
2026-05-09
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing technologies cannot effectively characterize the long-range spatiotemporal synergistic dependence of bimodal signals in the pathological process of acute myocardial infarction (AMI), and cannot adapt to individual heterogeneity, resulting in the inability to achieve highly accurate ultra-early warning.

Method used

The study employs an electrocardiogram signal acquisition module, a myocardial biomarker preprocessing module, a baseline correction module, a spatiotemporal feature extraction module, and a risk prediction module. By using an improved Transformer network and a multi-head attention mechanism, combined with individualized baseline correction and cross-modal signal fusion, global spatiotemporal dependent features are extracted to predict the risk of acute myocardial infarction (AMI).

Benefits of technology

It significantly improves the accuracy and robustness of early warning for acute myocardial infarction, reduces the false alarm rate and false negative rate, and is suitable for real-time monitoring at home outside of hospitals using wearable devices and implantable detection chips.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122494239A_ABST
    Figure CN122494239A_ABST
Patent Text Reader

Abstract

This invention relates to the field of intelligent monitoring technology for acute myocardial infarction (AMI), and more particularly to an intelligent monitoring and prevention system for AMI. The system comprises an electrocardiogram (ECG) signal acquisition module, a cTn (cTn) signal acquisition module, a baseline correction module, a spatiotemporal feature extraction module, and a risk prediction module connected in sequence. Through dual-dimensional individualized dynamic baseline correction, cross-attention cross-modal fusion, improved Transformer network feature extraction with physiological priors, and Monte Carlo dropout uncertainty calibration, it outputs the AMI risk probability and confidence level within a preset time window. This invention significantly improves the accuracy, robustness, and reliability of ultra-early AMI warning, reduces false alarm and false negative rates, and is widely adaptable to wearable devices and implantable detection chips for real-time outpatient and home monitoring scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent monitoring technology for acute myocardial infarction, and more particularly to an intelligent monitoring and prevention system for acute myocardial infarction. Background Technology

[0002] Myocardial infarction, specifically acute myocardial infarction (AMI), is myocardial necrosis caused by acute and persistent ischemia and hypoxia of the coronary arteries. It is characterized by rapid onset, rapid progression, and high mortality. Electrocardiography (ECG), as a direct reflection of cardiac electrical activity, uses cardiac troponin I (cTnI) or cardiac troponin T (cTnT) as the core diagnostic criteria for AMI. After technological breakthroughs in implanted cardiac biomarker detection chips, it is possible to output in vivo, continuous, and high-temporal-resolution quantitative detection signals of cTn, making it possible to synchronously monitor the co-occurring time axis of ECG electrical activity signals and in vivo cTn biochemical signals. With the development of wearable devices and artificial intelligence technology, intelligent myocardial infarction monitoring and early warning systems based on ECG signals have become a research hotspot. Currently, existing ECG monitoring and myocardial infarction early warning technologies still have the following technical shortcomings: The inherent limitations of existing algorithms' underlying architecture prevent them from effectively characterizing the global spatiotemporal co-dependency of bimodal signals in the pathological process of acute myocardial infarction (AMI). The progression from myocardial infarction to AMI is a continuous and dynamic pathological process, manifested not only as progressive abnormalities in ECG waveforms spanning hundreds of heartbeats and several minutes to tens of minutes, but also as a gradual increase in cTn signals detected by in vivo chips. Accurate identification of this process requires algorithms to achieve co-modeling of bimodal long-range time-series signals on the same time axis. Among existing mainstream algorithms, CNN-type models are strictly limited by local receptive fields and can only capture local morphological abnormalities in short single-cycle sequences; recurrent models such as LSTM / GRU are prone to gradient vanishing or exploding when processing ultra-long-range bimodal time-series sequences, failing to capture the co-evolutionary correlation of bimodal signals over long time, and ultimately making it difficult to identify early pathological trends before the onset of AMI.

[0003] Furthermore, the static training and fixed parameter deployment paradigm of existing models makes them unable to adapt to the individual heterogeneity of bimodal signals, thus failing to achieve highly accurate anomaly identification. The normal fluctuation range of ECG waveforms is affected by individual differences and dynamic shifts within individuals; at the same time, the baseline level of cTn continuously acquired by the in vivo chip will also fluctuate dynamically due to the patient's chronic underlying diseases and changes in physiological state, making it difficult to monitor using a uniform threshold.

[0004] Existing models are generally statically trained based on population datasets. After the parameters are fixed, a uniform feature extraction logic and judgment threshold are used for all individuals. This makes it impossible to adapt to the bimodal normal baseline of different individuals, or to adapt to the dynamic changes in the physiological state of the same patient. It is also impossible to distinguish between individual physiological fluctuations and pathologically significant micro-abnormalities. Therefore, it is difficult to achieve high-sensitivity identification of early pathological signals and avoid high false alarm rates.

[0005] In summary, current technologies cannot effectively characterize the long-range spatiotemporal synergistic dependence of dual-modal signals in the pathological process of acute myocardial infarction (AMI), adapt to the individual heterogeneous baseline of dual-dimensional physiological signals, or mine the pathological synergistic early warning value of the two types of signals. Ultimately, it is difficult to achieve ultra-early, personalized, and highly accurate and reliable early warning of AMI. Summary of the Invention To address the aforementioned problems in the existing technology, the present invention provides an intelligent monitoring and prevention system for acute myocardial infarction, comprising: The ECG signal acquisition module is used to filter, locate the R wave, and segment the acquired raw ECG signal to generate a fixed-length current ECG segment. The myocardial marker detection preprocessing module is used to receive the quantitative detection values ​​of cardiac troponin I or cardiac troponin T, preprocess the detection values ​​and align them with the current electrocardiogram segment in the time dimension to generate the current cTn feature vector; The baseline correction module is used to construct and iteratively update the baseline ECG segment and the baseline cTn value based on the historical ECG data and historical cTn detection data collected by the patient in a stable state, and to calculate the feature residual vector between the current ECG segment and the baseline ECG segment, as well as the cTn residual vector between the current cTn feature vector and the baseline cTn value during the real-time monitoring phase. The spatiotemporal feature extraction module is used to perform cross-modal fusion of the current ECG segment, feature residual vector and current cTn feature vector, input to the pre-trained improved Transformer network, and extract multimodal global spatiotemporal dependent feature vectors that characterize the dynamic evolution of myocardial infarction through a multi-head attention mechanism. The risk prediction module is used to calculate and output the risk probability value and confidence level of acute myocardial infarction within a future preset time window based on the global spatiotemporal dependent feature vector and through a risk assessment classifier composed of fully connected layers.

[0006] Preferably, the baseline correction module calculates the weighted feature residual vector based on a dynamic weighting strategy that is inversely proportional to the waveform variation coefficient, including the following process: Extract the ST segment feature vector, T wave feature vector, and QRS complex feature vector of the current ECG segment; Calculate the historical coefficients of variation for the ST segment, T wave, and QRS complex in the reference ECG segment, respectively. The coefficients of variation are the ratios of the standard deviation to the mean. Calculate the normalized weight coefficients for each waveform, and calculate three weighted corrected residuals based on the weight coefficients. Concatenate these residuals along the feature dimension to obtain the weighted feature residual vector. The formula for calculating the weight coefficients for each waveform is as follows: , ; In the formula, The weighting coefficient for the i-th waveform is... To prevent division by zero of extremely small constants, Let be the coefficient of variation of the i-th feature. is the historical variation coefficient of the j-th waveform, used only for iterative summation to calculate the total factor.

[0007] Preferably, the network architecture of the improved Transformer network includes: A learnable frequency domain prior bias matrix is ​​added to the multi-head self-attention layer of the Transformer encoder. The frequency domain prior bias matrix is ​​pre-initialized according to the physiological frequency band energy distribution of the electrocardiogram signal, and is used to guide the self-attention mechanism to focus on the low-frequency drift and mid-frequency repolarization change characteristics that are clinically significant for the diagnosis of myocardial infarction.

[0008] Preferably, the position encoding module of the Transformer encoder employs relative position encoding based on heart rate variability adaptive adjustment. The encoding vector P is dynamically scaled by the ratio of the current heartbeat's RR interval to the baseline RR interval. For the sequence position p and dimension index k, the encoding vector elements are defined as follows: ; ; In the formula, The scaling factor is calculated using the following formula: , This refers to the RR interval of the heartbeat at the current location. The mean RR period at the patient's resting state. This represents the embedding dimension of the Transformer model.

[0009] Preferably, the spatiotemporal feature extraction module, when extracting the global spatiotemporal dependent feature vector, runs two sub-networks at different time scales in parallel, including: The first subnetwork takes a long-range electrocardiogram sequence of the first duration as input and is used to capture the progressive evolution trend of myocardial infarction at the minute level, and outputs a long-range feature vector. The second subnetwork takes a short-range ECG sequence of the second duration as input and is used to capture subtle morphological abnormalities in a single heartbeat cycle, and outputs a short-range feature vector. The spatiotemporal feature extraction module adaptively fuses long-range and short-range feature vectors through a gated fusion unit to obtain the global spatiotemporal dependent feature vector.

[0010] Preferably, before outputting the risk probability value, the risk prediction module further includes calibrating the uncertainty of the risk probability value, including the following process: During the model inference phase, the Dropout layer is kept on, and T random drop-out forward propagation is performed on the same ECG input sequence, with each random drop-out having a probability of P, resulting in T risk probability prediction values. The arithmetic mean of the T predicted values ​​is used as the final risk probability value after calibration, and the unbiased sample variance of the T predicted values ​​is used as the cognitive uncertainty. When the cognitive uncertainty is higher than a preset uncertainty threshold, the output of a high-risk warning signal is suppressed, and a prompt message is generated.

[0011] Preferably, the electrocardiogram signal acquisition module is further used for: The quality index is calculated based on the signal-to-noise ratio and motion artifact intensity. When the quality index is lower than the preset quality threshold, the corresponding ECG segment is discarded or marked to avoid low-quality signals interfering with subsequent prediction modules.

[0012] Preferably, the baseline correction module further includes iteratively updating the benchmark ECG segment and the benchmark cTn value using an exponential moving average strategy, with the update formula being: ; In the formula, The waveform feature vector extracted under the current steady state. The original ECG segment feature vector is shown below. This is the updated ECG segment feature vector. This is the smoothing coefficient.

[0013] Preferably, the cross-modal fusion adopts a cross-attention mechanism, specifically as follows: the cTn feature vector is linearly transformed and used as the query matrix Q; the fusion sequence of the current ECG segment and the feature residual vector is used as the key matrix K and the value matrix V; the ECG attention weights guided by cTn are calculated; the ECG feature sequence enhanced by cTn is output; and then the sequence is input into the improved Transformer network.

[0014] Preferably, the output of the risk prediction module is further connected to a sub-module for subtyping prediction. The sub-module for subtyping prediction consists of an independent fully connected layer and is used to output the predicted probabilities of ST-segment elevation myocardial infarction and non-ST-segment elevation myocardial infarction based on the multimodal global spatiotemporal dependent feature vector.

[0015] The beneficial effects of this invention are as follows: This invention integrates electrocardiogram (ECG) electrical activity signals with in vivo biochemical signals of cardiac troponin acquired by an implanted chip. Through standardized preprocessing and precise time alignment of dual-modal signals, construction of individualized dynamic benchmarks for both ECG and troponin, weighted residual calculation, cTn-guided cross-attention deep fusion across modalities, global spatiotemporal feature extraction using an improved Transformer network with physiological priors and heart rate adaptive location coding, and a Monte Carlo dropout-based prediction uncertainty calibration process, it fundamentally eliminates the interference of individual physiological heterogeneity on early warning results. It fully leverages the synergistic and complementary value of dual-modal signals in ultra-early early warning of acute myocardial infarction (AMI), effectively addressing the core shortcomings of existing technologies such as inability to effectively capture long-term pathological evolution characteristics of myocardial infarction, insufficient cross-modal fusion depth, and low early warning reliability. It significantly improves the accuracy, robustness, and clinical applicability of ultra-early early warning for AMI, substantially reducing false alarm and false negative rates. It is widely adaptable to wearable devices and implanted detection chips for real-time outpatient and home monitoring scenarios. Attached Figure Description

[0016] To facilitate understanding by those skilled in the art, the present invention will be further described below with reference to the accompanying drawings.

[0017] Figure 1 This is a schematic diagram of the system structure of the present invention; Figure 2 This is a schematic diagram illustrating the steps of calibrating the uncertainty of risk probability values ​​in the risk prediction module of this invention. Detailed Implementation

[0018] To further illustrate the technical means and effects of the present invention in achieving its intended purpose, the following detailed description of the specific implementation methods, structures, features, and effects of the present invention, in conjunction with the accompanying drawings and preferred embodiments, is provided.

[0019] An intelligent monitoring and prevention system for acute myocardial infarction (AMI) is disclosed. This system can interface with implanted cardiac biomarker detection chips and wearable ECG monitoring devices, deployed on edge computing terminals and cloud servers. Through simultaneous acquisition, preprocessing, and time alignment of ECG signals and in vivo cardiac troponin detection signals, dual-dimensional individualized baseline correction, cross-modal global spatiotemporal feature extraction, and risk prediction, it achieves early intelligent warning of AMI. In this embodiment, the system uses a single-lead ECG signal as the ECG modal input at a sampling rate of 250Hz; it uses the quantitative detection value of cTnI or cTnT signals output from the implanted cardiac biomarker detection chip as the biochemical modal input, with a chip detection sampling cycle of 1 minute / time and a detection limit of 0.005 ng / mL; the warning time window is set to the next 10 minutes, effectively identifying dual-modal abnormalities in the progressive evolution of AMI and significantly reducing false alarm and false negative rates. The system includes an ECG signal acquisition module, a cTn signal acquisition module, a baseline correction module, a spatiotemporal feature extraction module, and a risk prediction module, which are connected in sequence. The specific functions of each module are as follows: The ECG signal acquisition module is used to filter, locate the R-wave, and segment the acquired raw ECG signal to generate a fixed-length current ECG segment. The specific implementation process is as follows: First, the acquired raw ECG signal was filtered. A 50Hz power frequency notch filter was used to remove mains interference, a 0.5Hz Butterworth high-pass filter to suppress baseline drift, and a 40Hz Butterworth low-pass filter to remove high-frequency electromyography artifacts, preserving the effective physiological frequency band of the ECG signal from 0.5 to 40Hz. After filtering, the R-wave was located using a differential thresholding method: first, a first-order differential operation was performed on the ECG signal to amplify the abrupt change characteristics of the R-wave; then, an adaptive threshold was set. When the peak value of the differential signal exceeded the threshold and met the physiological range of the heartbeat interval (0.3-2.0 seconds), it was determined to be the R-wave peak. Based on each R-wave peak, 200 sampling points were truncated forward and 824 sampling points were truncated backward, generating a fixed-length current ECG segment of 1024 sampling points. To avoid low-quality signals interfering with subsequent predictions, the ECG signal acquisition module also calculates a quality index for each ECG segment. The quality index is calculated by weighting the signal-to-noise ratio and motion artifact intensity, using the following formula: Q = 0.7 × SNR + 0.3 × (1 - At), where SNR is the power ratio of the ECG signal to the noise, and A is the intensity of motion artifacts, ranging from 0 to 1. When the quality index is lower than the preset threshold of 0.6, the system automatically discards the ECG segment and marks it as a low-quality signal, preventing it from entering the subsequent processing flow; when the quality index is higher than or equal to 0.6, the current ECG segment is transmitted to the baseline correction module.

[0020] The cTn signal acquisition module receives quantitative detection values ​​of cardiac troponin I (cTnI) or cardiac troponin T (cTnT) from a cardiac biomarker detection chip implanted in the patient. After preprocessing the detection values, it aligns them with the current ECG segment in the time dimension to generate the current cTn feature vector. This embodiment uses cTnI as an example for a complete description. Since cTnI and cTnT are recognized as equivalent in the diagnosis of myocardial infarction, and their detection signal types are similar, those skilled in the art can reasonably foresee that replacing cTnI with cTnT can achieve the same function. The specific implementation process is as follows: First, the received raw cTn quantitative detection values ​​are preprocessed, performing the following steps in sequence: ① Outlier removal: Outliers in the detection values ​​are removed using the Raida criterion (3σ criterion), and missing values ​​are filled in using linear interpolation; ② Moving average filtering: The completed detection sequence is smoothed using a moving average filter with a window length of 5 to suppress random noise interference during chip detection; ③ Standardization: Based on the patient's initial baseline cTn detection data, the smoothed detection values ​​are standardized using Z-score to eliminate individual batch differences in the detection chips.

[0021] After preprocessing, a time dimension alignment operation is performed: using the timestamp of the current ECG segment output by the ECG signal acquisition module as a reference, a cTn detection value sequence that completely corresponds to the time window of the ECG segment is matched. The aligned cTn detection value sequence is then mapped through a linear transformation layer to a feature vector that matches the feature dimension of the ECG segment, i.e., the current cTn feature vector, and synchronously transmitted to the baseline correction module and the spatiotemporal feature extraction module. In this embodiment, the output dimension of the linear transformation layer is set to 128, consistent with the embedding dimension of the subsequent Transformer network.

[0022] The baseline correction module is used to construct and iteratively update baseline ECG segments and baseline cTn values ​​based on historical ECG data and historical cTn detection data collected from patients in a stable state. During real-time monitoring, it calculates the feature residual vectors between the current ECG segment and the baseline ECG segment, as well as the cTn residual vector between the current cTn feature vector and the baseline cTn value. By establishing and iteratively updating a two-dimensional individualized baseline for patients, this addresses the technical problem in existing technologies that neglect inter-individual differences and intra-individual physiological dynamic shifts in ECG and cTn signals, leading to high false alarm and false negative rates. It eliminates the influence of individual differences and physiological dynamic shifts on prediction results.

[0023] S101: When the monitoring function is first enabled for a user, it automatically enters the baseline initialization phase. This phase requires the patient to be in a stable physiological state at rest, without emotional excitement or strenuous exercise. High-quality single-lead ECG signals (sampling rate 250Hz, signal quality index ≥0.6) are continuously acquired for 5-10 minutes using a wearable ECG device. The initial ECG data is first filtered, R-wave localized, and heartbeat segmented by the ECG signal acquisition module, extracting three core waveform features within each heartbeat cycle: QRS group feature vector: Extracts features such as time limit, amplitude, slope and morphological similarity of QRS groups; ST segment feature vector: Extract features such as offset, slope, duration, and morphological curvature of the ST segment; T-wave feature vector: Extracts features such as amplitude, polarity, width, and slope of the rising / falling limb of the T-wave; The arithmetic mean of the three types of features of all heartbeats is calculated, and the results are spliced ​​together to obtain a baseline ECG segment (vector form). The corresponding initial baseline ECG segment is then generated and stored in the patient's personal data file.

[0024] For the initial cTn detection data acquired synchronously, after preprocessing and time alignment by the cTn signal acquisition module, the arithmetic mean of all valid detection values ​​is calculated to obtain the initial baseline cTn value, which is stored synchronously with the baseline ECG segment.

[0025] S102: Perform dynamic iterative updates of the baseline ECG segment: Considering that patients' physiological state will undergo slow physiological changes with factors such as diurnal rhythm, emotions, and physical condition, the exponential moving average (EMA) strategy is used to dynamically iterate and update the baseline ECG segment to ensure that the baseline can always reflect the patient's current normal physiological baseline.

[0026] The update trigger conditions are as follows: the baseline update is automatically executed only when all of the following conditions are met: the patient's heart rate fluctuation range does not exceed ±5 beats / minute for 5 consecutive minutes; the quality index of all ECG segments is ≥0.6 for 5 consecutive minutes; and the system does not detect any abnormal features related to myocardial infarction, as well as other preset trigger conditions. The iterative update formula for the baseline ECG segment is: ; In the formula, The waveform feature vector extracted under the current steady state. The original ECG segment feature vector is shown below. This is the updated ECG segment feature vector. The coefficient is a smoothing factor, ranging from 0.05 to 0.2, with a preferred value of 0.1 in this embodiment. This coefficient balances the stability of the baseline with the response speed to slow changes in physiological state: the smaller the coefficient, the more stable the baseline; the larger the coefficient, the more sensitive the baseline is to physiological changes.

[0027] The iterative update of the baseline cTn value uses the same strategy exponential moving average method, and the update formula is as follows: ; In the formula, This represents the average cTn detection value under the current steady-state condition. The baseline value before the update. The updated baseline cTn value uses a smoothing coefficient consistent with the ECG baseline update, preferably set to 0.1. After the update, the system automatically overwrites the original baseline data and records the update time and the patient's physiological state (heart rate, baseline cTn value, etc.) at the time of the update, forming a baseline update log.

[0028] After the update is completed, the system automatically overwrites the original baseline data and records the update time and the patient's physiological state (heart rate, blood pressure, etc.) at the time of the update, forming a baseline update log.

[0029] S103: During the real-time monitoring phase, the characteristic residual vector of the ECG mode and the cTn residual vector of the cTn mode are calculated simultaneously. For ECG modalities, to highlight waveform changes more significant for myocardial infarction diagnosis while suppressing interference from waveforms with large physiological fluctuations, a dynamic weighting strategy based on the inverse ratio of waveform coefficient of variation was used to calculate the weighted feature residual vector. Different waveforms exhibit varying degrees of variability under normal physiological conditions: the QRS complex is significantly affected by autonomic nerve tension, exhibiting the highest degree of physiological variability; the T wave is next; and the ST segment exhibits the lowest degree of physiological variability, while its pathological deviations (such as ST segment elevation / depression) are the most crucial indicators for diagnosing myocardial infarction. Therefore, by assigning higher weights to waveforms with smaller coefficients of variation, the model focuses on subtle abnormalities in the ST segment and T wave, while reducing the impact of physiological fluctuations in the QRS complex on the prediction results. The calculation steps include: Extract the current waveform features. For the input current ECG segment, extract the QRS complex feature vector X using the same feature extraction method as the benchmark. QRS ST segment feature vector X ST and T-wave eigenvector X T ; Calculate the historical coefficient of variation: Calculate the historical coefficient of variation for the three types of waveforms in the baseline ECG segment. The coefficient of variation is the ratio of the standard deviation to the mean of the waveform feature in historical benchmark data, and is calculated using the following formula: ; In the formula, , Let be the standard deviation of the i-th type of waveform feature in the historical benchmark data. The mean of the i-th type of waveform feature in the historical benchmark data The weighting coefficient of each waveform is calculated based on the inverse ratio of the waveform's coefficient of variation. The calculation formula is as follows: ; In the formula, i is the index of a single waveform, and j is the index for traversing three waveforms. The normalized weighting coefficient is the i-th waveform. The weight is inversely proportional to the coefficient of variation. That is, the more stable the waveform and the higher its diagnostic value, the greater the weight. It is used to weight and correct the residual between the current waveform and the individualized benchmark, suppress physiological fluctuation interference, highlight pathological abnormalities, and the sum of the three weighting coefficients is 1. To prevent division by zero of extremely small constants, Let be the historical coefficient of variation for the i-th waveform, which is the ratio of the standard deviation to the mean of all characteristic dimensions of the waveform in the patient's historical normal baseline data, quantifying the inherent variability / stability of the waveform under normal physiological conditions. is the historical variation coefficient of the j-th waveform, used only for iterative summation to calculate the total factor.

[0030] Then, the residuals between the current features and the baseline features of the three types of waveforms are calculated separately, and multiplied by the corresponding weighting coefficients to obtain the weighted corrected residuals. The three weighted corrected residuals are then divided according to R... ST R T R QRS The components are concatenated sequentially to obtain the final feature residual vector.

[0031] For the cTn mode, calculate the cTn residual vector between the current cTn eigenvector and the baseline cTn value. The calculation formula is as follows: ; In the formula, This is the output cTn residual vector. Let C be the current cTn feature vector, C be the current baseline cTn value, and E be the unit vector matching the dimension of the cTn feature vector. The feature residual vector output by the baseline correction module and the cTn residual vector are synchronously transmitted to the spatiotemporal feature extraction module. The baseline correction module avoids misclassifying normal waveform variations as abnormal by constructing individualized baselines for each patient, significantly reducing the false alarm rate. The exponential moving average strategy is used to dynamically update the baseline, adapting to the slow changes in the patient's physiological state and ensuring the timeliness and accuracy of the baseline. A dynamic weighting strategy based on the inverse ratio of waveform variation coefficients allows the model to focus on the ST segment and T wave changes, which are crucial for diagnosing myocardial infarction, while suppressing interference from physiological fluctuations in the QRS complex. This improves the sensitivity to identifying subtle pathological shifts and effectively reduces the false alarm rate.

[0032] The spatiotemporal feature extraction module is used to fuse the current ECG segment with the feature residual vector point by point in the time dimension and input it into a pre-trained improved Transformer network. After the fusion is performed, a multi-head attention mechanism is used to extract a global spatiotemporal dependency feature vector representing the dynamic evolution of myocardial infarction. This module addresses the technical problem that general CNN models have limited local receptive fields or RNN-like models have long-range gradient vanishing, which cannot effectively represent the global spatiotemporal dependency relationship in the progressive evolution of myocardial infarction. The core function is to input the fused feature sequence output by the baseline correction module into the improved Transformer network. By introducing a frequency domain prior-guided self-attention mechanism and heart rate adaptive relative position encoding, the module accurately captures the long-range temporal dependency of the ECG signal. At the same time, a dual-timescale parallel sub-network architecture is adopted to extract the long-range evolution trend and short-range morphological abnormalities of myocardial infarction. Finally, the global spatiotemporal dependency feature vector representing the dynamic evolution of myocardial infarction is generated through gating fusion.

[0033] S201: Receives three inputs: the current ECG segment output by the ECG signal acquisition module, the feature residual vector output by the baseline correction module, and the current cTn feature vector output by the cTn signal acquisition module. First, it performs ECG modal feature fusion, and then it performs cross-modal deep fusion of ECG and cTn.

[0034] First, the current ECG segment and the feature residual vector are fused point-by-point over time to generate an ECG fusion feature sequence. The point-by-point fusion calculation formula is as follows: ; In the formula, The feature vector extracted from the sampled values ​​of the original electrocardiogram segment at time t. Let be the corresponding element of the feature residual vector at time t. To achieve the desired fusion weighting coefficient, a value of 0.6 is preferred in this embodiment, which is used to balance the proportion of the original waveform morphology information and the abnormal offset information.

[0035] By fusing point by point, the features of each time step simultaneously include the patient's original morphological information of the current ECG and the abnormal offset information relative to its normal baseline, providing more discriminative ECG basic features for subsequent cross-modal fusion.

[0036] Subsequently, cross-modal fusion of ECG and cTn is performed. In this embodiment, a cross-attention mechanism is used to achieve deep fusion. Specifically, the current cTn feature vector is linearly transformed and used as the query matrix Q. The above-mentioned ECG fusion feature sequence is linearly transformed and used as the key matrix K and value matrix V, respectively. The ECG attention weights guided by cTn are calculated, and the cTn-enhanced ECG feature sequence is output. The formula for calculating cross-attention is: ; In the formula, In this embodiment, the dimension of each attention head is set to 16. Through the cross-attention mechanism, the model is guided to focus on abnormal regions related to cardiomyocyte damage in the electrocardiogram (ECG) signal by utilizing the myocardial injury-specific information of cTn biochemical markers, suppressing irrelevant noise interference, and achieving deep synergistic fusion of ECG electrical activity information and cTn biochemical damage information.

[0037] After fusion, the cTn-enhanced ECG feature sequence is converted into a feature vector sequence of dimension D (D=128 in this embodiment) through a linear embedding layer and input to the improved Transformer encoder.

[0038] S202: Employs a 3-layer stacked improved Transformer encoder as the basic feature extractor. Each encoder contains a multi-head self-attention layer and a feedforward neural network layer. The multi-head self-attention layer has 8 heads, and the hidden layer dimension of the feedforward neural network layer is 512. The activation function is GELU. To adapt to the physiological characteristics of ECG signals, two improvements were made to the Transformer network: (1) Multi-head self-attention mechanism with learnable frequency domain prior bias: Traditional self-attention mechanisms calculate attention weights based solely on content, failing to utilize prior knowledge of known physiological frequency bands in ECG signals. This leads to the model focusing on clinically insignificant high-frequency noise while neglecting low-frequency and mid-frequency features crucial for myocardial infarction diagnosis. Therefore, this embodiment adds a learnable frequency domain prior bias matrix to the scoring matrix of the multi-head self-attention layer. Prior initialization of electrocardiogram physiological frequency bands: Based on the physiological characteristics of electrocardiogram signals, the effective frequency band of 0.5-40Hz is divided into three sub-bands: Low frequency band (0.5-5Hz): corresponds to ST segment baseline drift, which is the most important indicator for diagnosing myocardial infarction; Mid-frequency band (5-20Hz): corresponds to T-wave repolarization changes, reflecting abnormalities in the repolarization process of myocardial cells; High frequency band (20-40Hz): corresponds to QRS complex, mainly reflects the ventricular depolarization process, and has greater physiological variability; Based on the above clinical significance, the frequency domain prior bias matrix is ​​initialized as follows: the low-frequency and mid-frequency bands are given higher initial weights (0.5 for low-frequency bands and 0.35 for mid-frequency bands), while the high-frequency band is given a lower initial weight (0.15).

[0039] (2) The improved formula for calculating self-attention score is: ; In the formula, These are the query matrix, key matrix, and value matrix, respectively. For each dimension of attention head, This is a learnable frequency domain prior bias matrix, with dimensions consistent with the self-attention score matrix, used during model training. End-to-end fine-tuning can be performed through backpropagation to further optimize the distribution of attention weights, enabling the model to automatically learn the contribution of different frequency band features to myocardial infarction prediction, and ultimately achieve a focus on low-frequency ST segment drift and mid-frequency T wave repolarization changes.

[0040] Traditional Transformers employ fixed sinusoidal positional encoding, assuming uniform time step intervals within the sequence. However, in electrocardiogram (ECG) signals, the RR intervals of patients with arrhythmias fluctuate significantly, resulting in substantial differences in the actual physiological time corresponding to the same time step length. This makes traditional positional encoding inaccurate in representing the relative time distance between heartbeats, thus affecting the capture of long-term temporal dependencies. To address this, a relative positional encoding based on heart rate variability is used. For a sequence position p and a dimension index k, the encoding vector elements are defined as: ; ; In the formula, The scaling factor is calculated using the following formula: , This refers to the RR interval of the heartbeat at the current location. The mean RR period at the patient's resting state. This represents the embedding dimension of the Transformer model.

[0041] The frequency of position encoding is dynamically adjusted by comparing the current RR interval with the baseline RR interval. When the patient's heart rate increases (RR interval shortens), the scaling factor is less than 1, the frequency of position encoding increases, and the positional distance at the same time step decreases. Conversely, when the patient's heart rate decreases (RR interval lengthens), the scaling factor is greater than 1, the frequency of position encoding decreases, and the positional distance at the same time step increases. This allows the model to dynamically adjust the relative distance representation between time steps based on actual changes in heart rhythm, effectively improving its ability to handle abnormal heart rhythms such as atrial fibrillation and premature beats.

[0042] Because the development of myocardial infarction is a progressive pathophysiological process, it manifests both as a long-term evolution trend on a minute-by-minute scale (such as persistent ST segment elevation or depression) and as subtle morphological abnormalities within a single heartbeat cycle (such as T wave inversion and pathological Q waves). A single-timescale network cannot effectively capture both types of features simultaneously. Therefore, this embodiment employs a dual-timescale parallel sub-network architecture, including: The first sub-network uses the improved Transformer encoder described above. The input is a long-range electrocardiogram sequence with a duration of the first duration (corresponding to 75,000 sampling points, which are downsampled to 300 time steps). It is used to capture the progressive evolution trend of myocardial infarction at the minute level and output a long-range feature vector. The second sub-network uses an independent, identical Transformer encoder. It takes a short-range ECG sequence of the second duration (corresponding to 2500 sampling points, which are downsampled to 10 time steps) as input to capture subtle morphological abnormalities in a single heartbeat cycle and outputs a short-range feature vector. Long-range and short-range feature vectors characterize the features of myocardial infarction at different time scales, and their contribution to the prediction of final myocardial infarction risk dynamically changes with the patient's specific condition. For example, when ST segment elevation is present, the contribution of long-range features is higher; when pathological Q waves are present, the contribution of short-range features is higher. Therefore, this embodiment uses a gated fusion unit to adaptively weight and fuse the two feature vectors to obtain a global spatiotemporally dependent feature vector.

[0043] The gated fusion unit can automatically learn the optimal fusion weights of long-range and short-range features based on the input features, thereby achieving complementarity of features at different time scales and comprehensively characterizing the dynamic evolution of myocardial infarction.

[0044] The spatiotemporal feature extraction module introduces a frequency domain prior bias matrix to guide the model to focus on the ST segment and T wave features most significant for myocardial infarction diagnosis, suppressing high-frequency noise interference and improving the effectiveness of feature extraction. Furthermore, it adopts heart rate adaptive relative position coding to solve the problem of long-term signal position representation distortion in patients with arrhythmia, significantly improving the model's prediction accuracy under atrial fibrillation and premature beats and other abnormal heart rhythms.

[0045] The risk prediction module calculates and outputs the probability and confidence level of acute myocardial infarction occurring within a preset time window based on global spatiotemporal dependent feature vectors and a risk assessment classifier composed of fully connected layers. Specifically, a lightweight two-layer fully connected neural network is used to construct the risk assessment classifier, balancing prediction accuracy and inference speed, and adapting to the low-power, real-time operation requirements of wearable devices and edge computing terminals. Specific structural parameters are as follows: Input layer: 128 dimensions, which perfectly matches the dimension of the global spatiotemporal dependent feature vector output by the spatiotemporal feature extraction module; Hidden layer: 64 dimensions, ReLU activation function, with a Dropout layer (dropout probability 0.2). Output layer: Dimension 2, activation function Softmax, outputs the probability distributions of the two categories: "normal physiological state" and "high risk state of acute myocardial infarction".

[0046] Definition of output metrics: Take the probability value corresponding to "high risk of acute myocardial infarction" in the Softmax output. The value range is [0,1]. The higher the value, the greater the possibility of acute myocardial infarction occurring within the preset time window in the future. Confidence Con : Defined as the reliability of the model's risk prediction results, calculated using the following formula: Con=1-Uncer ; In the formula, Uncer The cognitive uncertainty, calculated subsequently using the Monte Carlo dropout method, ranges from [0,1]. A higher confidence level indicates a stronger certainty in the model regarding the prediction outcome.

[0047] Configure the warning time window, preferably set to 30 minutes in the future. This time window conforms to the typical pathological progression cycle of acute myocardial infarction from early myocardial infarction to irreversible myocardial necrosis, allowing sufficient preparation time for patients and medical staff. Depending on different clinical application scenarios (such as home monitoring outside the hospital, or intensive care unit in the hospital), the time window can be flexibly adjusted to different durations such as 10 minutes, 15 minutes, or 60 minutes.

[0048] Traditional deep learning models disable the dropout layer during the inference phase, outputting only a single point estimate. This fails to quantify the cognitive uncertainty caused by factors such as training data distribution shifts, signal quality fluctuations, and individual differences, easily leading to numerous unreliable high-risk warnings. This embodiment maintains the dropout layer during the inference phase, using the Monte Carlo dropout method to calibrate the uncertainty of the prediction results, accurately quantifying the model's cognitive uncertainty. The Monte Carlo dropout method treats the dropout layer as an approximation of a Bayesian neural network. Multiple forward propagations with random neuron dropouts are executed during the inference phase, resulting in multiple independent prediction sample values. By calculating the statistical dispersion of these sample values, the model's cognitive uncertainty can be quantified: the greater the dispersion of the sample values, the more ambiguous the model's understanding of the input, and the less reliable the prediction result.

[0049] During the training phase, a Dropout layer is added between the hidden and output layers of the risk assessment classifier, with a random dropout probability P set. In this embodiment, the dropout probability P is preferably set to 0.2. This value effectively prevents model overfitting and generates sufficient dispersion of prediction results during the inference phase, ensuring the accuracy of uncertainty calculation.

[0050] During the model inference phase, for the same input global spatiotemporal dependent feature vector, the calibrated risk probability and cognitive uncertainty are calculated strictly according to the following steps: Step 1: Keep the Dropout layer on and perform T independent random dropout forward propagations on the same global spatiotemporal dependent feature vector. In each propagation, different neurons in the hidden layer are randomly dropped to ensure the independence of each prediction result. Step 2: Obtain T predicted probabilities of acute myocardial infarction, denoted as: ; Step 3: Calculate the arithmetic mean of the T predicted values ​​as the final calibrated risk probability value. The calculation formula is as follows: ; Step 4: Calculate the unbiased sample variance of the T predicted values ​​as the cognitive uncertainty. The calculation formula is: .

[0051] In this embodiment, the sampling number T is preferably set to 20. This value, while ensuring the accuracy of uncertainty calculation, keeps the computational load of a single inference within the range that the wearable device can handle, thus meeting the system's real-time monitoring requirements.

[0052] To avoid unnecessary panic and waste of medical resources caused by unreliable high-risk warnings for patients and medical staff, this embodiment sets an uncertainty threshold to forcibly filter high-risk warnings. In this embodiment, the uncertainty threshold is preferably set to 0.15.

[0053] when When the prediction result is deemed reliable, the system will output the final risk probability value, confidence level, and corresponding warning level after calibration. when If the prediction result is deemed to have high uncertainty, the system will forcibly suppress the output of all high-risk warning signals, and will not trigger a red emergency warning regardless of whether the original risk probability value reaches the high-risk threshold. At the same time, it will generate a prompt message that "signal quality is insufficient or model confidence is low, it is recommended to remain still and re-monitor" and automatically record the abnormal monitoring data for subsequent online optimization of the model.

[0054] Finally, based on the calibrated final risk probability value and combined with cognitive uncertainty, the risk of acute myocardial infarction is divided into three levels, and corresponding early warning information is output.

[0055] Furthermore, the output of the risk prediction module is also connected to a sub-module for classification prediction. The sub-module for classification prediction consists of two independent fully connected layers, which are used to output the predicted probabilities of ST-segment elevation myocardial infarction (STEMI) and non-ST-segment elevation myocardial infarction (NSTEMI) based on the multimodal global spatiotemporal dependent feature vector, so as to realize accurate classification and auxiliary diagnosis of acute myocardial infarction.

[0056] The specific structural parameters of the submodule for classification prediction are as follows: the input layer has a dimension of 128, which perfectly matches the dimension of the global spatiotemporal dependent feature vector output by the spatiotemporal feature extraction module; the hidden layer has a dimension of 32, the activation function is ReLU, and a Dropout layer with a dropout probability of 0.2 is added; the output layer has a dimension of 2, the activation function is Softmax, and the probability distributions of STEMI and NSTEMI classifications are output respectively.

[0057] The sub-module for subtyping prediction shares the global spatiotemporal dependent feature vector input with the main risk prediction module and runs in parallel with the aforementioned risk assessment classifier. When the high-risk probability value of acute myocardial infarction output by the aforementioned risk prediction module is greater than or equal to a preset threshold (preferably 0.7 in this embodiment), the sub-module for subtyping prediction is automatically triggered to output the probability result of myocardial infarction subtyping, providing auxiliary reference for the formulation of clinical treatment plans.

[0058] This invention utilizes an ECG signal acquisition module to perform ECG signal filtering, segmentation, and quality screening; a baseline correction module to construct and dynamically update individualized benchmark ECG segments, employing a dynamic weighting strategy based on the inverse ratio of waveform variation coefficients to calculate weighted feature residual vectors; a spatiotemporal feature extraction module to fuse the original ECG with the residuals, inputting it into an improved Transformer network with frequency domain prior bias and heart rate adaptive position coding, extracting global spatiotemporal dependency features through dual-timescale parallel sub-networks; and a risk prediction module to calibrate prediction uncertainty based on the Monte Carlo dropout method, outputting the probability and confidence level of myocardial infarction risk within a preset future time window. This invention addresses the problems of existing technologies failing to effectively capture long-term ischemic evolution characteristics, ignoring individual ECG differences, and having unreliable early warnings, thereby reducing false alarm and false negative rates.

[0059] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.

Claims

1. An intelligent monitoring and prevention system for acute myocardial infarction, Its characteristics include: The ECG signal acquisition module is used to filter, locate the R wave, and segment the acquired raw ECG signal to generate a fixed-length current ECG segment. The cTn signal acquisition module is used to receive quantitative detection values ​​of cardiac troponin I or cardiac troponin T. After preprocessing the detection values, the module aligns them with the current ECG segment in the time dimension to generate the current cTn feature vector. The baseline correction module is used to construct and iteratively update the baseline ECG segment and the baseline cTn value based on the historical ECG data and historical cTn detection data collected by the patient in a stable state, and to calculate the feature residual vector between the current ECG segment and the baseline ECG segment, as well as the cTn residual vector between the current cTn feature vector and the baseline cTn value during the real-time monitoring phase. The spatiotemporal feature extraction module is used to perform cross-modal fusion of the current ECG segment, feature residual vector and current cTn feature vector, input to the pre-trained improved Transformer network, and extract multimodal global spatiotemporal dependent feature vectors that characterize the dynamic evolution of myocardial infarction through a multi-head attention mechanism. The risk prediction module is used to calculate and output the risk probability value and confidence level of acute myocardial infarction within a future preset time window based on the global spatiotemporal dependent feature vector and through a risk assessment classifier composed of fully connected layers.

2. The intelligent monitoring and prevention system for acute myocardial infarction according to claim 1, characterized in that: The baseline correction module calculates the weighted feature residual vector based on a dynamic weighting strategy that is inversely proportional to the waveform coefficient of variation, including the following process: Extract the ST segment feature vector, T wave feature vector, and QRS complex feature vector of the current ECG segment; Calculate the historical coefficients of variation for the ST segment, T wave, and QRS complex in the reference ECG segment, respectively. The coefficients of variation are the ratios of the standard deviation to the mean. Calculate the normalized weight coefficients for each waveform, and calculate three weighted corrected residuals based on the weight coefficients. Concatenate these residuals along the feature dimension to obtain the weighted feature residual vector. The formula for calculating the weight coefficients for each waveform is as follows: , ; wherein, is the weight coefficient of the i-th waveform, is a small constant to prevent division by zero, is the coefficient of variation of the i-th feature, is the historical coefficient of variation of the j-th waveform, used only for the total factor calculation of the traversal sum.

3. The intelligent monitoring and prevention system for acute myocardial infarction according to claim 1, characterized in that: The network architecture of the improved Transformer network includes: A learnable frequency domain prior bias matrix is ​​added to the multi-head self-attention layer of the Transformer encoder. The frequency domain prior bias matrix is ​​pre-initialized according to the physiological frequency band energy distribution of the electrocardiogram signal, and is used to guide the self-attention mechanism to focus on the low-frequency drift and mid-frequency repolarization change characteristics that are clinically significant for the diagnosis of myocardial infarction.

4. The intelligent monitoring and prevention system for acute myocardial infarction according to claim 3, characterized in that: The Transformer encoder's position encoding module employs relative position encoding based on heart rate variability adaptive adjustment. The encoding vector P is dynamically scaled by the ratio of the current heartbeat's RR interval to the baseline RR interval. For a sequence position p and a dimension index k, the encoding vector elements are defined as follows: ; ; wherein is a scaling factor, calculated as , is the RR interval of the current position, is the average RR interval of the patient in resting state, is the embedding dimension of the Transformer model.

5. The intelligent monitoring and prevention system for acute myocardial infarction according to claim 4, characterized in that: The spatiotemporal feature extraction module, when extracting the global spatiotemporal dependent feature vector, runs two sub-networks at different time scales in parallel, including: The first subnetwork takes a long-range electrocardiogram sequence of the first duration as input and is used to capture the minute-level progressive evolution trend of myocardial infarction, and outputs a long-range feature vector. The second subnetwork takes a short-range ECG sequence of the second duration as input and is used to capture subtle morphological abnormalities in a single heartbeat cycle, and outputs a short-range feature vector. The spatiotemporal feature extraction module adaptively fuses long-range and short-range feature vectors through a gated fusion unit to obtain the global spatiotemporal dependent feature vector.

6. The intelligent monitoring and prevention system for acute myocardial infarction according to claim 1, characterized in that: Before outputting the risk probability value, the risk prediction module also includes calibrating the uncertainty of the risk probability value, including the following process: During the model inference phase, the Dropout layer is kept on, and T random drop-out forward propagation is performed on the same ECG input sequence, with each random drop-out having a probability of P, resulting in T risk probability prediction values. The arithmetic mean of the T predicted values ​​is used as the final risk probability value after calibration, and the unbiased sample variance of the T predicted values ​​is used as the cognitive uncertainty. When the cognitive uncertainty is higher than a preset uncertainty threshold, the output of a high-risk warning signal is suppressed, and a prompt message is generated.

7. The intelligent monitoring and prevention system for acute myocardial infarction according to claim 1, wherein: The electrocardiogram signal acquisition module is also used for: The quality index is calculated based on the signal-to-noise ratio and motion artifact intensity. When the quality index is lower than the preset quality threshold, the corresponding ECG segment is discarded or marked to avoid low-quality signals interfering with subsequent prediction modules.

8. The intelligent monitoring and prevention system for acute myocardial infarction according to claim 1, wherein: The baseline correction module further includes iteratively updating the baseline ECG segment and the baseline cTn value using an exponential moving average strategy, with the update formula as follows: ; In the formula, The waveform feature vector extracted under the current steady state. The original ECG segment feature vector is shown below. This is the updated ECG segment feature vector. This is the smoothing coefficient.

9. The intelligent monitoring and prevention system for acute myocardial infarction according to claim 1, characterized in that: The cross-modal fusion adopts a cross-attention mechanism, specifically: the cTn feature vector is linearly transformed and used as the query matrix Q; the fusion sequence of the current ECG segment and the feature residual vector is used as the key matrix K and the value matrix V; the ECG attention weights guided by cTn are calculated; the ECG feature sequence enhanced by cTn is output; and then it is input into the improved Transformer network.

10. The intelligent monitoring and prevention system for acute myocardial infarction according to claim 1, characterized in that: The output of the risk prediction module is also connected to a sub-module for classification prediction. The sub-module for classification prediction consists of an independent fully connected layer and is used to output the predicted probabilities of ST-segment elevation myocardial infarction and non-ST-segment elevation myocardial infarction based on the multimodal global spatiotemporal dependent feature vector.