Submitted Successfully!
To reward your contribution, here is a gift for you: A free trial for our video production service.
Thank you for your contribution! You can also upload a video entry or images related to this topic.
Version Summary Created by Modification Content Size Created at Operation
1 -- 1157 2023-06-09 00:46:15 |
2 format correct -31 word(s) 1126 2023-06-09 02:53:31 | |
3 format correct Meta information modification 1126 2023-06-09 02:54:00 | |
4 Interpretations: short desynchronization periods during sleep and sleep fragmentation + 11 word(s) 1137 2023-06-20 22:57:57 |

Video Upload Options

Do you have a full video?


Are you sure to Delete?
If you have any further questions, please contact Encyclopedia Editorial Office.
Sitnikova, E.; Semenova, N. A Simple ANN for Sleep-Waking Recognition. Encyclopedia. Available online: (accessed on 20 April 2024).
Sitnikova E, Semenova N. A Simple ANN for Sleep-Waking Recognition. Encyclopedia. Available at: Accessed April 20, 2024.
Sitnikova, Evgenia, Nadezhda Semenova. "A Simple ANN for Sleep-Waking Recognition" Encyclopedia, (accessed April 20, 2024).
Sitnikova, E., & Semenova, N. (2023, June 09). A Simple ANN for Sleep-Waking Recognition. In Encyclopedia.
Sitnikova, Evgenia and Nadezhda Semenova. "A Simple ANN for Sleep-Waking Recognition." Encyclopedia. Web. 09 June, 2023.
A Simple ANN for Sleep-Waking Recognition

Artificial neural network (ANNs) is a machine learning approach that has rapidly gained popularity due to its ability to quickly and effectively solve complex problems. Sleep monitoring is often required for patients who are suffering from diseases or who are undergoing treatment. Recently, in a paper described a new method for the automatic recognition of behavioral sleep and waking states in freely moving rats. This is a simple ANN, in which the mean values and standard deviations of electrocorticograms. ANN was trained to recognize sleep and waking states with the accuracy of 80%. 

Machine learning Artificial neural network ECoG Sleep detection

1. Introduction

Artificial neural network (ANN) is a machine learning approach that creates a model of a real-world phenomenon using artificial neurons. ANN algorithms have been widely used in the medical field since the early 1990s. Rodents, such as mice and rats, are used in preclinical studies to evaluate the safety, efficacy, and optimal dosage of drugs and other compounds for humans. In some rodent studies, vigilance control is needed to monitor sleep-wake patterns. Rats have a polyphasic sleep: they sleep very little during the dark phase and nap every 15–30 minutes [1]. Episodes of sleep appeared to be longer at light phase. However, electrographic characteristics of sleep in rats are almost the same to that in humans: slow oscillations at ~0.5–4 Hz and spindle-like oscillations at ~10-14 Hz [2].

In humans, accurate recognition of sleep-wake phases is based on data obtained with electroencephalography (EEG) and electromyography (EMG) and oculography, which are measures of the brain and muscle activity. Our previous investigations showed [3] that three-channel electrocorticographic (ECoG) recordings from freely moving rats were sufficient for detection of non-REM sleep with the wavelet-based algorithm. Now we aimed to construct a simple ANN that effectively identifies sleep and wake states using an offline technology [4].

2. Registration of ECoG Signals in Freely Moving Rats with Implanted Electrodes

Rats were implanted with epidural electrodes, which are the surface electrodes located above the surface of the dura mater. Epidural electrodes were attached to the skull bone with stainless steel mini-screws. Three active electrodes and one reference electrode were implanted. Rats were allowed to recover for 10 days. After the recovery period, rats were put in the plexiglas recording cage (Figure 1). ​

ECoG recording in rats

Figure 1. The experimental setup used to record electrocorticographic (ECoG) signals in freely moved rats.   

The input signal was fed to a multichannel amplifier (PowerLab 8/35, ADInstruments) through a rotary connector, subjected to bandpass filtering in the range from 0.5 to 200 Hz, and digitized at 400 samples per second per channel.

ECoGs were recorded in adult WAG/Rij rats.  

3. Computational Algorithm

In order to train our ANN, we took into account both the signal-to-noise ratio, meaning the mean and standard deviation of ECoG signals, as well as the quality of the ECoG signals. The mean amplitude of ECoG signals and the standard deviation of ECoG signals were very appropriate for the input of ANN.

Our ANN contained only four input neurons and one artificial neuron. After training, the proposed simplified network will allow to replace the use of a neural network with a simple linear combination of input signals. This was considered a low-complexity model, as compared to other neural networks, which typically contain thousands of input and output neurons. This approach increased the speed of the classifier's performance and enabled the system to work in real time. This was a crucial step in the process, because it allowed us to get closer to an online working algorithm.

