Electrocardiogram intelligent abnormality detection method based on lead topology and space-time attention
Patent Information
- Application Number
- CN202611089633.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-22
- Publication Date
- 2026-10-30
AI Technical Summary
[0004](1)基于手工特征的机器学习方法,如通过小波变换提取RR(相邻R波)间期、QRS(Q波、R波、S波波群)宽度、ST(QRS波群的终点至T波起点)段偏移等形态学参数,再利用支持向量机(SVM)或随机森林进行分类,此类方法依赖专家知识设计特征,特征工程复杂度高且泛化能力有限;
[0022]本申请的上述各个实施例具有如下有益效果:1.导联空间拓扑信息的显式建模。本发明将心脏临床解剖学区域分组知识以静态邻接矩阵骨架形式嵌入图卷积网络,对下壁(II/III/aVF)、前壁(V1-V4)和侧壁(I/aVL/V5/V6)等具有明确壁面对应关系的导联组进行显式的空间信息传播与特征增强,而aVR(augmented Vector Right arm,加压单极肢体导联(右臂))作为方向相对独立的增强导联单独保留。该设计以临床先验为拓扑骨架,结合近恒等初始化与小残差门控,使GCN(Graph Convolutional Network,中文译为图卷积网络)分支在训练早期近似于安全增强路径,降低了对基线特征的破坏风险。2.层次化时空注意力协同精炼。串联式“导联-特征联合注意力→时态注意力”瓶颈层实现了“先辨空间、再辨时间”的层次化特征精炼。导联-特征联合注意力通过沿时间维度的统计汇聚生成导联级特征权重,时态注意力则融合GMP(Global Max Pooling,全局最大池化)与GAP(GlobalAverage Pooling,全局平均池化)的峰值-均值联合摘要经瓶颈映射生成时态门控,提高模型对高电压峰值、局灶性异常、关键ST-T时段及节律变化模式的联合建模能力。门控重映射技术使注意力不仅能削弱无关特征,还能增强关键特征,相较于传统仅能抑制的注意力形式具有更强表达能力。3.心脏肥大类别的针对性增强。心脏肥大形态学适配器通过显式编码肥大相关导联先验、导联级高电压/深S波统计、跨区域电压差及经典肥大判据强度,在不替换主体网络结构的前提下,对HYP(Hypertrophy,肥厚)类别进行定向增强。该模块可在导联汇聚、全局特征融合、HYP专属Logit(逻辑值)校正及HYP专属决策层辅助监督四个层面提供辅助信息,有望提高肥大类别的精确率、召回率和F1表现。4.多层级可学习残差融合。全系统在GCN注入点、注意力注入点、预Bi-LSTM(Bidirectional Long Short-Term Memory,双向长短期记忆网络)保底融合点、跨导联对比特征注入点、HYP特征注入点、全局特征融合点及决策层均部署可学习残差融合门控。所有门控均以较小初值启动,保证模型训练初期以稳定的CNN-Bi-LSTM基线为主,各增强模块在训练过程中逐步学习更优注入强度,从而实现“增强模块可带来增益,但不会在训练早期显著破坏基线性能”的安全设计目标。5.多标签场景下的决策稳定性增强。本发明不仅在训练阶段引入多标签损失、辅助监督和类别不平衡缓解策略,还在决策阶段采用验证集全局阈值搜索、关键类别保护约束、局部准确率优先细搜和测试时增强(TTA)等策略,使模型能够在多标签场景下更稳健地平衡整体MacroF1、关键少数类性能和部署稳定性。6.工程部署可行性较强。模型整体参数规模适中,输入输出流程清晰,预处理流水线以标准数字信号处理算法为主;GCN中使用的邻接矩阵规模小,attention(注意力)模块和形态学适配器均为轻量级增量结构。系统支持独立模型检查点保存、结果清单记录、测试图表导出和可视化分析,具备进一步导出为ONNX(Open NeuralNetwork Exchange,开放神经网络交换)格式并用于云端、边缘或临床工作站部署的工程可行性。
Smart Images

