Introduction: Automatic detection of ecg abnormalities can assist physicians in the diagnosis of the massive amount of ecg recordings and empower the patient cardiac monitoring system. We present a method of joint machine learning to classify 9 types of ecg abnormalities including normal in the context of Physionet/CinC 2020 Challenge. A variety of attention mechanisms were adopted to enhance the performance. Method: We treat each abnormality detection as a 2-catagorical classification problem. All data were preprocessed by a band pass filter before feature extraction stage. Both self-learning and manual feature extraction techniques were adopted, considering the abnormal ecg features can be either morphology or time dependent. The PAC,PVC,STE and STD models had their beat information extracted by an adaptive threshold algorithm. The cnn models dealing with PAC and PVC accepted variable length of ecg data and incorporate the r-r intervals as attention weights. A time-wise average pooling operation after feature extraction layers were used to fix the feature encoding length. For STD and STE problems, the beats' st segments were delineated. We use SVM classifiers and feed multiple measurements on the st segments to them as features. The AF, I-AVB, LBBB and RBBB models were accepting 10 seconds of data segment and a cascading 1-dimentinal residual convolutional neural network used for automatic feature learning. Neural networks above finally connected to softmax activated dense layers to perform categorical prediction. We constructed training sets for each model by equally sampling the 8 different counterparts. During the training stage, class imbalanced batches were over sampled to create the equality of losses. Data of variable lengths were padded to be aligned . All the models were cross validated on a 10-fold set. We reach a class averaged F2 score of 0.8 and G2 score of 0.6 on our local test samples.