Atrial fibrillation heartbeat detection method, device and storage medium

By extracting the SQ segments in the ECG signal and building the SQ template, combining dynamic time regularization and similarity evaluation algorithms, the shortcomings of traditional methods in accurately positioning T waves and adapting to irregular ventricular rate are solved, and a more accurate and robust atrial fibrillation heart-pitch detection is achieved.

CN115177268BActive Publication Date: 2025-03-18兴化市人民医院
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210821864.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-13
Publication Date
2025-03-18
Estimated Expiration
2042-07-13

AI Technical Summary

Technical Problem

The traditional template matching method for detecting atrial fibrillation heartbeat accurately positioning the T-wave termination point and adapting to irregular ventricular rate, making it difficult to effectively detect atrial fibrillation heartbeat.

Method used

By preprocessing the original ECG signal, the SQ segment is extracted, and the SQ template is constructed, and the signal matching and similarity calculation is used to perform signal matching and similarity calculations, and the atrial fibrillation heart beat is adaptively detected.

Benefits of technology

This method can adaptively process variable length signal segments, reduce interference from ventricular activity, and improve the accuracy and robustness of atrial fibrillation striking detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115177268B_ABST
    Figure CN115177268B_ABST
Patent Text Reader

Abstract

The present invention provides an atrial fibrillation heartbeat detection method, device and storage medium, the method comprising: preprocessing and enhancing the original electrocardiogram signal, and sequentially locating feature points and segmenting atrial activity of each heartbeat on the enhanced signal. Atrial activity segments under normal heart rhythm are selected to construct a template, and then adaptively similarity quantization is performed with variable-length heartbeat segments to be analyzed, and a similarity index is calculated. Atrial fibrillation signals are detected from the obtained similarity index sequence according to a preset threshold. The method is suitable for comparative analysis of ECG heartbeats in long-term monitoring in real scenarios, and can achieve effective detection of short-term paroxysmal atrial fibrillation segments. The present invention can be extended to other different types of physiological signal classification scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of signal detection, and in particular to an atrial fibrillation heartbeat detection method, device and storage medium. Background Art

[0002] Atrial fibrillation (AF), also known as AF, is the most common persistent arrhythmia. AF is prone to cause complications such as stroke and heart failure, leading to high mortality and disability rates. Dynamic electrocardiogram helps to capture transient paroxysmal atrial fibrillation fragments, make up for the shortcomings of routine clinical electrocardiograms, and facilitate the formulation of treatment plans as soon as possible. The electrocardiogram (ECG) signal of patients with AF is mainly manifested as the disappearance of the P wave, which is replaced by irregular fibrillation waves (f waves), and may lead to irregular ventricular rate.

[0003] Due to the coupling of noise and ventricular activity, effectively extracting atrial activity from ECG for atrial fibrillation detection is a difficult point in long-term dynamic electrocardiogram analysis. Analysis based on atrial activity can avoid misjudgment caused by ventricular rate rules in certain cases (such as atrial fibrillation with complete atrioventricular block). The difference between atrial activity in normal sinus rhythm and atrial fibrillation makes template matching-based detection methods possible. At the same time, this type of automatic detection algorithm has low complexity and has significant advantages in long-term automated analysis.

[0004] However, the traditional template matching method relies on pre-determining unified feature points (such as the T wave termination point used to intercept the TQ segment), and then aligning the sequences, and the sequence length is also required to be strictly consistent. The limitations of the traditional method are: on the one hand, the accuracy of the reference point selection may limit the subsequent analysis performance, especially when atrial fibrillation occurs, the P wave disappears, and irregular atrial activity will interfere with the positioning of the T wave; on the other hand, the fixed length requirement is also difficult to adapt to atrial fibrillation with irregular ventricular rate.

[0005] In view of this, the traditional template matching-based atrial fibrillation heartbeat detection method needs to be further improved. Summary of the invention

[0006] One of the purposes of the present invention is to overcome at least some of the deficiencies in the prior art and to provide an atrial fibrillation heartbeat detection method, device and storage medium.

[0007] The technical solution provided by the present invention is as follows:

[0008] A method for detecting atrial fibrillation heartbeats, comprising: preprocessing an original electrocardiogram signal, detecting characteristic points on the preprocessed electrocardiogram signal, and obtaining the positions of a Q peak, an R peak, and an S peak;

