Introduction: Electrocardiograms (ECG) provide information about the electrical activity of the heart, which is useful for diagnosing abnormal cardiac functions such as arrhythmias. Recently, several algorithms based on advanced structures of neural networks have been proposed for auto-detecting cardiac arrhythmias, but their performance still needs to be further improved. This study aimed to develop an auto-detection algorithm, which extracts valid features from 12-lead ECG for classifying multiple types of cardiac states.Method: The proposed algorithm consists of the following components: (i) a preprocessing component that utilizes the frame blocking method to split an ECG recording into frames with a uniform length for all considered ECG recordings; and (ii) a binary classifier based on ResNet, which is combined with the attention-based bidirectional long-short term memory model.Result: The developed algorithm was trained and tested on ECG data of nine types of cardiac states, fulfilling a task of multi-label classification. It achieved an averaged F1-score and area under the curve at 0.908 and 0.974, respectively.Conclusion: The frame blocking and bidirectional long-short term memory model represented an improved algorithm compared with others in the literature for auto-detecting and classifying multi-types of cardiac abnormalities.