A quality-aware dynamic electrocardiogram mamba state updating method and device
By introducing signal quality index and motion state information into the Mamba state-space model for adaptive modulation, the problem of low-quality fragment contamination in long-sequence dynamic electrocardiogram analysis is solved, the stability of the model and its ability to adapt to complex environments are improved, and more accurate dynamic electrocardiogram analysis is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGHAI YIZHOU INTELLIGENT TECHNOLOGY CO LTD
- Filing Date
- 2026-05-21
- Publication Date
- 2026-06-19
AI Technical Summary
Existing state-space models fail to explicitly distinguish signal quality differences in dynamic long-sequence ECG analysis, resulting in low-quality segments contaminating the long-term state and affecting subsequent judgments. Furthermore, signal quality information is only used for external model screening or post-processing, lacking internal control mechanisms, making it difficult to handle issues such as unstable input quality and uncertain preprocessing reliability.
Signal quality index, motion state information, and preprocessing confidence are introduced as control variables within the model. Through the quality control branch of modulation state writing, forgetting, and propagation, the Mamba state-space model is used for adaptive modulation to generate dynamic ECG event detection and rhythm recognition results.
It improves the stability and robustness of dynamic ECG long sequence analysis, reduces the contamination of long-term states by low-quality fragments, and enhances the model's adaptability and interpretability in complex environments.
Smart Images