[0009] According to the positions of the Q peak, the R peak and the S peak, the preprocessed electrocardiogram signal is segmented according to heartbeats, and the SQ segment of each heartbeat is intercepted, wherein the heartbeat is a signal segment between two adjacent R peaks, and the SQ segment is a signal segment between the S peak and the Q peak in the heartbeat;

[0010] Selecting N valid SQ segments under normal heart rhythm from the obtained SQ segments, and constructing an SQ template according to the N SQ segments;

[0011] Calculating the similarity index between each SQ segment and the SQ template respectively;

[0012] All similarity indexes are traversed, and the heartbeats corresponding to the similarity indexes below the preset threshold are judged as atrial fibrillation heartbeats.

[0013] In some embodiments, the preprocessing of the original ECG signal includes:

[0014] The original ECG signal is preprocessed using wavelet transform, empirical mode decomposition or digital filtering.

[0015] In some embodiments, the preprocessing of the original ECG signal by wavelet transform includes:

[0016] The original ECG signal is processed by median filtering, and then the quadratic spline wavelet is selected as the wavelet basis function to perform wavelet decomposition on the signal after median filtering;

[0017] The fourth-layer approximate component after wavelet decomposition is selected for reconstruction, and the obtained reconstructed signal is used as the preprocessed ECG signal.

[0018] In some embodiments, calculating the similarity index between each SQ segment and the SQ template includes:

[0019] Using a dynamic time warping algorithm to align the SQ segment with the SQ template to obtain an aligned SQ segment and an aligned SQ template;

[0020] Calculating a similarity index between the aligned SQ segment and the aligned SQ template, and recording it as an alignment similarity index;

[0021] Calculating a similarity loss according to the length of the SQ segment and the length of the SQ template;

[0022] The alignment similarity index is added to the similarity loss to obtain a similarity index between the SQ segment and the SQ template.

[0023] In some embodiments, the calculating the similarity index between the aligned SQ segment and the aligned SQ template comprises:

[0024] Segmenting the aligned SQ segment and the aligned SQ template respectively according to a preset segmentation coefficient to obtain a corresponding weak atrial activity segment and a strong atrial activity segment;

[0025] performing a cross-correlation operation on the weak atrial activity segment of the aligned SQ segment and the weak atrial activity segment of the aligned SQ template to obtain a similarity index of the weak atrial activity segment;

[0026] Performing a cross-correlation operation on the strong atrial activity segment of the aligned SQ segment and the strong atrial activity segment of the aligned SQ template to obtain a similarity index of the strong atrial activity segment;

[0027] The similarity index of the weak atrial activity segment and the similarity index of the strong atrial activity segment are weighted to obtain a similarity index between the aligned SQ segment and the aligned SQ template.

[0028] In some embodiments, the similarity loss d is calculated according to the following formula:

[0029]

[0030] Among them, w d is the third weight, len i is the length of the SQ segment, len t is the length of the SQ template, f s is the signal sampling rate.

[0031] In some embodiments, after obtaining the similarity index between each SQ segment and the SQ template, the method further includes:

[0032] Arrange all similarity indices in chronological order to obtain the first sequence;

[0033] Using median filtering to smooth the first sequence to obtain a second sequence;

[0034] The traversing all similarity indexes includes: traversing each similarity index of the second sequence.

[0035] The present invention also provides an atrial fibrillation heartbeat detection device, comprising:

[0036] A preprocessing module, used for preprocessing the original ECG signal;

[0037] A feature point detection module is used to detect feature points of the preprocessed ECG signal to obtain the positions of the Q peak, R peak and S peak;

[0038] An SQ extraction module is used to segment the preprocessed ECG signal according to heartbeats according to the positions of the Q peak, R peak and S peak, and to intercept the SQ segment of each heartbeat, wherein the heartbeat is a signal segment between two adjacent R peaks, and the SQ segment is a signal segment between the S peak and the Q peak in the heartbeat;

[0039] A template generation module, used to select N valid SQ segments under normal heart rhythm from the obtained SQ segments, and construct an SQ template according to the N SQ segments;

[0040] A similarity calculation module, used to calculate the similarity index between each SQ segment and the SQ template respectively;

[0041] The post-processing module is used to traverse all similarity indexes and judge the heartbeats corresponding to the similarity indexes below a preset threshold as atrial fibrillation heartbeats.

[0042] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements any of the aforementioned methods for detecting atrial fibrillation.

[0043] Compared with the prior art, the atrial fibrillation heartbeat detection method, device and storage medium provided by the present invention can at least bring the following beneficial effects:

[0044] 1. The present invention provides a new method for intercepting atrial activity in electrocardiogram signals, which detects atrial fibrillation by extracting the SQ segment from the electrocardiogram signals and performing signal analysis on the SQ segment, thus avoiding the need for accurate positioning of the T wave in traditional methods.

[0045] 2. The present invention obtains decomposition quantity reflecting atrial activity through wavelet decomposition, reconstructs the signal according to the decomposition quantity, and uses the obtained reconstructed signal as the object of subsequent atrial activity analysis, thereby reducing the interference of ventricular activity and making the template fragment as concentrated as possible on atrial activity.

[0046] 3. The template matching method based on dynamic time warping proposed in the present invention can adaptively match variable-length signal segments with templates.

[0047] 4. The adaptive similarity evaluation algorithm proposed in the present invention comprehensively considers the morphological differences and time limit differences of the signals, and at the same time strengthens the proportion of atrial activity segments in the overall evaluation through weight setting.

[0048] 5. The adaptive similarity evaluation algorithm proposed in the present invention is a similarity evaluation method based on a single heart beat, which is conducive to the detection of short-term paroxysmal atrial fibrillation segments. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] The following will explain the preferred implementation mode in a clear and understandable manner in conjunction with the accompanying drawings, and further illustrate the above-mentioned characteristics, technical features, advantages and implementation methods of an atrial fibrillation heartbeat detection method, device and storage medium.

[0050] Figure 1 is a flow chart of an embodiment of the atrial fibrillation heartbeat detection method of the present invention;

[0051] Figure 2 is a schematic structural diagram of an embodiment of an atrial fibrillation heartbeat detection device of the present invention;

[0052] Figure 3 is an overall flow chart of atrial fibrillation heartbeat detection in a specific implementation scenario;

[0053] Figure 4 yes Figure 3 A schematic diagram of feature point positioning in the illustrated embodiment;

[0054] Figure 5 yes Figure 3 A schematic diagram of a set of SQ templates derived from a normal heart rhythm used in the illustrated embodiment;

[0055] Figure 6 yes Figure 3 A schematic diagram of segmentation of a group of aligned SQ segments and an SQ template in the illustrated embodiment;

[0056] Figure 7 yes Figure 3 A schematic diagram of a preprocessed ECG signal, a schematic diagram of a heart rhythm labeling, and a schematic diagram of a second sequence in the illustrated embodiment. DETAILED DESCRIPTION

[0057] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the specific implementation methods of the present invention will be described below with reference to the accompanying drawings. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings and other implementation methods can be obtained based on these drawings without creative work.

[0058] In order to simplify the drawings, only the parts related to the present invention are schematically shown in each figure, and they do not represent the actual structure of the product. In addition, in order to simplify the drawings and facilitate understanding, in some figures, only one of the parts with the same structure or function is schematically drawn or marked. In this article, "one" not only means "only one", but also means "more than one".

[0059] In one embodiment of the present invention, Figure 1 As shown, a method for detecting atrial fibrillation includes:

[0060] Step S100 pre-processes the original ECG signal.

[0061] The purpose of preprocessing is to enhance the ECG signal to facilitate subsequent feature point detection and analysis of atrial activity. Existing signal processing techniques can be used to preprocess the original ECG signal. Preprocessing methods include but are not limited to wavelet transform or empirical mode decomposition or digital filtering.

[0062] Taking empirical mode decomposition as an example, the input ECG signal is decomposed by empirical mode decomposition, and a suitable signal is selected from the decomposed signal to represent the key atrial activity, and it is used as the subsequent atrial analysis object.

[0063] Step S200 performs feature point detection on the preprocessed ECG signal to obtain the positions of the Q peak, R peak and S peak.

[0064] Feature point detection refers to detecting the Q peak, R peak and S peak in the electrocardiogram (ECG) signal.

[0065] First determine the R peak position. After the R peak position is determined, search for extreme points by adding windows forward and backward to obtain the positions of the Q peak and S peak. The window length is recommended to be set by multiplying the heart beat length by the preset ratio, and the preset ratio is less than 0.5.

[0066] Step S300 segments the preprocessed ECG signal according to the positions of the Q peak, R peak and S peak, and extracts the SQ segment of each heartbeat.

[0067] The signal segment between two adjacent R peaks is a heartbeat, and the SQ segment of each heartbeat is the signal segment between the S peak and the Q peak in the corresponding heartbeat.

[0068] The SQ segment in a single heart beat is intercepted for subsequent analysis of atrial activity, reducing the interference of ventricular activity.

[0069] Step S400 constructs an SQ template.

[0070] Select N valid SQ segments under normal heart rhythm from the obtained SQ segments, and construct an SQ template based on the N SQ segments

[0071] For example, the SQ template is obtained by taking the average value:

[0072] N valid SQ segments under normal heart rhythm can be selected manually or through computer-assisted clustering.

[0073] Multiple SQ templates can be constructed. Considering the individual differences of subjects, the template construction in any long-term analysis is not limited to one group. A personalized template group can be designed according to the actual data type to optimize the detection effect based on the integrated evaluation of multiple templates.

[0074] Step S500 calculates the similarity index between each SQ segment and the SQ template respectively.

[0075] Generally, when the ventricular rate is regular, the length of the SQ segment is fixed, so the length of the obtained SQ template is fixed. However, when the ventricular rate is irregular, the length of the SQ segment is not fixed, so when calculating the similarity index between each SQ segment and the SQ template, there may be similarity calculations between two sequences of different lengths.

[0076] If the two sequences have the same length, the result of the cross-correlation operation of the two sequences can be directly used as the similarity index.

[0077] If the lengths of the two sequences are different, the two sequences can be aligned first, and then the similarity index of the two sequences before alignment can be obtained based on the similarity index of the two sequences after alignment. The similarity index of the two sequences after alignment can be obtained by using the result of the cross-correlation operation of the two sequences after alignment as the similarity index. On the basis of the similarity index of the two sequences after alignment, the similarity loss caused by the difference in the lengths of the two sequences before alignment is integrated to obtain the similarity index of the two sequences before alignment.

[0078] Step S600 traverses all similarity indexes, and determines the heartbeats corresponding to the similarity indexes below a preset threshold as atrial fibrillation heartbeats.

[0079] This embodiment provides a new way to intercept atrial activity in an ECG signal. Atrial fibrillation pulses are detected by extracting the SQ segment from the ECG signal and performing signal analysis on the SQ segment, thereby avoiding the need for accurately locating the T wave termination point in the traditional method (which requires intercepting the TQ segment).

[0080] The similarity evaluation algorithm provided in this embodiment is a similarity evaluation method based on a single heart beat, which is conducive to the detection of short-term paroxysmal atrial fibrillation segments. The similarity evaluation algorithm can be extended to other different types of physiological signal classification scenarios.

[0081] In one embodiment, preprocessing the original ECG signal using wavelet transform includes:

[0082] Step S110 performs median filtering on the original ECG signal, and then uses quadratic spline wavelet as wavelet basis function to perform wavelet decomposition on the median filtered signal;

[0083] Step S111 selects the fourth-layer approximate component after wavelet decomposition for reconstruction, and uses the obtained reconstructed signal as the preprocessed ECG signal.

[0084] Specifically, median filtering can remove baseline interference in the original ECG signal. The median filtered signal is subjected to wavelet decomposition. Since atrial activity is mainly distributed in the fourth-layer approximate component after wavelet decomposition, the fourth-layer approximate component is selected for reconstruction, and the reconstructed signal is used as the object for subsequent atrial activity analysis. This can further reduce the interference of ventricular activity and make the analysis object reflect atrial activity as much as possible.

[0085] For example, after wavelet decomposition, signal X is decomposed into D1+D2+D3+D4+A4, where D1~4 represent high-frequency parts and A4 represents low-frequency parts. A4 is the fourth-level approximate component, and signal X' is reconstructed based on A4, and signal X' is used as the subsequent analysis object.

[0086] In one embodiment, the calculation of the similarity index between each SQ segment and the SQ template in step S500 includes:

[0087] Step S510: aligning the SQ segment with the SQ template using a dynamic time warping algorithm to obtain an aligned SQ segment and an aligned SQ template;

[0088] Step S520 calculates the similarity index between the aligned SQ segment and the aligned SQ template, and records it as the alignment similarity index;

[0089] Step S530 calculates the similarity loss according to the length of the SQ segment and the length of the SQ template;

[0090] Step S540 adds the alignment similarity index to the similarity loss to obtain a similarity index between the SQ segment and the SQ template.

