Sleep contributes to more than a third of a person's life, making sleep monitoring essential for overall well-being. Cyclic alternating patterns (CAP) are crucial in monitoring sleep quality and associated illnesses such as insomnia, nocturnal frontal lobe epilepsy (NFLE), narcolepsy, etc. However, traditionally medical specialists practice manual division techniques of CAP phases which are sensitive to human weariness and inaccuracies.