An AI-based method and system for electrocardiogram monitoring and data analysis
By combining probabilistic suffix automata and implicit semi-Markov models with reinforcement learning, the modeling challenges of rhythm structure and duration distribution in electrocardiogram (ECG) signals were solved, enabling efficient, accurate, and real-time abnormal rhythm identification of ECG signals, which is applicable to mobile devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING SQUID QUANTUM TECH
- Filing Date
- 2025-12-10
- Publication Date
- 2026-06-30
AI Technical Summary
Existing ECG analysis methods are unable to effectively model the rhythm structure and duration distribution characteristics across ECG signals, lacking structured symbolic representation mechanisms and explicit modeling of state duration, which affects the accuracy of rhythm state recognition and intelligent decision-making capabilities.
The transition structure of ECG symbol states is modeled using a probabilistic suffix automaton model, and the rhythm duration distribution is constructed by combining a hidden semi-Markov model. Real-time identification and strategy optimization are achieved through a joint scoring mechanism and reinforcement learning strategy, realizing joint modeling and intelligent analysis of rhythm structure and duration in ECG signals.
It improves the accuracy and robustness of ECG signal rhythm recognition, is suitable for recognizing complex and variable heart rhythms, and has the advantages of strong real-time performance, good interpretability and embeddable implementation, making it suitable for deployment on mobile or edge devices.
Smart Images

Figure CN121302214B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to an AI-based method and system for electrocardiogram monitoring and data analysis. Background Technology
[0002] With the development of wearable devices and home healthcare systems, rhythm monitoring based on continuous electrocardiogram (ECG) signals has become an important means of early screening for arrhythmias and management of chronic diseases. Current mainstream ECG analysis methods mostly employ traditional machine learning or deep learning models based on convolutional neural networks and recurrent neural networks, focusing on local tasks such as heartbeat classification, waveform segmentation, or rhythm recognition. These methods often rely on static feature extraction or short-term window recognition, making it difficult to effectively model the rhythm structure and duration distribution characteristics across ECG signals. Especially when dealing with arrhythmias with significant rhythm variations, such as atrial fibrillation and supraventricular tachycardia, their ability to perceive rhythm continuity and trends is insufficient.
[0003] Existing methods lack effective means of representation for symbolic modeling, failing to encode continuous cardiac rhythm features into interpretable symbolic representations. This hinders subsequent state modeling and reasoning. Even though some studies have introduced Markov models to model rhythm state transitions, most employ first-order state assumptions and lack mechanisms for modeling state dwell time, making it difficult to characterize key timescale variations in ECG rhythms and limiting the algorithm's sensitivity and discriminative power to rhythm anomalies. On the other hand, while some recent studies have begun exploring ECG anomaly recognition strategies based on reinforcement learning, these typically decouple strategy training from rhythm feature modeling, lacking a mechanism for joint feedback from rhythm structure and duration features. This results in the strategy optimization process failing to fully perceive multi-scale abnormal features, impacting recognition accuracy and system stability.
[0004] Existing technologies still face the following challenges in ECG rhythm analysis: First, the lack of a structured symbolic representation mechanism makes it difficult to uniformly represent the morphological evolution of the ECG cycle; second, the lack of explicit modeling of the duration of the state affects the accuracy of rhythm state recognition; and third, reinforcement learning strategies cannot effectively train by integrating rhythm structure and duration information, thus limiting the ability of intelligent decision-making.
[0005] Therefore, how to provide an AI-based method and system for ECG monitoring and data analysis is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0006] One objective of this invention is to propose an AI-based method and system for ECG monitoring and data analysis. This invention employs a probabilistic suffix automaton model to model the transition structure of ECG symbol states, combines a hidden semi-Markov model to construct the rhythm duration distribution, and uses a joint scoring mechanism and reinforcement learning strategy to identify and optimize abnormal rhythms in real time. This achieves joint modeling and intelligent analysis of rhythm structure and duration in ECG signals, possessing advantages such as high recognition accuracy, strong real-time performance, good interpretability, and embeddable implementation.
[0007] According to an embodiment of the present invention, an AI-based electrocardiogram monitoring and data analysis method and system includes the following steps:
[0008] Continuous electrocardiogram (ECG) signals are acquired, filtered, baseline corrected, and heartbeat detected to generate a standardized ECG cycle sequence.
[0009] The electrocardiogram (ECG) cycle sequence is symbolically encoded, and each cycle is mapped to a discrete symbol based on the characteristics of the cycle waveform to obtain the ECG symbol sequence.
[0010] Input the ECG symbol sequence into the probabilistic suffix automaton model, construct the symbol state transition structure, and output the symbol state sequence and its corresponding state transition probability.
[0011] The symbolic state sequence and state transition probability are used as inputs to an implicit semi-Markov model to model the duration distribution of states and output a joint feature vector sequence of states and duration.
[0012] Based on state transition probability and duration distribution information, a joint scoring index within the rhythm window is calculated, and a rhythm identification label and duration consistency score are generated based on the joint scoring index.
[0013] Using the consistency score between the identified label and the duration as feedback information, and combining the joint feature vector sequence of state and duration, the state space, action set and reward function of the reinforcement learning model are constructed.
[0014] The policy function is trained using a state space, a set of actions, and a reward function, and the optimal policy is output through reinforcement learning.
[0015] The optimal strategy is applied to the real-time generated joint feature vector sequence of state and duration, and the strategy decision is executed to output the abnormal heart rhythm alarm result.
[0016] Optional, the generation of standardized ECG cycle sequences includes:
[0017] The acquired continuous electrocardiogram (ECG) signals were subjected to bandpass filtering. The frequency band was selected from 0.5 Hz to 45 Hz. A bidirectional zero-phase finite impulse response (BIF) filter was used to perform frequency domain filtering on the ECG signals and output a filtered signal to suppress high-frequency noise and low-frequency baseline drift.
[0018] The filtered signal is used as input to perform baseline correction processing. A sliding window is set to extract low-frequency trend terms, and the corresponding low-frequency trend terms are removed point by point from the filtered signal on the time axis to generate a baseline correction signal. The baseline correction signal retains the short-term change characteristics of the electrocardiogram waveform for subsequent rhythm detection.
[0019] The baseline correction signal was used for heartbeat detection, and the local waveform energy features were extracted using an integral window. The initial R wave candidate position was identified by combining a dynamic threshold mechanism.
[0020] The initial R-wave candidate position sequence is filtered, and spurious peaks are removed and a standardized ECG cycle sequence is output based on the minimum time interval between adjacent candidate points and the rhythm stability rule.
[0021] Optionally, obtaining the ECG symbol sequence includes:
[0022] The standardized electrocardiogram cycle sequence is subjected to periodic waveform feature extraction. Each cycle is divided into multiple equal-length segments along the time axis. The peak amplitude, mean amplitude, and waveform change trend are extracted as segment feature values in each segment. All segment feature values are combined in sequence to form the periodic feature vector of the corresponding cycle.
[0023] The periodic feature vector is quantized and encoded. Based on the preset amplitude range threshold, each segment feature value is mapped to a discrete level label, resulting in an initial label sequence arranged in segment order, which is used to express the discrete approximate structure of the heartbeat morphology.
[0024] The initial label sequences are structurally classified. An unsupervised clustering algorithm is used to cluster the initial label sequences corresponding to multiple periods. Sequences with similar structures are grouped into the same category. A finite set of symbols is generated based on the clustering results, where each cluster category corresponds to a unique symbol.
[0025] Each initial label sequence is mapped to a corresponding symbol according to its category, generating discrete symbols that correspond one-to-one with the period, ultimately forming a time-ordered ECG symbol sequence.
[0026] Optionally, the generation of the symbol state sequence and its corresponding state transition probabilities includes:
[0027] Input the ECG symbol sequence into the probabilistic suffix automaton model, set the maximum probability suffix length k, and extract historical symbols at each position of the ECG symbol sequence that do not exceed the maximum probability suffix length k to form the probabilistic suffix automaton state suffix set;
[0028] The joint frequency of occurrence of the state suffix set of the statistical probabilistic suffix automaton and the ECG symbol is calculated. The conditional probability of each ECG symbol under each state suffix of the probabilistic suffix automaton is calculated, and the mapping relationship between the probabilistic suffix automaton state and the symbol is formed by the corresponding conditional probability relationship.
[0029] Based on the mapping relationship between the state and symbol of the probabilistic suffix automaton, an initial probabilistic suffix automaton suffix tree structure is constructed. Each unique probabilistic suffix automaton state suffix is mapped to a probabilistic suffix automaton state node, and the corresponding ECG symbol is mapped to a probabilistic suffix automaton symbol state transition edge. The corresponding probabilistic suffix automaton symbol state transition probability is marked on the probabilistic suffix automaton symbol state transition edge.
[0030] Structural compression is performed on the initial probabilistic suffix automaton suffix tree structure. Probabilistic suffix automaton state nodes with the same probabilistic suffix automaton symbol state transition probability distribution are identified and merged to form a unique probabilistic suffix automaton state node, thus constructing a sparse probabilistic suffix automaton symbol state transition structure.
[0031] In the symbolic state transition structure of the probabilistic suffix automaton, the state node of the probabilistic suffix automaton is taken as the symbolic state, and the symbolic state transition edge of the probabilistic suffix automaton and the symbolic state transition probability of the probabilistic suffix automaton are combined to form a directed state transition path, forming a symbolic state transition structure composed of a triplet of probabilistic suffix automaton state node, probabilistic suffix automaton symbolic state transition edge and probabilistic suffix automaton symbolic state transition probability.
[0032] Traverse the ECG symbol sequence, match the directed state transition path of the probabilistic suffix automaton symbol state transition structure step by step, record the matched probabilistic suffix automaton state nodes in chronological order, generate the symbol state sequence, and simultaneously extract the corresponding probabilistic suffix automaton symbol state transition probability sequence.
[0033] Optionally, the output of the joint feature vector sequence of state and duration includes:
[0034] A hidden semi-Markov model with a hierarchical hidden state structure is constructed. The upper hidden state set is set as the waveform pattern state set, and the lower hidden state set is set as the rhythm duration state set. The waveform pattern state represents the morphological category corresponding to the ECG symbol state, and the rhythm duration state represents the duration distribution model under the corresponding morphological category. A many-to-many mapping relationship between the waveform pattern state and the rhythm duration state is established.
[0035] The symbol state sequence output from the probabilistic suffix automaton model is processed to identify state segments consisting of consecutive identical symbol states. The start time, end time, and duration of each state segment are recorded and marked as the observation state interval.
[0036] Based on the symbolic state labels in the observation state interval, generate corresponding waveform pattern state labels, and construct waveform pattern state sequences according to the state transition probability matrix between waveform pattern states.
[0037] For each waveform pattern state label, retrieve its corresponding rhythm duration state set, and extract the duration sample data with the same waveform pattern state and rhythm duration state from the constructed training samples.
[0038] For each set of duration sample data, a duration distribution model from the modeling function family is selected for fitting. The modeling function family includes the log-normal distribution function, the gamma distribution function, and the piecewise linear distribution function. The model parameters are determined by the maximum likelihood estimation method to construct the duration probability distribution of the rhythm duration state.
[0039] During the inference phase, for each observation state interval, the probability distribution function in the set of rhythm duration states that have been modeled under its waveform mode state is called to calculate the probability density value of the actual duration, and the rhythm duration state with the largest probability density value is selected as the inference result of the observation state interval.
[0040] The waveform pattern state, rhythm duration state, actual duration, and duration probability density value of each observation state interval are combined to generate a joint feature vector sequence of state and duration.
[0041] Optionally, the generation of rhythm identification labels and duration consistency scores includes:
[0042] Extract continuous observation state intervals from the joint feature vector sequence of state and duration, and construct a fixed-length rhythm analysis window in chronological order. Each rhythm analysis window contains multiple waveform pattern states and corresponding rhythm duration states.
[0043] For the waveform pattern state sequence within the rhythm analysis window, the state transition path and transition probability defined in the probabilistic suffix automaton symbolic state transition structure are used to match the state jump relationship one by one, and the waveform state score under the current window is accumulated to measure the structural consistency of the sequence.
[0044] For the rhythm duration state sequence within the rhythm analysis window, based on the duration probability distribution function corresponding to each rhythm duration state, the probability density value is calculated for the actual duration of the corresponding observation state interval. All probability density values are statistically aggregated to generate a duration consistency score, which is used to measure the stability of rhythm persistence.
[0045] The obtained waveform state score and duration consistency score are weighted and combined to construct a joint scoring index for the current rhythm analysis window. The joint scoring index is used to simultaneously reflect the rationality of the rhythm structure and the stability of the duration.
[0046] The joint scoring index of the rhythm analysis window is compared with the preset judgment threshold. When the joint scoring index is lower than the threshold, an abnormal rhythm identification label is generated, and when the joint scoring index is higher than the threshold, a normal rhythm identification label is generated.
[0047] Optionally, the construction of the state space, action set, and reward function of the reinforcement learning model includes:
[0048] Extract the waveform pattern state, rhythm duration state, actual duration and corresponding duration probability density value of each observation state interval in the rhythm analysis window, and construct the environmental state set of the reinforcement learning model. Each state is combined in time order to form a state vector sequence, which serves as the state space input of the reinforcement learning model.
[0049] The action set includes three types of actions: maintaining the current rhythm label, modifying the rhythm label, and triggering the alarm flag. Each type of action acts on the label output logic of the current rhythm analysis window. Triggering the alarm flag indicates that the current window has identified a potentially high-risk rhythm.
[0050] A reward function is constructed, which uses the consistency between the rhythm recognition label and the real label as the positive feedback basis. The reward value is constructed by combining the duration consistency score of the rhythm analysis window. The reward function gives a positive reward when the rhythm is correctly identified and the duration score is higher than the threshold, and gives a negative reward when the identification is wrong or the score is lower than the threshold.
[0051] Input the state space, action set, and reward function into the policy optimization module.
[0052] Optionally, the generation of the optimal strategy includes:
[0053] Construct a reinforcement learning policy function, and use the constructed state space, action set, and reward function as the training input for the policy function;
[0054] Initialize the parameters of the policy function, and set the exploration rate, discount factor and learning rate parameters to control the action selection mechanism, long-term expected reward weight and parameter update magnitude during policy training;
[0055] The policy training is performed using a time difference-based method. The historical state sequence is iteratively traversed, the corresponding action is selected according to the current policy, the instantaneous reward value is calculated through the reward function, and the policy function parameters are updated using the policy update rule.
[0056] In each training round, the current state vector of each rhythm analysis window is input into the policy function, and the corresponding policy action is output. The action effect is evaluated based on the actual label and time duration score through an interactive feedback mechanism, and the policy reward is accumulated.
[0057] Continue training the policy until the policy function converges, and output a stable and optimal policy function.
[0058] Optional, including the following modules:
[0059] The signal acquisition module is used to acquire continuous electrocardiogram (ECG) signals and output raw ECG waveform data.
[0060] The signal preprocessing module is used to receive raw ECG waveform data, perform bandpass filtering, baseline correction and heartbeat detection, and output a standardized ECG cycle sequence.
[0061] The symbol encoding module is used to divide the standardized ECG cycle sequence into multiple cycle segments, extract the cycle waveform features and perform discrete quantization mapping to generate the ECG symbol sequence.
[0062] The probabilistic suffix automaton construction module is used to receive ECG symbol sequences, establish the state structure of the probabilistic suffix automaton, and output the symbol state sequence and its state transition probabilities.
[0063] The implicit semi-Markov modeling module is used to receive symbol state sequences and state transition probabilities, construct a two-layer model structure of waveform pattern state and rhythm duration state, and output a joint feature vector sequence of state and duration.
[0064] The joint scoring calculation module is used to calculate waveform state score and duration consistency score within the rhythm analysis window, construct joint scoring index, and generate rhythm identification label and duration consistency score;
[0065] The policy optimization module is used to construct the state space, action set, and reward function of the reinforcement learning model based on the joint feature vector sequence of state and duration and the recognition label, and to train and output the optimal policy function.
[0066] The abnormal alarm module is used to receive the real-time generated joint feature vector sequence of status and duration, call the optimal strategy function to execute the strategy action, and output the abnormal heart rhythm alarm result.
[0067] The beneficial effects of this invention are:
[0068] (1) This invention introduces a probabilistic suffix automaton model to model the state of ECG symbols, which can effectively capture the structural evolution of ECG rhythms. It also combines a hidden semi-Markov model to model the duration of each type of rhythm, thereby achieving joint modeling of symbol structure and duration distribution in ECG data, thus improving the accuracy and robustness of rhythm recognition. It is particularly suitable for the recognition of complex variable rhythms.
[0069] (2) This invention constructs a joint scoring mechanism within the rhythm analysis window, which integrates waveform state transition probability and duration distribution probability density information, effectively quantifying the consistency and stability of rhythm structure, thereby achieving precise discrimination of abnormal rhythms. At the same time, based on reinforcement learning algorithms, a state space, action set, and reward function are constructed to achieve autonomous optimization of the policy function, supporting continuous learning and performance improvement of the model in real monitoring scenarios.
[0070] (3) This invention integrates continuous signal processing, periodic symbol encoding, probabilistic modeling and policy learning modules through a hierarchical structured design, which has strong logical interpretability and model scalability. This method can run efficiently without a large amount of manually labeled data, is suitable for deployment on mobile or edge devices, and can achieve efficient identification, evaluation and alarm of abnormal ECG rhythms, which significantly improves the intelligence level and practicality of remote ECG monitoring. Attached Figure Description
[0071] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0072] Figure 1 This is a flowchart of an AI-based electrocardiogram monitoring and data analysis method and system proposed in this invention;
[0073] Figure 2 This is a flowchart illustrating the construction of a joint feature vector sequence of state and duration in the implicit semi-Markov model of this invention. Detailed Implementation
[0074] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0075] refer to Figures 1-2 An AI-based method and system for electrocardiogram monitoring and data analysis includes the following steps:
[0076] Continuous electrocardiogram (ECG) signals are acquired, filtered, baseline corrected, and heartbeat detected to generate a standardized ECG cycle sequence.
[0077] The electrocardiogram (ECG) cycle sequence is symbolically encoded, and each cycle is mapped to a discrete symbol based on the characteristics of the cycle waveform to obtain the ECG symbol sequence.
[0078] Input the ECG symbol sequence into the probabilistic suffix automaton model, construct the symbol state transition structure, and output the symbol state sequence and its corresponding state transition probability.
[0079] The symbolic state sequence and state transition probability are used as inputs to an implicit semi-Markov model to model the duration distribution of states and output a joint feature vector sequence of states and duration.
[0080] Based on state transition probability and duration distribution information, a joint scoring index within the rhythm window is calculated, and a rhythm identification label and duration consistency score are generated based on the joint scoring index.
[0081] Using the consistency score between the identified label and the duration as feedback information, and combining the joint feature vector sequence of state and duration, the state space, action set and reward function of the reinforcement learning model are constructed.
[0082] The policy function is trained using a state space, a set of actions, and a reward function, and the optimal policy is output through reinforcement learning.
[0083] The optimal strategy is applied to the real-time generated joint feature vector sequence of state and duration, and the strategy decision is executed to output the abnormal heart rhythm alarm result.
[0084] In this embodiment, the generation of a standardized electrocardiogram cycle sequence includes:
[0085] The acquired continuous electrocardiogram (ECG) signals were subjected to bandpass filtering. The frequency band was selected from 0.5 Hz to 45 Hz. A bidirectional zero-phase finite impulse response (BIF) filter was used to perform frequency domain filtering on the ECG signals and output a filtered signal to suppress high-frequency noise and low-frequency baseline drift.
[0086] The filtered signal is used as input to perform baseline correction processing. A sliding window is set to extract low-frequency trend terms, and the corresponding low-frequency trend terms are removed point by point from the filtered signal on the time axis to generate a baseline correction signal. The baseline correction signal retains the short-term change characteristics of the electrocardiogram waveform for subsequent rhythm detection.
[0087] The baseline correction signal was used for heartbeat detection, and the local waveform energy features were extracted using an integral window. The initial R wave candidate position was identified by combining a dynamic threshold mechanism.
[0088] The initial R-wave candidate location sequence is filtered, and spurious peaks are removed and a standardized ECG cycle sequence is output based on the minimum time interval between adjacent candidate points and the rhythm stability rule.
[0089] The bidirectional zero-phase finite impulse response (FIR) filter is a digital filtering method. Its implementation involves sequentially applying forward and reverse FIR filtering to the input signal to eliminate the time delay introduced by the filter's phase response. This filter employs a linear phase structure to ensure that the signal waveform remains undistorted before and after filtering. In implementation, the original signal is first forward-filtered using the FIR filter. Then, the result is inverted on the time axis and the same filter is applied in reverse. Finally, the results of the two filtering processes are inverted on the time axis to restore the original signal, resulting in a zero-phase-distortion filtered signal. This method is commonly used in ECG signal processing to preserve key features such as the QRS complex while effectively suppressing electromyographic interference, power line interference, and low-frequency baseline drift. The filter parameters can be set to specific passband frequencies and filter orders according to bandpass requirements.
[0090] In this embodiment, obtaining the ECG symbol sequence includes:
[0091] The standardized electrocardiogram cycle sequence is subjected to periodic waveform feature extraction. Each cycle is divided into multiple equal-length segments along the time axis. The peak amplitude, mean amplitude, and waveform change trend are extracted as segment feature values in each segment. All segment feature values are combined in sequence to form the periodic feature vector of the corresponding cycle.
[0092] The periodic feature vector is quantized and encoded. Based on the preset amplitude range threshold, each segment feature value is mapped to a discrete level label, resulting in an initial label sequence arranged in segment order, which is used to express the discrete approximate structure of the heartbeat morphology.
[0093] The initial label sequences are structurally classified. An unsupervised clustering algorithm is used to cluster the initial label sequences corresponding to multiple periods. Sequences with similar structures are grouped into the same category. A finite set of symbols is generated based on the clustering results, where each cluster category corresponds to a unique symbol.
[0094] Each initial label sequence is mapped to a corresponding symbol according to its category, generating discrete symbols that correspond one-to-one with the period, and finally forming a time-ordered ECG symbol sequence.
[0095] The preset amplitude interval threshold refers to multiple non-overlapping numerical intervals defined based on the statistical distribution of feature values in each segment of the standardized electrocardiogram cycle sequence. These intervals are used to map continuous feature values to discrete level labels. This threshold can be set by clustering, quantile analysis, or equally spaced division of a large number of cycle features in the training samples. For example, the normalized amplitude range [0,1] can be divided into several intervals, each corresponding to a discrete level. Feature values falling within a certain threshold interval are assigned the corresponding label number for that interval, thus achieving feature value discretization.
[0096] In this embodiment, the generation of the symbol state sequence and its corresponding state transition probabilities includes:
[0097] Input the ECG symbol sequence into the probabilistic suffix automaton model, set the maximum probability suffix length k, and extract historical symbols at each position of the ECG symbol sequence that do not exceed the maximum probability suffix length k to form the probabilistic suffix automaton state suffix set;
[0098] The joint frequency of occurrence of the state suffix set of the statistical probabilistic suffix automaton and the ECG symbol is calculated. The conditional probability of each ECG symbol under each state suffix of the probabilistic suffix automaton is calculated, and the mapping relationship between the probabilistic suffix automaton state and the symbol is formed by the corresponding conditional probability relationship.
[0099] Based on the mapping relationship between the state and symbol of the probabilistic suffix automaton, an initial probabilistic suffix automaton suffix tree structure is constructed. Each unique probabilistic suffix automaton state suffix is mapped to a probabilistic suffix automaton state node, and the corresponding ECG symbol is mapped to a probabilistic suffix automaton symbol state transition edge. The corresponding probabilistic suffix automaton symbol state transition probability is marked on the probabilistic suffix automaton symbol state transition edge.
[0100] Structural compression is performed on the initial probabilistic suffix automaton suffix tree structure. Probabilistic suffix automaton state nodes with the same probabilistic suffix automaton symbol state transition probability distribution are identified and merged to form a unique probabilistic suffix automaton state node, thus constructing a sparse probabilistic suffix automaton symbol state transition structure.
[0101] In the symbolic state transition structure of the probabilistic suffix automaton, the state node of the probabilistic suffix automaton is taken as the symbolic state, and the symbolic state transition edge of the probabilistic suffix automaton and the symbolic state transition probability of the probabilistic suffix automaton are combined to form a directed state transition path, forming a symbolic state transition structure composed of a triplet of probabilistic suffix automaton state node, probabilistic suffix automaton symbolic state transition edge and probabilistic suffix automaton symbolic state transition probability.
[0102] Traverse the ECG symbol sequence, match the directed state transition path of the probabilistic suffix automaton symbol state transition structure step by step, record the matched probabilistic suffix automaton state nodes in chronological order, generate the symbol state sequence, and simultaneously extract the corresponding probabilistic suffix automaton symbol state transition probability sequence.
[0103] In this embodiment, the output of the joint feature vector sequence of state and duration includes:
[0104] A hidden semi-Markov model with a hierarchical hidden state structure is constructed. The upper hidden state set is set as the waveform pattern state set, and the lower hidden state set is set as the rhythm duration state set. The waveform pattern state represents the morphological category corresponding to the ECG symbol state, and the rhythm duration state represents the duration distribution model under the corresponding morphological category. A many-to-many mapping relationship between the waveform pattern state and the rhythm duration state is established.
[0105] The symbol state sequence output from the probabilistic suffix automaton model is processed to identify state segments consisting of consecutive identical symbol states. The start time, end time, and duration of each state segment are recorded and marked as the observation state interval.
[0106] Based on the symbolic state labels in the observation state interval, generate corresponding waveform pattern state labels, and construct waveform pattern state sequences according to the state transition probability matrix between waveform pattern states.
[0107] For each waveform pattern state label, retrieve its corresponding rhythm duration state set, and extract the duration sample data with the same waveform pattern state and rhythm duration state from the constructed training samples.
[0108] For each set of duration sample data, a duration distribution model from the modeling function family is selected for fitting. The modeling function family includes the log-normal distribution function, the gamma distribution function, and the piecewise linear distribution function. The model parameters are determined by the maximum likelihood estimation method to construct the duration probability distribution of the rhythm duration state.
[0109] To construct the probability distribution of duration of rhythm duration states, a probability density model with parameterized expressive power is used to model the labeled duration sample set. To improve the model's generalization ability and adaptability to the diversity of ECG rhythms, the gamma distribution is used as an example:
[0110] The probability density function of the gamma distribution is expressed as follows:
[0111] ;
[0112] in, This represents the actual duration of a single electrocardiographic rhythm state in the sample. The shape parameter of the gamma distribution controls the degree of skewness of the distribution. The scale parameter of the gamma distribution determines the degree of stretching in the distribution. The gamma function is used for normalization purposes to ensure that the integral of the probability density function is 1.
[0113] For a sample set under a certain rhythm duration state { }, construct its log-likelihood function as follows:
[0114] ;
[0115] The maximum likelihood estimation method aims to find a set of optimal parameters that maximize the log-likelihood function. Numerical optimization methods are used to estimate the log-likelihood function with respect to... and The partial derivatives are solved, and the optimal estimate is obtained by using optimization algorithms such as Newton-Raphson iteration and quasi-Newton method. This parameter has a direct control effect on the kurtosis, width and skewness of the final probability density function.
[0116] During the inference phase, for each observation state interval, the probability distribution function in the set of rhythm duration states that have been modeled under its waveform mode state is called to calculate the probability density value of the actual duration, and the rhythm duration state with the largest probability density value is selected as the inference result of the observation state interval.
[0117] In the inference stage of the implicit semi-Markov model, to avoid performing full probability density calculations for all rhythm duration states, a "candidate state pre-screening mechanism" based on observations is introduced. By analyzing the historical joint distribution of waveform mode states and durations, only the rhythm duration states with the top 90% cumulative contribution of the probability quality function under the current waveform mode are retained, significantly compressing the inference space. For low-frequency states, a fixed-mean interpolation method is used to approximate the probability density values, further reducing the computational load.
[0118] The waveform pattern state, rhythm duration state, actual duration and duration probability density value of each observation state interval are combined to generate a joint feature vector sequence of state and duration.
[0119] The constructed training samples refer to the symbol state sequence output by the probabilistic suffix automaton model during the modeling stage of the hidden semi-Markov model. The samples are divided into continuous intervals with the same symbol state, and the symbol state label, start position, end position and corresponding duration of each interval are recorded. These sample sets with clear labels and observation durations are used to construct a joint labeled dataset of waveform pattern state and rhythm duration state.
[0120] Determining model parameters using the maximum likelihood estimation method involves selecting a specific duration distribution model from the training samples for a given rhythm duration state, constructing the likelihood function of that model, which reflects the joint probability of observing all sample data under given parameter conditions; then, the likelihood function is subjected to extreme value processing, and the parameter combination that maximizes the overall sample likelihood value is selected as the optimal parameter estimate of the model, thereby completing the probability distribution modeling of that rhythm duration state.
[0121] In this embodiment, the generation of rhythm identification tags and duration consistency scores includes:
[0122] Extract continuous observation state intervals from the joint feature vector sequence of state and duration, and construct a fixed-length rhythm analysis window in chronological order. Each rhythm analysis window contains multiple waveform pattern states and corresponding rhythm duration states.
[0123] For the waveform pattern state sequence within the rhythm analysis window, the state transition path and transition probability defined in the probabilistic suffix automaton symbolic state transition structure are used to match the state jump relationship one by one, and the waveform state score under the current window is accumulated to measure the structural consistency of the sequence.
[0124] The waveform state score in the rhythm analysis window is calculated using the state transition probabilities defined in the probabilistic suffix automaton model. This is applied to adjacent state pairs within the temporally ordered sequence of symbol states within the window. Retrieve the corresponding state transition probability from the probabilistic suffix automaton model. The logarithmic values are then summed to obtain the waveform state score. :
[0125] ;
[0126] in, This represents the number of state transitions within the rhythm analysis window. This is the current state node. This will become the successor state node;
[0127] For the rhythm duration state sequence within the rhythm analysis window, based on the duration probability distribution function corresponding to each rhythm duration state, the probability density value is calculated for the actual duration of the corresponding observation state interval. All probability density values are statistically aggregated to generate a duration consistency score, which is used to measure the stability of rhythm persistence.
[0128] The duration consistency score within the rhythm analysis window is obtained based on the duration probability distribution established in the implicit semi-Markov model, which is the actual duration of each observed state interval within the window. Call the duration probability density function of its corresponding rhythm duration state. The duration consistency score is obtained by taking the arithmetic mean of all probability density values. The calculation method is as follows:
[0129] ;
[0130] The obtained waveform state score and duration consistency score are weighted and combined to construct a joint scoring index for the current rhythm analysis window. The joint scoring index is used to simultaneously reflect the rationality of the rhythm structure and the stability of the duration.
[0131] A joint scoring index for rhythm analysis windows is constructed using a linear weighting method. The calculation method is as follows:
[0132] ;
[0133] Among them, weight parameters and satisfy This is used to control the contribution of structural score and duration score in the joint score, and both values range from 0 to 1.
[0134] The joint scoring index of the rhythm analysis window is compared with a preset judgment threshold. When the joint scoring index is lower than the threshold, an abnormal rhythm identification label is generated. When the joint scoring index is higher than the threshold, a normal rhythm identification label is generated. The rhythm identification label is associated with the joint scoring index and duration consistency score of the window and output.
[0135] The determination of whether a rhythm is abnormal is based on a joint scoring index and a preset judgment threshold. The comparison results are used to set a preset judgment threshold. Based on the statistical distribution of the joint scoring index of normal rhythm samples in the training set, the 5th percentile is used as the judgment threshold to distinguish between normal rhythm identification labels and abnormal rhythm identification labels. When the joint scoring index is less than the preset judgment threshold... When the rhythm corresponding to the window is abnormal, the joint scoring index is not less than the preset judgment threshold. At that time, the rhythm corresponding to that window is marked as normal;
[0136] The probability distribution function for the duration corresponding to each rhythm duration state refers to constructing a probability density function that describes the statistical characteristics of the ECG rhythm duration under each rhythm duration state defined in the implicit semi-Markov model. This distribution function is obtained by collecting and modeling duration samples of the same rhythm duration state from historical ECG data. The function type selected can include log-normal distribution, gamma distribution, or other empirically fitted distributions, and the distribution parameters are fitted using the maximum likelihood estimation method. During the inference phase, this function is used to calculate the probability density value of the currently observed rhythm duration under its corresponding state, thus providing a quantitative basis for duration consistency.
[0137] In this embodiment, the construction of the state space, action set, and reward function of the reinforcement learning model includes:
[0138] Extract the waveform pattern state, rhythm duration state, actual duration and corresponding duration probability density value of each observation state interval in the rhythm analysis window, and construct the environmental state set of the reinforcement learning model. Each state is combined in time order to form a state vector sequence, which serves as the state space input of the reinforcement learning model.
[0139] The action set includes three types of actions: maintaining the current rhythm label, modifying the rhythm label, and triggering the alarm flag. Each type of action acts on the label output logic of the current rhythm analysis window. Triggering the alarm flag indicates that the current window has identified a potentially high-risk rhythm.
[0140] A reward function is constructed, which uses the consistency between the rhythm recognition label and the real label as the positive feedback basis. The reward value is constructed by combining the duration consistency score of the rhythm analysis window. The reward function gives a positive reward when the rhythm is correctly identified and the duration score is higher than the threshold, and gives a negative reward when the identification is wrong or the score is lower than the threshold.
[0141] The state space, action set, and reward function are input into the policy optimization module, and the policy function is iteratively learned using reinforcement learning policy training methods. The policy function is used to maximize the expected cumulative reward.
[0142] In this embodiment, the generation of the optimal strategy includes:
[0143] A reinforcement learning policy function is constructed, and the constructed state space, action set and reward function are used as the training input of the policy function. The state space consists of a sequence of state vectors from multiple rhythm analysis windows, the action set includes the maintenance, modification and output of rhythm labels and alarm flags, and the reward function is used to evaluate the result feedback of the policy behavior.
[0144] Initialize the parameters of the policy function, and set the exploration rate, discount factor and learning rate parameters to control the action selection mechanism, long-term expected reward weight and parameter update magnitude during policy training;
[0145] In the training process of reinforcement learning strategies, to ensure the convergence stability and policy exploration capability of the model, key hyperparameters need to be reasonably set, including the exploration rate, discount factor, and learning rate. The exploration rate controls the probability of the agent choosing a non-optimal action during training. It is initially set to 0.9 and gradually reduced using an exponential decay strategy, with a minimum value set to 0.05 to avoid the policy getting trapped in local optima. The discount factor balances the importance of current rewards and future rewards and is set to 0.98 to ensure the model responds well to long-term gains. The learning rate determines the magnitude of parameter updates in each training round. It is initially set to 0.001 and adaptively adjusted based on gradient variance; for example, the Adam optimizer can be used to dynamically adjust the learning rate during training. These parameter values were obtained through cross-validation on multiple real-world ECG datasets and effectively support the training convergence and generalization capabilities of the reinforcement learning strategy, ensuring the accuracy and timeliness of the final abnormal rhythm recognition results.
[0146] The policy training is performed using a time difference-based method. The historical state sequence is iteratively traversed, the corresponding action is selected according to the current policy, the instantaneous reward value is calculated through the reward function, and the policy function parameters are updated using the policy update rule.
[0147] In each training round, the current state vector of each rhythm analysis window is input into the policy function, and the corresponding policy action is output. The action effect is evaluated based on the actual label and time duration score through an interactive feedback mechanism, and the policy reward is accumulated.
[0148] Continue training the policy until the policy function converges, and output a stable and optimal policy function.
[0149] Policy update rules refer to specific methods used in reinforcement learning training to adjust policy function parameters to optimize decision performance. In the temporal difference learning framework, this rule is based on the difference between the immediate reward obtained from the action taken in the current state and the predicted value of the next state, i.e., the temporal difference error, to progressively modify the policy function. The parameters of the policy function are adjusted in the direction that increases the expected cumulative reward, and the update amount is controlled by the learning rate. This process is usually combined with action selection mechanisms such as greedy policies or soft policies to achieve iterative optimization of the policy function round by round, ultimately causing the policy function to converge to the action distribution that performs best under the given environment model.
[0150] This embodiment includes the following modules:
[0151] The signal acquisition module is used to acquire continuous electrocardiogram (ECG) signals and output raw ECG waveform data.
[0152] The signal preprocessing module is used to receive raw ECG waveform data, perform bandpass filtering, baseline correction and heartbeat detection, and output a standardized ECG cycle sequence.
[0153] The symbol encoding module is used to divide the standardized ECG cycle sequence into multiple cycle segments, extract the cycle waveform features and perform discrete quantization mapping to generate the ECG symbol sequence.
[0154] The probabilistic suffix automaton construction module is used to receive ECG symbol sequences, establish the state structure of the probabilistic suffix automaton, and output the symbol state sequence and its state transition probabilities.
[0155] The implicit semi-Markov modeling module is used to receive symbol state sequences and state transition probabilities, construct a two-layer model structure of waveform pattern state and rhythm duration state, and output a joint feature vector sequence of state and duration.
[0156] The joint scoring calculation module is used to calculate waveform state score and duration consistency score within the rhythm analysis window, construct joint scoring index, and generate rhythm identification label and duration consistency score;
[0157] The policy optimization module is used to construct the state space, action set, and reward function of the reinforcement learning model based on the joint feature vector sequence of state and duration and the recognition label, and to train and output the optimal policy function.
[0158] The abnormal alarm module is used to receive the real-time generated joint feature vector sequence of status and duration, call the optimal strategy function to execute the strategy action, and output the abnormal heart rhythm alarm result.
[0159] Example 1:
[0160] To verify the feasibility of this invention in practice, it was applied to a continuous cardiac rhythm monitoring system. To improve the ability to identify abnormal rhythms and the accuracy of duration assessment, the AI-based ECG monitoring and data analysis method proposed in this invention was deployed and tested. This method can be used in bedside monitoring, remote monitoring with wearable devices, and data processing scenarios using edge computing devices in conjunction with AI models. It is particularly suitable for highly sensitive capture and early warning of abnormal cardiac rhythms with rhythmic fluctuations, such as paroxysmal atrial fibrillation and supraventricular arrhythmias.
[0161] The system takes continuously acquired single-lead ECG signals as input. The raw signal undergoes bandpass filtering using a bidirectional zero-phase finite impulse response (FIR) filter, limiting the ECG signal frequency to between 0.5 Hz and 45 Hz. This filters out low-frequency drift caused by poor electrode contact and high-frequency electromyography (EMG) interference. The filtered signal then undergoes sliding window baseline correction, extracting local low-frequency trend terms and removing them point by point to obtain a baseline-corrected signal that retains complete QRS waveform information.
[0162] The baseline correction signal is further input to the heartbeat detection module, which extracts the local waveform energy changes within each cycle through an integral window and identifies candidate R wave positions in conjunction with a dynamic threshold mechanism. All candidate positions that meet the time interval and rhythm stability are retained, thereby constructing a standardized ECG cycle sequence and clarifying the start and end points and interval range of each beat cycle.
[0163] Each standardized cycle is divided into several equal-length segments, and the local peak, mean, and waveform trend features are extracted within each segment and combined to form a periodic waveform feature vector. By setting a threshold for the amplitude range, the features of each segment are mapped to discrete labels, and finally combined to form an initial label sequence. In order to extract structural patterns at the symbol level, an unsupervised clustering algorithm is used to cluster and classify the label sequence, assigning a unique symbol to each class, thereby converting all ECG cycles into a time-ordered ECG symbol sequence.
[0164] The ECG symbol sequence is input into a probabilistic suffix automaton model. By setting a maximum suffix length, a historical suffix set is constructed for each symbol position, and the joint frequency of symbols under each suffix condition is counted to form a probability mapping relationship. State nodes and symbol transition edges of the probabilistic suffix automaton are constructed to form an initial suffix tree structure. The structure is further compressed by merging state nodes with consistent transition probability distributions to construct a sparse symbol state transition structure. In this structure, state nodes represent symbol states, and edge weights represent state transition probabilities. Traversing the input symbol sequence can gradually output the corresponding symbol state sequence and its transition probability sequence.
[0165] The obtained symbolic state sequence is input into the constructed implicit semi-Markov model, which has a hierarchical hidden state structure, representing waveform pattern state and rhythm duration state respectively. The waveform pattern state is used to distinguish different rhythm structures, and the rhythm duration state is used to describe the statistical distribution of the duration of different states. By constructing a many-to-many mapping relationship, each waveform state can correspond to one or more rhythm duration states. For each observation state interval, its start and end times and duration are recorded, and its waveform state and rhythm state labels are extracted.
[0166] Probabilistic modeling of duration is achieved by fitting duration data with the same label from historical samples. The modeling functions used include log-normal distribution, gamma distribution, and piecewise linear function. Finally, the maximum likelihood estimation method is used to obtain the model parameters. In the inference stage, the probability density value of the actual observed duration is obtained on the corresponding probability distribution function. The rhythm duration state corresponding to the maximum density is selected as the inference output and combined with the waveform state to form a joint feature vector sequence of state and duration.
[0167] A rhythm analysis window is constructed using a time-sliding window, with each window containing multiple observation state intervals. The symbol state transition relationships within this window are matched one by one using a probabilistic suffix automaton, and the transition scores are statistically analyzed as waveform state scores. The probability distribution function corresponding to the duration of each rhythm state is called to calculate the probability density value of the actual duration, and all values are aggregated to form a duration consistency score. The two scores are then weighted to form a joint scoring index, and a threshold is used to determine whether the current rhythm is normal or abnormal.
[0168] To enhance the initiative and adaptability of the recognition, this invention further introduces a reinforcement learning mechanism. A state vector sequence is constructed based on the waveform pattern state, rhythm duration state, actual duration, and probability density value extracted from the rhythm window. This sequence serves as the state space input for the reinforcement learning model. The action set includes three actions: maintaining the current label, modifying the label, and triggering an alarm. The reward function is constructed by combining the rhythm recognition accuracy and duration consistency score. Positive feedback rewards are derived from correct recognition and high scores, while incorrect recognition and unstable durations trigger negative rewards. The policy function is trained using the policy gradient method, ultimately forming an optimal policy model for decision-making based on real-world data.
[0169] In experimental verification, the method of this invention was compared with mainstream ECG recognition algorithms in existing published literature. Manually labeled data was used for evaluation, and the evaluation metrics included recognition accuracy, rhythm discrimination recall, false alarm rate, and F1 score. The following data are performance evaluation statistics obtained during the tests.
[0170] Table 1 Comparison of ECG rhythm recognition performance
[0171]
[0172] As can be seen from the performance evaluation data in Table 1, the AI-based ECG monitoring and data analysis method proposed in this invention significantly outperforms existing methods in several key indicators. In terms of recognition accuracy, the method of this invention achieves 96.4%, which is 4.9 percentage points higher than the LSTM-based ECG model and 6.7 percentage points higher than the traditional CNN combined with Hidden Markov Model method, indicating that this invention performs better in overall accuracy of ECG rhythm classification. In terms of F1 score, this invention achieves 94.7%, significantly higher than the 88.6%, 86.3%, and 82.1% of the comparative methods, indicating a better balance between precision and recall. Regarding the false alarm rate, this method is only 3.1%, far lower than the 6.2% to 9.3% of other methods, demonstrating strong robustness and low false alarm performance. In terms of recall, this invention also achieves 92.8%, which is 7.7% to 13.4% higher than the comparative methods, reflecting its higher sensitivity in capturing abnormal rhythm events. These data collectively verify that the present invention not only possesses high accuracy and strong stability in complex rhythm recognition tasks, but also effectively enhances intelligent recognition and early warning capabilities in practical scenarios.
[0173] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. An AI-based electrocardio monitoring and data analysis method, characterized in that, include: Continuous electrocardiogram (ECG) signals are acquired, filtered, baseline corrected, and heartbeat detected to generate a standardized ECG cycle sequence. The electrocardiogram (ECG) cycle sequence is symbolically encoded, and each cycle is mapped to a discrete symbol based on the characteristics of the cycle waveform to obtain the ECG symbol sequence. The acquisition of the electrocardiogram symbol sequence includes: The standardized electrocardiogram cycle sequence is subjected to periodic waveform feature extraction. Each cycle is divided into multiple equal-length segments along the time axis. The peak amplitude, mean amplitude, and waveform change trend are extracted as segment feature values in each segment. All segment feature values are combined in sequence to form the periodic feature vector of the corresponding cycle. The periodic feature vector is quantized and encoded. Based on the preset amplitude range threshold, each segment feature value is mapped to a discrete level label, resulting in an initial label sequence arranged in segment order. The initial label sequences are structurally classified. An unsupervised clustering algorithm is used to cluster the initial label sequences corresponding to multiple periods. Sequences with similar structures are grouped into the same category. A finite set of symbols is generated based on the clustering results, where each cluster category corresponds to a unique symbol. Each initial label sequence is mapped to a corresponding symbol according to its category, generating discrete symbols that correspond one-to-one with the period, and finally forming a time-ordered ECG symbol sequence. Input the ECG symbol sequence into the probabilistic suffix automaton model, construct the symbol state transition structure, and output the symbol state sequence and its corresponding state transition probability. The symbolic state sequence and state transition probability are used as inputs to an implicit semi-Markov model to model the duration distribution of states and output a joint feature vector sequence of states and duration. Based on state transition probability and duration distribution information, a joint scoring index within the rhythm window is calculated, and a rhythm identification label and duration consistency score are generated based on the joint scoring index. The generation of the rhythm identification label and duration consistency score includes: Extract continuous observation state intervals from the joint feature vector sequence of state and duration, and construct a fixed-length rhythm analysis window in chronological order. Each rhythm analysis window contains multiple waveform pattern states and corresponding rhythm duration states. For the waveform pattern state sequence within the rhythm analysis window, the state transition path and transition probability defined in the probabilistic suffix automaton symbolic state transition structure are used to match the state jump relationship one by one, and the waveform state score under the current window is accumulated. For the rhythm duration state sequence within the rhythm analysis window, based on the duration probability distribution function corresponding to each rhythm duration state, the probability density value is calculated for the actual duration of the corresponding observation state interval, and all probability density values are statistically aggregated to generate a duration consistency score. The obtained waveform state score and duration consistency score are weighted and combined to construct a joint scoring index for the current rhythm analysis window; The joint scoring index of the rhythm analysis window is compared with the preset judgment threshold. When the joint scoring index is lower than the threshold, an abnormal rhythm identification label is generated, and when the joint scoring index is higher than the threshold, a normal rhythm identification label is generated. Using the consistency score between the identified label and the duration as feedback information, and combining the joint feature vector sequence of state and duration, the state space, action set and reward function of the reinforcement learning model are constructed. The policy function is trained using a state space, a set of actions, and a reward function, and the optimal policy is output through reinforcement learning. The optimal strategy is applied to the real-time generated joint feature vector sequence of state and duration, and the strategy decision is executed to output the abnormal heart rhythm alarm result.
2. The AI-based electrocardio monitoring and data analysis method according to claim 1, characterized in that, The generation of standardized electrocardiogram cycle sequences includes: The acquired continuous electrocardiogram (ECG) signals are subjected to bandpass filtering, and a bidirectional zero-phase finite impulse response (FIR) filter is used to perform frequency domain filtering on the ECG signals, and the filtered signal is output. The filtered signal is used as input to perform baseline correction processing. A sliding window is set to extract low-frequency trend terms, and the corresponding low-frequency trend terms are removed point by point from the filtered signal on the time axis to generate a baseline correction signal. The baseline correction signal was used for heartbeat detection, and the local waveform energy features were extracted using an integral window. The initial R wave candidate position was identified by combining a dynamic threshold mechanism. The initial R-wave candidate position sequence is filtered, and spurious peaks are removed and a standardized ECG cycle sequence is output based on the minimum time interval between adjacent candidate points and the rhythm stability rule.
3. The AI-based electrocardio monitoring and data analysis method according to claim 1, characterized in that, The generation of symbolic state sequences and their corresponding state transition probabilities includes: Input the ECG symbol sequence into the probabilistic suffix automaton model, set the maximum probability suffix length k, and extract historical symbols at each position of the ECG symbol sequence that do not exceed the maximum probability suffix length k to form the probabilistic suffix automaton state suffix set; The joint frequency of occurrence of the state suffix set of the statistical probabilistic suffix automaton and the ECG symbol is calculated. The conditional probability of each ECG symbol under each state suffix of the probabilistic suffix automaton is calculated, and the mapping relationship between the probabilistic suffix automaton state and the symbol is formed by the corresponding conditional probability relationship. Based on the mapping relationship between the state and symbol of the probabilistic suffix automaton, an initial probabilistic suffix automaton suffix tree structure is constructed. Each unique probabilistic suffix automaton state suffix is mapped to a probabilistic suffix automaton state node, and the corresponding ECG symbol is mapped to a probabilistic suffix automaton symbol state transition edge. The corresponding probabilistic suffix automaton symbol state transition probability is marked on the probabilistic suffix automaton symbol state transition edge. Structural compression is performed on the initial probabilistic suffix automaton suffix tree structure. Probabilistic suffix automaton state nodes with the same probabilistic suffix automaton symbol state transition probability distribution are identified and merged to form a unique probabilistic suffix automaton state node, thus constructing a sparse probabilistic suffix automaton symbol state transition structure. In the symbolic state transition structure of the probabilistic suffix automaton, the state nodes of the probabilistic suffix automaton are used as symbolic states, and the symbolic state transition edges of the probabilistic suffix automaton and the symbolic state transition probabilities of the probabilistic suffix automaton are combined to form a directed state transition path, thus forming the symbolic state transition structure. Traverse the ECG symbol sequence, match the directed state transition path of the probabilistic suffix automaton symbol state transition structure step by step, record the matched probabilistic suffix automaton state nodes in chronological order, generate the symbol state sequence, and simultaneously extract the corresponding probabilistic suffix automaton symbol state transition probability sequence.
4. The AI-based electrocardio monitoring and data analysis method of claim 1, wherein, The output of the joint feature vector sequence of state and duration includes: Construct a hidden semi-Markov model with a hierarchical hidden state structure, setting the upper hidden state set as the waveform pattern state set and the lower hidden state set as the rhythm duration state set, and establish a many-to-many mapping relationship between the waveform pattern state and the rhythm duration state. The symbol state sequence output from the probabilistic suffix automaton model is processed to identify state segments consisting of consecutive identical symbol states. The start time, end time, and duration of each state segment are recorded and marked as the observation state interval. Based on the symbolic state labels in the observation state interval, generate corresponding waveform pattern state labels, and construct waveform pattern state sequences according to the state transition probability matrix between waveform pattern states. For each waveform pattern state label, retrieve its corresponding rhythm duration state set, and extract the duration sample data with the same waveform pattern state and rhythm duration state from the constructed training samples. For each set of duration sample data, a duration distribution model from the modeling function family is selected for fitting. The modeling function family includes the log-normal distribution function, the gamma distribution function, and the piecewise linear distribution function. The model parameters are determined by the maximum likelihood estimation method to construct the duration probability distribution of the rhythm duration state. During the inference phase, for each observation state interval, the probability distribution function in the set of rhythm duration states that have been modeled under its waveform mode state is called to calculate the probability density value of the actual duration, and the rhythm duration state with the largest probability density value is selected as the inference result of the observation state interval. The waveform pattern state, rhythm duration state, actual duration, and duration probability density value of each observation state interval are combined to generate a joint feature vector sequence of state and duration.
5. The method for ECG monitoring and data analysis based on AI according to claim 1, characterized in that, The construction of the state space, action set, and reward function of a reinforcement learning model includes: Extract the waveform pattern state, rhythm duration state, actual duration and corresponding duration probability density value of each observation state interval in the rhythm analysis window, and construct the environmental state set of the reinforcement learning model, wherein each state is combined in time order to form a state vector sequence. The action set includes three types of actions: maintaining the current rhythm label, modifying the rhythm label, and triggering the alarm flag. Each type of action acts on the label output logic of the current rhythm analysis window. Triggering the alarm flag indicates that the current window has identified a potentially high-risk rhythm. A reward function is constructed, which uses the consistency between the rhythm recognition label and the real label as the positive feedback basis. The reward value is constructed by combining the duration consistency score of the rhythm analysis window. The reward function gives a positive reward when the rhythm is correctly identified and the duration score is higher than the threshold, and gives a negative reward when the identification is wrong or the score is lower than the threshold. Input the state space, action set, and reward function into the policy optimization module.
6. The method for ECG monitoring and data analysis based on AI according to claim 1, characterized in that, The generation of the optimal strategy includes: Construct a reinforcement learning policy function, and use the constructed state space, action set, and reward function as the training input for the policy function; Initialize the parameters of the policy function, and set the exploration rate, discount factor and learning rate parameters to control the action selection mechanism, long-term expected reward weight and parameter update magnitude during policy training; The policy training is performed using a time difference-based method. The historical state sequence is iteratively traversed, the corresponding action is selected according to the current policy, the instantaneous reward value is calculated through the reward function, and the policy function parameters are updated using the policy update rule. In each training round, the current state vector of each rhythm analysis window is input into the policy function, and the corresponding policy action is output. The action effect is evaluated based on the actual label and time duration score through an interactive feedback mechanism, and the policy reward is accumulated. Continue training the policy until the policy function converges, and output a stable and optimal policy function.
7. An AI-based electrocardiogram monitoring and data analysis system, characterized in that, Includes the following modules: The signal acquisition module is used to acquire continuous electrocardiogram (ECG) signals and output raw ECG waveform data. The signal preprocessing module is used to receive raw ECG waveform data, perform bandpass filtering, baseline correction and heartbeat detection, and output a standardized ECG cycle sequence. The symbol encoding module is used to divide the standardized ECG cycle sequence into multiple cycle segments, extract the cycle waveform features and perform discrete quantization mapping to generate the ECG symbol sequence. The symbol encoding module includes: The standardized electrocardiogram cycle sequence is subjected to periodic waveform feature extraction. Each cycle is divided into multiple equal-length segments along the time axis. The peak amplitude, mean amplitude, and waveform change trend are extracted as segment feature values in each segment. All segment feature values are combined in sequence to form the periodic feature vector of the corresponding cycle. The periodic feature vector is quantized and encoded. Based on the preset amplitude range threshold, each segment feature value is mapped to a discrete level label, resulting in an initial label sequence arranged in segment order. The initial label sequences are structurally classified. An unsupervised clustering algorithm is used to cluster the initial label sequences corresponding to multiple periods. Sequences with similar structures are grouped into the same category. A finite set of symbols is generated based on the clustering results, where each cluster category corresponds to a unique symbol. Each initial label sequence is mapped to a corresponding symbol according to its category, generating discrete symbols that correspond one-to-one with the period, and finally forming a time-ordered ECG symbol sequence. The probabilistic suffix automaton construction module is used to receive ECG symbol sequences, establish the state structure of the probabilistic suffix automaton, and output the symbol state sequence and its state transition probabilities. The implicit semi-Markov modeling module is used to receive symbol state sequences and state transition probabilities, construct a two-layer model structure of waveform pattern state and rhythm duration state, and output a joint feature vector sequence of state and duration. The joint scoring calculation module is used to calculate waveform state score and duration consistency score within the rhythm analysis window, construct joint scoring index, and generate rhythm identification label and duration consistency score; The joint scoring calculation module includes: Extract continuous observation state intervals from the joint feature vector sequence of state and duration, and construct a fixed-length rhythm analysis window in chronological order. Each rhythm analysis window contains multiple waveform pattern states and corresponding rhythm duration states. For the waveform pattern state sequence within the rhythm analysis window, the state transition path and transition probability defined in the probabilistic suffix automaton symbolic state transition structure are used to match the state jump relationship one by one, and the waveform state score under the current window is accumulated. For the rhythm duration state sequence within the rhythm analysis window, based on the duration probability distribution function corresponding to each rhythm duration state, the probability density value is calculated for the actual duration of the corresponding observation state interval, and all probability density values are statistically aggregated to generate a duration consistency score. The obtained waveform state score and duration consistency score are weighted and combined to construct a joint scoring index for the current rhythm analysis window; The joint scoring index of the rhythm analysis window is compared with the preset judgment threshold. When the joint scoring index is lower than the threshold, an abnormal rhythm identification label is generated, and when the joint scoring index is higher than the threshold, a normal rhythm identification label is generated. The policy optimization module is used to construct the state space, action set, and reward function of the reinforcement learning model based on the joint feature vector sequence of state and duration and the recognition label, and to train and output the optimal policy function. The abnormal alarm module is used to receive the real-time generated joint feature vector sequence of status and duration, call the optimal strategy function to execute the strategy action, and output the abnormal heart rhythm alarm result.
Citation Information
Patent Citations
CN108113646A
CN108304446A