[0091] Specifically, the Dynamic Time Warping (DTW) algorithm solves the problem of template matching for pronunciations of varying lengths and is an early and classic algorithm in speech recognition. This embodiment uses it for non-fixed-length SQ segments and fixed-length SQ templates. of matches.

[0092]

[0093]

[0094] Where dtw(·) is the dynamic time warping operation, aSQ i 、aSQ t They are the aligned SQ i Sequence and sequences, both have the same sequence length.

[0095] Calculate aSQ i With aSQ t Similarity index aSI; calculate the similarity loss introduced by the difference in sequence length, and the similarity loss value is <= 0. If the two sequences are of equal length, the similarity loss is 0. The greater the difference in the length of the two sequences, the greater the absolute value of the similarity loss. aSI plus the similarity loss equals SQ i With template The similarity index between .

[0096] Using the dynamic time warping algorithm, adaptive sequence alignment is performed for any non-fixed-length time series signal, avoiding the problem of selecting reference points and fixing sequence length in conventional template matching operations. In the quantification of the similarity index, the heart rate changes during atrial fibrillation are taken into account, and by integrating the differences in sequence length, the single dynamic time warping algorithm makes up for the neglect of the time limit factor.

[0097] In one embodiment, step S520 includes:

[0098] Step S521: segmenting the aligned SQ segment and the aligned SQ template according to preset segmentation coefficients to obtain corresponding weak atrial activity segments and strong atrial activity segments;

[0099] Step S522: performing a cross-correlation operation on the weak atrial activity segment of the aligned SQ segment and the weak atrial activity segment of the aligned SQ template to obtain a similarity index of the weak atrial activity segment;

[0100] Step S523: performing a cross-correlation operation on the strong atrial activity segment of the aligned SQ segment and the strong atrial activity segment of the aligned SQ template to obtain a similarity index of the strong atrial activity segment;

[0101] Step S520 performs weighted processing on the similarity index of the weak atrial activity segment and the similarity index of the strong atrial activity segment to obtain the similarity index between the aligned SQ segment and the aligned SQ template.

[0102] About aSQ i Segment and select each aSQ i The signal segment close to the current R peak is a strong atrial activity segment, which is used to strengthen the analysis of atrial activity, as follows:

[0103] QUR fi =aSQ i [1:(w 1 *len)]

[0104] QUR bi =aSQ i[(w 1 *len):len]

[0105] Among them, w 1 is the signal division coefficient, 1 represents the first sampling point, and len is the aSQ after alignment i Sequence length, aSQ fi for aSQ i Moderately weak atrial activity segment, aSQ bi for aSQ i Moderately strong atrial active segment.

[0106] Aligned SQ template aSQ t A similar segmentation is also performed to obtain the corresponding strong atrial activity segment aSQ bt and weak atrial activity segment aSQ ft .

[0107] aSQ bi and aSQ bt Perform cross-correlation operation and use the result as the similarity index SI of the strong atrial activity segment b ; For weak atrial activity segment aSQ fi and aSQ ft Perform cross-correlation operation and use the result as the similarity index SI of the weak atrial activity segment f According to SI f and SI b Calculate aSI, for example, aSI = w f *SI f +w b *SI b , w f 、w b are the first weight and the second weight respectively. By setting w b >w f , which can enhance the proportion of strong atrial activity segments in the overall assessment.

[0108] In one embodiment, the similarity loss d is calculated according to the following formula:

[0109]

[0110] Among them, w d is the third weight, len i For SQ i The length of the segment, len t For SQ template The length, f s is the signal sampling rate.

[0111] In one embodiment, after obtaining the similarity index between each SQ segment and the SQ template, the method further includes:

[0112] Arrange all similarity indexes in chronological order to obtain the first sequence SI1;

[0113] Smoothing the first sequence to obtain the second sequence SI2;

[0114] Each similarity index of the second sequence is traversed, and the heartbeat corresponding to the similarity index below the preset threshold is determined as an atrial fibrillation heartbeat.

[0115] Specifically, after smoothing and other processing is performed on the obtained first sequence SI1, atrial fibrillation heartbeats are detected according to a preset threshold. In order to reduce the influence of a single deviation on the interpretation of atrial fibrillation heartbeats, the similarity index sequence can be smoothed and filtered, or the volatility analysis of the comprehensive sequence (for example, entropy) can be used to determine the atrial fibrillation heartbeats.

[0116] Based on the same inventive concept, an embodiment of the present invention further provides an atrial fibrillation heartbeat detection device, which is designed to execute the atrial fibrillation heartbeat detection method of any of the aforementioned embodiments.