Figure CN122997704A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this application relate to the interdisciplinary fields of biomedical engineering, artificial intelligence in medicine, and graph neural networks, specifically to an intelligent electrocardiogram anomaly detection method based on lead topology and spatiotemporal attention. Background Technology
[0002] Cardiovascular disease is one of the leading causes of death worldwide. Electrocardiography (ECG), as a non-invasive and low-cost method for detecting cardiac electrical activity, plays an irreplaceable role in clinical screening, diagnosis, and health monitoring. A standard 12-lead ECG signal, obtained by placing electrodes at different locations on the body surface, simultaneously acquires information about the heart's electrical activity from multiple spatial perspectives. The spatial relationships between different leads (such as belonging to the inferior, anterior, or lateral anatomical regions) contain a wealth of prior clinical diagnostic knowledge. However, traditional ECG diagnosis heavily relies on visual interpretation and manual measurement by cardiologists, resulting in a heavy workload, low efficiency, and limited diagnostic consistency among physicians of different experience levels.
[0003] In recent years, deep learning-based automatic electrocardiogram (ECG) diagnostic technology has made significant progress. Existing technical solutions mainly include the following categories:
[0004] (1) Machine learning methods based on handcrafted features, such as extracting morphological parameters such as the interval between adjacent R waves, the width of QRS (Q wave, R wave, S wave group), and the shift of ST (from the end of QRS group to the beginning of T wave) segment through wavelet transform, and then using support vector machine (SVM) or random forest for classification. Such methods rely on expert knowledge to design features, and the feature engineering complexity is high and the generalization ability is limited.
[0005] (2) The method based on convolutional neural network (CNN) treats the ECG signal as a one-dimensional or multi-channel two-dimensional image and can automatically learn local morphological features. However, standard CNN usually mixes all leads, ignores the anatomical spatial topological relationship between leads, and lacks the ability to adaptively discriminate the importance of different time segments.
[0006] (3) The method based on recurrent neural network (RNN / LSTM) models the ECG signal as a time series to capture the rhythm evolution pattern, but its ability to express fine-grained spatial morphological features (such as high voltage in specific leads, deep S wave, local ST-T changes) is limited.
[0007] (4) Attention-based methods improve the ability to extract key information by assigning different feature dimensions or time steps with differentiated weights. However, existing attention designs are mostly single-dimensional (only spatial or only temporal) and fail to fully utilize the complementary information of the lead's spatial and temporal dimensions.
[0008] (5) Complex deep learning methods based on multi-module combinations, although they attempt to utilize local morphology, interlead relationships and temporal context at the same time, often adopt a fusion method of simple splicing, direct addition or fixed weight addition, lacking progressive adaptive control of the injection intensity of the enhancement branch, which can easily lead to the problem that the enhancement module destroys the baseline discrimination ability.
[0009] The aforementioned existing technologies have the following key shortcomings:
[0010] First, the spatial topological relationships between leads are not fully utilized. Most existing methods treat all 12 leads as independent or unordered multi-channel inputs, ignoring the inherent functional connections and complementary information relationships between lead groups with clear wall correspondences in cardiac anatomy, such as the inferior wall (II, III, aVF), anterior wall (V1-V4), and lateral wall (I, aVL, V5, V6). This results in the model lacking the ability to use cross-lead spatial context for reasoning.
[0011] Second, the spatiotemporal attention coordination mechanism is still imperfect. Channel attention usually focuses on "which leads or channels are more important", while temporal attention usually focuses on "which moment is more critical". Without hierarchical and serial design and appropriate enhancement capabilities, it is difficult to simultaneously take into account the synergistic effect between key leads, key time periods and local peak patterns.
[0012] Third, the ability to identify certain categories, especially hypertrophic hysterosalpingography (HYP), remains insufficient. The diagnosis of HYP is highly dependent on the voltage amplitude of specific lead combinations, the relationship between deep S waves and high R waves, cross-regional voltage differences, and strain-like features. Relying solely on end-to-end implicit learning can easily lead to low recall and precision for this type of sample.
[0013] Fourth, the multi-module fusion strategy is crude. If the enhancement branch lacks learnable residual gating, the output of complex modules (such as GCN, attention, and morphological auxiliary modules) can easily cover or even destroy the basic CNN features, leading to fluctuations in overall performance, especially when there is an imbalance in the distribution between classes.
[0014] Fifth, there is insufficient optimization in the training and decision layers. The traditional uniform threshold of 0.5 often fails to balance the overall Macro F1 score and the performance of key minority classes. Especially in multi-label diagnostic tasks, if the threshold is not globally coordinated and optimized, it is easy to see a situation where the performance of a certain minority class is improved, but the overall accuracy or the performance of other key classes is significantly reduced.
[0015] The information disclosed in this background section is only intended to enhance the understanding of the background of the inventive concept, and therefore may contain information that does not form prior art known to those skilled in the art. Summary of the Invention
[0016] The summary section of this application is intended to provide a brief overview of the concepts, which will be described in detail in the detailed description section below. This summary section is not intended to identify key or essential features of the claimed technical solutions, nor is it intended to limit the scope of the claimed technical solutions.
[0017] Some embodiments of this application propose an intelligent electrocardiogram anomaly detection method, apparatus, computer device, and computer-readable storage medium based on lead topology and spatiotemporal attention to solve one or more of the technical problems mentioned in the background section above.
[0018] In a first aspect, some embodiments of this application provide an intelligent electrocardiogram (ECG) anomaly detection method based on lead topology and spatiotemporal attention. The method includes: preprocessing each pre-acquired initial ECG signal to generate a preprocessed ECG signal set; performing feature extraction processing on the preprocessed ECG signal set based on an independent lead feature extraction sub-model included in a pre-determined ECG anomaly detection model to obtain ECG lead batch feature information. The ECG anomaly detection model further includes: a spatial topology graph feature enhancement sub-model, a spatiotemporal attention bottleneck layer, a time-series analysis sub-model, and a classifier; and utilizing the spatial topology graph features included in the ECG anomaly detection model... An enhancement sub-model enhances the batch feature information of the aforementioned ECG leads to obtain enhanced ECG batch feature information. Based on the spatiotemporal attention bottleneck layer included in the aforementioned ECG anomaly detection model, attention extraction is performed on the batch feature information of the aforementioned ECG leads to obtain ECG attention batch feature information. Based on the temporal analysis sub-model included in the aforementioned ECG anomaly detection model, temporal encoding is performed on the batch feature information of the aforementioned ECG leads and the aforementioned ECG attention batch feature information to obtain ECG encoded batch feature information. Based on the classifier included in the aforementioned ECG anomaly detection model, the aforementioned ECG encoded batch feature information is classified to obtain an ECG anomaly type information set.
[0019] Secondly, some embodiments of this disclosure provide an intelligent electrocardiogram (ECG) anomaly detection device based on lead topology and spatiotemporal attention. The device includes: a preprocessing unit configured to preprocess each pre-acquired initial ECG signal to generate a preprocessed ECG signal set; a feature extraction unit configured to perform feature extraction processing on the preprocessed ECG signal set based on an independent lead feature extraction sub-model included in a pre-determined ECG anomaly detection model to obtain ECG lead batch feature information. The ECG anomaly detection model further includes: a spatial topology graph feature enhancement sub-model, a spatiotemporal attention bottleneck layer, a time-series analysis sub-model, and a classifier; and an enhancement unit configured to enhance the ECG signal set based on the spatial topology graph feature enhancement sub-model included in the ECG anomaly detection model. The hadron model enhances the batch feature information of the aforementioned ECG leads to obtain enhanced batch feature information of the ECG. The attention extraction unit is configured to perform attention extraction on the batch feature information of the aforementioned ECG leads based on the spatiotemporal attention bottleneck layer included in the aforementioned ECG anomaly detection model to obtain attention batch feature information of the ECG. The temporal coding unit is configured to perform temporal coding on the batch feature information of the aforementioned ECG leads and the aforementioned attention batch feature information of the aforementioned ECG based on the temporal analysis sub-model included in the aforementioned ECG anomaly detection model to obtain encoded batch feature information of the ECG. The classification unit is configured to classify the encoded batch feature information of the aforementioned ECG based on the classifier included in the aforementioned ECG anomaly detection model to obtain a set of ECG anomaly type information.
[0020] Thirdly, some embodiments of this disclosure provide an electronic device, including: one or more processors; and a storage device having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation of the first aspect above.
[0021] Fourthly, some embodiments of this disclosure provide a computer-readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method described in any of the implementations of the first aspect above.
[0022] The above embodiments of this application have the following beneficial effects: 1. Explicit modeling of lead spatial topology information. This invention embeds knowledge of cardiac clinical anatomy region grouping into a graph convolutional network in the form of a static adjacency matrix skeleton, and performs explicit spatial information propagation and feature enhancement for lead groups with clear wall-to-wall correspondences, such as the inferior wall (II / III / aVF), anterior wall (V1-V4), and lateral wall (I / aVL / V5 / V6), while aVR (augmented vector right arm, compression unipolar limb lead (right arm)) is retained separately as an enhancement lead with relatively independent direction. This design uses clinical priors as the topological skeleton, combined with near-identical initialization and small residual gating, so that the GCN (Graph Convolutional Network) branch approximates a safe enhancement path in the early stage of training, reducing the risk of destroying baseline features. 2. Hierarchical spatiotemporal attention collaborative refinement. The serial "lead-feature joint attention → temporal attention" bottleneck layer realizes hierarchical feature refinement of "first distinguishing space, then distinguishing time". Lead-feature joint attention generates lead-level feature weights through statistical convergence along the time dimension, while temporal attention integrates peak-mean joint summaries from GMP (Global Max Pooling) and GAP (Global Average Pooling) to generate temporal gating via bottleneck mapping, improving the model's ability to jointly model high-voltage peaks, focal abnormalities, key ST-T periods, and rhythm variation patterns. The gating remapping technique enables attention not only to weaken irrelevant features but also to enhance key features, exhibiting stronger expressive power compared to traditional attention methods that only suppress features. 3. Targeted enhancement of cardiac hypertrophy categories. The cardiac hypertrophy morphology adapter, through explicit encoding of hypertrophy-related lead priors, lead-level high-voltage / deep S-wave statistics, cross-regional voltage differences, and the strength of classic hypertrophy criteria, provides targeted enhancement to the HYP (Hypertrophy) category without replacing the main network structure. This module provides auxiliary information at four levels: lead convergence, global feature fusion, HYP-specific Logit correction, and HYP-specific decision layer auxiliary supervision, which is expected to improve the precision, recall, and F1 performance of the hypertrophy category. 4. Multi-level learnable residual fusion. The entire system deploys learnable residual fusion gating at GCN injection points, attention injection points, pre-Bi-LSTM (Bidirectional Long Short-Term Memory) baseline fusion points, cross-lead contrast feature injection points, HYP feature injection points, global feature fusion points, and the decision layer.All gating is started with small initial values to ensure that the model training initially focuses on a stable CNN-Bi-LSTM baseline. Each enhancement module gradually learns a better injection strength during training, thus achieving the safe design goal that "enhancement modules can bring gains, but will not significantly degrade baseline performance in the early stages of training." 5. Enhanced decision stability in multi-label scenarios. This invention not only introduces multi-label loss, auxiliary supervision, and class imbalance mitigation strategies during the training phase, but also employs strategies such as global threshold search on the validation set, key class protection constraints, local accuracy-first fine search, and test-time enhancement (TTA) during the decision phase. This enables the model to more robustly balance overall MacroF1, key minority class performance, and deployment stability in multi-label scenarios. 6. Strong engineering deployment feasibility. The overall model parameter size is moderate, the input-output flow is clear, and the preprocessing pipeline mainly uses standard digital signal processing algorithms. The adjacency matrix used in GCN is small, and the attention module and morphological adapter are both lightweight incremental structures. The system supports saving independent model checkpoints, recording result lists, exporting test charts, and visual analysis. It also has engineering feasibility for further export to ONNX (Open Neural Network Exchange) format and deployment in the cloud, edge, or clinical workstations. Attached Figure Description
[0023] The above and other features, advantages, and aspects of the embodiments of this application will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and elements are not necessarily drawn to scale.
[0024] Figure 1 This is a flowchart of some embodiments of the intelligent electrocardiogram anomaly detection method based on lead topology and spatiotemporal attention according to this application;
[0025] Figure 2 This is a schematic diagram of the structure of some embodiments of the intelligent electrocardiogram anomaly detection device based on lead topology and spatiotemporal attention according to the present disclosure;
[0026] Figure 3 This is a schematic diagram of the structure of a computer device suitable for implementing some embodiments of this application. Detailed Implementation
[0027] Embodiments of this application will now be described in more detail with reference to the accompanying drawings. While some embodiments of this application are shown in the drawings, it should be understood that this application can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this application. It should be understood that the drawings and embodiments of this application are for illustrative purposes only and are not intended to limit the scope of protection of this application.
[0028] It should also be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings. Unless otherwise specified, the embodiments and features described herein can be combined with each other.
[0029] It should be noted that the concepts of "first" and "second" mentioned in this application are only used to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0030] It should be noted that the terms "a" and "a plurality of" used in this application are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0031] The names of the messages or information exchanged between multiple devices in the embodiments of this application are for illustrative purposes only and are not intended to limit the scope of these messages or information.
[0032] The present application will now be described in detail with reference to the accompanying drawings and embodiments.
[0033] Figure 1 A flowchart 100 of some embodiments of the intelligent ECG anomaly detection method based on lead topology and spatiotemporal attention according to this application is shown. This intelligent ECG anomaly detection method based on lead topology and spatiotemporal attention includes the following steps:
[0034] Step 101: Preprocess each pre-acquired initial electrocardiogram signal to generate a preprocessed electrocardiogram signal, thus obtaining a set of preprocessed electrocardiogram signals.
[0035] In some embodiments, the execution entity of the ECG intelligent anomaly detection method based on lead topology and spatiotemporal attention can preprocess each pre-acquired initial ECG signal to generate a preprocessed ECG signal set. The initial ECG signals can be acquired from an ECG acquisition device via wired or wireless connection. A preset batch number of initial ECG signals can be acquired from the ECG acquisition device. These initial ECG signals can be 12-lead ECG signals.
[0036] As an example, the aforementioned electrocardiogram (ECG) acquisition device can be an ECG machine. The aforementioned preset batch quantity can be, but is not limited to, 16, 24, or 32.
[0037] It should be noted that the aforementioned wireless connection methods may include, but are not limited to, 3G / 4G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other currently known or future wireless connection methods.
[0038] In some optional implementations of certain embodiments, the execution entity preprocesses each pre-acquired initial electrocardiogram signal to generate a preprocessed electrocardiogram signal, which may include the following steps:
[0039] The first step is to filter the initial electrocardiogram (ECG) signal to obtain a filtered ECG signal. This can be achieved using a preset filtering algorithm. This process removes baseline drift below 0.5 Hz.
[0040] As an example, the preset filtering algorithm mentioned above can be the Db4 (Daubechies 4, a filter with a length of 4 in the Daubechies wavelet family) wavelet transform algorithm or the Butterworth high-pass filtering algorithm.
[0041] The second step is to suppress the above-mentioned ECG filtered signal to obtain the ECG suppressed signal. This suppression can be achieved using a preset suppression filter.
[0042] As an example, the preset suppression filter mentioned above can be a 50Hz notch filter.
[0043] The third step is to standardize the aforementioned ECG suppression signal to obtain a preprocessed ECG signal. This can be achieved using a preset standardization algorithm.
[0044] As an example, the above-mentioned preset standardization algorithm can be the Z-score standardization algorithm.
[0045] Therefore, the obtained preprocessed ECG signal can be used as the standardized input of the CNN-GCN-lead feature joint attention-Bi-LSTM backbone.
[0046] Optionally, the amplitude reference signal, which has only been filtered but not standardized, can be retained for the cardiac hypertrophy morphology adapter to extract the relationship between absolute voltage and translead amplitude.
[0047] Step 102: Based on the pre-determined ECG abnormality detection model, which includes the independent lead feature extraction sub-model, feature extraction processing is performed on the preprocessed ECG signal set to obtain batch feature information of ECG leads.
[0048] In some embodiments, the aforementioned execution entity can perform feature extraction processing on the preprocessed electrocardiogram signal set based on the independent lead feature extraction sub-model included in the pre-determined electrocardiogram anomaly detection model, to obtain batch feature information of electrocardiogram leads. The aforementioned electrocardiogram anomaly detection model further includes: a spatial topology graph feature enhancement sub-model, a spatiotemporal attention bottleneck layer, a temporal analysis sub-model, and a classifier.
[0049] The ECG abnormality detection model can be pre-trained, taking a pre-processed ECG signal set as input and an ECG abnormality type information set as output; it is a neural network model.
[0050] Specifically, the independent lead feature extraction sub-model can consist of three cascaded one-dimensional grouped convolutional layers and three max pooling layers. The groups parameter of all convolutional layers is set to 12 (equal to the number of leads) to ensure that the feature extraction channels of each lead are completely independent and do not interfere with each other, thereby preserving the spatial information integrity of the lead dimension.
[0051] As an example, the specific structure of the independent lead feature extraction sub-model can be shown below:
[0052] First layer: Conv1d (one-dimensional convolution) (in_channels = 12, out_channels = 24, kernel_size = 7, groups = 12, padding = 3) → BatchNorm1d (one-dimensional batch normalization) → ReLU (Rectified Linear Unit) → MaxPool1d (one-dimensional max pooling) (kernel_size = 5, stride = 5). Output dimension: (B, 24, 1000). Here, B represents the batch size, which is equal to the preset batch number mentioned above.
[0053] Second layer: Conv1d(in_channels=24, out_channels=192, kernel_size=5, groups=12, padding=2) → BatchNorm1d → ReLU → MaxPool1d(kernel_size=2, stride=2). Output dimension: (B, 192, 500).
[0054] Third layer: Conv1d(in_channels=192, out_channels=1536, kernel_size=3, groups=12, padding=1) → BatchNorm1d → ReLU → MaxPool1d(kernel_size=2, stride=2). Output dimension: (B, 1536, 250).
[0055] Therefore, after three layers of group convolution and successive pooling, the feature tensor is reshaped from (B, 1536, 250) to (B, 12, 128, 250), and then transposed to (B, 12, 250, 128), resulting in a four-dimensional structured tensor that simultaneously preserves the lead axis, time axis, and feature axis, where V=12 is the number of leads, T=250 is the time step, and D=128 is the feature dimension. This four-dimensional structured tensor provides a structured feature basis for the graph convolution space enhancement in subsequent steps.
[0056] In practice, the spatial topology graph feature enhancement sub-model can include: spatial graph convolutional layer and residual fusion gating unit. The above spatial topology graph feature enhancement sub-model can first construct a static lead topology adjacency matrix A∈R^(12×12) based on the cardiac clinical anatomy partition. Wherein, R can represent the set of real numbers. According to the electrode placement position on the body surface of the standard 12-lead electrocardiogram and its corresponding cardiac anatomy region, the 11 leads with clear wall anatomical correspondence can be divided into three groups, while aVR, as a relatively independent enhancement lead, is retained separately and not included in the above three wall groupings. Specifically, as follows: (1) Inferior Wall: II, III, aVF (augmented voltage foot, left leg lead); (2) Lateral Wall: I, aVL (augmented voltage left arm, left arm lead), V5, V6; (3) Anterior Wall: V1, V2, V3, V4. The weighting modeling rule for adjacency matrix A is as follows: the weight between leads belonging to the same anatomical group is set to 1.0, and the weight between leads from different groups is set to 0.0, in order to avoid the problem of excessive smoothing of cross-group information leading to excessive smoothing of space.
[0057] Therefore, based on the aforementioned static topological framework, fixed adjacency relationships can be constructed along the lead dimension according to predefined clinical anatomical priors. This enables the graph convolution module to perform inter-lead message propagation and feature enhancement within locally reliable spatial ranges such as the inferior, anterior, and lateral walls. This design emphasizes using stable clinical priors as spatial topological constraints, thereby reducing the degrees of freedom of the graph structure and mitigating the risk of spurious correlations caused by overly flexible graph structures in small medical sample and noisy scenarios.
[0058] Secondly, the static lead topological adjacency matrix A is symmetrically normalized to obtain the normalized adjacency matrix: A_norm = D^(-1 / 2)·A^·D^(-1 / 2). A_norm can represent the normalized adjacency matrix. A^ = A + I_12 (self-connection is added to ensure the transitivity of node features), and D^ is the degree matrix of A^. I_12 can represent a 12-order identity matrix. Since this application uses the 12 leads of a standard 12-lead ECG (Electrocardiogram) as graph nodes, the order of the identity matrix is 12. Specifically, adding I_12 to the adjacency matrix introduces self-connection to each lead node in the graph structure, thereby ensuring that each node can receive information from adjacent leads while retaining its original features during the propagation of graph convolutional information.
[0059] Then, the spatial graph convolutional layer included in the spatial topology graph feature enhancement sub-model performs spatial graph convolution on the ECG lead batch feature information along the lead dimension based on the normalized adjacency matrix. Inter-lead message propagation is performed independently at each time step, and feature transformation is completed through the learnable graph weight matrix W_g∈R^(128×128). W_g is initialized with a near-identity mapping, meaning it is as close to the identity mapping as possible in the early stages of training to reduce the risk of GCN branches damaging baseline features.
[0060] Finally, the output of the spatial graph convolutional layer, after ReLU activation and LayerNorm normalization, is fused with the batch feature information of the ECG leads through a learnable residual blend gate: F_spatial = (1-α)·F + α·F_gcn. Here, F_spatial represents the fused ECG enhanced batch feature information. F represents the ECG lead batch feature information. F_gcn represents the ECG convolutional feature information. α represents the fusion weight value. Specifically, α is obtained by learning the Logit and normalizing it with a small initial injection strength (approximately 0.15) to ensure that the GCN enhanced features are injected gradually, avoiding excessive spatial smoothing that could lead to the loss of basic discriminative information. The input and output dimensions are both (B, 12, 250, 128).
[0061] Therefore, this invention employs a static lead topology strategy based on prior knowledge of clinical anatomical partitions, rather than a completely data-driven dynamic graph structure. This is because the standard 12-lead ECG itself has a clear and stable clinical anatomical partitioning basis, with long-standing clinically validated functional associations between the inferior, anterior, and lateral leads. Embedding this type of expert prior knowledge into an explicit adjacency structure model as the topological framework effectively reduces the graph structure's degrees of freedom, mitigating the risk of spurious correlations due to structural overfitting in medical signal scenarios with limited sample size and high noise. Furthermore, this invention does not restrict the existence of cross-regional information through the adjacency matrix. Instead, high-order joint discrimination across regions is primarily accomplished through mechanisms such as global feature extraction from the backbone CNN, temporal modeling using Bi-LSTM, global weighting of spatiotemporal attention, and cross-regional contrastive feature modeling in the morphological adapter. In other words, the adjacency matrix mainly serves as a "locally reliable prior constraint," while cross-regional comprehensive reasoning is collaboratively completed by subsequent modules.
[0062] In practice, the spatiotemporal attention bottleneck layer can include: a lead feature joint attention module, a temporal attention module, and a residual fusion unit. Specifically, the lead feature joint attention module in the spatiotemporal attention bottleneck layer can, firstly, statistically aggregate the 128-dimensional features corresponding to each lead in the ECG lead batch feature information along the time dimension to form an R^(B×12×128) lead-feature descriptor. Secondly, it performs a nonlinear transformation on this descriptor through a bottleneck mapping structure to generate an R^(B×12×128) lead-feature joint weight matrix. This lead-feature joint weight matrix can be used to characterize the importance of different morphological feature subspaces to the current diagnostic task in different leads. Therefore, this module can be understood as "lead-feature joint attention" or "feature channel attention under lead constraints," and its target includes both lead spatial information and feature expression information within the leads. In practice, to avoid the problem that traditional Sigmoid gating can only weaken features, a gating remapping technique can be used to remap the Sigmoid output from [0, 1] to a gating interval centered at 1.0. Finally, the remapped lead-feature joint weight matrix is broadcast along the time dimension and multiplied element-wise with the lead-feature descriptor to obtain the ECG spatial activation feature map.
[0063] As an example, the Sigmoid output can be remapped from [0, 1] to a gated interval centered at 1.0 using the following formula: g = 1.0 + strength × (Sigmoid(x) - 0.5). Here, g represents the gating value. Strength represents the intensity coefficient. Strength can be set to 0.8 (corresponding to a gating range of approximately [0.6, 1.4]). Strength can be selected within the range of 0.4 to 1.2. This design allows attention to both suppress irrelevant leads and moderately enhance the characteristics of key leads.
[0064] The temporal attention module included in the spatiotemporal attention bottleneck layer can, firstly, simultaneously perform global max pooling (GMP) and global average pooling (GAP) along the lead dimension on the ECG spatial activation feature map to obtain max pooling feature maps and average pooling feature maps. Then, the mean of the max pooling feature map and the average pooling feature map is used as the base time summary feature. Thus, GMP captures focal abnormal spikes, while GAP preserves the overall rhythm trend; the two complement each other to take into account both local transient and global temporal information. Secondly, before inputting the bottleneck structure, depthwise separable convolutions (kernel sizes 5 and 17) can be further used to extract short-range local morphological context features and mid-range related context features from the ECG spatial activation feature map. Then, the aforementioned max pooling feature map, average pooling feature map, short-range local morphological context features, and mid-range related context features are adaptively fused to obtain fused summary features. Next, clinically guided time summary features weighted a priori by hypertrophic leads are introduced, and the fused summary features and clinically guided time summary features are concatenated to form the fused time summary features. Subsequently, the clinically-oriented time summary features and the basic time summary features are concatenated to form a conditional time descriptor. Then, the fused conditional time descriptor is transposed and input into a bottleneck structure consisting of a Linear (fully connected linear layer, which maps a feature vector containing 250 values to a new feature vector containing 25 values through linear transformation), ReLU, another Linear (fully connected linear layer, which maps a feature vector containing 25 values to a new feature vector containing 250 values through linear transformation), and a Sigmoid activation with a temperature coefficient τ (e.g., τ=2.0, τ can be selected in the range of 1.0 to 4.0), generating temporal attention weights W_t∈R^(B×250×128). The temperature coefficient can be used to smooth the gated output and reduce sensitivity to single-time-point spike noise. Subsequently, a gated remapping technique is used to remap the Sigmoid output from [0,1] to a gated interval centered at 1.0. Finally, the remapped conditional time descriptor is broadcast along the lead dimension and multiplied element-wise with the ECG spatial activation feature map to obtain the refined ECG feature map.
[0065] The residual fusion unit in the spatiotemporal attention bottleneck layer performs the following steps: First, it normalizes the refined ECG feature map using LayerNorm. Second, it fuses the normalized refined ECG feature map with the enhanced batch ECG feature information using a learnable residual fusion gating unit to obtain the first fused feature. Then, it performs a baseline fusion process with the first fused feature and the batch ECG lead feature information using an additional pre-Bi-LSTM (Bidirectional Long Short-Term Memory) fusion gating to obtain the second fused feature. This ensures that the subsequent Bi-LSTM always receives the most basic CNN baseline features, preventing information loss due to over-refinement of the attention layer. Finally, it applies Dropout (random deactivation layer with a deactivation probability of p=0.5) to regularize the second fused feature, obtaining the ECG attention batch feature information. The input and output dimensions are both (B, 12, 250, 128).
[0066] In practice, the time series analysis sub-model can include: a baseline time series analysis module, an enhanced time series analysis module, and a fusion module. The baseline time series analysis module includes a baseline Bi-LSTM module. The enhanced time series analysis module includes a lead convergence head and an enhanced Bi-LSTM module. The baseline time series analysis module receives ECG lead batch feature information and performs simple equal-weighted lead convergence before inputting it into the baseline Bi-LSTM module. The enhanced time series analysis module receives ECG attention batch feature information and performs weighted convergence using a learnable lead convergence head before inputting it into the enhanced Bi-LSTM module. The baseline Bi-LSTM module and the enhanced Bi-LSTM module have the same structure but independent parameters and do not share weights to avoid gradient conflicts between the ECG lead batch feature information and the refined ECG feature map within the same set of time series weights.
[0067] Specifically, the enhanced time-series analysis module within the time-series analysis sub-model includes a lead pooling head that performs weighted pooling of features from 12 leads, rather than a simple equal-weighted average. The lead pooling head extracts the mean and maximum features along the time dimension for each lead and uses their average as the lead summary descriptor to simultaneously preserve both overall trend and focal peaks. This summary is then activated using Linear (128→32), Tanh (Hyperbolic Tangent) activation, and Linear (32→1) to generate importance scores for each lead. Specifically, the lead pooling head first calculates the scalar importance score for each lead based on the input features. Second, it averages the lead-feature joint weight matrix along the feature dimension D=128 to obtain the lead-level prior score matrix, while simultaneously incorporating the lead bias matrix output from the hypertrophic morphology adapter. Finally, it performs mean-reduction processing on the lead-level prior score matrix and the lead bias matrix respectively to obtain the target prior score matrix and the target bias matrix. Next, based on the learnable fusion coefficients, the lead-level prior score matrix, the target prior score matrix, and the target bias matrix are weighted and summed to obtain the target score matrix. Finally, the target score matrix is normalized to obtain the lead weight matrix. Thus, gradient blocking (stopping gradient backpropagation) of the lead-feature joint weight matrix avoids the same set of attention weights simultaneously undertaking both feature refinement and lead convergence optimization objectives. Based on the above lead weight matrix, the ECG attention batch feature information is weighted and averaged to obtain enhanced convergent feature information.
[0068] The enhanced temporal analysis module included in the temporal analysis sub-model can first determine the deviation matrix between the ECG attention batch feature information and the enhanced convergence feature information. Second, it performs weighted aggregation on the deviation matrix to obtain the aggregated deviation matrix. Then, it transforms the aggregated deviation matrix using learnable linear transformation and LayerNorm to obtain the transformed deviation matrix. Next, through a residual fusion gating unit, the transformed deviation matrix and the enhanced convergence feature information are fused into lead fusion feature information. Therefore, this mechanism can preserve the key translead relative relationships required for hypertrophic disease diagnosis, such as the contrast between deep S waves in leads V1 / V2 and high R waves in leads V5 / V6, avoiding the smoothing out of this key information in simple mean convergence.
[0069] The enhanced temporal analysis module, including the enhanced Bi-LSTM module, of the temporal analysis sub-model can first input the converged lead fusion feature information into a two-layer bidirectional LSTM network (128 unidirectional hidden units, with a Dropout ratio selectable in the range of 0.2 to 0.5, set to 0.3 in a preferred embodiment, and the batch dimension placed as the first dimension), outputting a complete temporal hidden state sequence. The final hidden state of the last layer of the forward LSTM and the final hidden state of the last layer of the backward LSTM are then concatenated to obtain the global enhanced temporal feature vector.
[0070] The fusion module included in the time series analysis sub-model can: normalize the 256-dimensional global feature vectors output by the baseline time series analysis module and the enhanced time series analysis module respectively through their respective LayerNorms, and then perform fusion processing through a learnable global feature fusion gate to obtain the ECG encoded batch feature information.
[0071] In practice, the classifier may include a main classifier, a hypertrophic cardiomyopathy (HYP) morphological adapter, and a decision-level fusion gating unit. Specifically, the main classifier can regularize the fused ECG encoded batch features using Dropout (p=0.5) and then feed them into a fully connected classification layer (Linear (256→5)). It outputs five classes of unnormalized logits, corresponding to five diagnostic categories: Normal ECG (NORM), Myocardial Infarction (MI), Arrhythmia / Repolarization Abnormality surrogate class (ARR, corresponding to the STTC superclass in PTB-XL), Hypertrophy (HYP), and Conduction Block (CD). After Sigmoid activation, multi-label predicted probabilities are obtained.
[0072] The classifier includes a hypertrophic cardiomyopathy (HYP) morphological adapter, which can be a lightweight auxiliary module specifically designed for hypertrophy categories. It does not replace or disrupt the main architecture, but rather provides targeted enhancements to HYP discrimination at the lead convergence, feature fusion, and decision layers. This module takes an unstandardized ECG suppressed signal as input and explicitly extracts hypertrophy-related morphological statistics from the raw amplitude level. In one embodiment of the invention, lead-level features may include the following six statistical quantities: positive peak value (high voltage statistics in top-k mean form), negative peak value, RMS (Root Mean Square) energy, mean slope (mean of absolute values of point-by-point differences), peak-to-peak amplitude, and R / S (R wave / S wave) ratio. In practice, for several key leads and regional combinations, 16-dimensional global cross-regional contrast features can be further constructed, including but not limited to: lateral wall lead voltage, septal lead S-wave depth, inferior wall lead voltage, anterior wall lead voltage, aVR contrast, lateral wall strain features, Sokolow-like exponent, Cornell-like features, r_aVL (r wave in lead aVL, aVL lead r wave amplitude), RV5 / SV1 (Ratio of R wave amplitude in lead V5 to S wave amplitude in lead V1, V5 lead R wave to V1 lead S wave amplitude), RV6 / SV1 (Ratio of R wave amplitude in lead V6 to S wave amplitude in lead V1, V6 lead R wave to V1 lead S wave amplitude), lateral and inferior wall voltage difference, septal and anterior wall difference, strain difference, aVR and inferior wall difference, and a criterion constructed based on the intensity of the classic hypertrophy criterion. The Hypertrophic Cardiac (HYP) morphological adapter can output three types of auxiliary quantities: lead bias vector (lead_bias), used to adjust the weight distribution of the convergence head of the enhancement path leads; feature bias vector (feature_bias, 256-dimensional), injected into the global feature fusion layer in a residual manner; and HYP-specific Logit bias (hyp_Logit_bias), which is directly superimposed on the HYP category Logit. Simultaneously, the module also uses learnable prior vectors and clinical lead templates to assign higher prior weights to hypertrophy-sensitive leads such as I, aVL, V1, V2, V5, and V6, and modulates the feature bias and lead bias by combining classical criterion strength.In addition, the adapter includes a dedicated HYP Logit bias generator. Taking the morphological global feature bias vector as input, it outputs a scalar bias value after Tanh activation, which is then superimposed on the final HYP category Logit, providing additional decision-level auxiliary signals for hypertrophy discrimination. All injections are strictly controlled using a low initial value strategy to ensure they only play an auxiliary role when needed without significantly interfering with other category discriminations.
[0073] It should be noted that although this invention retains the amplitude reference signal without Z-score normalization to extract hypertrophy-related high voltage, deep S-wave, and translead voltage difference features, it does not rely solely on a single absolute amplitude for discrimination. Preferably, the aforementioned morphological adapter also introduces multiple types of relative or comparative statistical features, including but not limited to inter-lead voltage difference, R / S ratio, cross-region voltage comparison, and combined features similar to Sokolow-like and Cornell-like characteristics, to mitigate the adverse effects of device amplification, electrode contact impedance, and individual size differences on simple absolute voltage measurements. Furthermore, the aforementioned morphological adapter does not replace the main discrimination function of the backbone network in the system, but participates in the final decision through low-intensity multi-level residual methods such as lead bias, feature bias, and HYP-specific Logit bias. Each injection starts with a small initial value and is progressively adjusted through learnable gating. In the current implementation, the initial strength of different injection positions is not exactly the same, usually ranging from 0.10 to 0.15, thereby enhancing the ability to identify hypertrophic classes while reducing the sensitivity to environmental changes and hardware differences.
[0074] The classifier includes multi-level auxiliary supervision that assists in prediction of three sets of output logits: baseline path logits, augmented path logits, and fusion path logits, in addition to the final logits of the main classifier. During training, the main loss is applied to the final logits, and the three auxiliary losses are applied to their respective auxiliary logits with adaptive weights: the baseline path auxiliary weight is approximately 0.15 (fixed), the augmented path auxiliary weight has an upper limit of approximately 0.20 and is gradually introduced in a linear warming manner in the early stages of training, and the fusion path auxiliary weight has an upper limit of approximately 0.10 and is gradually introduced with a similar warming strategy. This warming strategy ensures that the augmented branch gradually participates in optimization only after the baseline path has fully converged in the early stages of training, avoiding the augmented module from disrupting the learning of basic features in the early stages of training. In a preferred embodiment, the warming stage can be set for the first few epochs (training rounds), and the specific value can be flexibly adjusted according to the dataset size and training convergence speed.
[0075] The classifier includes a decision-level fusion gate, which can employ a classwise residual blend gate that learns independently for each class. This gate independently learns the optimal fusion injection strength for each class of baseline logits and co-logits (fused logits after HYP bias correction), adaptively balancing the robustness of the baseline model and the performance improvement of the enhancement module for specific classes. The final output ECG abnormality type information is obtained by fusing baseline logits and co-logits using a classwise gating method.
[0076] Optionally, before performing feature extraction processing on the preprocessed ECG signal set based on the independent lead feature extraction sub-model included in the pre-determined ECG abnormality detection model to obtain the batch feature information of the ECG leads, the execution entity may also perform the following steps:
[0077] The first step is to obtain a set of sample ECG signals and a set of sample ECG category labels. Each sample ECG signal in the sample ECG signal set corresponds one-to-one with a sample ECG category label in the sample ECG category label set. These can be obtained from a sample ECG database. The sample ECG signals in the sample ECG signal set can be 12-lead ECG signals. The sample ECG category labels in the sample ECG category label set represent the category information of the corresponding sample ECG signal. This category information can be, but is not limited to: normal ECG, myocardial infarction, arrhythmia / repolarization surrogate class, myocardial hypertrophy, and conduction block.
[0078] As an example, the aforementioned sample electrocardiogram database could be (PTB-XL, Physikalisch-Technische Bundesanstalt Diagnostic ECG Database-XL, the Diagnostic Electrocardiogram Database of the Great Institute of Physics and Technology).
[0079] The second step involves performing enhancement processing on each sample ECG signal in the above sample ECG signal set based on a preset enhancement probability value to generate a sample enhanced ECG signal, thus obtaining a sample enhanced ECG signal set.
[0080] As an example, the preset enhancement probability value could be 0.7.
[0081] The third step involves batch splitting the aforementioned sample enhanced electrocardiogram (ECG) signal set to obtain sample batch ECG signal groups. This batch splitting process can be achieved by dividing the sample enhanced ECG signal set into multiple sample batch ECG signal groups according to a preset number of batches per group, and then defining each of these multiple sample batch ECG signal groups as a sample batch ECG signal group set.
[0082] As an example, the preset number of split batches mentioned above can be, but is not limited to, 16, 24, or 32.
[0083] Fourth, select the target sample batch of ECG signal groups from the above sample batch ECG signal groups and perform the following training sub-steps:
[0084] The first sub-step involves detecting and processing the target sample batch of ECG signal groups based on the initial ECG abnormality detection model to obtain an initial ECG abnormality type information set. Specifically, a sample batch of ECG signal groups can be randomly selected from the aforementioned sample batch ECG signal group set as the target sample batch ECG signal group. The specific implementation method for generating the aforementioned initial ECG abnormality type information set and its resulting technical effects can be found in step 102 of the above embodiment, and will not be repeated here.
[0085] The second sub-step, based on a preset loss function, determines the detection loss value between the initial ECG abnormality type information set and the sample ECG category label set, and the sample ECG category label corresponding to each target sample batch ECG signal in the target sample batch ECG signal group. Among these,
[0086] As an example, the preset loss function can be a multi-label asymmetric loss function or a focal loss function as the main loss function, used to further focus on hard samples and suppress the interference of easily classified negative samples on training. It also supports fallback to the BCE With Logits Loss (Binary Cross-Entropy With Logits Loss) function. Label smoothing is supported during training, preferably with a smoothing value of 0.05. For hypertrophic categories, the training signal can be enhanced through mechanisms such as positive sample additional loss scaling, class-related prior modulation, and morphological Logit bias.
[0087] The third sub-step involves adjusting the initial ECG abnormality detection model based on the detection loss value. This adjustment can be achieved using a pre-defined algorithm.
[0088] As an example, the AdamW optimizer can be used (preferably with a learning rate of 1×10^(-3) and a weight decay coefficient of 1×10^(-4)). The learning rate scheduling adopts a Warmup+Cosine Annealing strategy: a linear warmup phase is set at the beginning of training (approximately 5 epochs in a preferred embodiment), and the learning rate is linearly increased from an initial low level to the target learning rate. Subsequently, cosine annealing is used to gradually decay the learning rate to improve convergence stability.
[0089] The fourth sub-step involves determining the initial ECG anomaly detection model as the ECG anomaly detection model in response to the determination that the sample batch of ECG signal sets meets the preset adjustment conditions. The preset adjustment conditions may include the absence of a previously unselected target sample batch of ECG signal sets within the sample batch of ECG signal sets.
[0090] Optionally, in response to determining that the sample batch of ECG signal sets does not meet the preset adjustment conditions, the adjusted initial ECG abnormality detection model is determined as the initial ECG abnormality detection model, and the target sample batch of ECG signal sets is selected from the unselected sample batches of ECG signal sets in the above sample batch of ECG signal sets, so as to execute the above training sub-step again.
[0091] In some optional implementations of certain embodiments, the execution entity performs enhancement processing on each sample electrocardiogram signal in the sample electrocardiogram signal set based on a preset enhancement probability value to generate a sample enhanced electrocardiogram signal, which may include the following steps:
[0092] The first step is to randomly generate a sample augmentation value. This involves randomly generating a sample augmentation value.
[0093] The second step, in response to determining that the above sample augmentation value is greater than the above preset augmentation probability value, is to perform the following augmentation sub-steps:
[0094] The first sub-step involves scaling the sample ECG signal based on a preset scaling probability value to obtain a scaled ECG signal. This scaling process can be achieved by applying both overall and lead-level scaling to the sample ECG signal using the preset scaling probability value as the execution probability. In practice, if the sample ECG category label represents myocardial hypertrophy, a more conservative scaling range and sensitive lead perturbation range can be used to reduce damage to high-voltage characteristics.
[0095] As an example, the preset scaling probability value can be 0.8. The scaling range can be set to 0.9-1.1.
[0096] The second sub-step involves performing perturbation enhancement processing on the scaled ECG signal based on a preset noise probability value to obtain a perturbed ECG signal. This perturbation enhancement processing can be achieved by adding random Gaussian noise of a preset noise intensity to the scaled ECG signal, using the preset noise probability value as the execution probability.
[0097] As an example, the preset noise probability value can be 0.5. The preset noise intensity can be 0.01, corresponding to a relatively small amplitude perturbation level. Furthermore, the preset noise intensity can be conditionally adjusted according to the sample ECG category label corresponding to the sample ECG signal, so as to enhance the robustness of the model while minimizing disruption of key diagnostic features.
[0098] The third sub-step involves performing drift processing on the disturbed ECG signal based on a preset drift probability value to obtain a sample-enhanced ECG signal. This drift processing, based on the preset drift probability value, can be achieved by adding a baseline signal within a preset frequency range and below a preset amplitude upper limit to the disturbed ECG signal, using the preset drift probability value as the execution probability.
[0099] As an example, the preset drift probability value can be 0.3. The preset frequency range can be 0.05Hz-0.3Hz. The preset amplitude upper limit can be 0.05.
[0100] Step 103: Based on the spatial topology feature enhancement sub-model included in the ECG anomaly detection model, enhance the batch feature information of ECG leads to obtain enhanced batch feature information of ECG.
[0101] In some embodiments, the execution entity may enhance the batch feature information of the electrocardiogram leads based on the spatial topology feature enhancement sub-model included in the electrocardiogram anomaly detection model to obtain enhanced batch feature information of the electrocardiogram.
[0102] In some optional implementations of certain embodiments, the execution entity enhances the ECG lead batch feature information based on the spatial topology graph feature enhancement sub-model included in the ECG anomaly detection model to obtain enhanced ECG batch feature information, which may include the following steps:
[0103] The first step is to construct the static lead topological adjacency matrix corresponding to the batch feature information of the above electrocardiogram leads.
[0104] The second step is to perform symmetric normalization on the above static lead topology adjacency matrix to obtain the normalized adjacency matrix.
[0105] The third step involves performing convolution processing on the ECG lead batch feature information based on the spatial graph convolutional layer and the normalized adjacency matrix included in the aforementioned spatial topology graph feature enhancement sub-model, thereby obtaining ECG convolutional feature information.
[0106] The fourth step involves fusing the ECG lead batch feature information and the ECG convolution feature information based on the residual fusion gating unit included in the aforementioned spatial topology graph feature enhancement sub-model to obtain enhanced ECG batch feature information.
[0107] Step 104: Based on the spatiotemporal attention bottleneck layer included in the ECG anomaly detection model, attention extraction processing is performed on the ECG lead batch feature information and the ECG enhancement batch feature information to obtain ECG attention batch feature information.
[0108] In some embodiments, the execution entity may perform attention extraction processing on the ECG lead batch feature information and the ECG enhancement batch feature information based on the spatiotemporal attention bottleneck layer included in the ECG anomaly detection model to obtain ECG attention batch feature information.
[0109] In some optional implementations of certain embodiments, the execution entity performs attention extraction processing on the ECG lead batch feature information and the ECG enhancement batch feature information based on the spatiotemporal attention bottleneck layer included in the ECG anomaly detection model to obtain ECG attention batch feature information, which may include the following steps:
[0110] The first step is to perform lead feature extraction processing on the lead feature joint attention module included in the above-mentioned spatiotemporal attention bottleneck layer to obtain the electrocardiogram spatial activation feature map.
[0111] The second step involves extracting temporal features from the aforementioned electrocardiogram spatial activation feature map based on the temporal attention module included in the spatiotemporal attention bottleneck layer, thereby obtaining a refined electrocardiogram feature map.
[0112] The third step involves fusing the refined ECG feature map and the ECG lead batch feature information based on the residual fusion unit included in the aforementioned spatiotemporal attention bottleneck layer to obtain ECG attention batch feature information.
[0113] Step 105: Based on the temporal analysis sub-model included in the ECG anomaly detection model, perform temporal encoding processing on the ECG lead batch feature information and the aforementioned ECG attention batch feature information to obtain ECG encoded batch feature information.
[0114] In some embodiments, the execution entity may perform time-series encoding processing on the ECG lead batch feature information and the ECG attention batch feature information based on the time-series analysis sub-model included in the ECG anomaly detection model to obtain ECG encoded batch feature information.
[0115] Step 106: Based on the classifier included in the ECG abnormality detection model, classify the batch feature information of the ECG encoding to obtain the ECG abnormality type information set.
[0116] In some embodiments, the execution entity may classify the ECG encoded batch feature information based on the classifier included in the ECG abnormality detection model to obtain an ECG abnormality type information set.
[0117] Further reference Figure 2 As an implementation of the methods shown in the above figures, this disclosure provides some embodiments of an intelligent electrocardiogram anomaly detection device based on lead topology and spatiotemporal attention. These device embodiments are similar to... Figure 1 Corresponding to the method embodiments shown, this ECG intelligent anomaly detection device based on lead topology and spatiotemporal attention can be specifically applied to various electronic devices.
[0118] like Figure 2As shown, an ECG intelligent anomaly detection device 200 based on lead topology and spatiotemporal attention in some embodiments includes: a preprocessing unit 201, a feature extraction unit 202, an enhancement unit 203, an attention extraction unit 204, a timing coding unit 205, and a classification unit 206. The preprocessing unit 201 is configured to preprocess each pre-acquired initial ECG signal to generate a preprocessed ECG signal set. The feature extraction unit 202 is configured to perform feature extraction processing on the preprocessed ECG signal set based on an independent lead feature extraction sub-model included in a pre-determined ECG anomaly detection model to obtain ECG lead batch feature information. The ECG anomaly detection model further includes: a spatial topology graph feature enhancement sub-model, a spatiotemporal attention bottleneck layer, a timing analysis sub-model, and a classifier. The enhancement unit 203 is configured to enhance the ECG lead batch feature information based on the spatial topology graph feature enhancement sub-model included in the ECG anomaly detection model. The process involves processing the ECG to obtain enhanced batch feature information; an attention extraction unit 204 is configured to perform attention extraction processing on the ECG lead batch feature information based on the spatiotemporal attention bottleneck layer included in the ECG anomaly detection model, to obtain ECG attention batch feature information; a temporal coding unit 205 is configured to perform temporal coding processing on the ECG lead batch feature information and the ECG attention batch feature information based on the temporal analysis sub-model included in the ECG anomaly detection model, to obtain ECG coded batch feature information; and a classification unit 206 is configured to perform classification processing on the ECG coded batch feature information based on the classifier included in the ECG anomaly detection model, to obtain an ECG anomaly type information set.
[0119] It is understandable that the various units and references described in the ECG intelligent anomaly detection device 200 based on lead topology and spatiotemporal attention are... Figure 1 The steps in the described method correspond accordingly. Therefore, the operations, features, and beneficial effects described above for the method are also applicable to the ECG intelligent abnormality detection device 200 based on lead topology and spatiotemporal attention and the units contained therein, and will not be repeated here.
[0120] The following is for reference. Figure 3 It shows a schematic diagram of the structure of an electronic device (e.g., a computing device) 300 suitable for implementing some embodiments of the present disclosure. Figure 3 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of this disclosure.
[0121] like Figure 3As shown, the electronic device 300 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory 302 or a program loaded from a storage device 308 into a random access memory 303. The random access memory 303 also stores various programs and data required for the operation of the electronic device 300. The processing unit 301, the read-only memory 302, and the random access memory 303 are interconnected via a bus 304. An input / output interface 305 is also connected to the bus 304.
[0122] Typically, the following devices can be connected to the input / output interface 305: input devices 306 including, for example, a touchscreen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 307 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 308 including, for example, magnetic tape, hard disk, etc.; and communication devices 309. Communication device 309 allows electronic device 300 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 3 An electronic device 300 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively. Figure 3 Each box shown can represent a device or multiple devices as needed.
[0123] In particular, according to some embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, some embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 309, or installed from a storage device 308, or installed from a read-only memory 302. When the computer program is executed by the processing device 301, it performs the functions defined in the methods of some embodiments of this disclosure.
[0124] It should be noted that, in some embodiments of this disclosure, the computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be—but is not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In some embodiments of this disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In some embodiments of this disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0125] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0126] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device. The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: preprocess each pre-acquired initial electrocardiogram (ECG) signal to generate a preprocessed ECG signal set; and perform feature extraction processing on the preprocessed ECG signal set based on an independent lead feature extraction sub-model included in a pre-determined ECG anomaly detection model to obtain ECG lead batch feature information. The ECG anomaly detection model further includes: a spatial topology graph feature enhancement sub-model, a spatiotemporal attention bottleneck layer, a temporal analysis sub-model, and a classifier; and perform feature extraction processing on the spatial topology graph features included in the ECG anomaly detection model. An enhancement sub-model enhances the batch feature information of the aforementioned ECG leads to obtain enhanced ECG batch feature information. Based on the spatiotemporal attention bottleneck layer included in the aforementioned ECG anomaly detection model, attention extraction is performed on the batch feature information of the aforementioned ECG leads to obtain ECG attention batch feature information. Based on the temporal analysis sub-model included in the aforementioned ECG anomaly detection model, temporal encoding is performed on the batch feature information of the aforementioned ECG leads and the aforementioned ECG attention batch feature information to obtain ECG encoded batch feature information. Based on the classifier included in the aforementioned ECG anomaly detection model, the aforementioned ECG encoded batch feature information is classified to obtain an ECG anomaly type information set.
[0127] Computer program code for performing operations of some embodiments of this disclosure can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0128] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0129] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), and so on.
[0130] The above description is merely a selection of preferred embodiments of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the embodiments of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in the embodiments of this disclosure.
Claims
1. A method for intelligent ECG anomaly detection based on lead topology and spatiotemporal attention, characterized in that, include: Each pre-acquired initial electrocardiogram signal is preprocessed to generate a preprocessed electrocardiogram signal, resulting in a preprocessed electrocardiogram signal set. Based on the independent lead feature extraction sub-model included in the pre-determined electrocardiogram (ECG) anomaly detection model, feature extraction processing is performed on the preprocessed ECG signal set to obtain batch feature information of ECG leads. The ECG anomaly detection model further includes: a spatial topology graph feature enhancement sub-model, a spatiotemporal attention bottleneck layer, a time series analysis sub-model, and a classifier. Based on the spatial topology feature enhancement sub-model included in the ECG anomaly detection model, the batch feature information of the ECG leads is enhanced to obtain enhanced batch feature information of the ECG. Based on the spatiotemporal attention bottleneck layer included in the ECG anomaly detection model, attention extraction processing is performed on the ECG lead batch feature information and the ECG enhancement batch feature information to obtain ECG attention batch feature information; Based on the temporal analysis sub-model included in the ECG anomaly detection model, temporal encoding processing is performed on the ECG lead batch feature information and the ECG attention batch feature information to obtain ECG encoded batch feature information; Based on the classifier included in the ECG abnormality detection model, the batch feature information of the ECG encoding is classified to obtain a set of ECG abnormality type information.
2. The ECG intelligent anomaly detection method based on lead topology and spatiotemporal attention according to claim 1, characterized in that, The step of preprocessing each pre-acquired initial electrocardiogram signal to generate a preprocessed electrocardiogram signal includes: The initial electrocardiogram signal is filtered to obtain a filtered electrocardiogram signal; The ECG filtered signal is suppressed to obtain the ECG suppressed signal; The ECG suppression signal is standardized to obtain a preprocessed ECG signal.
3. The ECG intelligent anomaly detection method based on lead topology and spatiotemporal attention according to claim 1, characterized in that, The spatial topology graph feature enhancement sub-model includes: a spatial graph convolutional layer and a residual fusion gating unit; and the spatial topology graph feature enhancement sub-model based on the ECG anomaly detection model enhances the batch feature information of the ECG leads to obtain enhanced batch feature information of the ECG, including: Construct a static lead topology adjacency matrix corresponding to the batch feature information of the electrocardiogram leads; The static lead topology adjacency matrix is symmetrically normalized to obtain a normalized adjacency matrix. Based on the spatial graph convolutional layer and the normalized adjacency matrix included in the spatial topology graph feature enhancement sub-model, the batch feature information of the electrocardiogram leads is processed by convolution to obtain the electrocardiogram convolutional feature information. Based on the residual fusion gating unit included in the spatial topology graph feature enhancement sub-model, the batch feature information of the ECG leads and the convolutional feature information of the ECG are fused to obtain the enhanced batch feature information of the ECG.
4. The ECG intelligent anomaly detection method based on lead topology and spatiotemporal attention according to claim 1, characterized in that, The spatiotemporal attention bottleneck layer includes: a lead feature joint attention module, a temporal attention module, and a residual fusion unit; and the spatiotemporal attention bottleneck layer based on the ECG anomaly detection model performs attention extraction processing on the ECG lead batch feature information and the ECG enhancement batch feature information to obtain ECG attention batch feature information, including: Based on the lead feature joint attention module included in the spatiotemporal attention bottleneck layer, lead feature extraction processing is performed on the batch feature information of the electrocardiogram leads to obtain the electrocardiogram spatial activation feature map. Based on the temporal attention module included in the spatiotemporal attention bottleneck layer, temporal feature extraction processing is performed on the electrocardiogram spatial activation feature map to obtain a refined electrocardiogram feature map; Based on the residual fusion unit included in the spatiotemporal attention bottleneck layer, the refined feature map of the electrocardiogram and the batch feature information of the electrocardiogram leads are fused to obtain the batch feature information of the electrocardiogram attention.
5. The ECG intelligent anomaly detection method based on lead topology and spatiotemporal attention according to claim 1, characterized in that, Before performing feature extraction processing on the preprocessed ECG signal set to obtain batch feature information of ECG leads based on the independent lead feature extraction sub-model included in the pre-determined ECG abnormality detection model, the method further includes: Obtain a sample electrocardiogram (ECG) signal set and a sample ECG category label set, wherein the sample ECG signals in the sample ECG signal set correspond one-to-one with the sample ECG category labels in the sample ECG category label set; Based on a preset enhancement probability value, each sample electrocardiogram signal in the sample electrocardiogram signal set is enhanced to generate a sample enhanced electrocardiogram signal, thus obtaining a sample enhanced electrocardiogram signal set; The sample enhanced electrocardiogram signal set is subjected to batch splitting processing to obtain sample batch electrocardiogram signal sets; From the set of ECG signal groups in the sample batch, select the target sample batch of ECG signal groups and perform the following training steps: Based on the initial electrocardiogram (ECG) abnormality detection model, the target sample batch of ECG signal groups are detected and processed to obtain the initial ECG abnormality type information set; Based on a preset loss function, the detection loss value between the initial ECG abnormality type information set and the sample ECG category label set and the sample ECG category label corresponding to each target sample batch ECG signal in the target sample batch ECG signal group is determined; Adjust the initial ECG abnormality detection model based on the detection loss value; In response to the determination that the ECG signal set of the sample batch meets the preset adjustment conditions, the adjusted initial ECG abnormality detection model is determined as the ECG abnormality detection model.
6. The ECG intelligent anomaly detection method based on lead topology and spatiotemporal attention according to claim 5, characterized in that, The method further includes: In response to the determination that the sample batch of ECG signal sets does not meet the preset adjustment conditions, the adjusted initial ECG abnormality detection model is determined as the initial ECG abnormality detection model, and the target sample batch of ECG signal sets is selected from the unselected sample batches of ECG signal sets in the sample batch of ECG signal sets for re-execution of the training step.
7. The ECG intelligent anomaly detection method based on lead topology and spatiotemporal attention according to claim 5, characterized in that, The step of enhancing each sample electrocardiogram signal in the sample electrocardiogram signal set based on a preset enhancement probability value to generate a sample enhanced electrocardiogram signal includes: Randomly generate sample augmentation values; In response to determining that the sample augmentation value is greater than the preset augmentation probability value, the following augmentation steps are performed: Based on a preset scaling probability value, the sample electrocardiogram signal is scaled to obtain a scaled electrocardiogram signal. Based on a preset noise probability value, the scaled electrocardiogram signal is subjected to perturbation enhancement processing to obtain a perturbed electrocardiogram signal. Based on a preset drift probability value, the disturbed electrocardiogram signal is subjected to drift processing to obtain a sample-enhanced electrocardiogram signal.
8. An intelligent electrocardiogram anomaly detection device based on lead topology and spatiotemporal attention, characterized in that, include: The preprocessing unit is configured to preprocess each pre-acquired initial electrocardiogram signal to generate a preprocessed electrocardiogram signal, thereby obtaining a set of preprocessed electrocardiogram signals. The feature extraction unit is configured to perform feature extraction processing on the preprocessed electrocardiogram signal set based on the independent lead feature extraction sub-model included in the pre-determined electrocardiogram anomaly detection model, to obtain batch feature information of electrocardiogram leads. The electrocardiogram anomaly detection model further includes: a spatial topology graph feature enhancement sub-model, a spatiotemporal attention bottleneck layer, a time series analysis sub-model, and a classifier. The enhancement unit is configured to enhance the batch feature information of the ECG leads based on the spatial topology feature enhancement sub-model included in the ECG anomaly detection model, thereby obtaining enhanced batch feature information of the ECG; The attention extraction unit is configured to perform attention extraction processing on the batch feature information of the ECG leads based on the spatiotemporal attention bottleneck layer included in the ECG anomaly detection model, so as to obtain the ECG attention batch feature information. The temporal coding unit is configured to perform temporal coding processing on the ECG lead batch feature information and the ECG attention batch feature information based on the temporal analysis sub-model included in the ECG abnormality detection model, to obtain ECG coded batch feature information; The classification unit is configured to classify the batch feature information of the electrocardiogram encoding based on the classifier included in the electrocardiogram abnormality detection model, so as to obtain a set of electrocardiogram abnormality type information.
9. An electronic device, characterized in that, include: One or more processors; A storage device on which one or more programs are stored; When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1 to 7.
10. A computer-readable medium, characterized in that, It stores a computer program, characterized in that the computer program, when executed by a processor, implements the method as described in any one of claims 1 to 7.
