Electrocardiogram (ECG) signal is a common and powerful tool to study heart function and diagnose several abnormal arrhythmia . While there have been remarkable improvements in cardiac arrhythmia classification methods, they still cannot offer an acceptable performance in detecting different heart conditions, especially when dealing with imbalanced datasets. In this paper, we propose a solution to address this limitation of current classification approaches by developing an automatic heartbeat classification method using deep convolutional neural networks and sequence to sequence models. We evaluated the proposed method on the MIT-BIH arrhythmia database, considering the intra-patient and inter-patient paradigms, and the AAMI EC57 standard. The evaluation results for both paradigms show that our method achieves the best performance in the literature (a positive predictive value of 96.46\% and sensitivity of 100\% for the category S, and a positive predictive value of 98.68\% and sensitivity of 97.40\% for the category F for the intra-patient scheme; a positive predictive value of 92.57\% and sensitivity of 88.94\% for the category S, and a positive predictive value of 99.50\% and sensitivity of 99.94\% for the category V for the inter-patient scheme.) 
Electrocardiogram (ECG) signal is a common and powerful tool to study heart function and diagnose several abnormal arrhythmias . While there have been remarkable improvements in cardiac arrhythmia classification methods, they still cannot offer acceptable performance in detecting different heart conditions, especially when dealing with imbalanced datasets. In this paper, we propose a solution to address this limitation of current classification approaches by developing an automatic heartbeat classification method using deep convolutional neural networks and sequence to sequence models. We evaluated the proposed method on the MIT-BIH arrhythmia database, considering the intra-patient and inter-patient paradigms, and the AAMI EC57 standard. The evaluation results for both paradigms show that our method achieves the best performance in the literature (a positive predictive value of 96.46\% and sensitivity of 100\% for the category S, and a positive predictive value of 98.68\% and sensitivity of 97.40\% for the category F for the intra-patient scheme; a positive predictive value of 92.57\% and sensitivity of 88.94\% for the category S, and a positive predictive value of 99.50\% and sensitivity of 99.94\% for the category V for the inter-patient scheme.) . The source code is available at URL
R
arrhythmia
arrhythmias
D
an
A
. The source code is available at URL