[0117] In one embodiment of the present invention, Figure 2 As shown, an atrial fibrillation heartbeat detection device comprises:

[0118] The preprocessing module 100 is used to preprocess the original ECG signal;

[0119] The feature point detection module 200 is used to perform feature point detection on the preprocessed ECG signal to obtain the positions of the Q peak, R peak and S peak;

[0120] The SQ extraction module 300 is used to segment the preprocessed ECG signal according to the heartbeat according to the positions of the Q peak, the R peak and the S peak, and to intercept the SQ segment of each heartbeat, where the heartbeat is the signal segment between two adjacent R peaks, and the SQ segment is the signal segment between the S peak and the Q peak in the heartbeat;

[0121] The template generation module 400 is used to select N valid SQ segments under normal heart rhythm from the obtained SQ segments, and construct an SQ template according to the N SQ segments;

[0122] A similarity calculation module 500 is used to calculate the similarity index between each SQ segment and the SQ template respectively;

[0123] The post-processing module 600 is used to traverse all similarity indexes and determine the heartbeats corresponding to the similarity indexes below a preset threshold as atrial fibrillation heartbeats.

[0124] In one embodiment, the preprocessing module is further used to preprocess the original ECG signal by using wavelet transform, empirical mode decomposition or digital filtering.

[0125] In one embodiment, the preprocessing module includes a wavelet decomposition unit;

[0126] The wavelet decomposition unit is used to perform median filtering on the original ECG signal, and then use the quadratic spline wavelet as the wavelet basis function to perform wavelet decomposition on the signal after the median filtering; the fourth layer approximate component after the wavelet decomposition is selected for reconstruction, and the reconstructed signal is used as the preprocessed ECG signal.

[0127] In one embodiment, the similarity calculation module includes:

[0128] A time warping unit, used for aligning the SQ segment with the SQ template by using a dynamic time warping algorithm to obtain an aligned SQ segment and an aligned SQ template;

[0129] The similarity calculation unit is used to calculate the similarity index between the aligned SQ segment and the aligned SQ template, which is recorded as the alignment similarity index; calculate the similarity loss according to the length of the SQ segment and the length of the SQ template; and add the alignment similarity index to the similarity loss to obtain the similarity index between the SQ segment and the SQ template.

[0130] In one embodiment, the similarity calculation unit calculates the similarity index between the aligned SQ segments and the aligned SQ templates, including:

[0131] The aligned SQ segments and the aligned SQ templates are segmented according to preset segmentation coefficients to obtain corresponding weak atrial activity segments and strong atrial activity segments;

[0132] Performing cross-correlation operation on the weak atrial activity segment of the aligned SQ segment and the weak atrial activity segment of the aligned SQ template to obtain a similarity index of the weak atrial activity segment;

[0133] Performing cross-correlation operation on the strong atrial activity segment of the aligned SQ segment and the strong atrial activity segment of the aligned SQ template to obtain a similarity index of the strong atrial activity segment;

[0134] The similarity index of the weak atrial activity segment and the similarity index of the strong atrial activity segment are weighted to obtain the similarity index between the aligned SQ segment and the aligned SQ template.

[0135] In one embodiment, the similarity loss d in the similarity calculation unit is calculated according to the following formula:

[0136]

[0137] Among them, w d is the third weight, len i For SQ i The length of the segment, len tis the length of the SQ template, f s is the signal sampling rate.

[0138] In one embodiment, the post-processing unit is further configured to:

[0139] Arrange all similarity indices in chronological order to obtain the first sequence;

[0140] The first sequence is smoothed by using median filtering to obtain the second sequence;

[0141] Each similarity index of the second sequence is traversed, and the heartbeat corresponding to the similarity index lower than a preset threshold is determined as an atrial fibrillation heartbeat.

[0142] In one embodiment of the present invention, a computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the atrial fibrillation heartbeat detection method described in the aforementioned embodiment can be implemented. That is, when part or all of the technical solutions that contribute to the prior art in the aforementioned embodiment of the present invention are embodied in the form of a computer software product, the aforementioned computer software product is stored in a computer-readable storage medium. The computer-readable storage medium can be any physical device or equipment that can carry computer program code. For example, the computer-readable storage medium can be a USB flash drive, a mobile disk, a magnetic disk, an optical disk, a computer memory, a read-only memory, a random access memory, etc.

[0143] The present invention also provides a specific implementation scenario example, in which the atrial fibrillation heartbeat detection device provided by the present application is used for analyzing long-range electrocardiogram signals.

[0144] The ECG data in this embodiment comes from the public MIT-BIH atrial fibrillation database. Each record in the database contains data from two channels, the duration of each record is about 10 hours, and the sampling frequency is 250Hz. This embodiment selects the first channel data of one of the records. The overall workflow is as follows: Figure 3 As shown, the details are as follows:

[0145] (1) Preprocess the original ECG signal.

[0146] First, the original ECG signal is uniformly resampled to 360Hz, and the median filter is used to remove the baseline interference. Then, the quadratic spline wavelet is selected as the wavelet basis function to perform a 5-layer decomposition of the signal. Based on the decomposition results, each feature point (R peak, Q peak and S peak) is detected, such as Figure 4 As shown in the figure, the signal segment from the previous R peak to the current R peak is the current heartbeat, and the Q peak and S peak are obtained by searching for extreme points by adding windows forward and backward respectively after determining the position of the R peak, and the window length is 0.25 of the current heartbeat length. Figure 4In FIG, the horizontal axis is the number of sample points, and the vertical axis is the amplitude reconstructed based on the fourth-layer approximate component after wavelet decomposition of the ECG signal, wherein the dotted box is the SQ segment of each heart beat segment.

[0147] Considering that atrial activity is mainly distributed in the fourth-layer approximate component, the signal reconstructed by the fourth-layer approximate coefficient is selected for subsequent capture and analysis of atrial activity.

[0148] (2) Segment the SQ segment of any heart beat and manually select 8 consecutive SQ segments under normal heart rhythm for template calculation The results are as follows Figure 5 shown. Figure 5 In the figure, the horizontal axis is the number of sample points, and the vertical axis is the amplitude reconstructed based on the fourth-layer approximate component after wavelet decomposition of the ECG heart beat. Among them, the bold waveform is the average template obtained after calculation, and the rest are SQ segment signals of each heart beat.

[0149] (3) Calculate any SQ segment and template The similarity index SI of , all similarity indices constitute the first sequence SI1.

[0150] First, the dynamic time warping algorithm is used to align the SQ segment to be analyzed with the template signal, and then aSQ i 、aSQ t The last 2 / 5 of the sequence is approximately the main strong atrial activity segment, that is, w1 = 0.6 is selected, such as Figure 6 As shown. Let the weight of the result of the cross-correlation operation based on the strong atrial activity segment be w b =0.7, the weight of the result of the cross-correlation operation based on the weak atrial activity segment is w f =0.4, the weight of the time difference is w d =0.65. Figure 6 The horizontal axis is the number of sample points, and the vertical axis is the amplitude reconstructed based on the fourth-layer approximate component after wavelet decomposition of the ECG heart beat. Among them, the windowed segment is the part with concentrated atrial activity close to the R peak (i.e., the strong atrial activity segment), and the rest is the part with weak atrial activity (i.e., the weak atrial activity segment).

[0151] (4) The obtained SI1 sequence is smoothed to obtain the second sequence SI2, and a sliding median filter is performed with 15 consecutive heart beats as the window length. The result is as follows: Figure 7 shown. Figure 7 In the figure, Figure a) is the ECG signal waveform, and the ordinate is the amplitude reconstructed based on the fourth-layer approximate component after wavelet decomposition of the ECG signal; Figure b) is the actual corresponding heart rhythm labeling, where NSR represents sinus rhythm and AF represents atrial fibrillation; Figure c) is the SI2 sequence obtained after smoothing, and the ordinate is the final calculated SI value.

[0152] An empirical threshold is set and the SI2 sequence is traversed. The data segments below the threshold are the detected atrial fibrillation signals.

[0153] It should be noted that the above embodiments can be freely combined as needed. The above are only preferred embodiments of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be regarded as the protection scope of the present invention.

Claims

1. A method for detecting atrial fibrillation, characterized in that: include: Preprocessing the original ECG signal, performing feature point detection on the preprocessed ECG signal, and obtaining the positions of the Q peak, R peak, and S peak; According to the positions of the Q peak, the R peak and the S peak, the preprocessed electrocardiogram signal is segmented according to heartbeats, and the SQ segment of each heartbeat is intercepted, wherein the heartbeat is a signal segment between two adjacent R peaks, and the SQ segment is a signal segment between the S peak and the Q peak in the heartbeat; Selecting N valid SQ segments under normal heart rhythm from the obtained SQ segments, and constructing an SQ template according to the N SQ segments; Calculating the similarity index between each SQ segment and the SQ template respectively; All similarity indexes are traversed, and the heartbeats corresponding to the similarity indexes below the preset threshold are judged as atrial fibrillation heartbeats.

