Measurement(s)12-lead electrocardiogramTechnology Type(s)EKG or ECG Monitor Device
Deep learning approaches have exhibited a great ability on automatic interpretation of the electrocardiogram (ECG). However, large-scale public 12-lead ECG data are still limited, and the diagnostic labels are not uniform, which increases the semantic gap between clinical practice. In this study, we present a large-scale multi-label 12-lead ECG database with standardized diagnostic statements. The dataset contains 25770 ECG records from 24666 patients, which were acquired from Shandong Provincial Hospital (SPH) between 2019/08 and 2020/08. The record length is between 10 and 60 seconds. The diagnostic statements of all ECG records are in full compliance with the AHA/ACC/HRS recommendations, which aims for the standardization and interpretation of the electrocardiogram, and consist of 44 primary statements and 15 modifiers as per the standard. 46.04% records in the dataset contain ECG abnormalities, and 14.45% records have multiple diagnostic statements. The dataset also contains additional patient demographics.
Background & SummaryElectrocardiogram (ECG) is an important tool for diagnosing heart diseases and early screening1,2. In recent years, as the rapid growth in leveraging wearable devices (e.g. smartwatch3 and smart vest4) for ECG monitoring, the automatic classification of ECG has become a hot topic. It is known that the ECG classification problems can be efficiently addressed by deep learning based approaches, providing that large-scale ECG data with labels of high quality are available. Successful cases include the cardiologist-level arrhythmia detection5 and the screening for cardiac contractile dysfunction2, where tens of thousands ECGs with restricted access were used in these studies.Many ECG datasets have been published in past decades6, e.g., the MIT-BIH arrhythmia database7, the INCART database8, and the QT database9, but there are mostly dozens of ECG recordings in them, where the recordings usually have only one or two leads. In fact, such databases were mostly employed for developing models for the classification of heartbeats rather than whole ECG records. Recently, several large 12-lead ECG datasets have been made public (Table 1), e.g. the PTB-XL dataset10,11 and the Shaoxing People’s Hospital dataset12,13 respectively containing 21837 and 10646 records. Especially, the PTB-XL database, the CPSC database14,15, the INCART database8, and the Georgia database15, which are summarized in Table 1, have been exploited in the PhysioNet/CinC 2020 challenge15, leading to significant progress on real-world evaluation of the ECG classification methods. However, the existing sources of ECG are still limited for assessing the generalization ability. More importantly, ECG diagnostic statements, i.e. the label, used in the literature and competitions are not uniform. Specifically, the PTB-XL dataset adopts SCP-ECG (i.e. standard communications protocol for computer assisted electrocardiography) statements16 and the PhysioNet/CinC challenge uses SNOMED-CT codes17, and many ECG statements used by the two standards do not exactly match. In addition, more approaches just use non-standardized statements, e.g. a collection of common rhythms5,12. Such divergence hinders real-world application of large-scale ECG data, and may result in unfair or misleading comparison.Table 1Overview of large public 12-lead ECG datasets.Name# ECGLength (seconds)Standard# Classes# PatientSingle-sourceCPSC database14,15103306∼60—2310330NINCART database8741800—1032YPTB-XL dataset10,112183710SCP-ECG167118885YGeorgia database151034410SNOMED-CT172410344NShaoxing People’s Hospital dataset12,131064610—1110646YSPH dataset (this work)182577010∼60AHA194424666YIn this study, we present a large 12-lead ECG dataset18 with standardized diagnostic statements conforming to the AHA/ACC/HRS (i.e., the American Heart Association, the American College of Cardiology, and the Heart Rhythm Society) recommendations (hereinafter referred to as “AHA standard”)19. Our dataset contains 25770 12-lead clinical ECG records from 24666 patients (55.36% male and 44.64% female) and, to our best knowledge, this is the largest accessible single-source ECG dataset. The data were collected from Shandong Provincial Hospital from 2019/08 to 2020/08. The sampling frequency is 500 Hz and the length of records ranges from 10 to 60 seconds. Patient demographics such as age and sex are also included. 46.04% records in the dataset contain ECG abnormalities, which are described in Chinese. The original Chinese diagnostic statements were checked by cardiologists and then converted to standardized diagnostic statements as per the AHA standard, including primary statements, modifiers and pairing rules.The AHA standard aims for the standardization and interpretation of the ECG. It has been widely adopted in clinical scenario across the world. Compared with SNOMED-CT or SCP-ECG, which are mainly designed for medical information interchange and hence involve redundant or uncertain terms, the AHA recommendation mainly presents clinically useful statements and excludes unnecessary overlapping or vague terminology19. As supervised learning depends on accurate ECG labels to distinguish different ECG classes, a clearly organized and non-overlapping system of statements helps the deep learning models to efficiently learn the intrinsic ECG characteristics. Using the AHA terminology uniformly also enables valid model comparison and real-world clinical assessment.The Shandong Provincial Hospital (SPH) database covers a wide range of ECG abnormalities and includes 44 primary statements and 15 modifiers as per the AHA standard. Especially, the separation of statements and modifiers as well as the pairing rules between them can characterize ECG more thoroughly, which is of great value to explore precise ECG analysis. 14.45% records in the database and 31.39% abnormal records have multiple diagnostic statements, providing the opportunity to develop and evaluate multi-label classification methods.MethodsData acquisitionThis study was approved by the Institutional review board of Shandong Provincial Hospital. Requirement for individual patient consent was waived and the database is allowed to be shared publicly after the data were de-identified.Original ECG records were generated at Shandong Provincial Hospital, Jinan, China during 2019/08∼2020/08. The ECG signal was recorded by the MedEx MECG-200 machine, where the A/D converter has 24-bit resolution and the unit is mV. The ECG signal has 16-bit precision and the sampling frequency is 500 Hz. Noises caused by the power line interference, baseline wander, and muscle contraction have been removed by the machine. Next, the filtered ECG signal was presented to a responsible cardiologist belonging to the department of electrocardiogram for clinical diagnosis. All cardiologists have at least three-year clinical experience before they are qualified to conduct ECG diagnosis. The ECG analysis system can automatically calculate nine ECG features for reference, which include heart rate, P wave duration, P-R interval, QRS duration, QT interval, corrected QT (QTc) interval, QRS axis, the amplitude of the R wave in lead V5 (RV5), and the amplitude of the S wave in lead V1 (SV1). The features might be inaccurate, especially when the ECG signal is abnormal. The responsible cardiologist made the final diagnosis in consideration of the patient health record.Under the limitations that the record length should be between 10 and 60 seconds and the patient age should be larger than 18, the filtered signal and the diagnostic statements made by the doctor were then exported from the MedEx MECG-200 ECG analysis system together with the following related information from the health record database of the hospital:unique ID of the patientage and sex of the patientacquisition dateData processingSince ECG signals have been filtered by the ECG machine and were mostly of good quality, we did not make additional processing to the signals. The ID of ECG records and patients were generated randomly, where ECG records from the same patient were still associated with the same patient ID. In order to protect the privacy of patients, the acquisition date of ECG records were shifted by a random offset for each patient10. When there are multiple records for the same patient, the chronological order was kept unchanged during date randomization. ECG records with missing age or sex information were excluded.The original diagnostic statements, which were written in Chinese, mainly follow the proprietary statement set of ECG machine vendor, and also contain many inconsistent use of idioms and punctuation due to manual input. The AHA standard has 117 primary diagnostic statements under 14 categories. Each primary statement can be paired with one or more secondary statements or modifiers, which cannot be used alone. The steps to convert the original diagnostic statements to standardized AHA terminology are as follows.An experienced cardiologist re-checked all original diagnostic statements and made corrections (also in Chinese). ECG records of poor quality were excluded by visual inspection at the same time.We eliminated inconsistent use of idioms and punctuation as much as possible by manually converting them to uniform terminology.We developed a series of translation rules mapping Chinese statements to standardized statements conforming to the AHA standard, where each original statement may correspond to multiple AHA diagnostic statements. The rules do not cover all cases since there still exists vague or clinically useless statements. The rules were revised by the cardiologist and are described in the Supplemental File 1.We applied the rules to all records with original diagnostic statements. Any ECG record with untranslatable statements was excluded.Finally, there were 25770 12-lead ECG records with standardized diagnostic statements after all steps.Data RecordsThe SPH database includes ECG signal data, associated metadata and diagnostic statement dictionary (see Fig. 1), which are all available online at figshare18. Each unique ECG record was saved as a 12 × L array in HDF5 format with 16-bit precision, and the file was named by the associated ID (e.g. A00001.h5). The sampling frequency is 500 Hz. L is the number of samples and 12 is the number of leads. The order of leads is I, II, III, aVR, aVL, aVF, V1, V2, V3, V4, V5, V6. There are 25770 ECG data files in total.Fig. 1Files in the SPH database.The diagnostic statement dictionary file (code.csv) describes the AHA statements and codes used in the SPH dataset. As shown in Table 2, there are 44 primary statements spanning across 11 categories (see Table 3). The distribution of primary statements shown in the table is highly unbalanced and should not be viewed as the actual reflection of the population since many records were excluded for various reasons (see Methods Section). There are also 15 modifiers in Table 2, which are used to refine the meaning of core statements and cannot be used alone19. There are more than 40 modifiers according to the AHA standard. Some modifiers (e.g. 308 and 310) can be used with a wide range of core statements, and some modifiers can only be used with a specific category, e.g. 330–334 should be paired with statements in category M.Table 2Overview of primary statements and modifiers in the dataset.CategoryCodePrimary Statement (+ Modifier)CountA1Normal ECG13905C21Sinus tachycardia725C22Sinus bradycardia2711C23Sinus arrhythmia1553D30Atrial premature complex(es)539308+ Occasional153310+ Frequent125340+ Couplets11341+ In a bigeminal pattern31349+ With aberrancy16D31Atrial premature complexes, nonconducted4D36Junctional premature complex(es)64D37Junctional escape complex(es)20E50Atrial fibrillation675346+ With a rapid ventricular response210347+ With a slow ventricular response6E51Atrial flutter99E54Junctional tachycardia13F60Ventricular premature complex(es)1067308+ Occasional271310+ Frequent277340+ Couplets3341+ In a bigeminal pattern70342+ In a bigeminal pattern38350+ Polymorphic3H80Short PR interval11H81AV conduction ratio N:D3H82Prolonged PR interval238H83Second-degree AV block, Mobitz type I (Wenckebach)9H84Second-degree AV block, Mobitz type II3H852:1 AV block35H86AV block, varying conduction47H87AV block, advanced (high-grade)3H88AV block, complete (third-degree)22I101Left anterior fascicular block154I102Left posterior fascicular block6I104Left bundle-branch block84I105Incomplete right bundle-branch block1259I106Right bundle-branch block710I108Ventricular preexcitation27J120Right-axis deviation161J121Left-axis deviation138J125Low voltage322K140Left atrial enlargement19K142Left ventricular hypertrophy209K143Right ventricular hypertrophy6L145ST deviation1829362+ Depression1024363+ Elevation37L146ST deviation with T-wave change1063L147T-wave abnormality2218367+ Inversion176L148Prolonged QT interval24L152TU fusion9L153ST-T change due to ventricular hypertrophy88L155Early repolarization32M160Anterior MI52330+ Acute1332+ Old47M161Inferior MI120330+ Acute2331+ Recent3332+ Old114M165Anteroseptal MI91330+ Acute4331+ Recent9332+ Old75M166Extensive anterior MI7332+ Old7Table 3Overview of ECG categories in the dataset.CodeCategoryCountAOverall interpretation13905BTechnical conditions0CSinus node rhythms and arrhythmias4643DSupraventricular arrhythmias622ESupraventricular tachyarrhythmias787FVentricular arrhythmias1067GVentricular tachyarrhythmias0HAtrioventricular conduction370IIntraventricular and intra-atrial conduction2195JAxis and voltage612KChamber hypertrophy or enlargement229LST segment, T wave, and U wave5125MMyocardial infarction260NPacemaker0In the metadata file, each line represents a unique ECG record and contains the ECG ID, the patient ID, the AHA code, the age and sex, the record length, and the acquisition date, as described in Table 4. Since an ECG record can have multiple diagnostic statements, we used the semicolon as the separator between them. Besides, each diagnostic statement consists of one primary statement and additional modifiers, and the plus sign is used to joint them. Figure 2 describes the encoded representation of multiple statements, where the order of statements and modifiers is arbitrary. The proportions of male and female in the dataset are 55.36% and 44.64%. Tables 5 and 6 show the overview of patient age and the record length respectively. Most ECG records are between 10 and 15 seconds.Table 4Metadata describing the ECG record.FieldTypeDescriptionECG_IDStringUnique identifier for ECGAHA_CodeStringEncoded representation (see Fig. 2) of the AHA standardPatient_IDStringUnique identifier for patientAgeIntegerAge (18∼100)SexStringSex (’M’: male,’F’: female)NIntegerThe number of sampling pointDateStringAcquisition dateFig. 2Encoded representation of AHA diagnostic statements.Table 5Overview of patient age.Age[10, 20)[20, 30)[30, 40)[40, 50)[50, 60)[60, 70)[70, 80)[80, 90)[90, 100]#Records8622295145511057234441216182253Table 6Overview of ECG record length.Seconds[10, 15)[15, 20)[20, 25)[25, 30)[30, 35)[35, 40)[40, 45)[45, 50)[50, 55)[55, 60]#Records24242114125771261511331According to Table 2, there are 13905 normal ECG records, i.e., the remaining 11865 records, 46.04% of the SPH dataset, contain ECG abnormalities. Table 7 shows the overview of the number of statements per ECG record. 14.45% records in the dataset and 31.39% abnormal records have multiple diagnostic statements. Table 8 presents the overview of the number of ECG records per patient, and 4.32% patients have more than one ECG record.Table 7Overview of number of statements per ECG record.#Statements123456#Records220462936665109122Table 8Overview of number of ECG records per patient.#Records12345#Patients2360010332931Technical ValidationTo validate the quality of ECG records, after all the steps described in Methods Section, we conducted signal quality assessment for original ECG records using two signal quality indices20, basSQI and pSQI representing the relative power in the baseline and the QRS complex respectively. For each record, the index was first calculated for 12 leads separately and then averaged. Next, we checked ECG records with low SQI values to make sure their quality is still acceptable. Figures 3 and 4 visualize the distributions of basSQI and pSQI of ECG records in the database, which have a minimum of 0.418 and 0.370 respectively. Specifically, ECG records whose SQI values are close to the minimum were reviewed and no significant quality defect was found. Figure 5 shows four records with lowest basSQI values. It is worth pointing out that ECG records containing one or two noisy leads or short corrupted segments, as shown in Fig. 5, were not rejected as long as reliable diagnosis can be made.Fig. 3Distribution of basSQI of all ECG records.Fig. 4Distribution of pSQI of all ECG records.Fig. 5ECG signals with lowest basSQI values. The length is 10 seconds.Since an ECG record may have multiple diagnostic statements, we computed the co-occurrence matrix for primary statements to show the co-occurrence relationship (see Fig. 6). For a specific primary statement, the diagonal element represents the number of records labeled only by the specified statement, and other element in the same row means the number of records labeled by both statements. If two statements are not likely to happen at the same time in clinical practice, e.g. atrial fibrillation and other sinus rhythms, the matrix can indicate whether such records exist in the database intuitively. Since co-existing statements may describe different ECG intervals, the cardiologist revised the suspicious records to make sure the statements are correct. In addition, normal ECG records should not have statements indicating abnormalities, which is verified by the first column, thus the matrix was also used for quality control purposes.Fig. 6Co-occurrence matrix of primary statements. The diagonal element represents the number of records labeled only by the specified statement.AHA standard includes various pairing rules. As this dataset contains 44 primary statements as well as 15 modifiers, we make sure that each modifier is pairing correctly with the primary statement by checking all 25 combinations (see Table 2).Usage NotesThe ECG data are stored in HDF5 format, a platform-independent format designed for data storage and widely supported by scientific software and programming languages. Python code for loading the ECG data and processing diagnostic codes as well as the metadata is provided at figshare18.The hierarchy of ECG terminology presented by the AHA standard is well-organized. 117 primary statements belong to core statements, and most ECG classification in the literature focus on this level only. Considering all kinds of AHA statements and various real-world use cases, we suggest four tasks from coarse to fine levels for the usage of SPH dataset (see Fig. 7).Fig. 7ECG classification tasks from coarse level to fine level.The first task is the classification of normal ECG and abnormal ECG, which account for 53.96% and 46.04% in the dataset respectively. The detection of ECG abnormalities is useful in daily ECG monitoring. The remaining three tasks are at the levels of ECG category, primary statement, and full statement respectively, corresponding to the AHA standard, and all of them are multi-label classification. In addition, to avoid incorrect dataset partition (e.g. records from the same patient included in both training and testing sets) and improve comparability of models trained on the dataset, we provide the Python code at figshare18 for dataset splitting.Supplementary information
Supplemental File 1