The algorithm included three steps: data preprocessing, training the ANN, and postprocessing the outcomes.

  • Preprocessing. The signal was filtered from 0.5 to 100 Hz and normalized with NumPy and MNE (Python).
  • Training the ANN was performed using Keras API package (Python), the Adam optimization algorithm and the binary cross-entropy loss function.
  • Postprocessing. The detected intervals were adjusted for their duration, with the minimal duration of sleep being 10 seconds.

The ANN was trained to recognize sleep and wake states using the results of wavelet-based sleep and wake states, which were more accurate than conventional sleep and wake detections. This method was originally developed to detect periods of deep NREM sleep. This technique is described in more detail by Anastasia Runnova et al in 2021 [3] In total, The present computations were performed using ECoGs recoded in 11 male WAG/Rij rats at the age of 9-10 months [4],

The threshold values of sleep duration and intervals between consecutive sleep episodes were selected empirically based on sensitivity and specificity values. The performance of the ANN was evaluated by an expert who manually detected episodes of sleep and wakefulness.
Sensitivity was calculated as the ratio between the duration of a manually defined sleep and the ANN-defined sleep duration.
Specificity was calculated as the ratio between the duration of a manually defined wakefulness and the ANN-defined wakefulness.
Our aim was to achieve a sensitivity and specificity of at least 0.9.

4. Results of ANN-defined Sleep and Wakefulness

The ANN performed equally well in detecting sleep and wake in rats that were used to train the ANN and other rats. Noteworthy is the ECoG in our subjects was not normal and contained spontaneous spike-wave activity. The spike-wave discharges had extremely high amplitude (voltages up to 1 mV), and sudden amplitude increases were eliminated through the use of normalization. Sleep in rat  is polyphasic  Figure 2 shows an example of the expert's detection of sleep and wakefulness versus ANN-based detections. The signal was recorded in a rat whose ECoG was used to train the ANN. It can be seen that episodes of sleep defined by the ANN were interrupted by short periods of wakefulness that were not marked by an expert.

Evaluation of ANN performence

Figure 2. Sleep and wakefulness recognized by an expert and by ANN in ECoGs recorded in 9-m old male WAG/Rij rat.

Similarly, in a three-channel ECoGs recorded in a 10-m old female rat in a control condition, ANN-defined sleep was interrupted by short periods of wakefulness missed by an expert (Figure 3). 

Figure 3. Sleep and wakefulness recognized by an expert and by ANN in ECoGs recorded in 10-m old female WAG/Rij rat.

The ANN's specificity was very high, but sensitivity was not always higher than 0.95. Low sensitivity indicates that the ANN gave many false positives for sleep recognition, but very few false positives for wakefulness recognition (i.e., specificity was always high). This indicates that the ANN is very good at recognizing when a rat is asleep, but less good at recognizing when a rat is awake.

An important point to note is that sleep as defined by ANN was interrupted by short periods of wakefulness, which were missed by an expert. These short waking episodes during sleep represent short desynchronization periods during sleep. Long desynchronization periods might be interpreted as the sign of sleep fragmentation.
In general, the ANN-based technology provided by the group of Nadezhda Semenova[4] might be a good tool to evaluate sleep fragmentation in rats during preclinical examinations.  


  1. Van Twyver, H. Sleep Patterns of Five Rodent Species. Physiol. Behav. 1969, 4, 901–905, doi:10.1016/0031-9384(69)90038-9.
  2. Datta S., Hobson J. A. The rat as an experimental model for sleep neurophysiology. Behavioral Neuroscience 2000, 114(6), 1239–1244,
  3. Runnova, A.; Zhuravlev, M.; Kiselev, A.; Ukolov, R.; Smirnov, K.; Karavaev, A.; Sitnikova, E. Automatic wavelet-based assessment of behavioral sleep using multichannel electrocorticography in rats. Sleep Breath. 2021, 25, 2251–2258, 10.1007/s11325-021-02357-5.
  4. Sergeev, K.; Runnova, A.; Zhuravlev, M.; Sitnikova, E.; Rutskova, E.; Smirnov, K.; Slepnev, A.; Semenova, N. Simple Method for Detecting Sleep Episodes in Rats ECoG Using Machine Learning. Chaos, Solitons & Fractals 2023, 173, 113608, 10.1016/j.chaos.2023.113608.
Subjects: Neurosciences
Contributors MDPI registered users' name will be linked to their SciProfiles pages. To register with us, please refer to : ,
View Times: 240
Revisions: 4 times (View History)
Update Date: 20 Jun 2023