Electronic device and method for selecting features of an electrocardiogram
Through multi-module processing of electronic devices, the characteristic points in the electrocardiogram are identified, which solves the problem of high pseudo-positive rate in motor electrocardiogram examinations, improves the diagnostic efficacy of coronary artery disease, and achieves a more accurate judgment of heart health status.
Patent Information
- Application Number
- CN202110695328.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2020-12-29
- Filing Date
- 2021-06-02
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2041-06-02
AI Technical Summary
The existing motor electrocardiogram test has a high pseudo-positive rate when detecting coronary artery disease, which affects diagnostic efficacy.
Design an electronic device and method to perform multiple module processing of the electrocardiogram through a processor and storage medium, including data collection, preprocessing, marking, feature establishment and feature selection modules, identify feature points in the electrocardiogram to calculate feature values, Judge and output features related to heart disease to improve the effectiveness of machine learning models.
Effectively select features highly related to heart disease from the electrocardiogram, improve the diagnostic effectiveness of machine learning models, reduce the pseudo-positive rate, and improve the accuracy of coronary artery disease.
Smart Images

Figure CN114680901B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to an electronic device and method for selecting features of an electrocardiogram (ECG). Background Art
[0002] Cardiovascular disease has long been one of the top ten causes of death. Since cardiovascular disease has no obvious symptoms, it poses a great threat to patients. The walls of the coronary arteries that supply blood to the heart may become hardened or narrow due to factors such as aging, smoking, three highs, genetics or eating habits. This may lead to insufficient blood supply to the heart, causing problems such as angina pectoris or myocardial infarction.
[0003] In order to check for coronary artery related diseases, doctors often use exercise electrocardiograms for non-invasive examinations. However, compared with direct invasive examination methods, the use of exercise electrocardiograms for cardiovascular disease examinations has the problem of too high false positives (FP). Therefore, how to propose a method that can improve the performance of machine learning models for analyzing electrocardiograms is one of the goals that people in this field are committed to. Summary of the invention
[0004] The present invention provides an electronic device and method for selecting features of an electrocardiogram, which can find out one or more features that are highly correlated with heart diseases.
[0005] An electronic device for selecting features of an electrocardiogram of the present invention comprises a processor, a storage medium and a transceiver. The storage medium stores a plurality of modules. The processor is coupled to the storage medium and the transceiver, and accesses and executes a plurality of modules, wherein the plurality of modules comprises a data collection module, a first pre-processing module, a marking module, a feature establishment module, a feature selection module and an output module. The data collection module obtains an electrocardiogram through the transceiver. The first pre-processing module performs a first pre-processing on the electrocardiogram to generate a first electrocardiogram. The marking module marks a plurality of endpoints corresponding to at least one wave on the first electrocardiogram. The feature establishment module calculates a first feature value corresponding to a first feature according to a plurality of endpoints of at least one wave, and generates a first performance indicator corresponding to a machine learning model according to the first feature value. The feature selection module determines whether to select the first feature according to the first performance indicator. The output module outputs the first feature through the transceiver in response to selecting the first feature.
[0006] In one embodiment of the present invention, the at least one wave mentioned above includes an R wave, wherein the plurality of modules further include a second pre-processing module. The second pre-processing module performs a second pre-processing on the first electrocardiogram to generate a second electrocardiogram, wherein the marking module divides the second electrocardiogram into a plurality of parts according to a window function, and in response to a first part of the plurality of parts including at least one data point greater than zero, marks a first data point with a maximum value in the first part as a first reference point, wherein the first reference point corresponds to a first reference time point, wherein the marking module determines a first time period of the first electrocardiogram according to the first reference time point, and marks a second data point with a maximum value in the first time period as a first R wave endpoint, wherein the first reference time point is located at the center of the first time period, wherein the plurality of endpoints include the first R wave endpoint.
[0007] In one embodiment of the present invention, the at least one wave mentioned above also includes a Q wave, wherein the first R wave endpoint corresponds to a first time point, wherein the marking module determines a second time period of the first electrocardiogram based on the first time point, and marks a third data point with a minimum value in the second time period as a first Q wave endpoint, wherein the first time point is the latest time point of the second time period, and wherein the multiple endpoints include the first Q wave endpoint.
[0008] In one embodiment of the present invention, the marking module marks a fourth data point having a minimum value in a third time period earlier than the second time period as a first Q wave endpoint in response to a positive slope of the third data point.
[0009] In one embodiment of the present invention, the above-mentioned first Q wave endpoint corresponds to a second time point, wherein the marking module marks multiple R wave endpoints including the first R wave endpoint on the first electrocardiogram, calculates the average RR interval based on the multiple R wave endpoints, determines the weight based on the number of the multiple R wave endpoints, and determines the second window function based on the average RR interval and the weight, wherein the marking module determines a fourth time period earlier than the second time point based on the second window function, and marks the first P wave endpoint with the fifth data point with the maximum value in the fourth time period, wherein the second time point corresponds to the second latest time point of the fourth time period, wherein the multiple endpoints include the first P wave endpoint.
[0010] In one embodiment of the present invention, the marking module marks a sixth data point having a maximum value in a fifth time period earlier than the fourth time period as a first P-wave endpoint in response to the fifth data point having a negative slope.
[0011] In one embodiment of the present invention, the first pre-processing includes: performing baseline drift removal, noise removal, and standardization on the electrocardiogram to generate a first electrocardiogram.
[0012] In one embodiment of the present invention, the second pre-processing includes: dividing the first electrocardiogram into three parts, wherein the three parts include a first time period electrocardiogram, a second time period electrocardiogram later than the first time period electrocardiogram, and a third time period electrocardiogram later than the second time period electrocardiogram, wherein the lengths of the first time period electrocardiogram and the third time period electrocardiogram are the same; calculating a first standard deviation corresponding to the first time period electrocardiogram and a second standard deviation corresponding to the second time period electrocardiogram; and deleting the first time period electrocardiogram from the first electrocardiogram in response to the difference between the first standard deviation and the second standard deviation being greater than a first threshold.
[0013] In one embodiment of the present invention, the above-mentioned second pre-processing also includes: performing wavelet transform on the first electrocardiogram to generate a transformed electrocardiogram; standardizing the transformed electrocardiogram into a standard score; and setting multiple data points in the standard score that are less than a second threshold to zero to generate a second electrocardiogram.
[0014] In one embodiment of the present invention, the above-mentioned data collection module receives a plurality of electrocardiograms through a transceiver, wherein the plurality of electrocardiograms include a first lead electrocardiogram and a second lead electrocardiogram, wherein the data collection module normalizes the first lead electrocardiogram into a first standard score function, and in response to at least one first absolute value of at least one first standard score in the first standard score function being greater than the first absolute value of the first standard score in the first standard score function, selects at least one first standard score from a plurality of first standard scores of the first standard score function to calculate a first sum, wherein the data collection module normalizes the second lead electrocardiogram into a second standard score function, and in response to at least one second absolute value of at least one second standard score in the second standard score function being greater than the second absolute value of the second standard score in the second standard score function, selects at least one second standard score from a plurality of second standard scores of the second standard score function to calculate a second sum, wherein the data collection module selects an electrocardiogram corresponding to a third lead from the plurality of electrocardiograms according to the positive or negative of the first sum and the second sum.
[0015] In one embodiment of the present invention, the first lead electrocardiogram corresponds to lead I, the second lead electrocardiogram corresponds to lead aVF, and the third lead corresponds to one of the following: lead II, lead aVL, lead aVF and lead aVR.
[0016] In one embodiment of the present invention, the feature selection module selects the first feature in response to the first performance indicator being greater than a performance threshold.
[0017] In one embodiment of the present invention, the above-mentioned feature establishment module calculates a second feature value corresponding to a second feature based on multiple endpoints of at least one wave, and generates a second performance indicator corresponding to a machine learning model based on the second feature value, wherein the feature selection module selects the first feature from the first feature and the second feature in response to the first performance indicator being greater than the second performance indicator.
[0018] A method for selecting features of an electrocardiogram of the present invention comprises: obtaining an electrocardiogram; performing a first pre-processing on the electrocardiogram to generate a first electrocardiogram; marking multiple endpoints corresponding to at least one wave on the first electrocardiogram; calculating a first feature value corresponding to a first feature based on the multiple endpoints of the at least one wave, generating a first performance indicator corresponding to a machine learning model based on the first feature value, and determining whether to select the first feature based on the first performance indicator; and outputting the first feature in response to selecting the first feature.
[0019] Based on the above, the present invention can select one or more features that are highly related to heart disease from the many features of the electrocardiogram and output the features to prompt the user. Therefore, the user can train a machine learning model with better performance based on the features selected by the present invention. The machine learning model can be used to determine the health status of the subject's coronary artery based on the electrocardiogram. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 A schematic diagram showing an electronic device for selecting features of an electrocardiogram according to an embodiment of the present invention;
[0021] Figure 2 A schematic diagram showing a first pre-processing according to an embodiment of the present invention;
[0022] Figure 3A A schematic diagram showing a second pre-processing according to an embodiment of the present invention;
[0023] Figure 3B A schematic diagram showing the endpoints of various waves of an electrocardiogram is shown according to an embodiment of the present invention;
[0024] Figure 3C According to an embodiment of the present invention, Figure 3B a first partial enlarged view of a first electrocardiogram;
[0025] Figure 3D According to an embodiment of the present invention, Figure 3B a second partial enlarged view of the first electrocardiogram;
[0026] Figure 4 A flow chart of a method for selecting features of an electrocardiogram is shown according to an embodiment of the present invention.
[0027] Description of Reference Numerals
[0028] 100: Electronic devices
[0029] 110: Processor
[0030] 120: Storage media
[0031] 121: First pre-processing module
[0032] 122: Second pre-processing module
[0033] 123: Data collection module
[0034] 124: Marking module
[0035] 125: Feature Selection Module
[0036] 126: Output module
[0037] 127: Feature building module
[0038] 130: Transceiver
[0039] 21, 22: Electrocardiogram
[0040] 23: First ECG
[0041] 25: Second ECG
[0042] 31: First period electrocardiogram
[0043] 32: Second period electrocardiogram
[0044] 33: Third period electrocardiogram
[0045] 41, 42: Part
[0046] 51: Reference point
[0047] 52: Reference time point
[0048] 61, 71: R wave endpoint
[0049] 62: Q-wave endpoint
[0050] 63: P wave endpoint
[0051] 64: S wave endpoint
[0052] 65: T wave endpoint
[0053] 81, 82, 83, 84: Data points
[0054] t1, t2, t3, t4, t5: time points
[0055] P1, P2, P3, P4, P5, P6, P7, P8, P9: Time period
[0056] S401, S402, S403, S404, S405: Steps
[0057] W1, W2: window function DETAILED DESCRIPTION
[0058] Reference will now be made in detail to exemplary embodiments of the present invention, examples of which are illustrated in the accompanying drawings. Whenever possible, the same reference numerals are used in the drawings and the description to refer to the same or like parts.
[0059] In order to make the content of the present invention more understandable, the following embodiments are given as examples on which the present invention can be implemented. In addition, wherever possible, components / members / steps with the same reference numerals in the drawings and embodiments represent the same or similar components.
[0060] Figure 1 A schematic diagram of an electronic device 100 for selecting features of an electrocardiogram according to an embodiment of the present invention is shown. The electronic device 100 may include a processor 110, a storage medium 120, and a transceiver 130.
[0061] The processor 110 is, for example, a central processing unit (CPU), or other programmable general-purpose or special-purpose micro control unit (MCU), microprocessor, digital signal processor (DSP), programmable controller, application specific integrated circuit (ASIC), graphics processing unit (GPU), image signal processor (ISP), image processing unit (IPU), arithmetic logic unit (ALU), complex programmable logic device (CPLD), field programmable gate array (FPGA), or other similar components or combinations thereof. The processor 110 may be coupled to the storage medium 120 and the transceiver 130, and access and execute multiple modules and various applications stored in the storage medium 120.
[0062] The storage medium 120 is, for example, any type of fixed or removable random access memory (RAM), read-only memory (ROM), flash memory, hard disk drive (HDD), solid state drive (SSD) or similar components or a combination of the above components, and is used to store multiple modules or various applications that can be executed by the processor 110. In this embodiment, the storage medium 120 can store multiple modules including a first pre-processing module 121, a second pre-processing module 122, a data collection module 123, a marking module 124, a feature selection module 125, an output module 126 and a feature establishment module 127, and their functions will be described later.
[0063] The transceiver 130 transmits and receives signals in a wireless or wired manner. The transceiver 130 may also perform operations such as low noise amplification, impedance matching, mixing, up or down frequency conversion, filtering, amplification, and the like.
[0064] The data collection module 123 may receive multiple electrocardiograms of the subject through the transceiver 130, wherein the multiple electrocardiograms may correspond to multiple leads, respectively. For example, the multiple leads may include lead I, lead II, lead III, lead aVR, lead aVL, lead aVF, lead V1, lead V2, lead V3, lead V4, lead V5, or lead V6.
[0065] In order to select features from the electrocardiogram, the electronic device 100 may first mark the extreme points of the P wave, Q wave, R wave, S wave or T wave on the electrocardiogram, wherein the extreme points include wave peaks or wave troughs. Since not all electrocardiograms of all leads are suitable for marking the extreme points, after obtaining multiple electrocardiograms, the data collection module 123 may select the electrocardiogram corresponding to the primary lead (i.e., the primary electrocardiogram) from the multiple electrocardiograms, wherein the electrocardiogram may be used to mark the extreme points of the waves.
[0066] Specifically, the data collection module 123 may select a lead I electrocardiogram and a lead aVF electrocardiogram from a plurality of electrocardiograms. The data collection module 123 may standardize the lead I electrocardiogram into a first standard score function. Then, the data collection module 123 may select at least one first standard score from a plurality of first standard scores of the first standard score function in response to at least one first absolute value of at least one first standard score in the first standard score function being greater than the first absolute value of the first standard score in the first standard score function to calculate the first total. For example, assuming that the first standard score function includes 100 first standard scores. The data collection module 123 may select two first standard scores corresponding to the absolute values of the top 2% from the first standard score function (the absolute values of the two first standard scores are greater than the absolute values of the other 98 first standard scores), and add the two first standard scores to calculate the first total.
[0067] Similarly, the data collection module 123 may normalize the lead aVF electrocardiogram into a second standard score function. Then, the data collection module 123 may select at least one second standard score from a plurality of second standard scores of the second standard score function in response to at least one second absolute value of at least one second standard score in the second standard score function being greater than the second absolute value of the second standard score in the second standard score function to calculate the second total. For example, assuming that the second standard score function includes 100 second standard scores. The data collection module 123 may select 2 second standard scores corresponding to the absolute values of the top 2% from the second standard score function (the absolute values of the 2 second standard scores are greater than the absolute values of the other 98 second standard scores), and add the 2 second standard scores to calculate the second total.
[0068] After obtaining the first sum and the second sum, the data collection module 123 can select the main lead according to the positive and negative of the first sum and the second sum, thereby selecting the electrocardiogram corresponding to the main lead from the multiple electrocardiograms. Specifically, the data collection module 123 can determine the main lead according to Table 1.
[0069] Table 1
[0070] The positive and negative of the first sum (lead I) The positive and negative of the second sum (lead aVF) Main course just just Lead II just burden Lead aVL burden just Lead aVF burden burden Lead aVR
[0071] After selecting the electrocardiogram corresponding to the main lead, the first pre-processing module 121 may perform first pre-processing on the electrocardiogram to generate a first electrocardiogram. The first pre-processing may include steps such as baseline wandering removal, noise removal or standardization, but the present invention is not limited thereto. Figure 2A schematic diagram of the first pre-processing is shown according to an embodiment of the present invention. The first pre-processing module 121 can perform a first pre-processing on the electrocardiogram 21 to generate a first electrocardiogram 23. The original signal of the electrocardiogram 21 may cause baseline wandering due to factors such as the measurement environment or errors. Therefore, the first pre-processing module 121 can remove the baseline drift of the electrocardiogram 21 by, for example, a band rejection filter or a notch filter to generate a more regular electrocardiogram 22. Then, the first pre-processing module 121 can remove noise from the adjusted electrocardiogram 22 by, for example, a low-pass filter to smooth the electrocardiogram 22. Then, the first pre-processing module 121 can standardize the smoothed electrocardiogram 22 to generate a first electrocardiogram 23 with an average value of 0.
[0072] In one embodiment, before obtaining the main lead, the first pre-processing module 121 may perform first pre-processing on the multiple electrocardiograms corresponding to the multiple leads collected by the data collection module 123, and determine the main lead according to the multiple electrocardiograms after the first pre-processing.
[0073] After obtaining the first electrocardiogram 23 , the second pre-processing module 122 may perform second pre-processing on the first electrocardiogram 23 to generate a second electrocardiogram 25 . Figure 3A According to an embodiment of the present invention, a schematic diagram of the second pre-processing is shown. Since the measurement signal of the electrocardiogram is often disturbed by noise when starting or ending the measurement, it is distorted. Therefore, the second pre-processing module 122 can remove the head and tail of the first electrocardiogram 23. Specifically, the second pre-processing module 122 can divide the first electrocardiogram 23 into three parts, wherein the three parts can include a first time period electrocardiogram 31, a second time period electrocardiogram 32 later than the first time period electrocardiogram 31, and a third time period electrocardiogram 33 later than the second time period electrocardiogram 32, wherein the length of the first time period electrocardiogram 31 is the same as that of the third time period electrocardiogram 33. Specifically, if the first time period electrocardiogram 31 accounts for m% (m is a positive real number) of the first electrocardiogram 23, the third time period electrocardiogram 33 can account for m% of the first electrocardiogram 23, and the second time period electrocardiogram 32 can account for (1-2*m)% of the first electrocardiogram 23. For example, if the first period electrocardiogram 31 accounts for 10% of the first electrocardiogram 23 , the third period electrocardiogram 33 may account for 10% of the first electrocardiogram 23 , and the second period electrocardiogram 32 may account for 80% of the first electrocardiogram 23 .
[0074] Next, the second pre-processing module 122 may calculate the standard deviation corresponding to each period of the electrocardiogram. The second pre-processing module 122 may calculate the first standard deviation corresponding to the first period of the electrocardiogram 31 (or the third standard deviation corresponding to the third period of the electrocardiogram 33) and the second standard deviation corresponding to the second period of the electrocardiogram 32. If the difference between the first standard deviation (or the third standard deviation) and the second standard deviation is greater than the first threshold, the second pre-processing module 122 may delete the first period of the electrocardiogram 31 (or the third period of the electrocardiogram 33) from the first electrocardiogram 23, thereby removing the first and tail of the first electrocardiogram 23. The first threshold may be adjusted by the user according to needs.
[0075] In order to make the endpoints of the electrocardiogram waveform more prominent for easy marking, the second pre-processing module 122 can further perform a wavelet transform on the first electrocardiogram 23 to generate a transformed electrocardiogram. The second pre-processing module 122 can standardize the transformed electrocardiogram to a standard score, and set a plurality of data points in the standard score that are less than a second threshold to 0 to generate a second electrocardiogram 25. The second threshold can be adjusted by the user as required. For example, the second threshold can be configured as X times the standard deviation of the standard score, where X can be a positive real number.
[0076] The marking module 124 can use the second electrocardiogram 25 as a reference to mark the R wave endpoint (i.e., the R wave peak) on the first electrocardiogram 23. Specifically, after generating the second electrocardiogram 25, the marking module 124 can determine the window function according to the second electrocardiogram 25. For example, the marking module 124 can calculate the window function W1 according to formula (1), where mbpm is the maximum heart rate (in beats per minute, bpm), and SR is the sampling rate of the electrocardiogram, where mbpm can be adjusted by the user according to needs.
[0077]
[0078] The marking module 124 can divide the second electrocardiogram 25 into multiple parts according to the window function W1, and mark the data point with the maximum value in one of the multiple parts as a reference point in response to the part including at least one data point greater than zero, wherein the reference point corresponds to a reference time point. Figure 3BAccording to an embodiment of the present invention, a schematic diagram of marking the endpoints of various waves of an electrocardiogram is shown. For example, the marking module 124 may divide the second electrocardiogram 25 into a plurality of parts including a part 41 and a part 42 according to the window function W1. The marking module 124 may mark the data point with the maximum value in the part 41 as a reference point 51 in response to the part 41 including a plurality of data points greater than zero, wherein the reference point 51 may correspond to a reference time point 52. Relatively speaking, since the part 42 does not include a data point greater than zero, the marking module 124 will not mark any reference point in the part 42.
[0079] In one embodiment, the marking module 124 may filter multiple reference points that are too close. For example, the marking module 124 may pre-store a minimum allowable distance. If the distance between two reference points is less than the minimum allowable distance, the marking module 124 may delete the reference point with the smaller value between the two reference points. The minimum allowable distance may be defined by the user according to needs. For example, the user may determine the minimum allowable distance based on the RR interval of a person who does not suffer from coronary artery disease.
[0080] After marking the reference point on the second electrocardiogram 25, the marking module 124 may mark multiple endpoints of at least one wave on the first electrocardiogram 23 according to the reference time point corresponding to the reference point, wherein the at least one wave may include a P wave, a Q wave, an R wave, an S wave or a T wave, wherein the multiple endpoints may include the peak of the P wave, the trough of the Q wave, the peak of the R wave, the trough of the S wave or the peak of the T wave.
[0081] Figure 3C According to an embodiment of the present invention, Figure 3B The first partial enlarged image of the first electrocardiogram 23. The marking module 124 can determine the time period P1 of the first electrocardiogram 23 according to the reference time point 52, wherein the reference time point 52 can be located at the center of the time period P1. For example, the earliest time point in the time period P1 can be the reference time point 52 minus k seconds, and the latest time point in the time period P1 can be the reference time point 52 plus k seconds, wherein k can be a positive real number. The marking module 124 can mark the data point with the maximum value in the time period P1 as the R wave endpoint 61, wherein the R wave endpoint 61 corresponds to the peak of the R wave.
[0082] After determining the position of the R-wave endpoint 61 on the first electrocardiogram 23, the marking module 124 may mark the Q-wave endpoint 62 according to the R-wave endpoint 61, wherein the R-wave endpoint 61 and the Q-wave endpoint 62 correspond to the same heartbeat. Specifically, if the R-wave endpoint 61 corresponds to the time point t1, the marking module 124 may determine the time period P2 of the first electrocardiogram 23 according to the time point t1, wherein the time point t1 may be the latest time point of the time period P2. For example, the earliest time point of the time period P2 may be the time point t1 minus i seconds, and the latest time point of the time period P2 may be the time point t1, wherein i may be a positive real number. Technicians in the medical field often set i to 0.1. The marking module 124 may mark the data point with the minimum value in the time period P2 as the Q-wave endpoint 62, wherein the Q-wave endpoint 62 may be the trough of the Q wave.
[0083] In some cases, the period P2 may not include the Q wave endpoint 62. Thus, the above method may cause the marking module 124 to mistakenly mark a data point (e.g., data point 81) located at the edge of the period P2 as a Q wave endpoint. Therefore, in one embodiment, the marking module 124 may calculate the slope of the data point 81 with the minimum value in the period P2. If the slope of the data point 81 is positive, the marking module 124 may mark the data point with the minimum value in the period P3 as the Q wave endpoint 62, where the period P3 is earlier than the period P2.
[0084] On the other hand, the marking module 124 can mark the S wave endpoint 64 according to the R wave endpoint 61, wherein the R wave endpoint 61 and the S wave endpoint 64 correspond to the same heartbeat. Specifically, if the R wave endpoint 61 corresponds to the time point t1, the marking module 124 can determine the time period P6 of the first electrocardiogram 23 according to the time point t1, wherein the time point t1 can be the earliest time point of the time period P6. For example, the earliest time point of the time period P6 can be the time point t1, and the latest time point of the time period P6 can be the time point t1 plus i seconds, wherein i can be a positive real number. Technicians in the medical field often set i to 0.1. The marking module 124 can mark the data point with the minimum value in the time period P6 as the S wave endpoint 64, wherein the S wave endpoint 64 can be the trough of the S wave.
[0085] In some cases, the period P6 may not include the S-wave endpoint 64. Thus, the above method may cause the marking module 124 to mistakenly mark a data point (e.g., data point 82) located at the edge of the period P6 as an S-wave endpoint. Therefore, in one embodiment, the marking module 124 may calculate the slope of the data point 82 with the minimum value in the period P6. If the slope of the data point 82 is negative, the marking module 124 may mark the data point with the minimum value in the period P7 as the S-wave endpoint 64, where the period P7 is later than the period P6.
[0086] After marking the Q wave endpoint 62 and the S wave endpoint 64, the marking module 124 may obtain the time point t2 corresponding to the Q wave endpoint 62 and the time point t4 corresponding to the S wave endpoint 64. The marking module 124 may mark the P wave endpoint 63 according to the time point t2, and may mark the T wave endpoint 65 according to the time point t4. Figure 3D According to an embodiment of the present invention, Figure 3B The second partial enlarged view of the first electrocardiogram 23. The marking module 124 can mark all R wave endpoints including the R wave endpoint 61 and the R wave endpoint 71 in the first electrocardiogram 23, and calculate the average RR interval based on all R wave endpoints. The RR interval is the interval between adjacent R wave endpoints. Figure 3D The RR interval between the R wave endpoint 61 and the R wave endpoint 71 is shown. The marking module 124 can calculate the average RR interval RRI according to formula (2), where p is the number of R wave endpoints of the first electrocardiogram (for example, according to Figure 3B , corresponding to the first electrocardiogram 23, p is equal to 10) and R j is the index of the R wave endpoint (for example: R 1 may represent the R wave endpoint 61 and R 2 Can represent the R-wave endpoint 71).
[0087]
[0088] The marking module 124 may determine the weight PT according to the number p of the plurality of R-wave endpoints in the first electrocardiogram 23, as shown in formula (3), where S1 and S2 are positive numbers that can be customized by the user. For example, if p is equal to 10, S2 is greater than or equal to 10, and 10 is greater than or equal to S1, then the weight PT is equal to 3 (ie, 3.5-0.05*10=3).
[0089]
[0090] The marking module 124 may determine the window function W2 according to the weight PT and the average RR interval RRI, as shown in formula (4).
[0091] W2=RRI / PT…(4)
[0092] After determining the window function W2, the marking module 124 may determine, according to the window function W2, a time period P4 that is earlier than the time point t2 corresponding to the Q wave endpoint 62. For example, the latest time point of the time period P4 may be the time point t2, and the earliest time point of the time period P4 may be the time point t2 minus the window function W2. After the time period P4 is determined, the marking module 124 may mark the data point with the maximum value in the time period P4 as the P wave endpoint 63.
[0093] In some cases, the period P4 may not include the P-wave endpoint 63. Thus, the above method may cause the marking module 124 to mistakenly mark a data point (e.g., data point 83) located at the edge of the period P4 as a P-wave endpoint. Therefore, in one embodiment, the marking module 124 may calculate the slope of the data point 83 with the minimum value in the period P4. If the slope of the data point 83 is negative, the marking module 124 may mark the data point with the maximum value in the period P5 as the P-wave endpoint 63, where the period P5 is earlier than the period P4.
[0094] On the other hand, the marking module 124 may determine the time period P8 later than the time point t4 corresponding to the S wave endpoint 64 according to the window function W2. For example, the earliest time point of the time period P8 may be the time point t4, and the latest time point of the time period P8 may be the time point t4 plus the window function W2. After the time period P8 is determined, the marking module 124 may mark the data point with the maximum value in the time period P8 as the T wave endpoint 65.
[0095] In some cases, the period P8 may not include the T wave endpoint 65. Thus, the above method may cause the marking module 124 to mistakenly mark a data point (e.g., data point 84) located at the edge of the period P8 as a T wave endpoint. Therefore, in one embodiment, the marking module 124 may calculate the slope of the data point 84 with the minimum value in the period P8. If the slope of the data point 84 is positive, the marking module 124 may mark the data point with the maximum value in the period P9 as the T wave endpoint 65, where the period P9 is later than the period P8.
[0096] After marking multiple endpoints (e.g., P wave endpoints, Q wave endpoints, R wave endpoints, S wave endpoints, or T wave endpoints) on the first electrocardiogram 23, the feature establishment module 127 may calculate multiple feature values corresponding to multiple features respectively according to the multiple endpoints, wherein the multiple features (or the multiple feature values) may be associated with a combination of field 1, field 2, and field 3 as shown in Table 2 or Table 3, wherein Table 2 is associated with the features of a single heartbeat, and Table 3 is associated with the features of multiple heartbeats. For example, as can be seen from Table 2, multiple features may include features corresponding to "the maximum value of the PQ interval" or "the average value of the cosine value of the angle PQR". For another example, as can be seen from Table 3, multiple features may include features corresponding to "the standard deviation of the PP interval".
[0097] Table 2
[0098]
[0099] Table 3
[0100]
[0101] The feature selection module 125 can select one or more features from a plurality of features, and determine the performance index of each feature on the machine learning model, thereby determining how to select the features. The machine learning model may include but is not limited to a random forest (RF) model, a support vector machine (SVM) model, a least absolute shrinkage and selection operator (Lasso) model, a recursive feature elimination with cross validation (RFECV) model, or a statistical test model, wherein the statistical test model may be associated with a Chi-square test or an analysis of variance (ANOVA). The performance index may correspond to a parameter in a confusion matrix, such as accuracy (ACC), precision, recall rate, false positive (FP), or F1 score.
[0102] Taking the first feature among multiple features as an example, the feature establishment module 127 can generate a first performance indicator corresponding to the machine learning model according to the first feature value of the first feature. Specifically, the feature selection module 125 can use the data containing the first feature to train the machine learning model, and test the performance of the machine learning model to generate the first performance indicator. Similarly, the feature establishment module 127 can generate multiple performance indicators corresponding to the multiple features respectively. The multiple performance indicators may include a first performance indicator corresponding to the first feature, a second performance indicator corresponding to the second feature, or a third performance indicator corresponding to the third feature, and so on.
[0103] The feature selection module 125 may determine whether to select the first feature according to the first performance indicator. If the feature selection module 125 determines to select the first feature, the output module 126 may output the first feature through the transceiver 130 for user reference.
[0104] In one embodiment, the feature selection module 125 may determine to select the first feature in response to the first performance indicator being greater than a performance threshold. The performance threshold may be defined by the user as required. For example, the feature selection module 125 may generate an "accuracy" corresponding to the "maximum value of the PQ interval" feature. If the "accuracy" is greater than a preset performance threshold of "90%", the feature selection module 125 may select the "maximum value of the PQ interval" feature.
[0105] In one embodiment, the feature selection module 125 may select the first feature from the first feature and the second feature in response to the first performance indicator corresponding to the first feature being greater than the second performance indicator corresponding to the second feature. In other words, the feature selection module 125 may select a number of features corresponding to higher performance indicators. For example, the feature establishment module 127 may generate a "first precision" corresponding to the "maximum value of the PQ interval" feature, a "second precision" corresponding to the "average value of the cosine value of the angle PQR" feature, and a "third precision" corresponding to the "standard deviation of the PP interval" feature. If the feature selection module 125 wants to select features corresponding to the first 66.67% of the precision, the feature selection module 125 may select the "maximum value of the PQ interval" from the "maximum value of the PQ interval" feature and the "standard deviation of the PP interval" feature in response to the "first precision" being greater than the "third precision", and may select the "average value of the cosine value of the angle PQR" from the "average value of the cosine value of the angle PQR" feature and the "standard deviation of the PP interval" feature in response to the "second precision" being greater than the "third precision".
[0106] Figure 4 According to an embodiment of the present invention, a flow chart of a method for selecting features of an electrocardiogram is shown, wherein the method may be performed as follows: Figure 1 The electronic device 100 shown is implemented. In step S401, an electrocardiogram is obtained. In step S402, a first pre-processing is performed on the electrocardiogram to generate a first electrocardiogram. In step S403, multiple endpoints corresponding to at least one wave are marked on the first electrocardiogram. In step S404, a first feature value corresponding to a first feature is calculated based on the multiple endpoints of at least one wave, a first performance indicator corresponding to a machine learning model is generated based on the first feature value, and whether to select the first feature is determined based on the first performance indicator. In step S405, the first feature is output in response to selecting the first feature.
[0107] In summary, the present invention can select one or more features that are highly correlated with heart disease from many features of the electrocardiogram. After obtaining multiple electrocardiograms corresponding to different leads, the present invention can determine which lead electrocardiogram is more suitable for selecting features based on the electrocardiogram corresponding to lead I and the electrocardiogram corresponding to lead aVF. The present invention can perform a first pre-processing on the electrocardiogram to generate a first electrocardiogram with a more regular and smooth signal. In order to reduce the difference in signal range between different patients, the present invention can convert the first electrocardiogram into a standard score to generate a second electrocardiogram. The present invention can use the second electrocardiogram to accurately mark the peak of the R wave on the first electrocardiogram, thereby marking the peak or trough of the P wave, Q wave, S wave and T wave according to the peak of the R wave. After obtaining multiple endpoints of each type of wave, the present invention can calculate the characteristic value of a specific feature based on the multiple endpoints, and determine whether the specific feature can improve the performance of the machine learning model based on the characteristic value. If it is considered that the specific feature can significantly improve the performance of the machine learning model, the present invention can output the specific feature to prompt the user. Therefore, the user can train a machine learning model with better performance according to the features selected by the present invention. The machine learning model can be used to determine the health status of the coronary arteries of the subject according to the electrocardiogram.
[0108] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. An electronic device for selecting features of an electrocardiogram, characterized in that include: Transceiver; A storage medium for storing multiple modules; as well as A processor is coupled to the storage medium and the transceiver, and accesses and executes the multiple modules, wherein the multiple modules include: A data collection module, which obtains an electrocardiogram through the transceiver; A first pre-processing module, performing a first pre-processing on the electrocardiogram to generate a first electrocardiogram; A second pre-processing module performs second pre-processing on the first electrocardiogram to generate a second electrocardiogram, wherein the second pre-processing includes: Divide the first electrocardiogram into three parts, wherein the three parts include an electrocardiogram of a first period, an electrocardiogram of a second period later than the electrocardiogram of the first period, and an electrocardiogram of a third period later than the electrocardiogram of the second period, wherein the electrocardiogram of the first period and the electrocardiogram of the third period have the same length; Calculating a first standard deviation of the electrocardiogram corresponding to the first period and a second standard deviation of the electrocardiogram corresponding to the second period; In response to a difference between the first standard deviation and the second standard deviation being greater than a first threshold, deleting the first period electrocardiogram from the first electrocardiogram; performing a wavelet transform on the first electrocardiogram to produce a transformed electrocardiogram; normalizing the transformed electrocardiogram to a standard score; and Setting a plurality of data points in the standard score that are less than a second threshold value to zero to generate the second electrocardiogram; a marking module, marking a plurality of endpoints corresponding to at least one wave including an R wave on the first electrocardiogram, comprising: the marking module dividing the second electrocardiogram into a plurality of parts according to a window function, and marking a first data point having a maximum value in the first part as a first reference point in response to a first part of the plurality of parts including at least one data point greater than zero, wherein the first reference point corresponds to a first reference time point, wherein the marking module determines a first time period of the first electrocardiogram according to the first reference time point, and marking a second data point having a maximum value in the first time period as a first R wave endpoint, wherein the first reference time point is located at the center of the first time period, wherein the plurality of endpoints include the first R wave endpoint; a feature establishment module, calculating a first feature value corresponding to a first feature according to the plurality of endpoints of the at least one wave, and generating a first performance indicator corresponding to a machine learning model according to the first feature value; a feature selection module, determining whether to select the first feature according to the first performance indicator; and An output module, in response to selecting the first feature, outputs the first feature through the transceiver.
2. The electronic device of claim 1, wherein the at least one wave further comprises a Q wave, wherein the first R wave endpoint corresponds to a first time point, wherein The marking module determines the second time period of the first electrocardiogram based on the first time point, and marks the third data point with the minimum value in the second time period as the first Q wave endpoint, wherein the first time point is the latest time point of the second time period, and wherein the multiple endpoints include the first Q wave endpoint.
3. The electronic device according to claim 2, wherein The marking module marks a fourth data point having a minimum value in a third time period earlier than the second time period as the first Q wave endpoint in response to the slope of the third data point being positive.
4. The electronic device of claim 2, wherein the first Q wave endpoint corresponds to a second time point, wherein The marking module marks a plurality of R wave endpoints including the first R wave endpoint on the first electrocardiogram, calculates an average RR interval according to the plurality of R wave endpoints, determines a weight according to the number of the plurality of R wave endpoints, and determines a second window function according to the average RR interval and the weight, wherein The marking module determines a fourth time period earlier than the second time point according to the second window function, and marks the fifth data point with the maximum value in the fourth time period as the first P wave endpoint, wherein the second time point corresponds to the second latest time point of the fourth time period, and the multiple endpoints include the first P wave endpoint.
5. The electronic device according to claim 4, wherein The marking module marks a sixth data point having a maximum value in a fifth time period earlier than the fourth time period as the first P-wave endpoint in response to the slope of the fifth data point being negative.
6. The electronic device according to claim 1, wherein the first pre-processing comprises: Baseline drift removal, denoising and normalization are performed on the electrocardiogram to generate the first electrocardiogram.
7. The electronic device according to claim 1, wherein The data collection module receives a plurality of electrocardiograms through the transceiver, wherein the plurality of electrocardiograms include a first lead electrocardiogram and a second lead electrocardiogram, wherein The data collection module normalizes the first lead electrocardiogram into a first standard score function, selects the at least one first standard score from a plurality of first standard scores of the first standard score function to calculate a first sum in response to at least one first absolute value of at least one first standard score in the first standard score function being greater than a first absolute value of a first standard score in the first standard score function, wherein The data collection module normalizes the second lead electrocardiogram into a second standard score function, selects the at least one second standard score from a plurality of second standard scores of the second standard score function to calculate a second sum in response to at least one second absolute value of the at least one second standard score in the second standard score function being greater than a second absolute value of the second standard score in the second standard score function, wherein The data collection module selects the electrocardiogram corresponding to the third lead from the plurality of electrocardiograms according to whether the first total and the second total are positive or negative.
8. The electronic device of claim 7, wherein the first lead electrocardiogram corresponds to lead I, wherein the second lead electrocardiogram corresponds to lead aVF, and wherein the third lead corresponds to one of the following: Lead II, lead aVL, lead aVF and lead aVR.
9. The electronic device according to claim 1, wherein The feature selection module selects the first feature in response to the first performance indicator being greater than a performance threshold.
10. The electronic device according to claim 1, wherein The feature establishment module calculates a second feature value corresponding to a second feature according to the multiple endpoints of the at least one wave, and generates a second performance indicator corresponding to the machine learning model according to the second feature value, wherein The feature selection module selects the first feature from among the first feature and the second feature in response to the first performance indicator being greater than the second performance indicator.
11. A method for selecting features of an electrocardiogram, characterized in that include: Obtain an electrocardiogram; Performing a first pre-processing on the electrocardiogram to generate a first electrocardiogram; Performing a second pre-processing on the first electrocardiogram to generate a second electrocardiogram, wherein the second pre-processing includes: Divide the first electrocardiogram into three parts, wherein the three parts include an electrocardiogram of a first period, an electrocardiogram of a second period later than the electrocardiogram of the first period, and an electrocardiogram of a third period later than the electrocardiogram of the second period, wherein the electrocardiogram of the first period and the electrocardiogram of the third period have the same length; Calculating a first standard deviation of the electrocardiogram corresponding to the first period and a second standard deviation of the electrocardiogram corresponding to the second period; In response to a difference between the first standard deviation and the second standard deviation being greater than a first threshold, deleting the first period electrocardiogram from the first electrocardiogram; performing a wavelet transform on the first electrocardiogram to produce a transformed electrocardiogram; normalizing the transformed electrocardiogram to a standard score; and Setting a plurality of data points in the standard score that are less than a second threshold value to zero to generate the second electrocardiogram; Marking a plurality of endpoints corresponding to at least one wave including R wave on the first electrocardiogram, comprising: dividing the second electrocardiogram into a plurality of parts according to a window function, and marking a first data point having a maximum value in the first part as a first reference point in response to a first part of the plurality of parts including at least one data point greater than zero, wherein the first reference point corresponds to a first reference time point; determining a first time period of the first electrocardiogram according to the first reference time point, and marking a second data point having a maximum value in the first time period as a first R wave endpoint, wherein the first reference time point is located at the center of the first time period, wherein the plurality of endpoints include the first R wave endpoint; Calculating a first eigenvalue corresponding to a first feature according to the multiple endpoints of the at least one wave, generating a first performance indicator corresponding to a machine learning model according to the first eigenvalue, and determining whether to select the first feature according to the first performance indicator; and The first feature is output in response to selecting the first feature.
