Learning to Learn Personalized Neural Network for Ventricular Arrhythmias Detection on Intracardiac EGMs
Proceedings of the Thirtieth International Joint Conference on Artificial Intelligence. Main Track. Pages 2606-2613.
https://doi.org/10.24963/ijcai.2021/359
Keywords
- Machine Learning: Transfer, Adaptation, Multi-task Learning
- Machine Learning Applications: Bio/Medicine
- Multidisciplinary Topics and Applications: Biology and Medicine
Abstract
Life-threatening ventricular arrhythmias (VAs) detection on intracardiac electrograms (IEGMs) is essential to Implantable Cardioverter Defibrillators (ICDs). However, current VAs detection methods count on a variety of heuristic detection criteria, and require frequent manual interventions to personalize criteria parameters for each patient to achieve accurate detection. In this work, we propose a one-dimensional convolutional neural network (1D-CNN) based life-threatening VAs detection on IEGMs. The network architecture is elaborately designed to satisfy the extreme resource constraints of the ICD while maintaining high detection accuracy. We further propose a meta-learning algorithm with a novel patient-wise training tasks formatting strategy to personalize the 1D-CNN. The algorithm generates a well-generalized model initialization containing across-patient knowledge, and performs a quick adaptation of the model to the specific patient's IEGMs. In this way, a new patient could be immediately assigned with personalized 1D-CNN model parameters using limited input data. Compared with the conventional VAs detection method, the proposed method achieves 2.2% increased sensitivity for detecting VAs rhythm and 8.6% increased specificity for non-VAs rhythm.
- [Acharya et al., 2018] U Rajendra Acharya, Hamido Fujita, Shu Lih Oh, U Raghavendra, Jen Hong Tan, Muhammad Adam, Arkadiusz Gertych, and Yuki Hagiwara. Auto- mated identification of shockable and non-shockable life- threatening ventricular arrhythmias using convolutional neural network. Future Generation Computer Systems, 79:952-959, 2018.
- [Adabag et al., 2010] A Selcuk Adabag, Russell V Luepker, Véronique L Roger, and Bernard J Gersh. Sudden car- diac death: epidemiology and risk factors. Nature Reviews Cardiology, 7(4):216, 2010.
- [AnnArbor, 2003] AnnArbor. Ann Arbor Electrogram Li- braries, Chicago IL, USA, 2003.
- [Antoniou et al., 2018] Antreas Antoniou, Harrison Ed- wards, and Amos Storkey. How to train your maml. arXiv preprint arXiv:1810.09502, 2018.
- [Camara et al., 2015] Carmen Camara, Pedro Peris-Lopez, and Juan E Tapiador. Security and privacy issues in im- plantable medical devices: A comprehensive survey. Jour- nal of biomedical informatics, 55:272-289, 2015.
- [Elola et al., 2019] Andoni Elola, Elisabete Aramendi, Unai Irusta, Artzai Picón, Erik Alonso, Pamela Owens, and Ahamed Idris. Deep neural networks for ECG-based pulse detection during out-of-hospital cardiac arrest. Entropy, 21(3):305, 2019.
- [Finn et al., 2017a] Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. arXiv preprint arXiv:1703.03400, 2017.
- [Finn et al., 2017b] Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. arXiv preprint arXiv:1703.03400, 2017.
- [Greenberg et al., 2004] Henry Greenberg, Robert B Case, Arthur J Moss, Mary W Brown, Elizabeth R Carroll, Mark L Andrews, MADIT-II Investigators, et al. Analysis of mortality events in the multicenter automatic defibrilla- tor implantation trial (MADIT-II). Journal of the American College of Cardiology, 43(8):1459-1465, 2004.
- [Hannun et al., 2019] Awni Y Hannun, Pranav Rajpurkar, Masoumeh Haghpanahi, Geoffrey H Tison, Codie Bourn, Mintu P Turakhia, and Andrew Y Ng. Cardiologist- level arrhythmia detection and classification in ambulatory electrocardiograms using a deep neural network. Nature Medicine, 25(1):65, 2019.
- [Hofer et al., 2017] Daniel Hofer, Jan Steffel, David Hürlimann, Laurent Haegeli, Thomas F Lüscher, Firat Duru, Urs Eriksson, and Nazmi Krasniqi. Long-term inci- dence of inappropriate shocks in patients with implantable cardioverter defibrillators in clinical practice-An un- derestimated complication. Journal of Interventional Cardiac Electrophysiology, 50(3):219-226, 2017.
- [Li et al., 2013] Qiao Li, Cadathur Rajagopalan, and Gari D Clifford. Ventricular fibrillation and tachycardia classifi- cation using a machine learning approach. IEEE Transac- tions on Biomedical Engineering, 61(6):1607-1613, 2013.
- [Madhavan and Friedman, 2013] Malini Madhavan and Paul A Friedman. Optimal programming of implantable cardiac-defibrillators. Circulation, 128(6):659-672, 2013.
- [Moss et al., 2012] Arthur J Moss, Claudio Schuger, Christopher A Beck, Mary W Brown, David S Cannom, James P Daubert, NA Mark Estes III, Henry Greenberg, W Jackson Hall, David T Huang, et al. Reduction in inappropriate therapy and mortality through ICD programming. New England Journal of Medicine, 367(24):2275-2283, 2012.
- [Nichol et al., 2018] Alex Nichol, Joshua Achiam, and John Schulman. On first-order meta-learning algorithms. arXiv preprint arXiv:1803.02999, 2018.
- [Senges-Becker et al., 2005] Julia C Senges-Becker, Mar- tina Klostermann, Ruediger Becker, Alexander Bauer, Karl E Siegler, Hugo A Katus, and Wolfgang Schoels. What is the "Optimal" follow-up schedule for ICD pa- tients? EP Europace, 7(4):319-326, 2005.
- [Simon et al., 2007] Fernando Simon, Juan Pablo Martinez, Pablo Laguna, Bart van Grinsven, Cyril Rutten, and Richard Houben. Impact of sampling rate reduction on automatic ecg delineation. In 2007 29th Annual Interna- tional Conference of the IEEE Engineering in Medicine and Biology Society, pages 2587-2590. IEEE, 2007.
- [Sparkfun, 2018] Sparkfun. SparkFun Edge Development Board -Apollo3 Blue, 2018.
- [Strydis et al., 2013] Christos Strydis, Robert M Seepers, Pedro Peris-Lopez, Dimitrios Siskos, and Ioannis Sourdis. A system architecture, processor, and communication pro- tocol for secure implants. ACM Transactions on Architec- ture and Code Optimization (TACO), 10(4):1-23, 2013.
- [Theuns and Gold, 2010] Dominic AMJ Theuns and Michael R Gold. Defibrillation threshold testing at implantation: Can we predict the patient with a high defibrillation threshold? EP Europace, 12(3):309-310, 2010.
- [Thøgersen et al., 2017] Anna Margrethe Thøgersen, Ja- cob Moesgaard Larsen, Jens Brock Johansen, Moeen Abe- din, and Charles D Swerdlow. Failure to treat life- threatening ventricular tachyarrhythmias in contemporary implantable cardioverter-defibrillators: Implications for strategic programming. Circulation: Arrhythmia and Electrophysiology, 10(9):e005305, 2017.
- [Zanker et al., 2016] Norbert Zanker, Diane Schuster, James Gilkerson, and Kenneth Stein. Tachycardia detection in icds by Boston Scientific. Herzschrittmachertherapie+ Elektrophysiologie, 27(3):186-192, 2016.
- [Zdarek and Israel, 2016] Jan Zdarek and Carsten W Israel. Detection and discrimination of tachycardia in ICDs man- ufactured by St. Jude Medical. Herzschrittmacherthera- pie+ Elektrophysiologie, 27(3):226-239, 2016.
References were extracted automatically from the PDF and may contain errors.
Full text extracted automatically from the PDF; figures, tables and equations may differ. The PDF is the version of record.
1 Introduction
The Implantable Cardioverter Defibrillator (ICD) is a small device implanted to reduce Sudden Cardiac Death (SCD) risk and improve the survival rate for recipients by detecting ventricular arrhythmias (VAs) on IEGMs, which reflect electric changes measured by electrodes placed within the heart. Life-threatening VAs includes ventricular tachycardia (VT) and ventricular fibrillation (VF), which are the main cause of SCD [Zdarek and Israel, 2016]. ICDs are programmed to release defibrillation (i.e., electrical shock) therapy on VAs to restore rhythm back to normal. Therefore, VAs detection is a pivotal component to ICDs as detection accuracy severely affects the effectiveness and lifetime of ICDs.
Current VA detection methods count on a wide variety of criteria and there are hundreds of programmable criteria parameters affecting the defibrillation delivery decision in these methods [Madhavan and Friedman, 2013]. To achieve the best detection performance for the patient, cardiologists have to periodically and manually tune the criteria parameters by learning from the cardiac rhythm of the patient [SengesBecker et al., 2005]. Current VA detection methods utilized in ICDs are often referred to as criteria-based VA detection.
However, existing criteria-based methods still suffer from a relatively high Inappropriate Shock Rate (ISR). Inappropriate shock is the shock delivered to a non-VA rhythm (i.e., the rhythm other than VT or VF) due to an incorrect detection and has been associated with proarrhythmia, intolerable pain, anxiety and depression on patients [Moss et al., 2012]. Inappropriate shock has been reported in 12-23% ICD recipients [Greenberg et al., 2004; Hofer et al., 2017]. To alleviate the problem, designing new detection criteria and the personalized fine-tuning on criteria parameters are two vital approaches. However, both procedures demand a high level of expertise engaged and a long period of optimization.
Recently, deep learning based arrhythmias detection on electrocardiogram (ECG) has achieved outstanding performance in terms of accuracy [Hannun et al., 2019; Elola et al., 2019; Acharya et al., 2018]. Compared with criteria-based detection methods, its most significant advantage is the reduction of the cardiological expertise required in the detection method design. The labeled ECG signal could be directly utilized as the input and the pre-trained CNN model outputs the prediction without cumbersome criteria design and selection.
However, there are two main challenges in applying the aforementioned CNN-based detection models to the scenarios of VA detection on IEGMs: 1) The existing CNNs for accurate arrhythmias detection cannot satisfy the resource constraints if deployed on the ICDs platform; 2) The detection accuracy of the pre-trained CNN model would degrade significantly on some patients due to their unique rhythm features, which is intolerable in the ICD scenarios. Fine-tuning the CNN model using the data from the specific patient could improve the detection accuracy. However, it is not practical since fine-tuning the CNN requires extensive amount of labeled IEGMs for each individual patient.
To address the challenges, we propose the one-dimensional convolutional neural network (1D-CNN) based VAs detection and a novel meta-learning algorithm to personalize the 1DCNN for patient-specific arrhythmias detection. Specifically, we develop a 1D-CNN to detect VAs on the one-channel IEGMs. The 1D-CNN only occupies tiny memory space and computational power such that it fits the resource-constrained ICDs. Since each patient has the unique characteristics in the rhythm, a pre-trained 1D-CNN cannot achieve the optimal detection performance for each individual. Thus we propose a novel meta-learning algorithm. Different from the N-wayK-shot classification targeted by conventional meta-learning approaches [Finn et al., 2017a], our meta-learning algorithm accommodates the patient-specific VAs detection through a novel patient-wise training tasks formatting strategy. In this way, the 1D-CNN could learn across-patient knowledge and end up with a well-generalized model initialization. When a new patient is involved, a quick adaption would be performed on the well-generalized 1D-CNN to the specific patient's rhythm with only limited IEGMs of the patient. An inner-loop update optimization and a dynamic task set mechanism are devised to optimize the meta-learning process, and at the same time further improve the model generalization. The effectiveness of our meta-learning algorithm has also been examined by surface rhythm ECG, where the patient-specific arrhythmias detection are evaluated.
The main contributions summarized are as follows:
- We propose a novel 1D-CNN, which meets the requirements of ICDs in terms of memory, response time and power while maintaining a high detection accuracy.
- To the best of our knowledge, this paper is the first to propose a meta-learning method to accommodate the patient-specific arrhythmias detection through a novel patient-wise training tasks formatting strategy.
- We further improve the arrhythmias detection performance by optimizing the generalization of the metamodel initialization through a dynamic task set mechanism and an inner-loop update optimization.
- Our meta-learning algorithm is shown to be effective and generalized on various arrhythmias detection on surface rhythm from ECG standard databases.
2 RelatedWorks andMotivations
2.1 Ventricular Arrhythmias and ICDs
VF and VT are called life-threatening ventricular arrhythmias (VAs) which are the main cause of Sudden Cardiac Death (SCD). More than 60% of deaths from cardiovascular disease are from the out-of-hospital SCD [Adabag et al., 2010]. Unless the heart is shocked back into normal rhythm, the patient rarely survives.
There are various types of ICDs. In this paper, we focus on improving the VAs detection accuracy of single-chamber ICDs [Zanker et al., 2016]. The single-chamber ICD has leads attached in right ventricle to sense ventricular heart rhythm and the rhythm data that the ICD normally utilizes to detect VAs is the one-channel EGMs sensed by right ventricular apex-bipolar (RVA-Bi) lead. Due to the constraints in physical size and battery lifetime, current ICDs can only provide 128-1024 KB for ROM and 8-32 KB for RAM to store data and execute program with 1-5 mA during VAs detection [Strydis et al., 2013; Camara et al., 2015].
2.2 VAs DetectionMethods
Current VAs detection methods on ICDs utilize various criteria such as number of intervals to detect (NID), fast/slow interval determination, rhythm stability, and onset analysis on IEGMs to determine VAs [Zdarek and Israel, 2016; Thøgersen et al., 2017]. To achieve the best detection performance for each patient, cardiologists have to periodically fine-tune the criteria parameters by learning the sensed rhythm of the patient, which requires massive manual intervention to achieve the optimal VAs detection.
Machine Learning (ML) based detection methods for arrhythmias classification become popular in recent years. The benefits of applying ML are the high detection accuracy and the degradation of expertise required in method design. Authors in [Li et al., 2013] utilize SVM to discriminate VT/VF rhythm based on various combinations of features with the highest 97.52% accuracy. The convolutional neural network (CNN) proposed in [Hannun et al., 2019] achieves an even better performance in 12 arrhythmias classification than cardiologists using single-lead ECG. However, both methods could not be directly deployed on ICDs since the computational resources are severely constrained. Authors in [Acharya et al., 2018] propose a CNN with simple structure for VT/VF detection using single-lead surface ECG in intra-patient paradigms (i.e., the training and testing set may include data from the same patient). However, the detection accuracy on non-VAs rhythm is only 91.04%, which cannot be adopted in the ICDs scenarios.
2.3 Motivations
In this work, we are looking for a decent solution to personalize the VAs detection model with only limited rhythm data of each individual patient. We find the conventional meta-learning approaches (e.g. MAML [Finn et al., 2017b] and Reptile [Nichol et al., 2018]) provide a learning strategy that a meta-model with well-generalized initialization is obtained by training on the tasks containing support and query set. The meta-model can be further fine-tuned using the specific patient's rhythm data to obtain the personalized detection model. However, those methods mix training samples with different classes from various patients in a single training task during meta-learning process. The training tasks with such biased data distribution may cause gradient diminishing and training instability, which degrade the generalization of the model and leads to low VAs detection accuracy. Thus, it is necessary to devise a tasks formatting strategy for metalearning approaches to optimize the training process and obtain a well-generalized model initialization.
3 Method
In this section, we first introduce the 1D-CNN based VAs detection. We then present the meta-learning algorithm which performs a quick and effective model personalization.
3.1 1D-CNN Based VAs Detection
We first demonstrate the 1D-CNN detection model applied on IEGMs in ICDs. As shown in Fig. 1, the input of the 1DCNN is the set of 2s-length sampling points (i.e., total 500

points under 250Hz sampling rate) of the EGMs sensed by the ICD, and the output would be the prediction (i.e. VAs or nonVAs) on the given segment. The segment length is set to be 2s since it contains adequate rhythm information for accurate inference while we can maintain a relatively low computation overhead for the inference on the devices. The sampling rate of EGMs is 250Hz since it is the sampling rate applied in most ICDs [Simon et al., 2007]. The 1D-CNN consists of five 1D-convolutions (stride 2) followed by two fully connected layers. The batch-normalization (BN) at each layer is applied to ensure the same magnitude of the numerical values.
The 1D-CNN based VAs detection mechanism leverages an evaluator to determine the VAs on the sensed IEGMs. As shown in Fig. 1, the evaluator receives the series of segment predictions and determines the VAs rhythm with an empirical criteria. The criteria is that the VAs rhythm would be reported if there are four consecutive VAs predictions on the 2s segments. In other words, the evaluator would consistently monitor the latest four inferences, and therefore the decision period is 8 seconds. The criteria is set since the detection period of criteria-based VAs detection in ICDs is usually 5 to 10 seconds [Madhavan and Friedman, 2013].
3.2 Learning to Learn Personalized 1D-CNN
There are two key steps to learn a personalized 1D-CNN for each individual patient's VAs detection. 1) Meta-learning: Format the patient-wise training tasks and optimize learning process to obtain a well-generalized 1D-CNN initialization containing across-patient knowledge as meta-model. 2) Personalization: Perform a quick personalization on the metamodel to adapt to the specific patient's intracardiac rhythm.
Meta-Learning
Formally, we denote the initial meta-model parameters of the 1D-CNN as φ. The purpose of the learning process is to iteratively train the network over each TaskSet T in the TaskSet collection T to obtain a well-generalized meta-model parameters φ∗ . However, existing meta-learning algorithms focus on solving N-way-K-shot classification and are not applicable in the VAs detection scenarios. To address the challenges, we propose the patient-wise training tasks and two optimizations to ensure that the across-patient knowledge is learned by the meta-model.
We first introduce Patient-wise Training Tasks Formatting along with the necessary formulation. For each task of the T , we randomly select N patients from training patients dataset and randomly collect n VAs and n non-VAs labeled 2s segments from each selected patient to form a task τi.
Once a task τi is formed, the first p of every patient's VAs and non-VAs segments would be extracted to form the support set, denoted as τ s i . The rest n - p VAs and non-VAs segments of each patient in τi would be formed as query set, denoted as τ q i . The formal definition of both set are shown as follows:
where (x, y)i is the set of segment and label pairs in τi, and M spt and M qry are the pair indices (in τi) set for τ s i and τ q i separately. There are total 2p · N indices for pairs in τ s i and 2(n - p) · N indices for τ q i . A TaskSet T is constructed by repeating the aforementioned process to include a number of tasks τi and a TaskSet collection T contains multiple T .
We define the 1D-CNN inference as fθ(x), where x is the input segment and θ is the parameters of the network. When adapting the model to each task τi, k-step gradient update is applied to update the model parameter from θ0 i = φ to θk i using the segment and label pairs in the support set τ s i of task τi. The one example gradient update on step m (where 0 < m ≤ k) is defined as follows:
where L is the loss function and α is the learning rate. The gradient descent (GD) in Eqn. (2) would be processed from step 0 to k to obtain the task-specific model with θk i for τi:

This process is defined as inner-loop model update.
Once obtaining |T | number of task-specific models using Eqn. (3) for each task τi ∈ T , we then evaluate the generalization capability of the obtained models. We first calculate the loss of each task-specific model on the corresponding task's query set. The loss is calculated as follows:
Here, we fetch the tasks using a tasks batch methodology (i.e., the batch-size number of tasks are grouped as a batch) from the TaskSet T . The meta objective of one batch of tasks is defined as follows:
where b is the index of a particular task in the batch and B is the batch size. This objective in Eqn. (5) is utilized to evaluate the generalization of meta-model parameters φ in terms of the total loss on all tasks in the batch. The objective should be minimized to optimize the meta-model parameters. Such optimization is defined as outer-loop meta-model update and could be solved using Adam or Stochastic Gradient Descent (SGD). The resulting meta-model parameters updating is shown as follows:
where β is the meta learning rate and φ′ is the updated parameters of meta-model which contains the across-patient knowledge and would be used as the initial parameters for next batch update.To obtain the well-generalized meta-model parameters φ∗ , we should iteratively update the meta-model over batches extracted from each TaskSet T ∈ T.
Fig. 2 demonstrates the meta-learning process from initial model parameters φ to the well-generalized φ∗ . Each batch is formed by extracting different B tasks from the T . As shown in Fig. 2, for each task τ in a batch, the VAs segments are denoted with red border and the non-VAs segments are denoted with green border. N selected patients' first p VAs and non-VAs segments form the support set τ s and the rest n - p segments form the query set τ q of τ . The batch size B is fixed for all T ∈ T. Therefore, the meta-learning process is conducted batch by batch until every task from all T in T are utilized as a member of the batch.
To increase the generalization of the final meta-model parameters and speed up the learning process, we further propose the following optimizations:
Dynamic Task Set Mechanism. For each TaskSet T ∈ T, we apply a dynamic setting to construct the support and query set for the tasks. In conventional N-way-K-shot classification problems, the settings of tasks are fixed. The task must consist of samples from different N classes and its support set must have K elements to fit the classification problem. On the other hand, in our scenarios of VAs detection, we could have a flexible setting for the tasks in one T to increase the universality of the TaskSet collection T without violating the classification formulation. Here, we extract N patients and a dynamic number of VAs and non-VAs segments of each patient to form the support and query set among different T . The value of N is set to be a random integer value in a preset range [Nlower,Nupper]. The support and query set defined in Eqn. (1) are formed with a dynamic p ∈ [Ulow,Uup], where Ulow, Uup are the lower and upper bound of the random integer p. Note that inside one T , the value of N and p are kept the same. This optimization technique could increase the universality of the data collection so that we could obtain a more generalized meta-model parameters.
Inner-loop Update Optimization. The training of the conventional meta-learning method is time-consuming and may come with training instability problem [Antoniou et al., 2018]. To speed up the training process while maintaining a high quality of the meta-model parameters, we propose an inner-loop update steps annealing strategy. This strategy is based on the observation that the meta-model would rapidly learn the across-patient knowledge through the preceding part of the TaskSet collection T. As a consequence, for the Ta from the latter of T, the losses calculated on each update step of the task-specific model are relatively stable or even the same. Therefore, we propose an annealing strategy based on a step function to evenly reduce the inner-loop update steps k in Eqn. (3) for each T in T. The strategy is defined as follows:
where a is the index of a particular Ta ∈ T, w is the preset updating stride, and K is the minimal inner-loop update steps. To stabilize the gradients, we further invoke the multi-step loss optimization to take the loss of task-specific model based on the loss from every inner-loop update step. The Eqn. (4) can be re-written as:
where k is the inner-loop steps calculated in Eqn. (7) and vk(m) is the weight of the loss at step m.
Personalization
The personalization of the 1D-CNN for the given new patient would start with the well-generalized model parameters φ∗ obtained from the meta-learning. Here, we take advantage of a routine process in the ICD implantation surgery where limited IEGMs containing VAs and non-VAs of the patient would be recorded to assist the cardiologist to tune the criteria parameters before implanting the ICD [Theuns and Gold, 2010]. Instead of having the cardiologists to optimize the criteria parameters manually, we utilize those limited VAs and non-VAs rhythm to automatically personalize the 1DCNN by fine-tuning the model with φ∗ . The 1D-CNN could quickly adapt to the specific patient's rhythm feature since φ∗ contains across-patient knowledge through meta-learning. Specifically, the parameters of the 1D-CNN with φ∗ would be updated by SGD and back-propagation with those limited but labeled VAs and non-VAs segments of the new patient. The 1D-CNN based VAs detection model would be personalized to adapt to the specific patient with a few training iterations.
4 Experiments
4.1 Dataset and Data Preprocessing
Our dataset is retrieved from volume I & II of Ann Arbor Electrogram Libraries (AAEL), which is one of the largest dataset for IEGMs and used by all manufacturers developing implantable defibrillators to test their methods [AnnArbor, 2003]. The sampling rate of all recordings is 1, 000 Hz. Different periods of recordings have been annotated and reviewed by cardiac electrophysiologists to ensure an accurate interpretation of arrhythmia.
Here, we select 217 recordings over 78 patients to form the dataset by excluding the patients who do not experience VAs and the recordings with length less than 20s. Each selected recording contains the one-channel IEGMs sensed by RVA-Bi lead. All recordings are resampled to 250 Hz as the sampling rate is widely utilized in implantable devices [Simon et al., 2007]. As the raw physiological signals contain noise, we perform very common filtering techniques on the IEGMs recordings by applying a band-pass FIR filter with a pass-band frequency of 0.5 Hz and stop-band frequency of 50 Hz. Next, the recording is participated into various VA or non-VA events based on the rhythm diagnostic annotations on the IEGMs periods. Then, each event is segmented into segments using a 2-second sliding window (250 Hz × 2 s = 500 samples) with and without a overlap. The overlap is set to perform data augmentation for training only. The detailed segments and events statistics are illustrated in Table ??.
| Data | 2s-Segments | Events | |
|---|---|---|---|
| Non-Overlapping | Overlapping | ||
| VAs | 2,197 | 10,542 | 145 |
| Non-VAs | 5,097 | 10,206 | 214 |
4.2 Inter-Patient Evaluation Paradigms
The dataset is partitioned patient-wisely into 5 folds to ensure that the patients data is not mixed between the training and testing sets. That is, once the patient is selected for training or testing, all related events and segments would be utilized only for training or testing. The split is done randomly on the patients and we perform 5-fold cross-validation.
For each validation, four folds of patients' overlapping 2s segments serve as the training set and are used to perform learning to learn a well-generalized 1D-CNN model initialization in our method or training in the baseline methods. For each patient in the last fold for testing, the first 10s rhythm (five consecutive 2s non-overlapping segments) of a VAs and a non-VAs event are extracted to serve as the personalizing set and used to personalize or fine-tune the model for the specific patient. The rest 2s non-overlapping segments of the patients serve as testing set and are used to report the detection performance. In the testing fold, each time we extract a different specific patient with the corresponding segments from the personalizing set to personalize the model (if applicable) and the testing set to evaluate the model.
4.3 Methods Evaluated
We present performance comparisons for the following VAs detection methods:
Criteria-based VAs detection. We implement a VAs detection method used in single-chamber ICDs [Zanker et al., 2016], denoted as Classic. This method continuously monitors each heart beat and report VAs if criteria is satisfied. We set two detection zones for VT and VF respectively. The heart rate boundary of VT/VF zone and fast/slow interval threshold are fine-tuned for each testing patient to simulate the manual intervention such that the best discrimination performance could be achieved.
SVM-basedVAs detection. We implement an existingmachine learning based VAs detection method using support vector machine (SVM) [Li et al., 2013], denoted as SVM. The features extracted in SVM are Count2 and Leakage.
| Methods | F1 | Se/Sp | BAC/ACC | PPV/NPV |
|---|---|---|---|---|
| Classic | .923 | .972/.910 | .941/.935 | .880/.979 |
| SVM | .902 | .951/.892 | .921/.916 | .861/.964 |
| DL1 | .926 | .923/.954 | .939/.940 | .931/.947 |
| DL1-FT | .953 | .974/.952 | .963/.961 | .935/.981 |
| DL2 | .911 | .903/.947 | .925/.929 | .922/.935 |
| DL2-FT | .955 | .950/.974 | .962/.965 | .960/.968 |
| MAML | .959 | .967/.973 | .969/.943 | .952/.953 |
| Reptile | .943 | .955/.941 | .951/.948 | .932/.976 |
| Meta-Static | .973 | .982/.985 | .983/.987 | .977/.976 |
| Meta | .993 | .993/.996 | .995/.995 | .994/.996 |
| Methods | F1 | Se/Sp | BAC/ACC | PPV/NPV |
|---|---|---|---|---|
| SVM | .851 | .937/.906 | .922/.911 | .788/.970 |
| DL1 | .879 | .910/.944 | .927/.931 | .860/.960 |
| DL1-FT | .925 | .955/.958 | .957/.957 | .900/.981 |
| DL2 | .865 | .890/.937 | .914/.922 | .844/.953 |
| DL2-FT | .926 | .936/.967 | .951/.957 | .916/.972 |
| MAML | .929 | .934/.923 | .933/.951 | .921/.969 |
| Reptile | .935 | .946/.922 | .936/.945 | .929/.966 |
| Meta-Static | .954 | .961/.959 | .959/.948 | .948/.961 |
| Meta | .965 | .968/.960 | .962/.953 | .964/.977 |
CNN-basedVAs detection. We implement two deep learning based VAs detection methods. One is based on the CNN demonstrated in Fig. 1 and the other is an existing CNN-based VAs detection model [Acharya et al., 2018]. Both models would be trained on the training set following the mini-batch training process. We denote these two detection approaches as DL1 and DL2. Moreover, the pre-trained models would be firstly fine-tuned with the personalizing set and then evaluated on the testing set. We denote these two approaches as DL1-FT and DL2-FT.
Meta learning-based VAs detection. We implement our meta-learning based 1D-CNN VAs detection model and denote it as Meta. We also implement the same meta-learning based model but without inner-loop update optimization and dynamic task set mechanism, denoted as Meta-Static. We further implement a conventional meta-learning approach with and without first-order approximation [Finn et al., 2017b; Nichol et al., 2018], denoted as MAML and Reptile. Entropy loss is applied for all CNN models.
4.4 Results
VAs Detection Performance Evaluation
We evaluate our meta-learning based 1D-CNN VAs detection against other methods in terms of various metrics including F1 score (F1), Sensitivity (Se), Specificity (Sp), balanced accuracy (BAC), accuracy (ACC), positive predictive value (PPV), and negative predictive value (NPV). The condition positive is VAs and condition negative is non-VAs.
Table 2 illustrates the detection performance on events. The performance on events is more practical since the defibrillation therapy should be delivered based on the rhythm period but not a single 2s segment. Compared with the Classic, DL1 achieves 4.9% deduction from a baseline of 97.2% on VAs rhythm detection rate represented Se but 4.4% increase on non-VAs rhythm detection rate from a baseline of 91.0% represented by Sp. As for DL2, it achieves 6.9% lower on VAs rhythm detection rate and 3.7% higher on non-VAs rhythm detection rate compared with Classic. Both detection rates increase to 95.0% and 97.4% respectively after finetuning. As for SVM, it does not perform well since the features extracted in the method are not applicable to the IEGMs. The two conventional meta-learning approaches, MAML and Reptile, achieve the similar performances on VAs detection as the DL1-FT and DL2-FT. As for the Meta, it achieves the best performance on all testing metrics. It has the nearoptimal detection accuracy on VAs rhythm (99.3%) and nonVAs rhythm (99.6%), and the highest F1 score (0.993).
Table 3 illustrates the detection performance on segments. Meta still achieves the best performance on all metrics compared with other evaluated methods. The fine-tuning is necessary for CNN-based methods to increase the detection accuracy. Therefore, the generalization of the CNN initialization is critical in the VAs detection scenarios and the proposed meta-learning provides an effective solution to the problem. The detailed experimental setup and the performance of the proposed meta learning method for arrhythmias detection on ECG would be demonstrated in the Appendix.
Model Generalization and Training Overhead
To demonstrate the importance of the proposed dynamic task set mechanism and inner-loop update optimization, we present the average accuracy and loss curve for each patient's personalization process of Meta, Meta-Static, MAML, Reptile, DL1 and DL2 together with the training overhead.
The 10-step gradient descent (GD) is applied to personalize each pre-trained model through fine-tuning on the patientspecific IEGMs. As shown in Fig. 3(a), at step 0, the initial model of our Meta method do not perform well on the patients compared with the models of DL1 and DL2. However, the model initialization of Meta could rapidly adapt to the specific patient's rhythm and achieves higher accuracy through 10-step GD personalization. As shown in Fig. 3(b), the convergence speed of Meta is much faster than that of DL1, DL2, MAML and Reptile. The accuracy of Meta improves from 91.4% to 98.9% while that of Meta-Static improves from 92.2% to 97.8%. It indicates that the dynamic task set mechanism improves the quality of the model initialization.
As for training overhead, the inner-loop optimization of Meta significantly reduces the training overhead of metalearning. The average training hours of Meta is 4.3, while the Meta-Static requires 8.4 training hours on average.

