Arrhythmia signal detection method, system and terminal based on expert knowledge
By employing an expert-based arrhythmia signal detection method, utilizing signal filtering and P-QRS-T localization detection, the problems of low detection accuracy and high power consumption in existing technologies are solved, achieving high-precision, low-power ECG monitoring.
Patent Information
- Application Number
- CN202210596750.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-17
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2042-05-17
AI Technical Summary
Existing arrhythmia detection algorithms lack medical basis, cannot cope with the individuality of biological signals, and reduce detection accuracy; high-precision anomaly detection neural network models are computationally complex and not suitable for low-power hardware implementation.
An expert-knowledge-based arrhythmia signal detection method is adopted, including signal filtering, P-QRS-T localization detection, and feature mapping. Noise is filtered out using an infinite impulse response bandpass filter, and arrhythmia is detected by combining QRS complex and P/T wave detection algorithms through feature mapping and threshold comparison.
It improves the accuracy of arrhythmia detection, reduces computational complexity, is suitable for high-precision, ultra-low-power ECG monitoring chips, and has high robustness and low power consumption characteristics.
Smart Images

Figure CN114916940B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of biomedical and machine learning, in particular to a heart arrhythmia signal detection method and system based on expert knowledge and a terminal, which are suitable for electrocardiogram processing and analysis. BACKGROUND
[0002] According to the World Health Organization, most cardiovascular diseases are preventable. Studies have shown that electrocardiogram (ECG) as a direct physiological indicator of heart condition can accurately reflect cardiovascular information such as arrhythmia, and monitoring the ECG of the human body can provide information reference assistance at the early stage of cardiovascular disease, benefiting hundreds of millions of patients.
[0003] With the deep cross-fusion of integrated circuit technology and biomedical technology, electrocardiogram monitoring chips provide the possibility for real-time monitoring and prevention of cardiovascular diseases. The miniaturization and microfabrication trend of electrocardiogram sensing devices from portable to wearable to flexible sensing means that the size of the battery is repeatedly reduced, and strict requirements are put forward for power consumption. In addition, the battery of the implanted electrocardiogram sensing chip cannot be replaced, so the service life is only 4.5 years, and the service life of the chip must be extended to reduce power consumption. Whether it is a wearable or implanted electrocardiogram monitoring chip, ultra-low power consumption is an urgent need. However, cardiovascular disease is a chronic disease, usually intermittent, and the interval period is counted in days or even months, and most of the real-time physiological signal data collected is redundant information. The power consumption of the existing typical commercial transceiver chip can reach 2-5mA, and if all the data is stored locally or sent to the cloud, a large amount of energy will be wasted. Therefore, only the transmission of a small amount of abnormal signals also reduces the power consumption required for wireless transmission of the chip to the data, which meets the ultra-low power consumption demand of the electrocardiogram sensing device. In addition, as a scout for arrhythmia, high precision is the most fundamental requirement for electrocardiogram detection chips. Therefore, researching arrhythmia detection algorithms and improving the recognition accuracy of the algorithm and the energy efficiency of hardware implementation have a very important role in realizing high-precision, ultra-low-power electrocardiogram monitoring chips.
[0004] After searching, it is found that:
[0005] A Chinese invention patent with the authorization announcement number CN108652615B, "ECG data pathological feature quantization analysis method and device", extracts the geometric features, nonlinear dynamic features, time domain features, frequency domain features, etc. of the ECG signal, performs weighting to obtain the quantization analysis index heterogeneity, and performs abnormality determination, but such feature extraction method cannot cope with the individuality of biological signals. A Chinese invention patent with the authorization announcement number CN107137072B, "Ventricular ectopic beat detection method based on 1D convolutional neural network", extracts features from the original ECG signal by using a one-dimensional convolutional neural network, and performs abnormality detection by using a Softmax activation function. Although the neural network classification method has high accuracy, the model is complex and is not conducive to low-power hardware implementation. Therefore, the existing arrhythmia detection algorithm still has the following shortcomings:
[0006] (1) The feature extraction algorithm lacks medical basis and cannot cope with the individuality of biological signals, reducing the detection accuracy;
[0007] (2) The high-precision abnormality detection neural network model is complex in calculation and is not suitable for low-power hardware implementation.
[0008] At present, no similar technology to the present application has been found, and no similar domestic and foreign data has been collected. SUMMARY
[0009] The present application provides an arrhythmia signal detection method, system and terminal based on expert knowledge to overcome the above-mentioned shortcomings in the prior art, and provides a corresponding medium.
[0010] According to one aspect of the present application, an arrhythmia signal detection method based on expert knowledge is provided, comprising:
[0011] Signal filtering is performed on the acquired ECG signal to filter out high-frequency noise and baseline drift in the ECG signal;
[0012] P-QRS-T positioning detection is performed on the signal-filtered ECG signal to obtain QRS wave groups and P / T waves;
[0013] The obtained QRS wave groups and P / T waves are subjected to expert knowledge-based feature mapping to obtain the category features of the ECG signal;
[0014] The obtained category features of the ECG signal are compared with a preset threshold to determine the arrhythmia signal, and the detection of the arrhythmia signal is completed.
[0015] Optionally, the signal filtering of the acquired ECG signal to filter out the high-frequency noise and baseline drift in the ECG signal comprises:
[0016] The infinite impulse response band-pass filter is used to suppress high-frequency noise and baseline drift.
[0017] An expression of the infinite impulse response band-pass filter is as follows:
[0018]
[0019] In the expression, x[n] represents an original digital electrocardiogram signal, y[n] represents an electrocardiogram signal after the signal is filtered by the band-pass filter, a p and b q are coefficients of the infinite impulse response band-pass filter, p is a delay of an input signal, q is a delay of a filtered signal, M is a maximum delay of the input signal, and N is a maximum delay of the filtered signal.
[0020] Optionally, the coefficients a p and b q of the infinite impulse response band-pass filter are quantized from a floating-point form to a fixed-point number; wherein a decimal part and an integer part of the fixed-point number respectively represent a decimal part and an integer part of the original floating-point number, and a bit width is selected and set according to a minimum accuracy required to ensure that the filter is not oscillating.
[0021] Optionally, the electrocardiogram signal after the signal filtering is subjected to P-QRS-T positioning detection to obtain QRS complexes and P / T waves, including:
[0022] The electrocardiogram signal is subjected to P-QRS-T positioning detection by using a QRS complex detection algorithm and a P / T wave detection algorithm respectively to obtain QRS complexes and P / T waves; wherein:
[0023] The QRS complex detection algorithm includes:
[0024] The electrocardiogram signal after the signal filtering is subjected to differential, squaring and smoothing filtering to obtain a QRS enhanced signal; wherein:
[0025] ECG d [n] = 2ECG f [n+1] + ECG f [n+2] - 2ECG f [n-1] - ECG f [n-2],#(2)
[0026] ECG s [n] = ECG d [n] * ECG d [n],#(3)
[0027]
[0028] In the expression, ECGf ECG is the filtered ECG signal d ECG is the differential filtered signal s ECG is the squared filtered signal m ECG is the QRS enhanced signal obtained by smoothing filtering
[0029] finds a peak point from the QRS enhanced signal ECG m ECG_peak, and marks the position of the peak point in the filtered ECG signal ECG m ECG_peak in the filtered ECG signal ECG m ECG_peak and the minimum interval T1 between R peaks and the maximum interval T2 between R peaks, and labels the position of the pending peak ECG m _peak in the filtered ECG signal ECG f ; wherein:
[0030] If the time difference rpp_interval is greater than or equal to the minimum interval T1 and less than or equal to the maximum interval T2, the amplitude ECG m _peak_amp of the pending peak ECG m _peak is compared with a dynamic threshold Th m ; if the amplitude ECG m _peak_amp is greater than or equal to the dynamic threshold Th m , the position of the pending peak ECG m _peak in the filtered ECG signal ECG f is marked, and the pending peak ECG m _peak corresponds to a possible R peak in the ECG signal ECG f , and the dynamic threshold Th is updated according to the following update expression: m :
[0031] Th m = 0.25*ECG m _peak_amp + 0.375*Th m , # (5)
[0032] If the amplitude ECG m _peak_amp is less than the dynamic threshold Th m , the next peak point is found and marked as a new pending peak ECG m _peak.
[0033] If the time difference rpp_interval is greater than the maximum interval T2, there is a possibility of missing an R peak; at this time, search forward for the last peak point ECG m _peak_pre, the amplitude of the peak point ECG m _peak_pre is compared with 0.25*Th m ; if the amplitude ECG m _peak_pre_amp is greater than or equal to 0.25*Th m , then mark the position of the peak point ECG m _peak_pre in the signal-filtered electrocardio signal ECG m , and the pending peak ECG f _peak corresponds to a possible R peak in the electrocardio signal ECG m , and the dynamic threshold Th is updated according to the following expression f :
[0034] Th m = 0.25*ECG m _peak_amp+0.25*Th m , # (6)
[0035] If the amplitude ECG m _peak_pre_amp is less than 0.25*Th m , then compare the amplitude ECG m _peak_amp of the current pending peak ECG m _peak with the dynamic threshold Th m , and according to the case that the time difference rpp_interval is between the minimum interval T1 and the maximum interval T2, mark the position of the pending peak ECG m _peak in the signal-filtered electrocardio signal ECG f , and update the dynamic threshold Th m ;
[0036] If the time difference rpp_interval is less than T1, then search for the next peak point, denoted as a new pending peak ECG m _peak;
[0037] According to the position of the marked pending peak ECG m _peak in the electrocardio signal ECG f , search forward for the peak point ECG f _peak and the valley point ECG f _peak_pre in the electrocardio signal ECG f .f _valley; calculating the peak point ECG f _peak of the slope ECG f _peak_slope, if the slope ECG f _peak_slope is less than or equal to 0.5 times the slope of the last determined R peak, the pending peak ECG m _peak is considered as a misjudged T wave in the electrocardiogram ECG f , return to find the next peak point, recorded as a new pending peak ECG m _peak, otherwise continue; the peak value ECG f _peak_amp and the valley point ECG f _valley of the valley ECG f _valley_amp respectively compared with the dynamic threshold Th f_pos and the dynamic threshold Th f_neg , determine the R peak and its direction, and update the dynamic threshold; wherein:
[0038] If the peak ECG f _valley_amp is less than or equal to the dynamic threshold Th f_neg , and the peak ECG f _peak_amp is less than or equal to the dynamic threshold Th f_pos , the pending peak ECG m _peak is the R peak in the electrocardiogram ECG f , the direction of the R peak R_dir is-1, indicating that the R peak is downward, and the amplitude of the R peak R_amp is ECG f _valley_amp, at this time the dynamic threshold Th f_neg is updated as:
[0039] If the peak ECG f _valley_amp is greater than the dynamic threshold Th f_neg , or the peak ECG f _peak_amp is greater than the dynamic threshold Th f_pos , the pending peak ECG m _peak is the R peak in the electrocardiogram ECG f , the direction of the R peak R_dir is 1, indicating that the R peak is upward, and the amplitude of the R peak R_amp is ECG f _peak_amp, at this time the dynamic threshold is updated as:
[0040] Based on the determined position R_loc and direction R_dic of the R-peak, if the direction of the R-peak is upward, then forward T of the R-peak... q Find the first amplitude less than or equal to the dynamic threshold Th within the duration. q_pos trough ECG f _valley_amp is determined to be point Q, where T q The maximum time interval between point Q and peak R; if the direction of peak R is downward, then T is the time interval before peak R. q Find the first amplitude greater than or equal to the dynamic threshold Th within the duration. q_neg Peak ECG f _peak_amp is determined to be point Q;
[0041] Based on the determined position R_loc and direction R_dic of the R-peak, if the direction of the R-peak is upward, then T is the distance after the R-peak. s Find the first amplitude less than or equal to the dynamic threshold Th within the duration. s_pos trough ECG f _valley_amp, determined as point S, where T s The maximum time interval between point S and peak R; if the direction of peak R is downward, then T is the time interval before peak R. s Find the first amplitude greater than or equal to the dynamic threshold Th within the duration. s_neg Peak ECG f _peak_amp is determined to be point S;
[0042] The QRS group is obtained based on the R peak, Q point, and S point.
[0043] The P / T wave detection algorithm includes:
[0044] Obtain the filtered electrocardiogram (ECG) signal f The information of two adjacent heartbeats is recorded as the SQ segment, which is the position from point S of the first heartbeat to point Q of the second heartbeat. The output includes the position, amplitude and direction of the T wave of the first heartbeat and the position, amplitude and direction of the P wave of the second heartbeat.
[0045] The SQ segment is then smoothed to obtain the smoothed signal ECG. sq ;
[0046] According to the smoothed and filtered ECG signal sq Length L sq The smoothed and filtered signal ECGsq is divided into T region and P region;
[0047] The number of peaks and the amplitude max_p of the maximum value of the P region are counted;
[0048] The dynamic threshold values thres_p, thres_t- and thres_t+ are calculated:
[0049] thres_p = min(S_amp + 5, 0), # (7)
[0050]
[0051] thres_t+ = thres_p - 10 # (9)
[0052] In the formula, thres_p is used to determine whether the peak point is a P wave, thres_t- is used to determine whether the valley point is a downward T wave, thres_t+ is used to determine whether the peak point is an upward T wave, and S_amp is the amplitude of the detected S point;
[0053] If the P region has a peak value and max_p > thres_p, the position of max_p is the peak value of the P wave; if the P region has no peak value or max_p < thres_p, there is no P wave, and P_exis is set to 0 to indicate that the P wave does not exist;
[0054] Let the amplitude of the maximum value of the peak value of the T region be max_t, and the amplitude of the minimum value of the peak value of the T region be min_t, then the maximum value max of the peak value of the smoothed signal ECG sq and its position max_loc and the minimum value min of the peak value and its position min_loc include the following cases:
[0055] The P wave exists, max_t < thres_t+ and min_t < thres_t-, at this time, the T wave is downward, and min_t is its amplitude;
[0056] The P wave exists, max_t >= thres_t+ or min_t >= thres_t-, at this time, the T wave is upward, and max_t is its amplitude;
[0057] The P wave does not exist, min >= thres_t- or max_loc <= min_loc, at this time, the T wave is upward, and max is its amplitude;
[0058] The P wave does not exist, min < thres_t- and max_loc > min_loc, at this time, the T wave is downward, and min is its amplitude.
[0059] Optionally, the obtained QRS complex and P / T wave are subjected to expert knowledge-based feature mapping to obtain category features of the electrocardiosignal, including:
[0060] The expert knowledge is converted into a feature expression, including:
[0061] RR_diff_pre = RR_inte2 - RR_inte3, (10)
[0062] RR_diff = RR_inte1 - RR_inte2, (11)
[0063] TR_amp_diff = T_amp - R_amp, (12)
[0064] QS_amp_diff = Q_amp - S_amp, (13)
[0065] QRS_duration = S_loc - Q_loc, (14)
[0066] PR_interval = R_loc - P_loc, (15)
[0067] PQ_interval = Q_loc - P_loc, (16)
[0068] wherein RR_diff_pre is the difference between the two RR intervals before and after the n-1 heartbeat, RR_diff is the difference between the two RR intervals before and after the n heartbeat, TR_amp_diff is the difference between the amplitude of the T wave and the amplitude of the R wave, QS_amp_diff is the difference between the amplitude of the Q point and the amplitude of the S point, QRS_duration is the time length of the QRS complex, PR_interval is the time interval between the P wave and the R peak, PQ_interval is the time interval between the P wave and the Q point, RR_inte1, RR_inte2 and RR_inte3 are the time differences between the R peak of the n+1 heartbeat period and the R peak of the n heartbeat period, the R peak of the n heartbeat period and the R peak of the n-1 heartbeat period, and the R peak of the n-1 heartbeat period and the R peak of the n-2 heartbeat period, respectively; T_amp, R_amp, Q_amp and S_amp are the amplitudes of the T wave, the R peak, the Q wave and the S wave of the n heartbeat period, respectively; S_loc, Q_loc, R_loc and P_loc are the time points corresponding to the amplitudes of the T wave, the R peak, the Q wave and the S wave of the n heartbeat period, respectively.
[0069] According to the feature expression of the expert knowledge, the features of the expert knowledge mapping are obtained for the obtained QRS complex and P / T wave, and meanwhile, the R peak direction R_dic, the T wave direction T_dic, the time difference RR_inte1, the time difference RR_inte2, the R peak amplitude R_amp, the T wave amplitude T_amp, the S wave slope S_slo and the parameter P_exis indicating whether the P wave exists are obtained, i.e., the category features of the electrocardiosignal.
[0070] Optionally, the obtained category features of the electrocardiosignal are compared with preset threshold values to determine the arrhythmia signal, including:
[0071] When the absolute amount of the feature is greater than or less than the set threshold value, the electrocardiosignal is determined as the arrhythmia signal, including any one or any multiple of the following cases:
[0072] P_exist==0, indicating that the P peak is missing;
[0073] (R_dir==1)&&(T_dir==-1), indicating that the polarities of the R peak and the T peak are opposite;
[0074] (RR_inte1<RR_inte_min)&&(RR_inte2<RR_inte_min), indicating that the interval between the two continuous R peaks is too short;
[0075] (RR_inte1>RR_inte_max)&&(RR_inte2>RR_inte_max), indicating that the interval between the two continuous R peaks is too long;
[0076] TR_amp_diff>TR_amp_diff_max, indicating that the T peak is higher than the R peak and exceeds a certain range;
[0077] (QRS_duration>case6-qrs_duration_thres)&&(S_slo<case6_s_slo_thres), indicating that the QRS wave appears too early;
[0078] PR_interval<case7_pr_thres, indicating that the PR interval is too short;
[0079] P_exis indicates whether a P wave exists or not, R_dic is a direction of an R peak, T_dir is a direction of a T wave, RR_intel is a time difference between an R peak of an n+1th heartbeat cycle and an R peak of an nth heartbeat cycle, RR_inte_min is a minimum normal value of an RR interval, RR_inte2 is a time difference between an R peak of an nth heartbeat cycle and an R peak of an n-1th heartbeat cycle, RR_inte_max is a maximum normal value of an RR interval, TR_amp_diff is a difference between an amplitude of a T wave and an amplitude of an R wave, TR_amp_diff_max is a maximum normal value of the difference between the amplitude of the T wave and the amplitude of the R wave, QRS_duration is a time length of a QRS complex, case6_qrs_duration_thres is a minimum value of a QRS complex duration when a QRS wave is wide and an S wave is wide, S_slo is an S wave slope, case6_s_slo_thres is a minimum value of an S wave slope when the S wave is wide, PR_interval is a time interval of a P wave and an R peak, and case7_pr_thres is a minimum normal time interval of the P wave and the R peak when a PR interval is too short.
[0080] When a difference between the feature value and the normal value is greater than a set threshold value, the electrocardiosignal is determined to be an arrhythmia signal, including any one or any multiple of the following cases:
[0081] ((RR_intel-RR_intel_n)<case8_rr_inter1_thres) && ((RR_inte2- RR_inte2_n)>case8_rr_inter2_thres), indicating that a QRS wave appears in advance;
[0082] (RR_diff-RR_diff_n)>case9_rr_diff_thres, indicating that a QRS wave appears in advance;
[0083] (|RR_diff-RR_diff_n|<case10_rr_diff_thres) && ((RR_intel- RR_intel_n)<case10_rr_inter1_thres) && ((RR_inte2-RR_inte2_n)> case10_rr_inter2_thres), indicating that two consecutive R peak intervals are too short;
[0084] |R_amp-R_amp_n|>R_amp_thres, indicating that a QRS wave appears in advance;
[0085] |S_amp-S_amp_n|>S_amp_thres, indicating that a QRS wave appears in advance;
[0086] |Q_amp-Q_amp_n|>Q_amp_thres indicates that the QRS wave appears earlier;
[0087] T_dic_n! = T_dic, indicating that the QRS wave appears earlier;
[0088] (QRS_duration-QRS_duration_n)>QRS_duration_thres indicates that the QRS wave appears earlier than expected.
[0089] ((QRS_duration-QRS_duration_n)> case16_qrs_duration_thres)&&((R_amp-R_amp_n)> case16_r_amp_thres) indicates that the QRS wave appears earlier than expected;
[0090] |S_slo-S_slo_n|>case17_s_slo_thres indicates that the QRS wave appears earlier;
[0091] ((QS_amp_diff-QS_amp_diff_n)>case18_qs_amp_thres)&&((QRS_duration-QRS_duration_n)>case18_qrs_duration_thres) indicates that the QRS wave appears earlier than expected;
[0092] (|R_amp-R_amp_n|>case19_r_amp_thres)&&(|T_amp-T_amp_n1>case19_t_amp_thres), indicating that the PR interval is too short;
[0093] (PR_interval<case20_pr_thres)&&((PQ_interval-PQ_interval_n)< pq_thres) indicates that the PR interval is too short;
[0094] wherein, *n represents the normal value of the feature, *thres represents the configurable setting threshold; RR_intel is the time difference between the R peak of the n+1th heartbeat cycle and the R peak of the nth heartbeat cycle, case8_rr_interl_thres is the maximum value of the difference between RR_intel and its normal value when QRS wave is advanced, RR_inter2 is the time difference between the R peak of the nth heartbeat cycle and the R peak of the n-1th heartbeat cycle, case8_rr_inter2_thres is the minimum value of the difference between RR_inter2 and its normal value when QRS wave is advanced, RR_diff is the difference between the two RR intervals of the nth heartbeat, case9_rr_diff_thres is the minimum value of the difference between RR_diff and its normal value when QRS wave is advanced, case10_rr_diff_thres is the minimum value of the difference between RR_diff and its normal value when the interval between two consecutive R peaks is too short, case10_rr_interl_thres is the minimum value of the difference between RR_interl and its normal value when the interval between two consecutive R peaks is too short, case10_rr_inter2_thres is the minimum value of the difference between RR_inter2 and its normal value when the interval between two consecutive R peaks is too short, R_amp is the amplitude of the R peak, R_amp_thres is the maximum value of the deviation of the normal R peak amplitude from the normal value, S_amp is the amplitude of the S wave, S_amp_thres is the maximum value of the deviation of the normal S wave amplitude from the normal value, Q_amp is the amplitude of the Q wave, Q_amp_thres is the maximum value of the deviation of the normal Q wave amplitude from the normal value, T_dic is the direction of the T wave, QRS_duration is the duration of the QRS wave, QRS_duration_thres is the minimum value of the deviation of the QRS wave duration from its normal value when the QRS wave is wide, case16_qrs_duration_thres is the minimum value of the deviation of the QRS wave duration from its normal value when the QRS wave is wide with R peak constraint, case16_r_amp_thres is the minimum value of the deviation of the R peak amplitude from the normal value when the QRS wave is wide, S_slo is the slope of the S wave, case17_s_slo_thres is the minimum value of the deviation of the slope of the S wave from its normal value when the S wave is too slow, QS_amp_diff is the difference between the amplitude of the Q point and the amplitude of the S point, case18_qs_amp_thres is the minimum value of the deviation of QS_amp_diff from its normal value when the QRS wave is wide, case18_qrs_duration_thres is the minimum value of the deviation of the QRS wave duration from its normal value when the QRS wave is wide with QS_amp_diff constraint, case19_r_amp_thres is the minimum value of the deviation of the R peak amplitude from the normal value when the amplitudes of the R peak and the T wave deviate from the normal value at the same time,case19-t_amp_thres is the minimum value of the T peak amplitude deviating from the normal value when the amplitudes of the R peak and the T wave deviate from the normal value at the same time, PR_interval is the time interval of the P wave and the R peak, case20_pr_thres is the minimum value of the PR interval deviating from the normal value when the PR interval is too short, PQ_interval is the time interval of the P wave and the Q wave, and pq_thres is the minimum value of the PQ interval deviating from the normal value when the PQ interval is too short.
[0095] According to another aspect of the present application, there is provided an expert knowledge-based arrhythmia signal detection system, comprising:
[0096] a signal filtering module configured to perform signal filtering on the acquired electrocardio signal to filter out high-frequency noise and baseline drift in the electrocardio signal;
[0097] a P-QRS-T positioning detection module configured to perform P-QRS-T positioning detection on the signal-filtered electrocardio signal to obtain QRS complex and P / T wave;
[0098] a feature mapping module configured to perform expert knowledge-based feature mapping on the obtained QRS complex and P / T wave to obtain category features of the electrocardio signal;
[0099] an arrhythmia signal detection module configured to compare the obtained category features of the electrocardio signal with preset threshold values to determine an arrhythmia signal, thereby completing detection of the arrhythmia signal.
[0100] According to a third aspect of the present application, there is provided a terminal comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor is configured to execute the program to perform any of the above-described methods or run the above-described system.
[0101] According to a fourth aspect of the present application, there is provided a computer-readable storage medium having a computer program stored thereon, wherein the program is executable by a processor to perform any of the above-described methods or run the above-described system.
[0102] Thanks to the above technical solutions, the present application has at least one of the following beneficial effects compared with the prior art:
[0103] 1. The expert knowledge-based arrhythmia signal detection method, system, terminal and medium provided by the present application first propose a way of detecting arrhythmia signals based on expert knowledge of heart disease, which helps to solve the problem of biological signal individuality and improves the detection accuracy.
[0104] 2. The expert knowledge-based arrhythmia signal detection method, system, terminal and medium provided by the application realize a P-QRS-T positioning mode, fully consider the morphology of abnormal heartbeats and the time of positioning P / T waves, jointly consider two heartbeats before and after, can effectively avoid the inaccurate P-QRS-T positioning caused by abnormal heartbeats, and have high robustness.
[0105] 3. The expert knowledge-based arrhythmia signal detection method, system, terminal and medium provided by the application have low operation complexity of arrhythmia signal detection, and are suitable for application in high-precision and ultra-low-power electrocardio monitoring chips. BRIEF DESCRIPTION OF DRAWINGS
[0106] Other features, objects and advantages of the application will become more apparent from the following detailed description of non-limiting embodiments with reference to the attached drawings:
[0107] Figure 1 The working flow chart of the expert knowledge-based arrhythmia signal detection method in an embodiment of the application is shown in the figure.
[0108] Figure 2 The working schematic diagram of the expert knowledge-based arrhythmia signal detection method in a preferred embodiment of the application is shown in the figure.
[0109] Figure 3 The QRS complex detection flow chart in a preferred embodiment of the application is shown in the figure.
[0110] Figure 4 The P / T wave detection flow chart in a preferred embodiment of the application is shown in the figure.
[0111] Figure 5 The arrhythmia signal waveform sample schematic diagram in a preferred embodiment of the application is shown in the figure.
[0112] Figure 6 The structural block diagram of the expert knowledge-based arrhythmia signal detection in an embodiment of the application is shown in the figure. DETAILED DESCRIPTION
[0113] The embodiments of the application are described in detail as follows: The embodiments are implemented on the premise of the technical scheme of the application, and detailed implementation modes and specific operation processes are given. It should be noted that, for those skilled in the art, without departing from the concept of the application, a number of modifications and improvements can be made, which all belong to the protection scope of the application.
[0114] An expert knowledge-based arrhythmia signal detection method is provided in an embodiment of the application.
[0115] As Figure 1As shown, the expert knowledge-based arrhythmia signal detection method provided by the embodiment can include the following steps:
[0116] S100, performing signal filtering on the acquired electrocardio signal to filter out high-frequency noise and baseline drift in the electrocardio signal;
[0117] S200, performing P-QRS-T positioning detection on the signal-filtered electrocardio signal to obtain QRS complex and P / T wave;
[0118] S300, performing expert knowledge-based feature mapping on the obtained QRS complex and P / T wave to obtain the category feature of the electrocardio signal;
[0119] S400, comparing the obtained category feature of the electrocardio signal with a preset threshold to determine the arrhythmia signal and complete the detection of the arrhythmia signal.
[0120] In a preferred embodiment of S100, performing signal filtering on the acquired electrocardio signal to filter out high-frequency noise and baseline drift can include the following steps:
[0121] An infinite impulse response band-pass filter is used to suppress the high-frequency noise and baseline drift; wherein:
[0122] The expression of the infinite impulse response band-pass filter is:
[0123]
[0124] In the formula, x[n] represents the original digital electrocardio signal, y[n] represents the electrocardio signal after signal filtering by the band-pass filter, a p and b q are coefficients of the infinite impulse response band-pass filter, p is the delay of the input signal, q is the delay of the filtered signal, M is the maximum delay of the input signal, and N is the maximum delay of the filtered signal.
[0125] Further, the coefficients a p and b q of the infinite impulse response band-pass filter are quantized from floating-point form to fixed-point numbers; wherein the decimal places and integer places of the fixed-point numbers respectively represent the decimal part and the integer part of the original floating-point number, and the bit width is selected and set according to the minimum accuracy required to ensure that the filter does not oscillate.
[0126] In a preferred embodiment of S200, performing P-QRS-T positioning detection on the signal-filtered electrocardio signal to obtain QRS complex and P / T wave can include the following steps:
[0127] The QRS wave group detection algorithm and the P / T wave detection algorithm are respectively used to detect P-QRS-T positioning of the ECG signal to obtain the QRS wave group and the P / T wave.
[0128] The QRS wave group detection algorithm S201 can include the following steps.
[0129] In S2011, the signal-filtered ECG signal is subjected to difference filtering, square filtering, and smoothing filtering to obtain a QRS-enhanced signal; wherein:
[0130] ECG d [n]=2ECG f [n+1]+ECG f [n+2]-2ECG f [n-1]-ECG f [n-2],#(2)
[0131] ECG s [n]=ECG d [n]*ECG d [n],#(3)
[0132]
[0133] In the formula, ECG f is the signal-filtered ECG signal, ECG d is the difference-filtered signal, ECG s is the square-filtered signal, and ECG m is the QRS-enhanced signal obtained through smoothing filtering.
[0134] In S2012, a peak point is searched from the QRS-enhanced signal ECG m , and the searched peak point is recorded as a to-be-determined peak ECG m _peak. The time difference rpp_interval between the to-be-determined peak ECG m _peak and the last R peak is compared with the minimum interval T1 between R peaks and the maximum interval T2 between R peaks, and the position of the to-be-determined peak ECG m _peak in the signal-filtered ECG signal ECG f is marked; wherein:
[0135] If the time difference rpp_nterval is between the minimum interval T1 and the maximum interval T2 (including the end values T1 and T2), the amplitude ECG m _peak_amp of the to-be-determined peak ECG m _peak is compared with the dynamic threshold Th m_peak_amp is greater than or equal to the dynamic threshold Th m Then mark the undetermined peak ECG m _peak is the ECG signal after signal filtering. f The location of the undetermined peak in ECG m _peak corresponds to the electrocardiogram (ECG) signal. f Find a possible R peak and update the dynamic threshold Th according to the following update expression. m :
[0136] Th m =0.25*ECG m _peak_amp+0.375*Th m , #(5)
[0137] If the amplitude ECG m _peak_amp is less than the dynamic threshold Th m If the next peak point is not found, it will be recorded as a new undetermined peak in ECG. m _peak;
[0138] If the time difference rpp_interval is greater than the maximum interval T2, there is a possibility of missing the R peak; in this case, search backwards for the previous peak point on the ECG. m _peak_pre, the peak point ECG m The amplitude of _peak_pre (ECG) m _peak_pre_amp and 0.25*Th m Compare; if the amplitude ECG m _peak_pre_amp is greater than or equal to 0.25 * Th m Then mark the peak point of ECG. m _peak_pre is the ECG signal after signal filtering. f The location of the undetermined peak in ECG m _peak corresponds to the electrocardiogram (ECG) signal. f Find a possible R peak and update the dynamic threshold Th according to the following update expression. m :
[0139] Th m =0.25*ECG m _peak_amp+0.25*Th m , #(6)
[0140] If the amplitude ECG m _peak_pre_amp is less than 0.25*Th m Then the current undetermined peak ECGm _peak amplitude ECG m _peak_amp and dynamic threshold Th m Compare the results and mark the undetermined ECG peaks based on the time difference rpp_interval being between the minimum interval T1 and the maximum interval T2. m _peak is the ECG signal after signal filtering. f The position in the middle and the dynamic threshold Th are updated. m ;
[0141] If the time difference rpp_interval is less than T1, then search for the next peak point and record it as a new undetermined peak ECG. m _peak;
[0142] S2013, according to the marked undetermined peak ECG m _peak in ECG signal f The position in the ECG signal f Forward search for peak ECG f _peak and valley ECG f _valley; calculate the peak ECG. f ECG slope of _peak f _peak_slope, if the slope ECG f If the slope of the peak is less than or equal to 0.5 times the slope of the previous defined R peak, then the ECG of the undetermined peak is considered. m _peak as an electrocardiogram (ECG) signal f The R peak in the ECG is considered a misjudged T wave, and the search continues to find the next peak point, which is recorded as a new undetermined peak. m _peak, otherwise continue; the peak value of the obtained peak point ECG f _peak_amp and the valley point ECG f Valley's lowest ECG value f _valley_amp and the dynamic threshold Th are respectively f_pos and dynamic threshold Th f_neg In comparison, the R peak and its direction are determined, and the dynamic threshold is updated; where:
[0143] If the peak ECG f _valley_amp is less than or equal to the dynamic threshold Th f_neg And the peak ECG f _peak_amp is less than or equal to the dynamic threshold Th f_pos The undetermined peak ECG m_peak represents the electrocardiogram (ECG) signal. f The R-peak in the image, wherein the direction of the R-peak R_dir is -1 (i.e., the R-peak is downward), and the amplitude of the R-peak R_amp is ECG. f _valley_amp, at this time update the dynamic threshold Th f_neg for:
[0144] If the peak ECG f _valley_amp is greater than the dynamic threshold Th f_neg or the peak ECG f _peak_amp is greater than the dynamic threshold Th f_pos The undetermined peak ECG m _peak represents the electrocardiogram (ECG) signal. f The R-peak in the image, wherein the direction of the R-peak R_dir is 1 (i.e., the R-peak is upward), and the amplitude of the R-peak R_amp is ECG. f _peak_amp, at this point update the dynamic threshold. for:
[0145] S2014, based on the determined position R_loc and direction R_dic of the R peak, if the direction of the R peak is upward, then forward T of the R peak... q Find the first amplitude less than or equal to the dynamic threshold Th within the duration. q_pos trough ECG f _valley_amp is determined to be point Q, where T q The maximum time interval between point Q and peak R; if the direction of peak R is downward, then T is the time interval before peak R. q Find the first amplitude greater than or equal to the dynamic threshold Th within the duration. q_neg Peak ECG f _peak_amp is determined to be point Q;
[0146] S2015, based on the determined position R_loc and direction R_dic of the R peak, if the direction of the R peak is upward, then T is the distance after the R peak. s Find the first amplitude less than or equal to the dynamic threshold Th within the duration. s_pos trough ECG f _valley_amp, determined as point S, where T s The maximum time interval between point S and peak R; if the direction of peak R is downward, then T is the time interval before peak R. sthe length of the signal ECG s_neg the peak ECG f _peak_amp, determined as the S point;
[0147] According to the obtained R peak, Q point and S point, the QRS complex is obtained;
[0148] S202, the P / T wave detection algorithm, can include the following steps:
[0149] S2020, the filtered ECG signal ECG f is obtained, and the information of two adjacent heartbeats in the signal is obtained. The position from the S point of the first heartbeat to the Q point of the second heartbeat is recorded as an SQ segment, and the position, amplitude and direction of the T wave of the first heartbeat and the position, amplitude and direction of the P wave of the second heartbeat are outputted;
[0150] S2021, the SQ segment is subjected to smoothing filtering to obtain a smoothed signal ECG sq ;
[0151] S2022, according to the length L sq of the smoothed signal ECG sq , the smoothed signal ECG sq is divided into a T region and a P region;
[0152] S2023, the number of peak values in the P region and the amplitude max_p of the maximum value are counted;
[0153] S2024, the dynamic threshold thres_p, thres_t- and thres_t+ are calculated:
[0154] thres_p = min (S_amp + 5, 0), # (7)
[0155]
[0156] thres_t+ = thres_p - 10 # (9)
[0157] In the formula, thres_p is used to determine whether the peak point is a P wave, thres_t- is used to determine whether the valley point is a downward T wave, thres_t+ is used to determine whether the peak point is an upward T wave, and S_amp is the amplitude of the detected S point;
[0158] S2025, if the P region has a peak value and max_p > thres_p, the position of max_p is the peak value of the P wave; if the P region has no peak value or max_p < thres_p, there is no P wave, and P_exis is set to 0 to indicate that the P wave does not exist;
[0159] S2026, the amplitude of the maximum value of the T-zone peak is max_t, and the amplitude of the minimum value of the T-zone peak is min_t, then the peak maximum value max and its position max_loc and the peak minimum value min and its position min_loc of the smoothed signal ECG sq include the following cases:
[0160] P wave exists, max_t < thres_t+ and min_t < thres_t-, at this time, the T wave is downward, and min_t is the amplitude thereof;
[0161] P wave exists, max_t >= thres_t+ or min_t >= thres_t-, at this time, the T wave is upward, and max_t is the amplitude thereof;
[0162] P wave does not exist, min >= thres_t- or max_loc <= min_loc, at this time, the T wave is upward, and max is the amplitude thereof;
[0163] P wave does not exist, min < thres_t- and max_loc > min_loc, at this time, the T wave is downward, and min is the amplitude thereof.
[0164] In a preferred embodiment of S300, the obtained QRS complex and P / T wave are subjected to expert knowledge-based feature mapping to obtain the category features of the electrocardiosignal, which can include the following steps:
[0165] S301, converting the expert knowledge into a feature expression, including:
[0166] RR_diff_pre = RR_inte2 - RR_inte3, (10)
[0167] RR_diff = RR_inte1 - RR_inte2, (11)
[0168] TR_amp_diff = T_amp - R_amp, (12)
[0169] QS_amp_diff = Q_amp - S_amp, (13)
[0170] QRS_duration = S_loc - Q_loc, (14)
[0171] PR_interval = R_loc - P_loc, (15)
[0172] PQ_interval = Q_loc - P_loc, (16)
[0173] In the formula, RR_diff_pre is the difference between the two RR intervals before and after the n-1th heartbeat, RR_diff is the difference between the two RR intervals before and after the nth heartbeat, TR_amp_diff is the difference between the amplitude of the T wave and the amplitude of the R wave, QS_amp_diff is the difference between the amplitude of the Q point and the amplitude of the S point, QRS_duration is the time length of the QRS complex, PR_interval is the time interval between the P wave and the R peak, PQ_interval is the time interval between the P wave and the Q point, RR_inte1, RR_inte2 and RR_inte3 are respectively the time difference between the R peak of the n+1th heartbeat cycle and the R peak of the nth heartbeat cycle, the time difference between the R peak of the nth heartbeat cycle and the R peak of the n-1th heartbeat cycle, and the time difference between the R peak of the n-1th heartbeat cycle and the R peak of the n-2th heartbeat cycle; T_amp, R_amp, Q_amp and S_amp are respectively the amplitudes of the T wave, the R peak, the Q wave and the S wave of the nth heartbeat cycle; S_loc, Q_loc, R_loc and P_loc are respectively the time points corresponding to the amplitudes of the T wave, the R peak, the Q wave and the S wave of the nth heartbeat cycle.
[0174] In S302, according to the characteristic expression of the expert knowledge, the characteristics of the expert knowledge mapping are obtained for the obtained QRS complex and P / T wave, and the R peak direction R_dic, the T wave direction T_dic, the time difference RR_inte1, the time difference RR_inte2, the R peak amplitude R_amp, the T wave amplitude T_amp, the S wave slope S_slo and the P wave existence P_exis indicating whether the P wave exists are obtained, that is, the category characteristics of the electrocardiosignal are obtained.
[0175] In a preferred embodiment of S400, the category characteristics of the obtained electrocardiosignal are compared with a preset threshold value, and it is judged whether the arrhythmia signal is obtained, which can include the following steps:
[0176] S401, when the absolute amount of the characteristics is greater than or less than the set threshold value, the electrocardiosignal is determined to be the arrhythmia signal, which includes any one or any multiple of the following cases:
[0177] P_exist==0, indicating that the P peak is missing;
[0178] (R_dir==1)&&(T_dir==-1), indicating that the polarity of the R peak and the T peak is opposite;
[0179] (RR_inte1<RR_inte_min)&&(RR_inte2<RR_inte_min), indicating that the interval between the two consecutive R peaks is too short;
[0180] (RR_inte1 > RR_inte_max) && (RR_inte2 > RR_inte_max), indicating that the interval between two consecutive R peaks is too long;
[0181] TR_amp_diff > TR_amp_diff_max, indicating that the T peak is higher than the R peak and exceeds a certain range;
[0182] (QRS_duration > case6_qrs_duration_thres) && (S_slo < case6_s_slo_thres), indicating that the QRS wave appears too early;
[0183] PR_interval < case7_pr_thres, indicating that the PR interval is too short;
[0184] In the formula, P_exis indicates whether the P wave exists, R_dic is the direction of the R peak, T_dir is the direction of the T wave, RR_inte1 is the time difference between the R peak of the n+1 heartbeat cycle and the R peak of the n heartbeat cycle, RR_inte_min is the minimum normal value of the RR interval, RR_inte2 is the time difference between the R peak of the n heartbeat cycle and the R peak of the n-1 heartbeat cycle, RR_inte_max is the maximum normal value of the RR interval, TR_amp_diff is the difference between the amplitude of the T wave and the amplitude of the R wave, TR_amp_diff_max is the maximum normal value of the difference between the amplitude of the T wave and the amplitude of the R wave, QRS_duration is the time length of the QRS complex, case6_qrs_duration_thres is the minimum value of the QRS complex duration when the QRS wave is wide and the S wave is wide, S_slo is the S wave slope, case6_s_slo_thres is the minimum value of the S wave slope when the S wave is wide, PR_interval is the time interval between the P wave and the R peak, and case7_pr_thres is the minimum normal time interval between the P wave and the R peak when the PR interval is too short;
[0185] S402, when the difference between the feature value and the normal value is greater than the set threshold value, determining that the electrocardiosignal is an arrhythmia signal, including any one or any multiple of the following cases:
[0186] ((RR_inte1-RR_inte1_n) < case8_rr_inter1_thres) && ((RR_inte2- RR_inte2_n) > case8_rr_inter2_thres), indicating that the QRS wave appears too early;
[0187] (RR_diff - RR_diff_n) > case9_rr_diff_thres, indicating that the QRS wave appears early;
[0188] (|RR_diff - RR_diff_n| < case10_rr_diff_thres) && ((RR_intel - RR_intel_n) < case10_rr_interl_thres) && ((RR_inte2 - RR_inte2_n) > case10_rr_inter2_thres), indicating that the interval between two consecutive R peaks is too short;
[0189] |R_amp - R_amp_n| > R_amp_thres, indicating that the QRS wave appears early;
[0190] |S_amp - S_amp_n| > S_amp_thres, indicating that the QRS wave appears early;
[0191] |Q_amp - Q_amp_n| > Q_amp_thres, indicating that the QRS wave appears early;
[0192] T_dic_n!= T_dic, indicating that the QRS wave appears early;
[0193] (QRS_duration - QRS_duration_n) > QRS_duration_thres, indicating that the QRS wave appears early;
[0194] ((QRS_duration - QRS_duration_n) > case16_qrs_duration_thres) && ((R_amp - R_amp_n) > case16_r_amp_thres), indicating that the QRS wave appears early;
[0195] |S_slo - S_slo_n| > case17_s_slo_thres, indicating that the QRS wave appears early;
[0196] ((QS_amp_diff - QS_amp_diff_n) > case18_r_amp_thres) && ((QRS_duration - QRS_duration_n) > case18_qrs_duration_thres), indicating that the QRS wave appears early;
[0197] (|R_amp-R_amp_n| > case19_r_amp_thres) && (|T_amp-T_amp_n| > case19_t_amp_thres), indicates that the PR interval is too short;
[0198] (PR_interval < case20_pr_thres) && ((PQ_interval-PQ_interval_n) < pq_thres), indicates that the PR interval is too short;
[0199] wherein, *n represents the normal value of the feature, *thres represents the configurable setting threshold; RR_intel is the time difference between the R peak of the n+1th heartbeat cycle and the R peak of the nth heartbeat cycle, case8_rr_interl_thres is the maximum value of the difference between RR_intel and its normal value when QRS wave is advanced, RR_inter2 is the time difference between the R peak of the nth heartbeat cycle and the R peak of the n-1th heartbeat cycle, case8_rr_inter2_thres is the minimum value of the difference between RR_inter2 and its normal value when QRS wave is advanced, RR_diff is the difference between the two RR intervals of the nth heartbeat, case9_rr_diff_thres is the minimum value of the difference between RR_diff and its normal value when QRS wave is advanced, case10_rr_diff_thres is the minimum value of the difference between RR_diff and its normal value when the interval between two consecutive R peaks is too short, case10_rr_interl_thres is the minimum value of the difference between RR_interl and its normal value when the interval between two consecutive R peaks is too short, case10_rr_inter2_thres is the minimum value of the difference between RR_inter2 and its normal value when the interval between two consecutive R peaks is too short, R_amp is the amplitude of the R peak, R_amp_thres is the maximum value of the deviation of the normal R peak amplitude from the normal value, S_amp is the amplitude of the S wave, Samp_thres is the maximum value of the deviation of the normal S wave amplitude from the normal value, Q_amp is the amplitude of the Q wave, Q_amp_thres is the maximum value of the deviation of the normal Q wave amplitude from the normal value, T_dic is the direction of the T wave, QRS_duration is the duration of the QRS wave, QRS_duration_thres is the minimum value of the deviation of the QRS wave duration from its normal value when the QRS wave is wide, case16-qrs_duration_thres is the minimum value of the deviation of the QRS wave duration from its normal value when the QRS wave is wide with R peak constraint, case16_r_amp_thres is the minimum value of the deviation of the R peak amplitude from the normal value when the QRS wave is wide, S_slo is the slope of the S wave, case17_s_slo_thres is the minimum value of the deviation of the slope of the S wave from its normal value when the S wave is slow, QS_amp_diff is the difference between the amplitude of the Q point and the amplitude of the S point, case18_qs_amp_thres is the minimum value of the deviation of QS_amp_diff from its normal value when the QRS wave is wide, case18_qrs_duration_thres is the minimum value of the deviation of the QRS wave duration from its normal value when the QRS wave is wide with QS_amp_diff constraint, case19_r_amp_thres is the minimum value of the deviation of the R peak amplitude from the normal value when the amplitudes of the R peak and the T wave deviate too much from the normal value at the same time,case19_t_amp_thres is the minimum deviation of the T-peak amplitude from the normal value when both the R-wave and T-wave amplitudes deviate too much from the normal value. PR_interval is the time interval between the P-wave and the R-wave. case20_pr_thres is the minimum deviation of PR_interval from the normal value when the PR interval is too small. PQ_interval is the time interval between the P-wave and the Q-wave. pq_thres is the minimum deviation of PQ_interval from the normal value when the PQ interval is too small.
[0200] The arrhythmia signal detection method based on expert knowledge provided in the above embodiments of the present invention first performs accurate P-QRS-T localization of the electrocardiogram signal, laying the foundation for subsequent detection of arrhythmia signals based on cardiology expert knowledge; then, the arrhythmia signal detected based on expert knowledge is converted into a mathematical expression to address the adverse effects of the individuality of biological signals on abnormal signals and improve the detection accuracy. This method is computationally simple and suitable for low-power hardware implementation.
[0201] The technical solutions provided by the above embodiments of the present invention will be further described below with reference to the accompanying drawings.
[0202] like Figure 2 As shown, the arrhythmia signal detection method provided in the above embodiments of the present invention mainly includes four parts: signal filtering, P-QRS-T localization, feature mapping based on expert knowledge, and threshold judgment. Wherein:
[0203] I. Signal Filtering:
[0204] Raw electrocardiogram (ECG) signals are easily overwhelmed by background noise from various sources, including power line interference (50Hz or 60Hz), baseline drift (0.15-0.3Hz), and motion artifacts caused by muscle activity. Therefore, signal filtering is crucial for noise reduction and obtaining a clean ECG signal. The spectrum of a clean ECG signal is primarily distributed in the 0-20Hz range; therefore, high-frequency noise can be easily eliminated using low-pass filters. However, the frequency range of baseline drift overlaps with that of the ECG signal, increasing the difficulty of baseline drift removal. Current baseline drift removal methods, including wavelet transform, median filters, and morphological filters, require significant hardware storage or computational complexity. Furthermore, simple low-pass finite impulse response (FIR) filters have poor stopband attenuation and insufficient noise suppression capabilities. Therefore, infinite impulse response (IIR) bandpass filters are used to suppress high-frequency noise and baseline drift.
[0205] To suppress noise as much as possible while preserving valid ECG information, the low-pass cutoff frequency is set to 15Hz; the high-pass cutoff frequency is set to 1Hz. Where resources permit, the priority should be given to making the transition band as narrow as possible, the stopband attenuation as large as possible, and the passband ripple as small as possible. The expression for the IIR filter is as follows:
[0206]
[0207] Where x[n] represents the original digital electrocardiogram signal, y[n] represents the signal after passing through a bandpass filter, and a p and b q These are the coefficients of the IIR filter, where p is the delay of the input signal, q is the delay of the filtered signal, M is the maximum delay of the input signal, and N is the maximum delay of the filtered signal.
[0208] To simplify calculations, the coefficient a in floating-point form is... p and b q Quantization is performed to a fixed-point number, and the number of decimal and integer bits is appropriately selected to avoid spectral oscillations in the IIR filter.
[0209] II. P-QRS-T Positioning
[0210] Although ECG signals have relatively weak amplitudes, typically only a few millivolts, they possess relatively distinct "P," "Q," "R," "S," and "T" characteristics. These characteristics play a crucial role in the analysis of arrhythmia signals within a cardiology expert system. For example, QRS duration (the time interval from the start to the end of a QRS complex) is a key indicator of premature ventricular contractions (PVCs), and a wide QRS complex indicates slow ventricular depolarization. Therefore, robust P-QRS-T localization algorithms are essential for improving the accuracy of expert-guided arrhythmia detection frameworks.
[0211] The P-QRS-T localization algorithm proposed in the above embodiments of the present invention consists of two steps: QRS wave group detection and P / T wave detection.
[0212] 1. QRS group detection
[0213] like Figure 3 As shown, the QRS group detection algorithm accurately detects the positions of the R, Q, and S peaks and the direction of the R peak from the filtered signal. The process of the QRS group detection algorithm proposed in the above embodiment of the present invention is as follows:
[0214] (1) QRS enhancement processing: The output signal of the bandpass filter (i.e., the ECG signal after signal filtering) is processed to enhance the QRS signal. f The QRS-enhanced ECG signal is obtained after differential, squared, and smoothing filtering. m The filter expression is as follows:
[0215] ECG d [n] = 2ECG f [n+1]+ECG f [n+2]-2ECG f [n-1]-ECG f [n-2],#(2)
[0216] ECG s [n] = ECG d [n]*ECG d [n],#(3)
[0217]
[0218] Among them, ECG d The signal after differential filtering, ECG s This is the signal after square filtering.
[0219] (2) Identifying undetermined peaks: from ECG m Find the peak point in the ECG and record the found peak point as an undetermined peak. m _peak, compares the time difference rpp_interval between the undetermined peak and the previous R peak with the minimum interval T1 between R peaks and the maximum interval T2 between R peaks.
[0220] Case 1: rpp_interval is between T1 and T2, and the amplitude of the peak to be determined is measured using ECG. m _peak_amp and dynamic threshold Th m Compare. If it is greater than Th m Then mark the ECG m _peak corresponds to ECG f If a possible R peak is found, jump to ③ and update the threshold Th. m As shown in formula (5); if it is less than Th m If so, start over ② and search for the next ECG. m _peak.
[0221] Th m =0.25*ECG m _peak_amp+0.375*Th m , #(5)
[0222] Scenario 2: If rpp_interval is greater than T2, there is a possibility of missing the R peak. Search backwards for the previous peak point on the ECG. m _peak_pre, will be the amplitude ECG m _peak_pre_apm and 0.25*Thm Compare. If greater than 0.25*Th m , then mark the ECG m _peak as a possible R peak, go to ③ and update the threshold Th f as in equation (6); if less than 0.25*Th m , then compare the current pending peak's amplitude ECG m _peak_amp with the steps in case 1 and update the threshold accordingly. m
[0223] Th m = 0.25*ECG m _peak_amp + 0.25*Th m , # (6)
[0224] Case 3: rpp_interval is less than Tl, then restart ② and look for the next ECG m _peak.
[0225] (3) Determine the R peak and its direction: search for the peak point ECG m _peak and the valley point ECG f _valley in the ECG f from the marked ECG f _peak location; calculate the slope of the peak point ECG f _peak_slope. If ECG f _peak_slope is less than 0.5 times the slope of the last determined R peak, then consider it as a misjudged T wave, return to ②, otherwise continue; compare the obtained peak ECG f _peak_amp and valley ECG f _valley_amp with the dynamic threshold Th f_pos and Th f_neg respectively, determine the R peak and its direction according to the following algorithm and update the threshold.
[0226]
[0227] Where R_dir is the direction of the R peak and R_amp is the amplitude of the R peak.
[0228] (4) Determine the position of the Q point: according to the position of the R peak R_loc and the direction of the R peak R_dic, if the R peak is upward, then search for the first amplitude less than Th q _valley in the T q_pos duration before the R peak. f _valley_amp is determined as point Q; if the R peak is downward, then it is T ahead of the R peak. q Find the first amplitude greater than Th within the duration. q_neg Peak ECG f _peak_amp is determined to be point Q.
[0229] (5) Determine the location of point S: Based on the position R_loc of peak R and the direction R_dic of peak R, if peak R is upward, then point S is located T after peak R. s Find the first amplitude less than Th within the duration. s_pos trough ECG f _valley_amp, determined as point S; if peak R is downward, then T is ahead of peak R. s Find the first amplitude greater than Th within the duration. s_neg Peak ECG f _peak_amp is determined to be point S.
[0230] 2. P / T wave detection
[0231] like Figure 4 As shown, the P / T wave detection algorithm proposed in the above embodiments of the present invention requires combining information from two consecutive heartbeats for judgment. The position from point S of the previous heartbeat to point Q of the current heartbeat is denoted as the SQ segment. The algorithm outputs the position, amplitude, and direction of the T wave of the previous heartbeat and the position, amplitude, and direction of the P wave of the current heartbeat. The specific steps are as follows:
[0232] S1: Obtain ECG by smoothing and filtering the SQ segment. sq ;
[0233] S2: According to ECG sq Length L sq ECG sq Divided into T area and P area;
[0234] S3: Count the number of peaks in region P and the magnitude of the maximum value max_p;
[0235] S4: Calculate the dynamic thresholds thresholds thresholds thres_p, thresholds_t-, and thresholds_t+, as shown in formulas (7), (8), and (9):
[0236] thres_p=min(S_amp+5,0),#(7)
[0237]
[0238] thres-t+=thres_p-10#(9)
[0239] S5: Determine the existence of P-wave. If there is a peak in P-zone and max_p>thres_p, the position of max_p is the peak of P-wave; if there is no peak in P-zone or max_p<thres_p, there is no P-wave, set P_exist as 0;
[0240] S6: Determine the position, amplitude and direction of T-wave. Denote the maximum of T-zone as max_t and the minimum of T-zone as min_t. ECG sq The maximum and its position max, max_loc, the minimum and its position min, min_loc can be classified into the following four cases:
[0241] P-wave exists, max_t<thres_t+ and min_t<thres_t-: T-wave is downward, min_t is its amplitude;
[0242] P-wave exists, max_t>=thres_t+ or min_t>=thres_t-: T-wave is upward, max_t is its amplitude;
[0243] P-wave does not exist, min>=thres_t- or max_loc<=min_loc: T-wave is upward, max is its amplitude;
[0244] P-wave does not exist, min<thres_t- and max_loc>min_loc: T-wave is downward, min is its amplitude.
[0245] III. Feature mapping based on expert knowledge
[0246] For example, Figure 5The typical waveforms of different types of heart beat fluctuations and their characteristics are shown. (a)-(c) belong to S class (supraventricular ectopic beat), including atrial premature beat, junctional premature beat, atrial premature beat with differential transmission, and other arrhythmia signal waveforms. The electrocardiogram is characterized by the early appearance of QRS wave / P wave, and the shape is similar to that of the sinus fluctuation. In (a), the RR interval is significantly shortened; in (b), the P wave is ahead of the previous T wave; and in (c), the P wave is almost fused with the previous T wave. (d)-(g) belong to V class (ventricular ectopic beat), including premature ventricular contraction, ventricular escape, and other arrhythmia signal waveforms. The electrocardiogram shows that the QRS wave appears early, the shape is abnormal, the time limit is mostly >0.12 seconds, the T wave is opposite to the main wave direction of the QRS wave, and the ST shifts with the T wave, and there is no P wave before it, such as (d). In (e), two consecutive V class heart beat fluctuations are shown; in (f), the polarity of the R wave is opposite; and in (e), the T wave amplitude is higher than that of the R wave, and there is no P wave. (d)-(g) belong to F class (fusion beat), including ventricular fusion wave arrhythmia signal waveforms. The electrocardiogram is characterized by short PR interval and wide QRS wave. In (h), the T wave is higher than the R wave, and there is a P wave, but the PR interval is small; in (i), the S wave is wide, and there is a P wave, but the PR interval is small. In summary, the important characteristics of distinguishing S class are that the RR interval is too short; the key to distinguishing V class beat is that the P wave disappears, there are only two obvious waves, and the QRS is wide; and the distinguishing feature of F class beat is that the PR interval is small and the QRS wave is wide. Therefore, each category has obvious morphological characteristics. The above embodiments of the present application comprehensively summarize the basis for arrhythmia signal analysis in electrocardiogram expert knowledge and convert it into a mathematical expression of the characteristics. The expression of the characteristics is as follows:
[0247] RR_diff_pre = RR_inte2 - RR_inte3, (10)
[0248] RR_diff = RR_inte1 - RR_inte2, (11)
[0249] TR_amp_diff = T_amp - R_amp, (12)
[0250] QS_amp_diff = Q_amp - S_amp, (13)
[0251] QRS_duration = S_loc - Q_loc, (14)
[0252] PR_interval = R_loc - P_loc, (15)
[0253] PQ_interval = Q_loc - P_loc, (16)
[0254] Wherein, RR_diff_pre is the difference between the two RR intervals of the n-1th heartbeat, RR_diff is the difference between the two RR intervals of the nth heartbeat, TR_amp_diff is the difference between the amplitude of T wave and the amplitude of R wave, QS_amp_diff is the difference between the amplitude of Q point and the amplitude of S point, QRS_duration is the time length of QRS complex, PR_interval is the time interval between P wave and R peak, PQ_interval is the time interval between P wave and Q point, RR_inte1, RR_inte2 and RR_inte3 are the time differences between the R peak of the next heartbeat cycle and the R peak of the current heartbeat cycle, the R peak of the current heartbeat cycle and the R peak of the previous heartbeat cycle and the R peak of the previous heartbeat cycle and the R peak of the heartbeat cycle before the previous heartbeat cycle respectively. T_amp, R_amp, Q_amp and S_amp are the amplitudes of T wave, R peak, Q wave and S wave of the current heartbeat cycle respectively, and S_loc, Q_loc, R_loc and P_loc are the corresponding time points respectively.
[0255] In addition to the values calculated by the formulas (10)-(16), the features mapped by the expert knowledge are obtained, and the R peak direction R_dic, the T wave direction T_dic, the time difference RR_inte1, the time difference RR_inte2, the R peak amplitude R_amp, the T wave amplitude T_amp, the S wave slope S_slo and whether the P wave exists P_exi are also used as important features for the detection of arrhythmia signal abnormalities.
[0256] Four, threshold judgment
[0257] After the features mapped by the expert knowledge are obtained, a threshold needs to be designed to detect abnormalities. Some features only need to be greater or less than a certain threshold in absolute amount, and then the abnormalities are determined. Another part of the features needs to be subtracted from the normal value, and then the abnormalities are determined if the difference is greater than a certain threshold. The present application summarizes the following abnormal conditions:
[0258] 1. Absolute amount
[0259] Case 1: P_exist==0, indicating that the P peak is missing
[0260] Case 2: (R_dir==1)&&(T_dir==-1), indicating that the polarity of R peak and T peak is opposite
[0261] Case 3: (RR_inte1<RR_inte_min)&&(RR_inte2<RR_inte_min), indicating that the interval between two consecutive R peaks is too short, which can reflect tachycardia
[0262] Case 4: (RR_intel > RR_inte_max) && (RR_inte2 > RR_inte_max), indicating that the interval between two consecutive R peaks is too long, which can reflect bradycardia
[0263] Case 5: TR_amp_diff > TR_amp_diff_max, indicating that the T peak is higher than the R peak and exceeds a certain range
[0264] Case 6: (QRS_duration > case6-qrs_duration_thres) && (S_slo < case6_s_slo_thres),
[0265] Case 7: PR_interval < case7_pr_thres, indicating that the PR interval is too short
[0266] 2. Relative amount
[0267] Case 8: ((RR_intel - RR_intel_n) < case8_rr_inter1_thres) && ((RR_inte2 - RR_inte2_n) > case8_rr_inter2_thres),
[0268] Case 9: (RR_diff - RR_diff_n) > case9_rr_diff_thres,
[0269] Case 10: (|RR_diff - RR_diff_n| < case10_rr_diff_thres) && ((RR_intel - RR_intel_n) < case10_rr_inter1_thres) && ((RR_inte2 - RR_inte2_n) > case10_rr_inter2_thres),
[0270] Case 11: |R_amp - R_amp_n| > R_amp_thres,
[0271] Case 12: |S_amp - S_amp_n| > S_amp_thres,
[0272] Case 13: |Q_amp - Q_amp_n| > Q_amp_thres,
[0273] Case 14: T_dic_n!= T_dic,
[0274] Case 15: (QRS_duration-QRS_duration_n) > QRS_duration_thres,
[0275] Case 16: ((QRS_duration-QRS_duration_n) > case16_qrs_duration_thres) && ((R_amp-R_amp_n) > case16_r_amp_thres),
[0276] Case 17: |S_slo-S_slo_n| > case17_s_slo_thres,
[0277] Case 18: ((QS_amp_diff-QS_amp_diff_n) > case18_r_amp_thres) && ((QRS_duration-QRS_duration_n) > case18_qrs_duration_thres),
[0278] Case 19: (|R_amp-R_amp_n| > case19_r_amp_thres) && (|T_amp-T_amp_n| > case19_t_amp_thres),
[0279] Case 20: (PR_interval < case20_pr_thres) && ((PQ_interval-PQ_interval_n) < pq_thres),
[0280] Wherein, the character ended with "_n" represents the normal value of the feature, and the character ended with "_thres" represents the configurable threshold value.
[0281] Case 1, Case 8 and Case 9 belong to the S type in which the QRS wave appears in advance; Case 3 and Case 10 belong to the S type in which the interval between two continuous R peaks is too short, which can reflect the tachycardia of continuous heartbeats; Case 1, Case 2, Case 6, Case 11, Case 12, Case 13, Case 14, Case 15, Case 16, Case 17 and Case 18 all belong to the V type in which the QRS wave appears in advance, the abnormality of the shape, and the time limit is mostly > 0.12 seconds, and the mathematical expression of the T wave and the QRS wave main wave direction is opposite; Case 5, Case 7, Case 19 and Case 20 belong to the F type, which is manifested as the short PR interval, the wide QRS wave, the T wave higher than the R wave, the P wave, but the PR interval is small.
[0282] The technical solutions provided by the above embodiments of the application are further described below in combination with a specific application example.
[0283] The specific related values in this specific application example are summarized based on the verification results on the MIT-BIH, QT, etc. databases.
[0284] In this specific application example, the four parts contained in the arrhythmia signal detection method are as follows:
[0285] 1. Signal filtering: Chebyshev Type I IIR filter is used, which has steeper stopband attenuation compared with other types of IIR filters (such as Butterworth, Bessel filter). According to the frequency range of the signal and noise, the passband cutoff frequency of the IIR filter is selected as 1-15Hz, and the ripple is less than 3dB. The stopband corner frequency is set to 0.1-40Hz, and the attenuation is at least 20dB. In the process of coefficient quantization, we use 22-bit fixed-point numbers to represent the coefficients, and the fixed-point numbers are composed of 4 signed integer bits and 18 decimal bits. And the coefficients are expanded by 2 18 times to avoid decimal calculation.
[0286] 2. P-QRS-T positioning: first is the threshold initialization stage, first use the first 1500 samples to initialize Th m and Th f_pos , Th m is 0.25 times the maximum value of ECG m , Th f_pos is 0.25 times the maximum value of ECG f , Th f_meg is initialized to 0. We set the minimum RR interval T1 to 40 and the maximum RR interval T2 to 1.5 times RR_inte_mean under the condition of a sampling frequency of 256Hz. Since RR_inte_mean is calculated by the average of the last 8 RR_inte, the application starts to count the number of detected R peaks after 1500 sample points. When the number of detected R peaks is less than or equal to 9, in the pending peak search stage, the length of rpp_interval is not classified and discussed (T2 is not accurate), only the amplitude is judged. When the number of R peaks is greater than or equal to 9, the normal P-QRS-T positioning algorithm is started.
[0287] 3. Feature mapping based on expert knowledge: consistent with the foregoing, it will not be repeated here.
[0288] 4. Threshold judgment: the normal value of the feature needs to be obtained by the average of the first 8 normal heartbeats of the individual, so at least 8 normal heartbeat signals are needed before starting to detect abnormalities. In the case of a signal sampling rate of 256Hz and a sample of 12-bit signed numbers, the threshold of the abnormality is set as follows:
[0289] (1) Absolute quantity
[0290] Case 1: P exist == 0,
[0291] Case 2: (R dic == 1) && (T dic == -1),
[0292] Case 3: (RR intel < 150) && (RR inte2 < 150),
[0293] Case 4: (RR intel > 300) && (RR inte2 > 300),
[0294] Case 5: TR amp diff > 150,
[0295] Case 6: (QRS duration > 40) && (S slo < 10),
[0296] Case 7: PR interval < 10,
[0297] (2) Relative quantity
[0298] Case 8: ((RR intel - RR intel n) < -20) && ((RR inte2 - RR inte2 n) > 20),
[0299] Case 9: (RR diff - RR diff n) > 20,
[0300] Case 10: (|RR diff - RR diff n| < 20) && ((RR intel - RR intel n) < -15) && ((RR inte2 - RR inte2 n) > -15),
[0301] Case 11: |R amp - R amp n| > 200,
[0302] Case 12: |S amp - S amp n| > 200,
[0303] Case 13: |Q amp - Q amp n| > 200,
[0304] Case 14: T dic n!= T dic,
[0305] Case 15: (QRS duration - QRS duration n) > 80,
[0306] Case 16: ((QRS_duration-QRS_duration_n) > 20) && ((R_amp-R_amp_n) > 30),
[0307] Case 17: |S_slo-S_slo_n| > 30,
[0308] Case 18: ((QS_amp_diff-QS_amp_diff_n) > 5) && ((QRS_duration-QRS_duration_n) > 30),
[0309] Case 19: (|R_amp-R_amp_n| > 50) && (|T_amp-T_amp_n| > 30),
[0310] Case 20: (PR_interval < 20) && ((PQ_interval-PQ_interval_n) < -15).
[0311] An embodiment of the present application provides a heart arrhythmia signal detection system based on expert knowledge.
[0312] As shown in the figure, the heart arrhythmia signal detection system based on expert knowledge provided by the embodiment can comprise the following modules: Figure 6
[0313] A signal filtering module filters high-frequency noise and baseline drift in the acquired electrocardio signal.
[0314] A P-QRS-T positioning detection module detects P-QRS-T positioning of the signal-filtered electrocardio signal to obtain QRS complex and P / T wave.
[0315] A feature mapping module maps the obtained QRS complex and P / T wave based on expert knowledge to obtain the category feature of the electrocardio signal.
[0316] A heart arrhythmia signal detection module compares the obtained category feature of the electrocardio signal with a preset threshold to determine the heart arrhythmia signal and complete the detection of the heart arrhythmia signal.
[0317] It should be noted that the steps in the method provided by the present application can be realized by corresponding modules, devices, units, etc. in the system, and those skilled in the art can refer to the technical solution of the method to realize the composition of the system, i.e., the embodiments in the method can be understood as preferred examples of constructing the system, which will not be described here.
[0318] An embodiment of the present application provides a terminal, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, and when the processor executes the program, the processor can be used to execute the method in any of the above-mentioned embodiments of the present application, or run the system in any of the above-mentioned embodiments of the present application.
[0319] An embodiment of the present application further provides a computer readable storage medium, which stores a computer program, and when the processor executes the program, the processor can be used to execute the method in any of the above-mentioned embodiments of the present application, or run the system in any of the above-mentioned embodiments of the present application.
[0320] Optionally, the memory is used for storing the program; the memory can comprise a volatile memory (English: volatile memory), for example, a random access memory (English: random-access memory, abbreviation: RAM), such as a static random access memory (English: static random-access memory, abbreviation: SRAM), a double data rate synchronous dynamic random access memory (English: Double Data Rate Synchronous Dynamic Random Access Memory, abbreviation: DDR SDRAM) and the like; the memory can also comprise a non-volatile memory (English: non-volatile memory), for example, a flash memory (English: flash memory). The memory is used for storing a computer program (such as an application program, a functional module and the like for realizing the above-mentioned method), computer instructions and the like, and the above-mentioned computer program, computer instructions and the like can be stored in one or more memories in a partitioned manner. And the above-mentioned computer program, computer instructions, data and the like can be called by the processor.
[0321] The above-mentioned computer program, computer instructions and the like can be stored in one or more memories in a partitioned manner. And the above-mentioned computer program, computer instructions, data and the like can be called by the processor.
[0322] The processor is used for executing the computer program stored in the memory, so as to realize each step in the method related to the above-mentioned embodiments. Details can be referred to the related description in the above-mentioned method embodiments.
[0323] The processor and the memory can be an independent structure, or an integrated structure. When the processor and the memory are an independent structure, the memory and the processor can be coupled and connected through a bus.
[0324] The method, system, terminal and medium for arrhythmia signal detection based on expert knowledge provided by the above embodiments of the present application first propose a method for arrhythmia signal detection based on the detection of arrhythmia according to the knowledge of cardiologists, which helps to solve the problem of individual differences of biological signals and improves the detection accuracy; a P-QRS-T positioning method is implemented, which fully considers the morphology of abnormal heartbeats and the timing of positioning P / T waves, jointly considers two heartbeats before and after, can effectively avoid the inaccurate P-QRS-T positioning due to the abnormal heartbeats, and has high robustness; the operation complexity of the arrhythmia signal detection is low, and is suitable for application in high-precision and ultra-low-power electrocardio monitoring chips.
[0325] The details not described in the above embodiments of the present application are known in the art.
[0326] The specific embodiments of the present application are described above. It should be understood that the present application is not limited to the specific embodiments described above, and various modifications or changes can be made by those skilled in the art within the scope of the claims, which does not affect the essential content of the present application.
Claims
1. An expert knowledge based method for arrhythmia signal detection, characterized in that, The method comprises the following steps: Signal filtering is performed on the acquired electrocardio signal, and an infinite impulse response band-pass filter is used to suppress high-frequency noise and baseline drift in the electrocardio signal; QRS wave group detection algorithm and P / T wave detection algorithm are used respectively to perform P-QRS-T positioning detection on the signal-filtered electrocardio signal, so as to obtain QRS wave group and P / T wave; Expert knowledge-based feature mapping is performed on the obtained QRS wave group and P / T wave, so as to obtain the category feature of the electrocardio signal; The obtained category feature of the electrocardio signal is compared with a preset threshold value, so as to obtain an arrhythmia signal and complete detection of the arrhythmia signal; The P / T wave detection algorithm comprises the following steps: Obtaining a filtered electrocardiogram signal ECG f two adjacent heart beat information in the signal, through the position from the S point of the first heart beat to the Q point of the second heart beat, recorded as the SQ segment, outputting the position, amplitude and direction of the T wave of the first heart beat and the position, amplitude and direction of the P wave of the second heart beat; Smooth filtering the SQ segment to obtain a smooth filtered signal ECG sq ; According to the smoothed filtered signal ECG sq length L sq , the smoothed filtered signal ECG sq is divided into T zone and P zone; The number of peak values in the P area and the amplitude max_p of the maximum value are counted; Dynamic threshold values thres_p, thres_t- and thres_t+ are calculated: thres_p = min(S_amp + 5, 0), (7) thres_t+ = thres_p - 10 (9) In the formula, thres_p is used to determine whether a peak point is a P wave, thres_t- is used to determine whether a valley point is a downward T wave, thres_t+ is used to determine whether a peak point is an upward T wave, and S_amp is the amplitude of the detected S point; If the P area has a peak value and max_p > thres_p, the position of max_p is the peak value of the P wave; if the P area has no peak value or max_p < thres_p, there is no P wave, and P_exis is set to 0 to indicate that the P wave does not exist; The amplitude of the maximum of the T-zone peak is denoted max_t and the amplitude of the minimum of the T-zone peak is denoted min_t. The smoothed signal ECG sq The maximum max and its location max_loc and the minimum min and its location min_loc of the peaks of the smoothed signal ECG sq include the following cases: P wave exists, max_t < thres_t+ and min_t < thres_t-, at this time, the T wave is downward, and min_t is the amplitude thereof; P wave exists, max_t >= thres_t+ or min_t >= thres_t-, at this time, the T wave is upward, and max_t is the amplitude thereof; P wave does not exist, min >= thres_t- or max_loc <= min_loc, at this time, the T wave is upward, and max is the amplitude thereof; P wave does not exist, min < thres_t- and max_loc > min_loc, at this time, the T wave is downward, and min is the amplitude thereof.
2. The expert knowledge based arrhythmia signal detection method according to claim 1, characterized in that, The signal filtering performed on the acquired electrocardio signal, and the infinite impulse response band-pass filter used to suppress high-frequency noise and baseline drift in the electrocardio signal, comprises the following steps: The expression of the infinite impulse response band-pass filter is as follows: where x[n] represents the original digital ECG signal, y[n] represents the ECG signal after filtered by the band-pass filter, a p and b q are the coefficients of the infinite impulse response band-pass filter, p is the delay of the input signal, q is the delay of the filtered signal, M is the maximum delay of the input signal, and N is the maximum delay of the filtered signal.
3. The expert knowledge based arrhythmia signal detection method according to claim 2, characterized in that, coefficients a p and b q quantizing from floating-point form into fixed-point number; wherein the decimal place and integer place of the fixed-point number respectively represent the decimal part and integer part of the original floating-point number, and the bit width is selected and set according to the minimum accuracy required to ensure that the filter is not oscillating.
4. The expert knowledge based arrhythmia signal detection method according to claim 1, characterized in that, The QRS wave group detection algorithm comprises the following steps: The signal-filtered electrocardio signal is subjected to difference, squaring and smoothing filtering, so as to obtain a QRS-enhanced signal; wherein: ECG d [n] = 2 ECG f [n+1] + ECG f [n+2] - 2 ECG f [n-1] - ECG f [n-2], (2) ECG s [n] = ECG d [n] * ECG d [n], (3) wherein ECG f is the filtered ECG signal, ECG d is the difference filtered signal, ECG s is the square filtered signal, ECG m is the QRS enhanced signal after smoothing filtering. from the QRS-enhanced signal ECG m find a peak point, and mark the found peak point as a pending peak ECG m _peak, and compare the time difference rpp_interval between the pending peak ECG m _peak and the last R peak with the minimum interval T1 between R peaks and the maximum interval T2 between R peaks, and mark the position of the pending peak ECG m _peak in the filtered ECG signal ECG f . if the time difference rpp_interval is greater than or equal to a minimum interval T1 and less than or equal to a maximum interval T2, the pending peak ECG m _peak is compared with a dynamic threshold Th m ; if the amplitude ECG m _peak_amp of the pending peak ECG m _peak is greater than or equal to the dynamic threshold Th m , the pending peak ECG m _peak is marked in the filtered ECG f _signal at a location corresponding to a possible R peak in the ECG m _signal, and the dynamic threshold Th f is updated according to the following update expression m : Th m = 0.25 * ECG m _peak_amp + 0.375 * Th m , (5) If the amplitude ECG m _peak is less than the dynamic threshold Th m then a next peak point is re-found, denoted as a new pending peak ECG m _peak; If the time difference rpp_interval is greater than the maximum interval T2, there is a possibility of missing an R peak; at this time, the last peak point ECG m _peak_pre is found forwardly m The amplitude ECG m _peak_pre of the peak point ECG m _peak_pre is compared with 0.25*Th m If the amplitude ECG m _peak_pre is greater than or equal to 0.25*Th m , the peak point ECG f _peak_pre is marked in the position of the signal filtered electrocardio signal ECG m , the pending peak ECG f _peak corresponds to a possible R peak in the electrocardio signal ECG m , and the dynamic threshold Th is updated according to the following update expression Th m = 0.25 * ECG m _peak_amp + 0.25 * Th m , (6) If the amplitude ECG m _peak__pre_amp is less than 0.25*Th m Then the current undetermined peak ECG m _peak amplitude ECG m _peak_amp and dynamic threshold Th m The comparisons are made, and based on the case where the time difference rpp_interval is between the minimum interval T1 and the maximum interval T2, the undetermined ECG peaks are marked. m _peak is the ECG signal after signal filtering. f The position in the middle and the dynamic threshold Th are updated. m ; If the time difference rpp_interval is less than Tl, then the next peak is re- found, noted as a new pending peak ECG m _peak; According to the marked pending peak ECG m _peak in the electrocardiosignal ECG f f _forward search for the peak point ECG f _peak and the valley point ECG f _valley; the slope ECG f _peak_slope of the peak point ECG f _peak is calculated, if the slope ECG f _peak_slope is less than or equal to 0.5 times the slope of the last determined R peak, the pending peak ECG m _peak is considered as a misjudged T wave in the electrocardiosignal ECG f , and the search for the next peak point is returned to, marked as a new pending peak ECG m _peak, otherwise it continues; the peak value ECG f _peak_amp of the peak point obtained and the valley value ECG f _valley of the valley point ECG f _valley_amp are compared with the dynamic threshold Th f_pos and the dynamic threshold Th f_neg respectively, the R peak and its direction are determined, and the dynamic threshold is updated; wherein: if the peak ECG f _peak_amp is less than or equal to the dynamic threshold Th f_neg , and the peak ECG f _peak_amp is less than or equal to the dynamic threshold Th f_pos , then the pending peak ECG m _peak is an R peak in the ECG signal ECG f with a direction R_dir of -1, indicating a downward R peak, and an amplitude R_amp of ECG f _valley_amp, at which time the dynamic threshold Th f_neg is updated as follows: Th f_neg = 0.25 * ECG f _valley_amp + 0.5 * Th f_neg ; if the peak ECG f _valley_amp is greater than the dynamic threshold Th f_neg , or the peak ECG f _peak_amp is greater than the dynamic threshold Th f_pos , then the pending peak ECG m _peak is an R peak in the electrocardiogram ECG f , the direction R_dir of the R peak is upward, the amplitude R_amp of the R peak is ECG f _peak_amp, at this time the dynamic threshold Th f_pos is updated as: Th f_pos = 0.25 * ECG f _peak_amp + 0.5 * Th f_pos ; According to the determined position R_loc of the R-peak and the direction R_dic of the R-peak, if the direction of the R-peak is upward, the first valley ECG_valley_amp with an amplitude less than or equal to a dynamic threshold Th q is searched for within a time duration T q_pos forward of the R-peak, and determined as a Q-point, wherein T f is the maximum time interval from the Q-point to the R-peak; if the direction of the R-peak is downward, the first peak ECG_peak_amp with an amplitude greater than or equal to a dynamic threshold Th q is searched for within a time duration T q forward of the R-peak, and determined as a Q-point. q_neg f According to the determined position R_loc of the R-peak and the direction R_dic of the R-peak, if the direction of the R-peak is upward, the first valley ECG_valley_amp with an amplitude less than or equal to a dynamic threshold Th within a time duration T backward of the R-peak is searched for as the S-point, wherein T is the maximum time interval from the R-peak to the S-point; if the direction of the R-peak is downward, the first peak ECG_peak_amp with an amplitude greater than or equal to a dynamic threshold Th within a time duration T forward of the R-peak is searched for as the S-point. s s_pos f s s s_neg f The R peak, Q point and S point are obtained, and the QRS wave group is obtained.
5. The expert knowledge-based arrhythmia signal detection method according to claim 1, wherein, The expert knowledge-based feature mapping performed on the obtained QRS wave group and P / T wave, so as to obtain the category feature of the electrocardio signal, comprises the following steps: The expert knowledge is converted into a feature expression, which comprises the following steps: RR_diff_pre = RR_inte2 - RR_inte3, (10) RR_diff = RR_intel-RR_inte2, (11) TR_amp_diff = T_amp-R_amp, (12) QS_amp_diff = Q_amp-S_amp, (13) QRS_duration = S_loc-Q_loc, (14) PR_interval = R_loc-P_loc, (15) PQ_interval = Q_loc-P_loc, (16) wherein, RR_diff_pre is the difference between the two RR intervals before and after the n-1th heartbeat, RR_diff is the difference between the two RR intervals before and after the nth heartbeat, TR_amp_diff is the difference between the amplitude of T wave and the amplitude of R wave, QS_amp_diff is the difference between the amplitude of Q point and the amplitude of S point, QRS_duration is the time length of QRS complex, PR_interval is the time interval between P wave and R peak, PQ_interval is the time interval between P wave and Q point, RR_intel, RR_inte2 and RR_inte3 are respectively the time difference between the R peak of the n+1th heartbeat cycle and the R peak of the nth heartbeat cycle, the time difference between the R peak of the nth heartbeat cycle and the R peak of the n-1th heartbeat cycle and the time difference between the R peak of the n-1th heartbeat cycle and the R peak of the n-2th heartbeat cycle; T_amp, R_amp, Q_amp and S_amp are respectively the amplitude of T wave, R peak, Q wave and S wave of the nth heartbeat cycle; S_loc, Q_loc, R_loc and P_loc are respectively the time corresponding to the amplitude of T wave, R peak, Q wave and S wave of the nth heartbeat cycle; According to the characteristic expression of the expert knowledge, the characteristics of the expert knowledge mapping are obtained for the obtained QRS complex and P / T wave, and the R peak direction R_dic, the T wave direction T_dic, the time difference RR_intel, the time difference RR_inte2, the R peak amplitude R_amp, the T wave amplitude T_amp, the S wave slope S_slo and the parameter P_exis indicating whether the P wave exists are obtained, i.e. the class features of the electrocardio signal are obtained.
6. The expert knowledge based arrhythmia signal detection method according to claim 1, characterized in that, The obtained class features of the electrocardio signal are compared with the preset threshold value, and the arrhythmia signal is obtained, including: When the absolute amount of the feature is greater than or less than the set threshold value, the electrocardio signal is determined as the arrhythmia signal, including any one or any multiple of the following conditions: P_exist == 0, indicating that the P peak is missing; (R_dir == 1) && (T_dir == -1), indicating that the polarity of the R peak and the T peak is opposite; (RR_intel < RR_inte_min) && (RR_inte2 < RR_inte_min), indicating that the interval between the two consecutive R peaks is too short; (RR_inte1>RR_inte_max) && (RR_inte2>RR_inte_max), indicating that the interval between two consecutive R peaks is too long; TR_amp_diff>TR_amp_diff_max, indicating that the T peak is higher than the R peak and exceeds a certain range; (QRS_duration>case6_qrs_duration_thres) && (S_slo<case6_s_slo_thres), indicating that the QRS wave appears too early; PR_interval<case7_pr_thres, indicating that the PR interval is too short; In the formula, P_exis indicates whether the P wave exists, R_dic is the direction of the R peak, T_dir is the direction of the T wave, RR_inte1 is the time difference between the R peak of the n+1 heartbeat cycle and the R peak of the n heartbeat cycle, RR_inte_min is the minimum normal value of the RR interval, RR_inte2 is the time difference between the R peak of the n heartbeat cycle and the R peak of the n-1 heartbeat cycle, RR_inte_max is the maximum normal value of the RR interval, TR_amp_diff is the difference between the amplitude of the T wave and the amplitude of the R wave, TR_amp_diff_max is the maximum normal value of the difference between the amplitude of the T wave and the amplitude of the R wave, QRS_duration is the time length of the QRS complex, case6_qrs_duration_thres is the minimum value of the QRS complex duration when the QRS wave is wide and the S wave is wide, S_slo is the S wave slope, case6_s_slo_thres is the minimum value of the S wave slope when the S wave is wide, PR_interval is the time interval between the P wave and the R peak, and case7_pr_thres is the minimum normal time interval between the P wave and the R peak when the PR interval is too short; When the difference between the feature value and the normal value is greater than the set threshold, the electrocardiosignal is determined to be an arrhythmia signal, including any one or any multiple of the following cases: ((RR_inte1-RR_inte1_n)<case8_rr_inter1_thres) && ((RR_inte2-RR_inte2_n)>case8_rr_inter2_thres), indicating that the QRS wave appears too early; (RR_diff-RR_diff_n)>case9_rr_diff_thres, indicating that the QRS wave appears too early; (|RR_diff-RR_diff_n|<case10_rr_diff_thres) && ((RR_inte1-RR_inte1_n)<case10_rr_inter1_thres) && ((RR_inte2-RR_inte2_n> case10_rr_inter2_thres), indicating that the interval between two consecutive R peaks is too short; | R_amp - R_amp_n | > R_amp_thres, indicating that the QRS wave appears early; | S_amp - S_amp_n | > S_amp_thres, indicating that the QRS wave appears early; | Q_amp - Q_amp_n | > Q_amp_thres, indicating that the QRS wave appears early; T_dic_n!= T_dic, indicating that the QRS wave appears early; (QRS_duration - QRS_duration_n) > QRS_duration_thres, indicating that the QRS wave appears early; ((QRS_duration - QRS_duration_n) > case16_qrs_duration_thres) && ((R_amp - R_amp_n) > case16_r_amp_thres), indicating that the QRS wave appears early; | S_slo - S_slo_n | > case17_s_slo_thres, indicating that the QRS wave appears early; ((QS_amp_diff - QS_amp_diff_n) > case18_qs_amp_thres) && ((QRS_duration - QRS_duration_n) > case18_qrs_duration_thres), indicating that the QRS wave appears early; (| R_amp - R_amp_n | > case19_r_amp_thres) && (| T_amp - T_amp_n | > case19_t_amp_thres), indicating that the PR interval is too short; (PR_interval < case20_pr_thres) && ((PQ_interval - PQ_interval_n) < pq_thres), indicating that the PR interval is too short; comprising: a signal filtering module, which performs signal filtering on the acquired electrocardio signal, and uses an infinite impulse response band-pass filter to suppress high-frequency noise and baseline drift in the electrocardio signal; a P-QRS-T positioning detection module, which uses a QRS complex detection algorithm and a P / T wave detection algorithm to perform P-QRS-T positioning detection on the signal-filtered electrocardio signal to obtain QRS complex and P / T wave; wherein the P / T wave detection algorithm comprises: wherein, _n represents the normal value of the feature, _thres represents the configurable setting threshold; RR_intel is the time difference between the R peak of the n+1th heartbeat cycle and the R peak of the nth heartbeat cycle, case8_rr_inter1_thres is the maximum value of the difference between RR_intel and its normal value when QRS wave is advanced, RR_inter2 is the time difference between the R peak of the nth heartbeat cycle and the R peak of the n-1th heartbeat cycle, case8_rr_inter2_thres is the minimum value of the difference between RR_inter2 and its normal value when QRS wave is advanced, RR_diff is the difference between the two RR intervals of the nth heartbeat, case9_rr_diff_thres is the minimum value of the difference between RR_diff and its normal value when QRS wave is advanced, case10_rr_diff_thres is the minimum value of the difference between RR_diff and its normal value when the interval between two consecutive R peaks is too short, case10_rr_inter1_thres is the minimum value of the difference between RR_inter1 and its normal value when the interval between two consecutive R peaks is too short, case10_rr_inter2_thres is the minimum value of the difference between RR_inter2 and its normal value when the interval between two consecutive R peaks is too short, R_amp is the amplitude of the R peak, R_amp_thres is the maximum value of the deviation of the normal R peak amplitude from the normal value, S_amp is the amplitude of the S wave, S_amp_thres is the maximum value of the deviation of the normal S wave amplitude from the normal value, Q_amp is the amplitude of the Q wave, Q_amp_thres is the maximum value of the deviation of the normal Q wave amplitude from the normal value, T_dic is the direction of the T wave, QRS_duration is the duration of the QRS wave, QRS_duration_thres is the minimum value of the deviation of the QRS wave duration from the normal value when the QRS wave is wide, case16_qrs_duration_thres is the minimum value of the deviation of the QRS wave duration from the normal value when the QRS wave is wide with R peak constraint, case16_r_amp_thres is the minimum value of the deviation of the R peak amplitude from the normal value when the QRS wave is wide, S_slo is the slope of the S wave, case17_s_slo_thres is the minimum value of the deviation of the slope of the S wave from the normal value when the S wave is slow, QS_amp_diff is the difference between the amplitude of the Q point and the amplitude of the S point, case18_qs_amp_thres is the minimum value of the deviation of QS_amp_diff from the normal value when the QRS wave is wide, case18_qrs_duration_thres is the minimum value of the deviation of the QRS wave duration from the normal value when the QRS wave is wide with QS_amp_diff constraint, case19_r_amp_thres is the minimum value of the deviation of the R peak amplitude from the normal value when the amplitudes of the R peak and the T wave deviate from the normal value at the same time,case19_t_amp_thres is the minimum value of the T peak amplitude deviating from the normal value when the amplitudes of the R peak and the T wave deviate from the normal value at the same time, PR_interval is the time interval between the P wave and the R peak, case20_pr_thres is the minimum value of the PR interval deviating from the normal value when the PR interval is too short, PQ_interval is the time interval between the P wave and the Q wave, and pq_thres is the minimum value of the PQ interval deviating from the normal value when the PQ interval is too short.
7. An expert knowledge-based arrhythmia signal detection system characterized by, counting the number of peak values and the amplitude max_p of the maximum value of the P region; calculating dynamic thresholds thres_p, thres_t-, and thres_t+: thres_p = min(S_amp + 5, 0), (7) Obtaining a filtered electrocardiogram signal ECG f The position, amplitude and direction of the T wave of the first heartbeat and the position, amplitude and direction of the P wave of the second heartbeat are output. smoothing filtering the SQ segment to obtain a smoothed signal ECG sq ; According to the smoothed filtered signal ECG sq length L sq the smoothed filtered signal ECG sq is divided into T-zone and P-zone; thres_t+ = thres_p - 10 (9) wherein thres_p is used to determine whether a peak point is a P wave, thres_t- is used to determine whether a valley point is a downward T wave, thres_t+ is used to determine whether a peak point is an upward T wave, and S_amp is the amplitude of the detected S point. If the P region has a peak and max_p>thres_p, the position of max_p is the P wave peak; if the P region has no peak or max_p<thres_p, there is no P wave, and P_exis is set to 0 to indicate that the P wave does not exist; The amplitude of the maximum of the T-zone peak is denoted max_t and the amplitude of the minimum of the T-zone peak is denoted min_t. The smoothed signal ECG sq has a maximum max and its location max_loc and a minimum min and its location min_loc, which are defined as follows: The P wave exists, max_t<thres_t+ and min_t<thres_t-, at this time, the T wave is downward, and min_t is the amplitude thereof; The P wave exists, max_t>=thres_t+ or min_t>=thres_t-, at this time, the T wave is upward, and max_t is the amplitude thereof; The P wave does not exist, min>=thres_t- or max_loc<=min_loc, at this time, the T wave is upward, and max is the amplitude thereof; The P wave does not exist, min<thres_t- and max_loc>min_loc, at this time, the T wave is downward, and min is the amplitude thereof; A feature mapping module, which performs feature mapping on the obtained QRS complex and P / T wave based on expert knowledge to obtain a category feature of the electrocardiosignal; An arrhythmia signal detection module, which compares the obtained category feature of the electrocardiosignal with a preset threshold value, judges an arrhythmia signal, and completes detection of the arrhythmia signal.
8. A terminal comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the program and can be used to execute the method in any one of claims 1-6, or run the system in claim 7.
9. A computer readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor and can be used to execute the method in any one of claims 1-6, or run the system in claim 7. The program is executed by the processor and can be used to execute the method in any one of claims 1-6, or run the system in claim 7.
Citation Information
Patent Citations
A method for detecting ventricular ectopic beats based on 1D convolutional neural networks
CN107137072B
A method and device for quantitative analysis of pathological features of electrocardiogram data
CN108652615B
Electrocardiogram (ECG) data analysis method suitable for mobile platform
CN104173043A
R wave rapid detection method adaptive to electrocardiogram waveform pathological change
CN105286857A
Automated detection method of QRS wave groups of electrocardiosignals
CN107788969A