Abstract:In recent years, driven by the progress in artificial intelligence, deep learning models have been widely applied to ECG data analysis (especially the detection of atrial fibrillation). This study proposes an algorithm based on the multi-head attention mechanism to classify atrial fibrillation, which is trained and validated through the public data set of the PhysioNet 2017 Challenge. Firstly, the local features of the ECG signal are extracted through the deep residual network. Then, the bidirectional long short-term memory network is built to extract the global features on this basis. Finally, the multi-head attention mechanism layer is used to extract the key features, and cascade modules greatly improve the performance of the overall model. The experimental results show that the proposed heads-8 model can achieve precision of 0.861, recall of 0.862, F1 score of 0.861, and accuracy of 0.860, which is better than the latest methods based on ECG signals for classifying atrial fibrillation.