Computer and Modernization ›› 2022, Vol. 0 ›› Issue (12): 50-59.

Previous Articles     Next Articles

Automatic Sleep Staging Algorithm Based on Self-attention Mechanism and Single Lead ECG


  1. (1.Aerospace Information Research Institution, Chinese Academy of Sciences, Beijing 100190, China; 2.School of
    Electronic, Electrical and Communication Engineering, University of Chinese Academy of Sciences, Beijing 100049, China)
  • Online:2023-01-04 Published:2023-01-04

Abstract: The realization of sleep staging based on manual labeling or traditional machine learning methods is complex and inefficient. Deep neural network improves the results of sleep staging because of its powerful ability to extract complex features, but there are still some problems, such as ignoring the correlation of internal information. To solve this problem, this paper proposes an automatic sleep staging algorithm based on self-attention mechanism and single lead ECG signal, realizing feature extraction and classification automatically by using convolution module, bidirectional gated recurrent unit and self-attention mechanism. In the open database Sleep Heart Health Study database (SHHS1, SHHS2), Multi-Ethnic Study of Atherosclerosis database (MESA) and MIT-BIH Polysomnographic database (MITBPD), the single lead ECG data of 1000, 1000, 1000 and 16 subjects are randomly selected for training and testing. The experimental results show that the accuracy of the four sleep classifications (wake, rapid eye movement, light sleep and deep sleep) of the model is 75.77% (kappa=0.63), 81.01% (kappa =0.66), 8279% (kappa=0.71) and 76.22% (kappa=0.58) respectively, which is better than the sleep staging results based on the traditional machine learning algorithms, verifying the validity of the model.

Key words: automatic sleep staging, single lead electrocardiogram, convolution network, gated recurrent unit, self-attention mechanism