(a) Accuracy curve.

Performance on Hardware
We deploy the 1D-CNN on the Apollo3 Blue [Sparkfun, 2018] board to test its performance in terms of energy, latency and memory overhead on real hardware. The model requires only 36.2 KB to store its model parameters and occupies at most 5.32 KB to process the intermediate data. The average latency on one inference over a 2s segment is 368 ms and the power is 5.445 mW (supplied with 3.3 V). It turns out that the model could satisfy the performance requirements of the implantable devices on VAs detection [Strydis et al., 2013].
5 Conclusion
In this paper, we propose a 1D-CNN based VAs detection mechanism and a novel meta-learning algorithm for patientspecific arrhythmias detection. The 1D-CNN is applied to detect VAs by inputting segments of intracardiac EGMs. The meta-learning is then utilized to generate personalized hyperparameters setting on the 1D CNN for each patient. The 1D-CNN meets the resources constraints and real-time requirements of ICDs while maintaining a high detection accuracy. The proposed patient-wise tasks formatting strategy improves the applicability of the meta-learning methods. The 1D-CNN personalized by our method achieves 2.2% higher on VAs rhythm detection rate and 8.6% higher on non-VAs rhythm detection rate compared with the classic VAs detection method in ICDs.
@inproceedings{ijcai2021p359,
title = {Learning to Learn Personalized Neural Network for Ventricular Arrhythmias Detection on Intracardiac EGMs},
author = {Jia, Zhenge and Wang, Zhepeng and Hong, Feng and PING, Lichuan and Shi, Yiyu and Hu, Jingtong},
booktitle = {Proceedings of the Thirtieth International Joint Conference on
Artificial Intelligence, {IJCAI-21}},
publisher = {International Joint Conferences on Artificial Intelligence Organization},
editor = {Zhi-Hua Zhou},
pages = {2606--2613},
year = {2021},
month = {8},
note = {Main Track},
doi = {10.24963/ijcai.2021/359},
url = {https://doi.org/10.24963/ijcai.2021/359},
}
TY - CPAPER TI - Learning to Learn Personalized Neural Network for Ventricular Arrhythmias Detection on Intracardiac EGMs AU - Jia, Zhenge AU - Wang, Zhepeng AU - Hong, Feng AU - PING, Lichuan AU - Shi, Yiyu AU - Hu, Jingtong T2 - Proceedings of the Thirtieth International Joint Conference on Artificial Intelligence, IJCAI-21 PB - International Joint Conferences on Artificial Intelligence Organization PY - 2021 SP - 2606 EP - 2613 DO - 10.24963/ijcai.2021/359 UR - https://doi.org/10.24963/ijcai.2021/359 ER -Copied
Machine-readable versions of this paper, for tools and AI agents: