Automatic detection of cyclic alternating pattern

  • Fábio Mendonça
  • Ana Fred
  • Sheikh Shanawaz Mostafa
  • Fernando Morgado-Dias
  • Antonio G. Ravelo-García
S.I. : Advances in Bio-Inspired Intelligent Systems


The cyclic alternating pattern is a microstructure phasic event, present in the non-rapid eye movement sleep, which has been associated with multiple pathologies, and is a marker of sleep instability that is detected using the electroencephalogram. However, this technique produces a large quantity of information during a full night test, making the task of manually scoring all the cyclic alternating pattern cycles unpractical, with a high probability of miss classification. Therefore, the aim of this work is to develop and test multiple algorithms capable of automatically detecting the cyclic alternating pattern. The employed method first analyses the electroencephalogram signal to extract features that are used as inputs to a classifier that detects the activation (A phase) and quiescent (B phase) phases of this pattern. The output of the classifier was then applied to a finite state machine implementing the cyclic alternating pattern classification. A systematic review was performed to determine the features and classifiers that could be more relevant. Nine classifiers were tested using features selected by a sequential feature selection algorithm and features produced by principal component analysis. The best performance was achieved using a feed-forward neural network, producing, respectively, an average accuracy, sensitivity, specificity and area under the curve of 79, 76, 80% and 0.77 in the A and B phases classification. The cyclic alternating pattern detection accuracy, using the finite state machine, was of 79%.


Automatic classification CAP A phase 



The authors acknowledge the Portuguese Foundation for Science and Technology for their support through Projeto Estratégico LA 9—UID/EEA/50009/2013 and also the ARDITI—Agência Regional para o Desenvolvimento da Investigação, Tecnologia e Inovação under the scope of the Project M1420-09-5369-FSE-000001—Ph.D. Studentship.

Compliance with ethical standards

Conflict of interest

All authors declare that they do not have conflict of interest.


  1. 1.
    Iber C, Ancoli-Israel S, Chesson A, Quan S (2007) The AASM manual for the scoring of sleep and associated events: rules, terminology and technical specifications. American Academy of Sleep Medicine, WestchesterGoogle Scholar
  2. 2.
    Schomer D, Silva F (2010) Electroencephalography: basic principles, clinical applications and related fields. Lippincott Williams and Wilkins, PhiladelphiaGoogle Scholar
  3. 3.
    Teplan M (2002) Fundamentals of EEG measurement. Meas Sci Revew 2(2):1–11Google Scholar
  4. 4.
    Chokroverty S (2009) Sleep disorders medicine: basic science, technical considerations, and clinical aspects. Saunders, PhiladelphiaGoogle Scholar
  5. 5.
    Smerieri A, Parrino L, Agosti M, Ferri R, Terzano M (2007) Cyclic alternating pattern sequences and non-cyclic alternating pattern periods in human sleep. Clin Neurophysiol 118(10):2305–2313CrossRefGoogle Scholar
  6. 6.
    Mendez M, Alba A, Chouvarda I, Milioli G, Grassi A, Terzano M, Parrino L (2014) On separability of A-phases during the cyclic alternating pattern. In: Proceedings of the 36th annual international conference of the IEEE engineering in medicine and biology society. IEEE, pp 2253–2256Google Scholar
  7. 7.
    Mariani S, Grassi A, Mendez M, Parrino L, Terzano M, Bianchi A (2011) Automatic detection of CAP on central and fronto-central EEG leads via support vector machines. In: Proceedings of the 33rd annual international conference of the IEEE engineering in medicine and biology society. IEEE, pp 1491–1494Google Scholar
  8. 8.
    Terzano M, Parrino L (2000) Origin and significance of the cyclic alternating pattern (CAP). Sleep Med Rev 4(1):101–123CrossRefGoogle Scholar
  9. 9.
    Halász P, Terzano M, Parrino L, Bódizs R (2004) The nature of arousal in sleep. J Sleep Res 13(1):1–23CrossRefGoogle Scholar
  10. 10.
    Parrino L, Milioli G, Melpignano A (2016) The cyclic alternating pattern and the brain-body-coupling during sleep. Epileptologie 33:150–160Google Scholar
  11. 11.
    Parrino L, Ferri R, Bruni O, Terzano M (2012) Cyclic alternating pattern (CAP): the marker of sleep instability. Sleep Med Rev 16(1):27–45CrossRefGoogle Scholar
  12. 12.
    Terzano M, Parrino L (1993) Clinical applications of cyclic alternating pattern. Physiol Behav 54(4):807–883CrossRefGoogle Scholar
  13. 13.
    Terzano M, Parrino L, Boselli M, Spaggiari M, Giovanni G (1996) Polysomnographic analysis of arousal responses in obstructive sleep apnea syndrome by means of the cyclic alternating pattern. J Clin Neurophysiol 13(2):145–155CrossRefGoogle Scholar
  14. 14.
    Kato T, Montplaisir J, Guitard F, Sessle B, Lund J, Lavigne G (2003) Evidence that experimentally induced sleep bruxism is a consequence of transient arousal. J Dent Res 82(4):284–288CrossRefGoogle Scholar
  15. 15.
    Parrino L, Ferrillo F, Smerieri A, Spaggiari M, Palomba V, Rossi M, Terzano M (2004) Is insomnia a neurophysiological disorder? The role of sleep EEG microstructure. Brain Res Bull 63(5):377–383CrossRefGoogle Scholar
  16. 16.
    Parrino L, Boselli M, Buccino G, Spaggiari M, Giovanni G, Terzano M (1996) The cyclic alternating pattern plays a gate-control on periodic limb movements during non-rapid eye movement sleep. J Clin Neurophysiol 13(4):314–323CrossRefGoogle Scholar
  17. 17.
    Terzano M, Parrino L, Spaggiari M, Palomba V, Rossi M, Smerieri A (2003) CAP variables and arousals as sleep electroencephalogram markers for primary insomnia. Clin Neurophysiol 114(9):1715–1723CrossRefGoogle Scholar
  18. 18.
    Halász P, Terzano M, Parrino L (2002) Spike-wave discharge and the microstructure of sleep-wake continuum in idiopathic generalised epilepsy. Clin Neurophysiol 32(1):38–53CrossRefGoogle Scholar
  19. 19.
    Rosa A, Alves G, Brito M, Lopes M, Tufik S (2006) Visual and automatic cyclic alternating pattern (CAP) scoring. Arq Neuropsiquiatr 64(3):578–581CrossRefGoogle Scholar
  20. 20.
    Mendonça F, Fred A, Mostafa S, Morgado-Dias F, Ravelo-Gracía A (2018) Automatic detection of a phases for CAP classification. In: Proceedings of the 7th international conference on pattern recognition application and methods, SCITEPRESS, pp 394–400Google Scholar
  21. 21.
    Karimzadeh F, Seraj E, Boostani R, Torabi-Nami M (2015) Presenting efficient features for automatic CAP detection in sleep EEG signals. In: Proceedings of the 38th international conference on telecommunications and signal processing. IEEE, pp 448–452Google Scholar
  22. 22.
    Barcaro U, Navona C, Belloli S, Bonanni E, Gneri C, Murri L (1998) A simple method for the quantitative description of sleep microstructure. Electroencephalogr Clin Neurophysiol 106(5):429–432CrossRefGoogle Scholar
  23. 23.
    Navona C, Barcaro U, Bonanni E, Martino F, Maestri M, Murri L (2002) An automatic method for the recognition and classification of the A-phases of the cyclic alternating pattern. Clin Neurophysiol 113(11):1826–1831CrossRefGoogle Scholar
  24. 24.
    Barcaro U, Bonanni E, Maestri M, Murri L, Parrino L, Terzano M (2004) A general automatic method for the analysis of NREM sleep microstructure. Sleep Med 5(6):567–576CrossRefGoogle Scholar
  25. 25.
    Mariani S, Manfredini E, Rosso V, Mendez M, Bianchi A, Matteucci M, Terzano M, Cerutti S, Parrino L (2011) Characterization of A phases during the cyclic alternating pattern of sleep. Clin Neurophysiol 122(10):2016–2024CrossRefGoogle Scholar
  26. 26.
    Largo R, Munteanu C, Rosa A (2005) Wavelet based CAP detector with GA tuning. In: Proceedings of the 6th World Scientific and Engineering Academy and Society international conference on evolutionary computing, WSEAS, pp 10–14Google Scholar
  27. 27.
    Largo R, Munteanu C, Rosa A (2005) CAP event detection by wavelets and GA tuning. In: Proceedings of the 2005 IEEE international workshop on intelligent signal processing. IEEE, pp 44–48Google Scholar
  28. 28.
    Ferri R, Bruni O, Miano S, Smerieri A, Spruyt K, Terzano M (2005) Inter-rater reliability of sleep cyclic alternating pattern (CAP) scoring and validation of a new computer-assisted CAP scoring method. Clin Neurophysiol 116(3):696–707CrossRefGoogle Scholar
  29. 29.
    Niknazar H, Seifpour S, Mikaili M, Nasrabadi A, Banaraki A (2015) A novel method to detect the A phases of cyclic alternating pattern (CAP) using similarity index. In: Proceedings of the 23rd Iranian conference on electrical engineering. IEEE, pp 67–71Google Scholar
  30. 30.
    Mariani S, Bianchi A, Manfredini E, Rosso V, Mendez M, Parrino L, Matteucci M, Grassi A, Cerutti S, Terzano M (2010) Automatic detection of A phases of the cyclic alternating pattern during sleep. In: Proceedings of the 32nd annual international conference of the IEEE engineering in medicine and biology society. IEEE, pp 5085–5088Google Scholar
  31. 31.
    Mariani S, Grassi A, Mendez M, Milioli G, Parrino L, Terzano M, Bianchi A (2013) EEG segmentation for improving automatic CAP detection. Clin Neurophysiol 124(9):1815–1823CrossRefGoogle Scholar
  32. 32.
    Mariani S, Manfredini E, Rosso V, Grassi A, Mendez M, Alba A, Matteucci M, Parrino L, Terzano M, Cerutti S, Bianchi A (2012) Efficient automatic classifiers for the detection of A phases of the cyclic alternating pattern in sleep. Med Biol Eng Comput 50(4):359–372CrossRefGoogle Scholar
  33. 33.
    Machado F, Sales F, Bento C, Dourado A, Teixeira C (2015) Automatic identification of cyclic alternating pattern (CAP) sequences based on the Teager Energy Operator. In: Proceedings of the 2015 37th annual international conference of the IEEE engineering in medicine and biology society. IEEE, pp 5420–5423Google Scholar
  34. 34.
    Machado F, Teixeira C, Santos C, Bento C, Sales F, Dourado A (2016) A-phases subtype detection using different classification methods. In: Proceedings of the IEEE 38th annual international conference of the engineering in medicine and biology society. IEEE, pp 1026–1029Google Scholar
  35. 35.
    Mendez M, Chouvarda I, Alba A, Bianchi A, Grassi A, Arce-Santana E, Milioli G, Terzano M, Parrino L (2016) Analysis of A-phase transitions during the cyclic alternating pattern under normal sleep. Med Biol Eng Comput 54(1):133–148CrossRefGoogle Scholar
  36. 36.
    Terzano M, Parrino L, Sherieri A, Chervin R, Chokroverty S, Guilleminault C, Hirshkowitz M, Mahowald M, Moldofsky H, Rosa A, Thomas R, Walters A (2001) Atlas, rules, and recording techniques for the scoring of cyclic alternating pattern (CAP) in human sleep. Sleep Med 2(6):537–553CrossRefGoogle Scholar
  37. 37.
    Aydin S, Saraoglu H, Kara S (2009) Log energy entropy-based EEG classification with multilayer neural networks in seizure. Ann Biomed Eng 37(12):2626–2630CrossRefGoogle Scholar
  38. 38.
    Mostafa S, Mendonça F, Morgado-Dias F, Ravelo-Gracía A (2017) SpO2 based sleep apnea detection using deep learning. In: Proceedings of the 2017 IEEE 21st international conference on intelligent engineering systems. IEEE, pp 91–96Google Scholar
  39. 39.
    Murphy K (2012) Machine learning: a probabilistic perspective. The MIT Press, MassachusettszbMATHGoogle Scholar
  40. 40.
    Duda R, Hart P, Strok D (2000) Pattern classification. Wiley, HobokenGoogle Scholar
  41. 41.
    Bishop C (2006) Pattern recognition and machine learning. Springer, New YorkzbMATHGoogle Scholar
  42. 42.
    Warmuth M, Liao J, Rätsch G (2006) Totally corrective boosting algorithms that maximize the margin. In: Proceedings of the 23rd international conference on Machine learning. ACM, pp 1001–1008Google Scholar
  43. 43.
    Bora D, Gupta A (2014) Effect of different distance measures on the performance of K-means algorithm: an experimental study in Matlab. Int J Comput Sci Inf Technol 5(2):2501–2506Google Scholar

Copyright information

© The Natural Computing Applications Forum 2018

Authors and Affiliations

  1. 1.Madeira Interactive Technologies InstituteFunchalPortugal
  2. 2.Instituto Superior Técnico - Universidade de LisboaLisbonPortugal
  3. 3.Instituto de TelecomunicaçõesInstituto Superior Técnico - Universidade de LisboaLisbonPortugal
  4. 4.Faculdade de Ciências Exatas e da Engenharia, Universidade da MadeiraFunchalPortugal
  5. 5.Institute for Technological Development and Innovation in CommunicationsUniversidad de Las Palmas de Gran CanariaLas PalmasSpain

Personalised recommendations