Figure CN122229468A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of biomedical signal processing, artificial intelligence time series modeling, and intelligent medical data analysis. In particular, it relates to a quality-aware state update method for dynamic electrocardiogram (ECG) long-sequence monitoring scenarios. More specifically, it relates to a dynamic ECG Mamba state update method, device, electronic device, and storage medium that introduces signal quality index, motion state information, and preprocessing confidence into a state-space sequence model to adaptively modulate state writing, state forgetting, and state propagation during dynamic ECG analysis. Background Technology
[0002] Compared to traditional resting ECG analysis, Holter monitoring presents significantly different data characteristics and technical challenges. Resting ECG data is typically acquired over a short period, with the subject remaining relatively still and lead contact being relatively stable, resulting in relatively uniform signal quality and controllable noise interference. However, Holter monitoring, especially long-term out-of-hospital monitoring data, is often accompanied by a variety of complex interferences, including walking, running, turning over, going up and down stairs, loosening of the ECG strap, fluctuations in contact impedance, electromyographic interference, baseline drift, and sudden environmental noise, leading to significant fluctuations in signal quality over time.
[0003] In existing technologies, the following methods are commonly used for long-sequence dynamic electrocardiogram analysis: Long sequences are directly modeled using convolutional neural networks, recurrent neural networks, or Transformer networks; the raw ECG is filtered, denoised, and artifact suppressed before being input into the model; state-space models or state-space-like long sequence modeling networks are used to perform trend analysis, rhythm modeling, or anomaly detection on ECG sequences ranging from several minutes to several hours; signal quality indices (such as SQI) are calculated and used for segment removal, post-processing screening, or result confidence correction.
[0004] With the development of long sequence modeling methods, sequence analysis networks based on state-space models have gradually gained application value in long-term dynamic electrocardiogram tasks due to their ability to model long-range dependencies and their computational efficiency. In particular, Mamba-like state-space modeling methods can process long time series with linear complexity and have shown potential in fields such as speech, time series, and physiological signals. However, the inventors have found that existing technologies that directly apply Mamba or other state-space models to long dynamic electrocardiogram sequences still have the following prominent drawbacks.
[0005] (i) Existing state-space models typically assume that the inputs in each time slice have the same write value. In existing technologies, regardless of whether a traditional recursive model or a long state-space sequence model is used, whether the current input enters the model's internal state, how many states it enters, and how long it remains there are typically determined by the input features and model parameters. The model assumes that observation sequences at each time point can participate in state updates according to a unified rule.
[0006] However, dynamic ECG signals themselves exhibit significant time-varying quality characteristics. Within the same long-duration ECG recording, high-quality resting segments, moderate-quality active segments, low-quality motion artifact segments, segments with localized contamination due to unstable electrode contact, and complex segments with high preprocessing uncertainty may alternate. Existing state-space models do not explicitly distinguish the differences in whether these segments are "worth writing into the long-term state," leading to low-quality and high-quality segments being treated approximately equivalently during state updates. This makes the model prone to continuously writing unreliable information such as artifacts, contact noise, and over-washing errors into the internal state, thereby contaminating the judgment results at subsequent time steps.
[0007] (ii) Low-quality segments are prone to causing state contamination and accumulation of false memories in long sequence modeling. One of the key challenges in long-term dynamic ECG modeling is that once erroneous information is written into the long-term state, its impact is usually not limited to the current moment but continues to propagate over a considerable subsequent period. For example, in Holter or patch monitoring, a short-duration strong motion artifact may only last for a few seconds, but if the existing model mistakenly writes the artifact morphology as a valid physiological change into the state during this phase, the erroneous state may affect rhythm judgment for tens of seconds or even longer. Even if the model subsequently re-enters a high-quality resting phase, it may still carry the contaminated historical state.
[0008] While existing technologies may use denoising modules or external SQI for pre-screening on the input side, they typically do not establish a quality constraint mechanism for updating the internal state of the model. In other words, they do not address the structural issues of "whether low-quality segments should enter the state, how many should enter, and how long should they be retained."
[0009] (iii) Existing SQI is mostly used for external screening or post-processing, and is not applied to Mamba state writing and forgetting control. Some existing technologies have incorporated Signal Quality Indicators (SQI) or other signal quality metrics to remove low-quality segments, perform post-processing corrections on output results, and indicate poor-quality intervals to the manual review interface. However, these approaches essentially use quality information external to the model, rather than internally. These solutions have the following limitations: if low-quality segments are directly removed, potential abnormal events may be lost simultaneously; if SQI is only used in the post-processing stage, the contamination of the model's internal state by low-quality segments has already occurred, and subsequent corrections cannot reverse early erroneous memories; existing solutions do not use SQI as a control variable for the write, forget, or propagation gates of the state-space model, failing to achieve structured quality constraints on long-term states. Existing technologies have not fully leveraged the technical value of quality information in dynamic long-sequence ECG modeling.
[0010] (iv) Existing methods are unable to simultaneously address the dual problems of "unstable input quality" and "uncertainty in preprocessing reliability". In practical dynamic ECG systems, the uncertainty of the input signal stems not only from the quality of the original sampling but also from the reliability of the preprocessing results themselves. For example, at a certain time, strenuous activity may cause a decrease in the SQI of the original signal; at another time, although the preprocessing module outputs a clean signal, this output may have high uncertainty; at yet another time, the IMU may show strenuous motion, indicating that the current waveform morphology is more likely to be affected by motion interference. Most existing technologies only use quality information from a single perspective, such as using only SQI or relying solely on the clean signal itself, failing to form the following joint judgments: whether the current original signal is reliable; whether the current motion state indicates a high risk of motion artifacts; whether the current preprocessing output is trustworthy; and whether the current segment is suitable for writing into the long-term state. In other words, existing technologies lack a technical solution that combines SQI, IMU, and preprocessing confidence for state update control.
[0011] (v) Existing state-space models lack an explicit mechanism for "determining whether something is worth remembering based on its quality". For long-duration dynamic ECG sequences, not all time slices are worth remembering by the model in the long term. What is truly worth remembering is typically the following: high-frequency, morphologically stable, true ECG rhythm features; effective heart rate changes, rhythm abnormalities, or conduction abnormalities in long-term trends. Information that should not be remembered in the long term or should be weakly remembered typically includes: strong motion artifacts; transient instability of electrode contact; spurious features caused by unreliable preprocessing; and obvious non-physiological burst noise. However, current techniques generally lack an explicit quality constraint mechanism for defining "whether it is worth remembering," leading to the state update process relying entirely on implicit learning. This approach lacks controllability, interpretability, and cross-scenario robustness, and is prone to performance instability in complex dynamic ECG environments.
[0012] For example, Chinese patent document CN120316566A discloses a long-term dependency sequence classification system based on the state-space model Mamba. This system includes a data preprocessing module and a convolutional feature extraction module connected to the data preprocessing module. It also includes a convolutional feature extraction module, a Mamba feature enhancement module, and a classification head module sequentially connected after the convolutional feature extraction module. The Mamba feature enhancement module comprises a first LayerNorm layer, a first Mamba layer, a second LayerNom layer, a second Mamba layer, a third LayerNorm layer, and an AdaptiveConcatPool layer, all connected sequentially. The Mamba feature enhancement module transposes the local features output by the convolutional feature extraction module, outputting an embedding vector with temporal features. Then, two Mamba layers are applied to capture long-term dependencies of the features, and the vectors are normalized using a layerNorm layer to output enhanced features. The classification head module consists of a first BN layer, a first Dropout layer, a first fully connected layer, a ReLU activation function layer, a second BN layer, a second Dropout layer, and a second fully connected layer, connected sequentially. The first BN layer serves as the input to the classification head module, receiving the enhanced features from the Mamba feature enhancement module; the second fully connected layer serves as the output, outputting the classification result. This scheme can accurately capture long-range dependencies in signals and is relatively effective for classification tasks; however, its ability to suppress contamination is limited.
[0013] Therefore, existing technologies urgently need a new technical solution that enables quality information to directly participate in the state writing, state forgetting, and state propagation control within the state-space model, thereby suppressing the contamination of long-term states by low-quality fragments and improving the stability, robustness, and accuracy of dynamic electrocardiogram long-sequence analysis. Summary of the Invention
[0014] In view of the technical problems existing in the prior art, the purpose of this invention is to provide a quality-aware dynamic ECG Mamba state update technology solution that can solve the problems of low-quality segments easily contaminating long-term states, signal quality information only being used outside the model, and the lack of quality constraint writing and forgetting control mechanisms in the state space model during long-sequence dynamic ECG analysis. This solution enables the signal quality index, motion state information, and preprocessing confidence of dynamic ECG to be used as internal control variables of the model and directly participate in the state writing, state forgetting, and state propagation processes, thereby improving the robustness, stability, and interpretability of long-term dynamic ECG modeling.
[0015] To achieve the above objectives, the present invention adopts the following technical solution: Specifically, according to one aspect of the present invention, a quality-aware dynamic ECG Mamba state update method is provided, characterized by comprising the following steps: The obtained signal quality index, motion state information, and preprocessing confidence corresponding to the long dynamic electrocardiogram sequence are input into the quality control branch of the state space sequence modeling network. Based on the modulated state update results, a dynamic ECG long-term feature representation is generated, and based on the long-term feature representation, at least one of the following is output: dynamic ECG event detection result, rhythm recognition result, or abnormal classification result.
[0016] Preferably, the state-space sequence modeling network is a Mamba network or a sequence modeling network based on a selective state-space model.
[0017] Preferably, the state control signal is used to determine whether the input features of the current time position are written into the internal state, how much is written, how much of the historical state is retained, and the contribution of the current state to the propagation of subsequent time positions.
[0018] To enable those skilled in the art to better understand the present invention, some of the technical terms used in this document are explained below. It should be noted that these terms have general meanings in the field and are not coined by the applicant; they have general technical meanings throughout the document. 1. Quality Control Branch In the architecture of the Mamba State-Space Model (SSM), the quality control branch is a separate parameterized processing module (typically composed of a lightweight multilayer perceptron (MLP) or linear layers). Its function is not to process the clinical diagnostic features of the ECG signal, but rather to specifically process the signal's metadata, namely SQI and exercise intensity. and preprocessing confidence This branch acts like a "regulator" or "gatekeeper" in a neural network, dynamically generating control signals (such as...) based on the environment and signal quality. and This allows for intervention at the underlying mathematical level in the backbone network's "acceptance" of data at the current moment.
[0019] 2. Dynamic ECG Events This refers to clinically significant transient or short-duration waveform changes that occur during long-term Holter monitoring. These events typically have a clear start and end time, such as premature ventricular contractions (PVCs), premature atrial contractions (PACs), long RR intervals (pauses), and sudden ST-segment elevation or depression. In the patent context, this term specifically refers to transient physiological phenomena that are susceptible to false alarms due to motion artifacts.
[0020] 3. Rhythm Identification Technical meaning: Rhythm recognition refers to the macroscopic determination of the overall dominant heart rhythm state of a segment of electrocardiogram (ECG) sequence. Unlike the transient nature of "events," rhythm recognition focuses on continuous physiological characteristics. Typical rhythms include: Normal Sinus Rhythm, Persistent Atrial Fibrillation (AF), Paroxysmal Atrial Fibrillation (AF), and Ventricular Tachycardia. The Mamba architecture, through its long-term state preservation, excels at handling such recognition tasks that require long-term contextual information.
[0021] 4. Anomaly Classification This refers to the process of mapping identified electrocardiographic features or waveform segments to a predefined pathological category space. This includes not only the classification of arrhythmias but also the determination of waveform morphological abnormalities (such as T-wave inversion and QT interval prolongation). In the Mamba update mechanism, the accuracy of abnormal classification directly depends on the hidden state. Whether artifact contamination was successfully eliminated.
[0022] 5. Input Features raw electrocardiogram signal After processing by a preceding encoding mapping network (such as a one-dimensional convolutional layer or a linear projection layer), at the current time step... The generated high-dimensional latent space feature vectors are uniformly denoted as follows in this paper. .
[0023] 6. Propagation Contribution The hidden state of the system at the current moment. The weighting of the impact on state updates at subsequent time steps. In Mamba's selective scanning mechanism, if the signal quality is extremely low and the confidence level is insufficient at the current time step, the weighting is reduced. and adjustment The discretization parameters corresponding to the matrix can make the current state have almost no impact on future predictions, thereby interrupting the spread of noise along the time axis.
[0024] 7. Unreliable Information This refers to non-cardiac interference components in dynamic electrocardiogram (ECG) signals. Specifically, it includes: Physical artifacts: Baseline wander caused by chest expansion movements and electrode displacement.
[0025] Physiological noise: Electromyographic interference (EMG) caused by muscle contraction.
[0026] Algorithm error: Waveform distortion caused by signal overlap in the preprocessing noise reduction module.
[0027] This information can mathematically lead to incorrect gradient updates in the model, which must be suppressed through a quality control branch.
[0028] 8. Long-term State The hidden state vector in a state-space model or Mamba backbone network is used to carry long-term temporal historical physiological memories, at time... The state is denoted as The state at the previous moment is recorded as In the Mamba architecture, the stability of the long-term state determines the model's ability to capture slow pathological evolutions (such as trends toward heart failure and axis shifts).
[0029] 9. Effective ECG Physiological Features The electrocardiogram (ECG) signal refers to the morphological components that truly reflect the electrophysiological activity of the heart. Specifically, this includes, but is not limited to, the amplitude, interval, and slope of the P wave (atrial depolarization), QRS complex (ventricular depolarization), and T wave (repolarization), as well as the physiological rhythm variability of the RR interval; these effective ECG characteristics are the core basis for the clinical diagnosis of cardiovascular diseases.
[0030] The signal quality index (SQI) is generated based on the physiological rationality analysis of electrocardiogram waveforms. Indicators of body motion intensity, attitude change, or physical motion state acquired and derived from inertial measurement units (IMUs). The confidence, uncertainty, or fidelity index of the output result calculated by the preprocessing module.
[0031] Preferably, the state update in the adaptive modulation process satisfies the following form:
[0032] in, Indicates time The hidden state within the network, Indicates the previous moment The hidden state within the network, Indicates time The input feature vector (belonging to the aforementioned input feature definition, is the input) (Feature vector obtained after encoding and mapping) Represents a nonlinear mapping function. This represents the element-wise multiplication operator. This indicates the write control quantity. This represents the forgetting control quantity, and and All are output from the quality control branch or modulated by the quality control branch.
[0033] Preferably, the write control quantity With the forgetting control quantity The solution satisfies the following form:
[0034] in, It is the Sigmoid activation function. Indicates time The signal quality index, Indicates time The motion state information, Indicates time The preprocessing confidence level, This indicates a concatenation operation based on channel dimensions or feature dimensions. and This represents the learnable mapping parameter matrix. and This represents the corresponding bias term vector.
[0035] The following physical shielding control logic is implemented through the aforementioned adaptive modulation: When the signal quality index is lower than the first quality threshold, the motion state information represents violent body movement, or the preprocessing confidence level is lower than the first confidence threshold, the write control quantity is reduced. The value or increase the forgetting control amount The value is used to suppress interference noise at the current time position and preprocess uncertain information to write into the hidden state inside the network; When the signal quality index is higher than the second quality threshold, the motion state is stable, and the preprocessing confidence level is higher than the second confidence threshold, the write control quantity is increased. The value or reduction of the forgetting control quantity The values are used to enhance the accumulation and retention of effective electrophysiological characteristics in the hidden state within the network.
[0036] During the training phase of the state-space sequence modeling network, an auxiliary loss function guided by quality labels is introduced. The quality control branch is subjected to joint supervised training, and the auxiliary loss function... It must satisfy the following form:
[0037] in, This represents the total temporal length of a long electrocardiogram (ECG) sequence. and This represents the actual write control amount and forget control amount predicted by the model. and This represents the true reference control target obtained by heuristically mapping prior labels based on the signal quality index, motion state information, and preprocessed confidence levels. express The square of the norm.
[0038] According to another aspect of the present invention, a dynamic electrocardiogram Mamba state update device based on quality information modulation is also provided, characterized in that it comprises: The acquisition module is configured to acquire long ECG sequences in dynamic monitoring scenarios, as well as the signal quality index, motion state information, and preprocessing confidence level that are synchronously aligned with them. The encoding module is configured to perform feature space encoding mapping on the dynamic long ECG sequence to generate an input feature vector; The quality control module is configured to input the signal quality index, motion state information and preprocessing confidence into a dedicated control branch to generate a state control signal for intervening in the evolution of the main state. The state adaptive modulation module is configured to dynamically adjust the state write intensity and state forget intensity of the backbone Mamba network at each time point based on the state control signal. The inference output module is configured to perform clinical decisions and output at least one of dynamic electrocardiogram event detection results, rhythm recognition results, or abnormal classification results based on the modulated updated state representation.
[0039] According to another aspect of the present invention, an electronic device is provided, comprising: at least one processor and a memory communicatively connected to said at least one processor; the memory stores a computer program, which, when executed by said at least one processor, causes the electronic device to perform the method described above. Furthermore, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the method described above.
[0040] Compared with the prior art, the present invention has at least the following beneficial effects: Instead of using SQI only in the input filtering or output post-processing stages, SQI, IMU, and preprocessing confidence are directly introduced into the Mamba state update process, structurally realizing quality constraints for dynamic long ECG sequence modeling, and enabling quality information to be elevated from external evaluation indicators to internal state control variables.
[0041] By quality modulating the write strength, forget strength, and propagation strength, the interference of motion artifacts, contact fluctuations, and unreliable preprocessing outputs on long-term state memory can be reduced, thereby significantly suppressing the contamination of long-term states by low-quality fragments.
[0042] For continuous ECG recordings lasting several hours or even longer, it can suppress the accumulation of short-term artifacts in the long-term state, improve the stability of subsequent rhythm recognition and event detection, and thus improve the stability and robustness of long-term dynamic ECG analysis.
[0043] By jointly utilizing SQI, IMU, and preprocessing confidence, it is possible to simultaneously perceive the quality of the original input, the risk of body movement, and the reliability of preprocessing, thus making it more suitable for dynamic ECG analysis in out-of-hospital free-movement scenarios and enhancing the model's adaptability to complex dynamic scenarios.
[0044] By making explicit quality criteria for "whether it is worth writing, whether it is worth keeping, and whether propagation should be reduced" within the model, the interpretability and controllability of the model can be improved, facilitating engineering debugging, performance analysis, and interpretation for clinical applications.
[0045] This invention has strong applicability, especially suitable for the following scenarios: long-term Holter ECG monitoring, continuous monitoring with dynamic patches, long-sequence ECG analysis in wearable free-movement states, exercise ECG monitoring, and continuous ECG abnormality event detection in complex out-of-hospital activity environments, etc. By implementing quality constraints on the state space writing, retention, and forgetting of long-term dynamic ECG sequences, with control variables derived from SQI, IMU, and preprocessing confidence, it avoids low-quality fragments from contaminating the long-term memory state, effectively improving the problem of false accumulation in long Holter / patch / motion monitoring sequences. Attached Figure Description
[0046] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments are briefly described below.
[0047] Figure 1 This is a schematic diagram illustrating the overall process of a quality-aware dynamic ECG Mamba state update method according to a specific embodiment of the present invention. Figure 2 This is a schematic diagram illustrating a multi-source input structure involving dynamic ECG input, SQI, IMU information, and preprocessing confidence, according to a specific embodiment of the present invention. Figure 3 This is a schematic diagram illustrating the structure of the quality control branch generating write control quantity and forget control quantity according to a specific embodiment of the present invention; Figure 4This is a schematic diagram illustrating the quality information modulation Mamba state update process according to a specific embodiment of the present invention; Figure 5 This is a schematic diagram illustrating different state update paths under high-quality and low-quality fragments according to a specific embodiment of the present invention; Figure 6 This is a schematic diagram illustrating the system deployment for long-term ECG monitoring using dynamic patch, according to a specific embodiment of the present invention. Detailed Implementation
[0048] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.
[0049] Implementation Method 1: Overall Architecture See Figure 1 The quality-aware dynamic ECG Mamba state update method of the present invention generally includes the following steps: S101, acquire long ECG sequences in dynamic monitoring scenarios; S102, obtain the signal quality index, motion state information and preprocessing confidence level corresponding to the long ECG sequence; S103, input the long ECG sequence into the Mamba state space to model the backbone network; S104, the signal quality index, motion state information and preprocessing confidence are input into the quality control branch to generate a state modulation signal; S105, modulates the state writing, state forgetting or state propagation of the Mamba backbone network at various time locations using state modulation signals. S106 outputs dynamic ECG event detection or abnormality classification results based on the modulated timing representation.
[0050] This embodiment is widely applicable and suitable for long-term dynamic electrocardiogram data acquired by single-lead, multi-lead, patch, chest strap, or other continuous ECG devices.
[0051] Implementation Method 2: Acquisition of Dynamic Electrocardiogram Signals and Quality Information See Figure 2 In this embodiment, the method of Implementation Method 1 can be used, except that, unlike Implementation Method 1, the input data includes at least one or more of the following categories: 1. Long-term dynamic electrocardiogram (ECG) sequence, denoted as:
[0052] Where T is the sequence length, x t The ECG sample value or pre-feature representation at time t.
[0053] 2. Signal quality index, denoted as:
[0054] Where, q t This represents the signal quality score at time t or the corresponding time window. It can be generated based on one or more of the following factors: R-peak detectability; short-time signal-to-noise ratio; baseline drift; high-frequency interference level; heartbeat morphology consistency; lead contact status; and artifact assessment value.
[0055] 3. Motion state information, denoted as:
[0056] Where, m t It can be derived from an IMU sensor and may include any one or more of the following: triaxial acceleration; triaxial angular velocity; motion intensity; attitude change rate; impact event indication; activity state category.
[0057] 4. Preprocessing confidence level, denoted as:
[0058] in, The reliability of the preprocessing result at time t can be estimated by the difference between the signal before and after filtering, reconstruction error, shape preservation, noise suppression stability, or uncertainty of the preprocessing network.
[0059] Before entering the model, the above-mentioned signals can be synchronized and resampled to be unified to the same time reference.
[0060] Implementation Method 3: Mamba Backbone Network In this embodiment, the same method and input data as in Embodiment 1 can be used. The difference from Embodiment 1 is that a Mamba backbone network based on a selective state-space model is further used to model the dynamic long ECG sequence.
[0061] Suppose that the input, after encoding and mapping, yields:
[0062] in, For the input embedding or local feature extraction function, x t The dynamic ECG sample value at time t (corresponding to the dynamic ECG long sequence) e t Indicates input x t The feature vector obtained after encoding and mapping.
[0063] The Mamba backbone network maintains an internal state at each time point to capture long-range dependencies in the sequence.
[0064] Traditional state updates can be abstractly represented as:
[0065] However, traditional methods assume that the contribution of the current input to the state update is implicitly determined by the network, without considering the quality change characteristics of dynamic electrocardiogram signals. Therefore, this invention introduces a quality control branch, which is described in detail in Implementation Method Four below.
[0066] Implementation Method Four: Quality Control Branch See Figure 3 In this embodiment, the other parts are the same as in embodiments one, two, and three. The difference is that in this fourth embodiment, a quality control branch running parallel to the Mamba backbone network is set up. This branch receives the following input: the signal quality index q at the current moment. t The motion state information m at the current moment t ; Preprocessing confidence level at the current moment Optionally, it can also receive the input feature e at the current time. t .
[0067] The quality control branch outputs control quantities for state modulation, such as: write control quantity u. t Forgetting control factor f t ; Optional propagation control quantity p t .
[0068] The technical meanings of these physical quantities are the same as those mentioned above.
[0069] In this fourth embodiment, more preferably, in one instance, the write control variable and the forget control variable can be expressed as:
[0070] in, It is the Sigmoid activation function. Indicates time The signal quality index, Indicates time The motion state information, Indicates time The preprocessing confidence level, This indicates a concatenation operation based on channel dimensions or feature dimensions. and This represents the learnable mapping parameter matrix. and This represents the corresponding bias term vector.
[0071] When q t low, m t Indicates vigorous physical movement, and At low levels, the model can reduce u t , improve f t This reduces unreliable inputs entering the state and accelerates its forgetting; when q t height, m t Stable and At high speeds, the model can improve u t , reduce f t This enhances the preservation of effective physiological signals.
[0072] Implementation Method 5: Quality Modulation State Update See Figure 4 In this embodiment, the other parts are the same as in embodiments one, two, three, and four. The difference is that in this embodiment five, the state update takes the following form:
[0073] in: s t Indicates the current state; s t-1 Indicates the state at the previous moment; Represents the input feature mapping; u t Indicates write control quantity; f t This indicates the amount of forgetting control.
[0074] In a further preferred embodiment, a propagation control variable may be introduced to adjust the influence of the current state on subsequent outputs or deeper state space modules, for example:
[0075] Among them, o t p represents the output feature. t Indicates the amount of transmission control. It represents Hadamaji. Indicates the output mapping function, s t It represents the state characteristics at the current moment (such as the internal state of Mamba, the merged characteristics after splicing, etc.).
[0076] The following explains the engineering of state updates after the introduction of propagation control variables. This mechanism is equivalent to adding a layer of "quality conditionalization valves" to Mamba state updates: Write gate: determines whether the current input value is worth writing; Forget gate: determines how much of the existing state should be retained; Propagation gate: determines how much of the current state value should be propagated backward. Thus, low-quality, artifact-prone, and unreliable preprocessed segments in dynamic ECGs will not be indiscriminately included in long-term memory like high-quality stable segments.
[0077] Implementation Method Six: Segmented Threshold Control See Figure 5 In this sixth embodiment, the other parts are the same as the previous five embodiments. More preferably, in this sixth embodiment, a segmented threshold strategy is added to achieve more engineering-interpretable quality control.
[0078] Let the SQI threshold be θq, the preprocessing confidence threshold be θz, and the motion intensity threshold be θm. Then at certain times: If q t <θq or z t pre If the value is less than θz, then reduce the write control amount; If m t If the value is greater than θm, then the amount of forgetting control is increased; If q t ≧θq and z t pre ≧θz and m t If ≤θm, then the write is enhanced and the state is retained.
[0079] For example, it can be defined as:
[0080] in, For quality fusion coefficient, u t For the original write control value, u t ′ represents the updated write control value, f t f is the original forgetting control factor. t ′ represents the updated forgetting control level. This is an additional forgetting enhancement.
[0081] In one embodiment, the quality fusion coefficient can be generated by the following function:
[0082] Where a, b, c, and d are learnable or preset parameters. The activation function is q (in this embodiment, it is Sigmoid, which constrains the output to [0,1]). t Let m be the SQI (Signal Quality Index) at time t. tLet be the intensity of motion at time t. Let be the preprocessing confidence level at time t.
[0083] Implementation Method Seven: Specific Application Scenarios See Figure 6 The following uses dynamic patch ECG 24-hour monitoring as an example to illustrate the application and deployment of this invention.
[0084] Scene settings ECG sampling rate: 250Hz; IMU sampling rate: 100Hz; Monitoring duration: 24 hours; Objectives: Detection of atrial fibrillation and premature ventricular contractions; Preprocessing module: used to remove baseline drift and power frequency noise, and output preprocessing confidence score; Backbone model: One-layer convolutional coding + multi-layer Mamba long sequence modeling network.
[0085] Execution process Acquire 24-hour raw ECG waveforms; SQI calculation based on ECG segments; IMU-based calculation of body dynamics intensity and motion state; The preprocessing module obtains the clean waveform and its corresponding preprocessing confidence level; Synchronize ECG, SQI, IMU, and preprocessing confidence levels over time; Encode the ECG and input it into the Mamba backbone network; Input SQI, IMU and preprocessing confidence into the quality control branch to generate write control and forget control variables; Update the status at each time point based on the quality control parameters; Output the probability of atrial fibrillation, premature ventricular contraction (PVC) label, or other abnormality categories.
[0086] Technical effect examples When a user is in a period of intense activity, the IMU indicates increased body motion and decreased SQI. The quality control branch reduces the amount of writing, making it less likely for body motion artifacts to enter a long-term state. When the user enters the resting phase, the SQI increases, the preprocessing confidence is high, and the state of the model-enhanced effective physiological waveform is preserved. When some preprocessing results are unstable, even if the surface waveform is relatively smooth, the model will reduce its long-term memory dependence on that segment due to low confidence.
[0087] Implementation Method 8: Training Phase Example In this preferred embodiment eight, the other parts are the same as in the previous embodiments one to seven, but a further quality consistency constraint is introduced during the training phase, which makes the state control branch learn "which segments are worth remembering" more stably.
[0088] In this preferred embodiment, during the training phase of the state-space sequence modeling network, an auxiliary loss function guided by quality labels is introduced. The quality control branch is subjected to joint supervised training, and the auxiliary loss function... It must satisfy the following form:
[0089] in, This represents the total temporal length of a long electrocardiogram (ECG) sequence. and This represents the actual write control amount and forget control amount predicted by the model. and This represents the true reference control target obtained by heuristically mapping prior labels based on the signal quality index, motion state information, and preprocessed confidence levels. express The square of the norm.
[0090] In a further preferred embodiment, stronger supervision can be set for high-quality segments during training, while robust loss or weak supervision constraints can be set for low-quality segments.
[0091] Implementation Method Nine: Device Example In this ninth embodiment, a quality-aware dynamic ECG Mamba state update device is also provided, comprising: The acquisition module is configured to acquire long ECG sequences in dynamic monitoring scenarios, as well as the signal quality index, motion state information, and preprocessing confidence level that are synchronously aligned with them. The encoding module is configured to perform feature space encoding mapping on the dynamic long ECG sequence to generate an input feature vector; The quality control module is configured to input the signal quality index, motion state information and preprocessing confidence into a dedicated control branch to generate a state control signal for intervening in the evolution of the main state. The state adaptive modulation module is configured to dynamically adjust the state write intensity and state forget intensity of the backbone Mamba network at each time point based on the state control signal. The inference output module is configured to perform clinical decisions and output at least one of dynamic electrocardiogram event detection results, rhythm recognition results, or abnormal classification results based on the modulated updated state representation.
[0092] This device can be used to implement the methods of embodiments one through nine.
[0093] Implementation Method 10: Electronic Device Example In this tenth embodiment, an electronic device is also provided, comprising: At least one processor; Memory; Computer programs stored in the memory.
[0094] When the processor executes the computer program, it implements the dynamic ECG quality sensing Mamba state update method in any of the above embodiments.
[0095] Implementation Method Eleven: Storage Medium Example The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, it implements the dynamic ECG quality sensing Mamba state update method in any of the above embodiments.
[0096] In summary, the present invention has been described in detail through specific embodiments. However, those skilled in the art will understand that the description is exemplary and that the present invention can be modified and changed in various ways. As long as these modifications and changes do not depart from the spirit and purpose of the present invention, they should all fall within the protection scope of the present invention, which is defined by the appended claims.
Claims
1. A quality-aware dynamic electrocardiogram Mamba state updating method, acquiring a long electrocardiogram sequence in a dynamic monitoring scene, and acquiring a signal quality index, motion state information and preprocessing confidence corresponding to the long electrocardiogram sequence, characterized in that, include: In dynamic monitoring scenarios, the acquired signal quality index, motion state information, and preprocessed confidence scores corresponding to the long ECG sequence are input into the quality control branch of the state space sequence modeling network. The write control quantity and forget control quantity at the current time position are calculated and output through the quality control branch to adaptively modulate the state write intensity and state forget intensity inside the state space sequence modeling network. Based on the modulated state update results, a dynamic ECG long-term feature representation is generated, and based on the long-term feature representation, at least one of the following is output: dynamic ECG event detection result, rhythm recognition result, or abnormal classification result.
2. The method of claim 1, wherein, The state-space sequence modeling network is a Mamba network or a sequence modeling network based on a selective state-space model.
3. The method as described in claim 1, characterized in that, The quality control branch generates the corresponding control quantity based on at least one of the following information: The signal quality index (SQI) is generated based on the physiological rationality analysis of electrocardiogram waveforms. Indicators of body motion intensity, attitude change, or physical motion state acquired and derived from inertial measurement units (IMUs). The confidence, uncertainty, or fidelity index of the output result calculated by the preprocessing module.
4. The method as described in claim 1, characterized in that, The state update in the adaptive modulation process satisfies the following form: , wherein s t denotes the network internal hidden state at time t, s t-1 denotes the network internal hidden state at the previous time t-1, e t denotes the input feature at time t, denotes a non-linear mapping function, denotes an element-wise multiplication operator, u t denotes the write control quantity, f t denotes the forget control quantity, and u t and f t are output by or modulated by a quality control branch.
5. The method as described in claim 4, characterized in that, The write control quantity With the forgetting control quantity The solution satisfies the following form: , in, The sigmoid activation function is q. t The signal quality index at time t, m t This represents the motion state information at time t. This represents the preprocessing confidence level at time t. W represents the concatenation operation of channel dimension or feature dimension. u W f Let b represent the learnable mapping parameter matrix. u b f This represents the corresponding bias term vector.
6. The method as described in claim 5, characterized in that, The following physical shielding control logic is implemented through the aforementioned adaptive modulation: When the signal quality index is lower than the first quality threshold, the motion state information represents violent body movement, or the preprocessing confidence level is lower than the first confidence threshold, the write control quantity is reduced. The value or increase the forgetting control amount The value is used to suppress interference noise at the current time position and preprocess uncertain information to write into the hidden state inside the network; When the signal quality index is higher than the second quality threshold, the motion state is stable, and the preprocessing confidence level is higher than the second confidence threshold, the write control quantity is increased. The value or reduction of the forgetting control quantity The values are used to enhance the accumulation and retention of effective electrophysiological characteristics in the hidden state within the network.
7. The method as described in claim 1, characterized in that, During the training phase of the state-space sequence modeling network, an auxiliary loss function guided by quality labels is introduced. The quality control branch is subjected to joint supervised training, and the auxiliary loss function... It must satisfy the following form: , in, This represents the total temporal length of a long electrocardiogram (ECG) sequence. and This represents the actual write control amount and forget control amount predicted by the model. and This represents the true reference control target obtained by heuristically mapping prior labels based on the signal quality index, motion state information, and preprocessed confidence levels. express The square of the norm.
8. A quality-aware dynamic ECG Mamba state update device, comprising: The acquisition module is configured to acquire long ECG sequences and their corresponding signal quality indices, motion state information, and preprocessing confidence levels in dynamic monitoring scenarios. The encoding module is configured to perform feature space encoding mapping on the dynamic long ECG sequence to generate an input feature vector; The quality control module is configured to input the signal quality index, motion state information and preprocessing confidence into a dedicated control branch to generate a state control signal for intervening in the evolution of the main state. The state adaptive modulation module is configured to dynamically adjust the state write intensity and state forget intensity of the backbone Mamba network at each time point based on the state control signal. The inference output module is configured to perform clinical decisions and output at least one of dynamic electrocardiogram event detection results, rhythm recognition results, or abnormal classification results based on the modulated updated state representation.
9. An electronic device, comprising: At least one processor; A memory that is communicatively connected to the at least one processor; The computer program stored in the memory, When the processor executes the computer program, it causes the electronic device to perform the dynamic ECG Mamba state update method according to any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements any one of the dynamic electrocardiogram Mamba state update methods of claims 1-7.
Citation Information
Patent Citations
Electrophysiological signal long-time dependence sequence classification system based on state space model Mamba
CN120316566A