2. The atrial fibrillation heartbeat detection method according to claim 1, characterized in that: The preprocessing of the original ECG signal includes: The original ECG signal is preprocessed using wavelet transform, empirical mode decomposition or digital filtering.

3. The atrial fibrillation heartbeat detection method according to claim 2, characterized in that: The preprocessing of the original ECG signal by wavelet transform comprises: The original ECG signal is processed by median filtering, and then the quadratic spline wavelet is selected as the wavelet basis function to perform wavelet decomposition on the signal after median filtering; The fourth-layer approximate component after wavelet decomposition is selected for reconstruction, and the obtained reconstructed signal is used as the preprocessed ECG signal.

4. The atrial fibrillation detection method according to claim 1, characterized in that: The calculating the similarity index between each SQ segment and the SQ template comprises: Using a dynamic time warping algorithm to align the SQ segment with the SQ template to obtain an aligned SQ segment and an aligned SQ template; Calculating a similarity index between the aligned SQ segment and the aligned SQ template, and recording it as an alignment similarity index; Calculating a similarity loss according to the length of the SQ segment and the length of the SQ template; The alignment similarity index is added to the similarity loss to obtain a similarity index between the SQ segment and the SQ template.

5. The atrial fibrillation heartbeat detection method according to claim 4, characterized in that: The calculating the similarity index between the aligned SQ segment and the aligned SQ template includes: Segmenting the aligned SQ segment and the aligned SQ template respectively according to a preset segmentation coefficient to obtain a corresponding weak atrial activity segment and a strong atrial activity segment; performing a cross-correlation operation on the weak atrial activity segment of the aligned SQ segment and the weak atrial activity segment of the aligned SQ template to obtain a similarity index of the weak atrial activity segment; Performing a cross-correlation operation on the strong atrial activity segment of the aligned SQ segment and the strong atrial activity segment of the aligned SQ template to obtain a similarity index of the strong atrial activity segment; The similarity index of the weak atrial activity segment and the similarity index of the strong atrial activity segment are weighted to obtain a similarity index between the aligned SQ segment and the aligned SQ template.

6. The atrial fibrillation heartbeat detection method according to claim 4, characterized in that: The similarity loss d is calculated according to the following formula: Among them, w d is the third weight, len i is the length of the SQ segment, len t is the length of the SQ template, f s is the signal sampling rate.

7. The atrial fibrillation detection method according to claim 1, characterized in that: After obtaining the similarity index between each SQ segment and the SQ template, the method further includes: Arrange all similarity indices in chronological order to obtain the first sequence; Using median filtering to smooth the first sequence to obtain a second sequence; The traversing all similarity indexes includes: traversing each similarity index of the second sequence.

8. An atrial fibrillation heartbeat detection device, characterized in that: include: A preprocessing module, used for preprocessing the original ECG signal; A feature point detection module is used to detect feature points of the preprocessed ECG signal to obtain the positions of the Q peak, R peak and S peak; An SQ extraction module is used to segment the preprocessed ECG signal according to heartbeats according to the positions of the Q peak, R peak and S peak, and to intercept the SQ segment of each heartbeat, wherein the heartbeat is a signal segment between two adjacent R peaks, and the SQ segment is a signal segment between the S peak and the Q peak in the heartbeat; A template generation module, used to select N valid SQ segments under normal heart rhythm from the obtained SQ segments, and construct an SQ template according to the N SQ segments; A similarity calculation module, used to calculate the similarity index between each SQ segment and the SQ template respectively; The post-processing module is used to traverse all similarity indexes and judge the heartbeats corresponding to the similarity indexes below a preset threshold as atrial fibrillation heartbeats.

9. The atrial fibrillation heartbeat detection device according to claim 8, characterized in that: include The preprocessing module is also used to preprocess the original ECG signal by using wavelet transform, empirical mode decomposition or digital filtering.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the atrial fibrillation heartbeat detection method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Sinus heart rate turbulence trend detection method based on piecewise linearization

    CN103006210A

  • Atrial fibrillation grading method based on cardiovascular system electrical-mechanical activity information

    CN111839505A