Movatterモバイル変換


[0]ホーム

URL:


CN120257176A - A method, system and storage medium for automated sleep staging of rodents - Google Patents

A method, system and storage medium for automated sleep staging of rodents
Download PDF

Info

Publication number
CN120257176A
CN120257176ACN202510714596.XACN202510714596ACN120257176ACN 120257176 ACN120257176 ACN 120257176ACN 202510714596 ACN202510714596 ACN 202510714596ACN 120257176 ACN120257176 ACN 120257176A
Authority
CN
China
Prior art keywords
emg
sleep
value
level
threshold
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202510714596.XA
Other languages
Chinese (zh)
Other versions
CN120257176B (en
Inventor
沈伟达
项丽阳
曾玲晖
董静尹
陈建权
李珊珊
陈伏建
王良雪
李晶
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou City University
Original Assignee
Hangzhou City University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou City UniversityfiledCriticalHangzhou City University
Priority to CN202510714596.XApriorityCriticalpatent/CN120257176B/en
Publication of CN120257176ApublicationCriticalpatent/CN120257176A/en
Application grantedgrantedCritical
Publication of CN120257176BpublicationCriticalpatent/CN120257176B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Landscapes

Abstract

Translated fromChinese

本发明公开了一种啮齿类动物自动化睡眠分期方法、系统及存储介质,该方法在获取睡眠监测原始数据后对其进行预处理及特征提取,获得EEG特征值和EMG水平特征值,之后采用自适应阈值计算方法确定EMG水平阈值以及EEG特征阈值,该过程中根据EMG数据进行睡眠分期二分类粗分(分为清醒和睡眠),进而根据粗分结果,结合特征值的数据分布自动为各个特征值设置合理的阈值;结合阈值实现对睡眠的明确分期。该方法无需获得大量标记好的训练数据集,特征物理意义清晰,分期判定结果可解释性强,分析速度快。该方法能够有效摆脱和避免因需要兼顾个体和采集差异性进行手动阈值设置的麻烦,能够快速准确地实现分期。

The present invention discloses a method, system and storage medium for automated sleep staging of rodents. After obtaining the raw sleep monitoring data, the method performs preprocessing and feature extraction on the data to obtain EEG feature values and EMG level feature values, and then uses an adaptive threshold calculation method to determine the EMG level threshold and the EEG feature threshold. In the process, the sleep staging is roughly classified into two categories (wakefulness and sleep) according to the EMG data, and then according to the rough classification results, a reasonable threshold is automatically set for each feature value in combination with the data distribution of the feature value; the threshold is combined to achieve clear staging of sleep. The method does not require obtaining a large number of labeled training data sets, the physical meaning of the features is clear, the staging determination results are highly interpretable, and the analysis speed is fast. The method can effectively get rid of and avoid the trouble of manual threshold setting due to the need to take into account individual and acquisition differences, and can quickly and accurately achieve staging.

Description

Rodent automatic sleep stage method, system and storage medium
Technical Field
The invention belongs to the technical field of sleep staging, and relates to an automatic sleep staging method, system and storage medium for rodents.
Background
Sleep is a complex physiological process regulated by a number of molecular, cellular, and brain loop level mechanisms. Rodents, such as rats, mice, etc., are a type of experimental animals commonly used in the scientific research of the sleeping field, and as an early mammal, the rodents have a multi-phase sleep mode with multiple sleep within one day, and are characterized by shorter sleep cycle, frequent sleep phase switching and more daytime sleep. Rodent sleep presents two basic stages, REM (rapid eye movement sleep, rapid eye movement sleep period) and NREM (non-REM sleep, non-rapid eye movement sleep period). Sleep staging is of great significance to sleep related domain studies such as sleep mechanisms, sleep structures, sleep functions, and the like. Generally speaking, the sleep monitoring period of rodents is longer, generally up to 24 hours compared with the common sleep period of 8 hours of human beings, and due to the relatively short sleep period, the time window length (i.e. frame length) for general setting and distinguishing is shorter than that of human beings, the frame length for human sleep stage judging is generally set to 30s, and the frame length is more set to 10s in rodent researches (research reports of using the sleep period as long as 30s or as short as 4s or even 1s are also available). The frame-by-frame judgment of each 24-hour data file is carried out manually from the physiological and behavioral angles, so that a great deal of time and energy are consumed, the design algorithm is very necessary for carrying out automatic sleep stage, the scientific research efficiency can be improved by assisting the scientific research personnel, and the scientific research personnel are promoted to think and carry out more meaningful scientific research activities.
The automatic sleep stage depends on sleep feature extraction and sleep stage decision, the feature extraction can be realized by a feature engineering mode or an automatic feature extraction mode such as a neural network, and correspondingly, the sleep stage decision can be automatically classified by a manual design rule or a machine learning model. In the automatic period of sleep data of human body, a model learning and automatic classification method is popular, and particularly, a deep learning mode based on a neural network model such as a convolutional neural network, a long-time and short-time memory network and the like is adopted. However, such techniques are just like "black boxes", the physiological meaning of model parameters is unknown, and the interpretation of the prediction results is not strong.
At present, definite standards are set for the stage of human sleep acquisition data, and the standard is widely accepted, however, the stage of sleep of rodents is not unified, and it is widely considered that the stage of sleep of rodents is converted between REM and NREM, and only 3 sleep phases are needed to be distinguished in addition to a waking period, so that the structure is simpler. In the awake period, the activity of rodents is increased, the myoelectric level is higher, the brain wave shape is desynchronized, in the NREM period, the EMG (electromyogram) level is reduced relative to that in the awake period, the brain wave synchronization level is increased, delta frequency band (0.5-4 Hz) energy is increased on the frequency spectrum, in the REM period, the EMG level is generally very low, and the brain wave is similar to that in the awake period and presents a desynchronization mode. The physiological and behavioral characteristics of the three sleep phases of the rodent are obviously different, and the characteristic engineering is simple, convenient and easy to carry out and has interpretability.
Based on the above, the invention provides a sleep stage method based on characteristic engineering and self-adaptive threshold setting, which is applied to automatic sleep stage of rodents. The method comprises the steps of adopting a coarse-to-fine two-step stage mode, firstly carrying out two-classification coarse classification (namely waking and sleeping) of sleep stage according to the EMG data statistical distribution characteristics acquired by each file, and then setting a reasonable threshold value for an electroencephalogram characteristic value in a self-adaptive mode according to a coarse classification result for subsequent final sleep stage judgment. Compared with the prior art, the method does not need to obtain a large number of marked training data sets, has clear physical meaning of the features, transparent and controllable classification rules, high analysis speed and strong interpretation of classification judgment results.
Disclosure of Invention
Aiming at the defects of the prior art, the invention provides an automatic sleep stage method, an automatic sleep stage system and a storage medium for rodents, which can carry out rapid and accurate automatic sleep stage on long-time sleep monitoring data of rodents, can effectively reduce the time consumption of manual stage and improve the research efficiency of the related biological fields such as sleep and the like.
In order to achieve the above purpose, the technical scheme adopted by the invention is as follows:
An automated sleep staging method for a rodent comprising the steps of:
Preprocessing and feature extraction are carried out on the acquired sleep monitoring original data to obtain EEG feature values and EMG level feature values;
Determining an EMG level threshold and an EEG characteristic threshold by adopting an adaptive threshold calculation method, and performing sleep classification and classification rough classification according to EMG data, wherein the sleep classification and rough classification are divided into a awake period and a sleep period;
according to the rough classification result, threshold values are automatically set for all the characteristic values by combining the data distribution of the characteristic values, and the clear stage of sleep is realized by combining the threshold values.
In the above technical solution, further, the method includes collecting long-term sleep monitoring raw data of the rodent, wherein the data includes an electromyography EMG channel data and at least one electroencephalogram EEG channel data;
In preprocessing, when a plurality of EEG channels exist, one EEG channel with fewer artifacts is selected, EMG channel data and the selected EEG channel data are filtered and downsampled, the filtering is that the selected EEG channel data is subjected to low-pass filtering to remove high-frequency interference, the cut-off frequency is set to be 40Hz or lower, high-pass filtering is performed to remove extremely-low-frequency interference, the cut-off frequency is set to be 0.4Hz or lower, and the EMG channel data is subjected to 10-100Hz band-pass filtering.
Further, the feature extraction includes the following steps:
after FFT conversion of EEG channel data in a selected time window, delta band energy Pow_delta is calculated as an EEG characteristic value;
calculating the root mean square value or the average absolute value of the EMG channel data waveform in the selected time window to obtain an EMG level EMG_level which is an EMG level characteristic value;
and performing smoothing processing after extracting the characteristic values of all frames.
Further, the adaptive threshold calculation method includes the following steps:
(1) Determining an EMG level change baseline based on EMG level data, judging the level distinction of the EMG baseline, acquiring an EMG baseline level threshold value, detecting a high EMG section and calculating an EMG baseline dynamic threshold value;
(2) Performing phase two classification on sleep data by using the high EMG section and the EMG baseline dynamic threshold value, and roughly classifying into a waking period and a sleep period;
(3) And according to the rough classification result, combining the data distribution of the characteristic values to automatically determine an EMG level threshold and an EEG characteristic threshold.
Further, the specific steps in the step (1) are as follows:
s401, coarsening EMG level data by adopting a method of solving a median value by adopting a long-time moving window to obtain an EMG level change base line L;
s402, arranging the values of the base line L according to the size, taking the smaller and larger ranking values to respectively represent the low and high EMG levels, calculating the difference between the two values, and prompting if the difference is smaller than a preset discrimination decision threshold;
S403, acquiring a first-order differential signal D of a base line L and an absolute value D_abs thereof, and further acquiring a larger threshold value TH_D_hi and a smaller threshold value TH_D_lo according to the data distribution of the D_abs;
S404, detecting the starting and ending positions of the high EMG section based on a double-threshold endpoint detection method by combining the differential signal D obtained in the step S403 and two thresholds TH_D_hi and TH_D_lo;
s405, setting a vector LW to represent the awake level, wherein the length is the same as L, wherein the element value is 0 or 1,0 represents the sleep period, 1 represents the awake period, initializing all elements to 0, then initializing the element value corresponding to the index position of the high EMG section to 1 to obtain a coarse-granularity binary sleep stage sequence, initializing a coarse-granularity dynamic EMG baseline threshold vector BL to L, and correcting the BL value of each high EMG section to be the average value of L vector elements corresponding to the nearest 5 moments before the start of the section.
Further, the (2) specifically includes the following steps:
S406, sleeping time phase rough division
1) Restoring the coarse granularity vectors BL and LW acquired in the step S405 to fine granularity vectors corresponding to the frame length by using a linear interpolation mode, wherein the fine granularity vectors are BLrs and LWrs respectively, and the value higher than 0.5 in LWrs is set to be 1 and the value lower than 0.5 is set to be 0;
2) Calculating sleep frame index, and if the frame index i is satisfied
LWRs (i) =0 and EMG_level (i) -BLrs (i) < TH_D_lo
Wherein LWRs (i) is a fine granularity awake level value at the i-th moment, EMG_level (i) is a myoelectricity level value at the i-th moment, BLrs (i) is a fine granularity EMG baseline threshold at the i-th moment, and the frame is set as a sleep frame and frames except the sleep frame are set as awake frames;
3) And respectively acquiring EMG level characteristic values corresponding to sleep and awake frame indexes, and correspondingly defining the EMG level characteristic values as two vectors BLs and BLw.
Further, the specific steps in (3) are as follows:
s407, calculating an EMG level threshold, namely calculating a higher threshold TH_EMG_hi for distinguishing sleep from wakefulness according to the BLs data distribution characteristics, and a lower threshold TH_EMG_lo for distinguishing REM from NREM;
S408, adaptively obtaining EEG feature thresholds for distinguishing REM and NREM according to the statistical distribution features of the data:
1) Acquiring a value of the sleep frame index position calculated in the corresponding S406 of the EEG feature vector pow_delta, and setting the value as pow_delta_s;
2) Removing extreme points in Pow_delta_s, dividing the residual data into 10 equally divided intervals, counting the number of data points falling into each interval, assuming that the interval vector is x, the number of corresponding intervals is vector n, and calculating n-means M;
3) Normalizing the vector n by M to obtain a vector r;
4) Finding a first index position which satisfies the quantity higher than TH in the n vectors, and setting the first index position as p, wherein the product of the maximum value in the TH vector r subtracted by 0.5 and the product of the maximum value and M is obtained by downward rounding;
5) Setting a cyclic variable i, traversing p to 10, and calculating a high eigenvalue region, namely an eigenvalue F1 with larger probability in the NREM period, wherein the high eigenvalue region is the ratio of the accumulated product value of a vector x and a vector n to the sum value of the vector n from p to 10;
6) Obtaining a low eigenvalue area, namely an eigenvalue F2 with larger REM probability, wherein the eigenvalue F2 is the ratio of the sum of the accumulated product value of the vector x and the vector n to the sum of the vector n from 1 to p-1 of the variable i;
7) Taking the average value of F1 and F2 as a candidate threshold value TH1, taking the average value of the pow_delta_s vector plus one time of the standard deviation as a candidate threshold value TH2, and taking the smaller one of the TH1 and TH2 as an EEG characteristic threshold value TH_delta.
Further, detecting and correcting the region where the REM period is likely to be based on the extracted feature values of all frames and the determined EMG level threshold, including the following steps:
1) Setting EEG characteristic value component vectors corresponding to index positions with EMG characteristic values lower than a higher myoelectricity level threshold value TH_EMG_hi as Pow_delta_s1;
2) Performing peak detection on the reverse waveform of the Pow_delta_s1 waveform, and obtaining a peak position according to a set condition;
3) And searching the starting position and the ending position of the low delta energy region leftwards and rightwards for each detected peak point position respectively, judging whether the starting and ending position is required to be corrected according to the set conditions, and if so, correcting according to the correction rules until the conditions are met without correcting, so that the low delta energy region position index meeting the conditions is finally obtained.
Furthermore, sleep is specifically staged by combining an EMG level threshold value and an EEG characteristic threshold value, and the method comprises the following steps:
First, all frames are set to NREM period, those frames in which EMG level eigenvalue is higher than TH_EMG_hi are modified to awake period, then REM is set, and then, for each obtained start-stop index position of low delta energy region, the method further filters the continuous frames in the corresponding start-stop index position by removing frames in which wakefulness has been classified, removing frames in which delta energy is higher than TH_delta, removing frames in which myoelectricity level is higher than the average of both TH_EMG_lo and TH_EMG_hi, and classifying the rest frames to REM.
The invention also provides a rodent automated sleep staging system for use in implementing a rodent automated sleep staging method as defined in any one of the preceding claims.
The present invention also provides a computer readable storage medium having stored thereon a computer program, characterized in that the program when executed by a processor implements the rodent automated sleep staging method as defined in any one of the above.
The invention also provides an electronic device comprising:
one or more processors;
A memory for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the rodent automated sleep staging method of any one of the preceding claims.
The invention has the following beneficial effects:
The invention provides a rodent automatic sleep stage method based on characteristic engineering and self-adaptive threshold setting. Compared with a method based on model learning, the method does not need to obtain a large number of marked training data sets in construction, has clear physical significance of the features and has strong interpretation of the stage judgment result. Meanwhile, the self-adaptive threshold setting mode provided by the invention can carry out sleep stage classification rough classification (namely waking and sleeping) according to EMG data acquired by each file, further automatically set reasonable thresholds for each characteristic value according to rough classification results, and be used for subsequent final sleep stage judgment. The method can effectively get rid of and avoid the trouble of setting the manual threshold value due to the need of considering individual and acquisition differences, and can realize stage rapidly and accurately.
Drawings
FIG. 1 is a schematic overall flow diagram of the method of the present invention;
FIG. 2 is a flow chart of a data preprocessing process;
FIG. 3 is a schematic flow chart of feature extraction;
FIG. 4 is a schematic diagram of an adaptive threshold calculation flow;
FIG. 5 is a graph of automated sleep stage results in accordance with one embodiment of the present invention;
FIG. 6 is a graph of the results of an automatic recognition of NREM frames in accordance with an embodiment of the present invention;
FIG. 7 is a diagram of the results of an automatic identification of REM frames in an embodiment of the present invention;
FIG. 8 is a graph of the results of automatically recognizing as awake frames in an embodiment of the invention;
FIG. 9 is a partial enlarged view of the stage result in an embodiment of the present invention.
Detailed Description
The technical scheme of the invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
The invention discloses an automatic sleep stage method for rodents, which mainly comprises the following steps of data reading, data preprocessing, feature extraction, self-adaptive threshold setting and sleep stage judgment (shown in figure 1).
1. Data reading (S10)
Firstly, the acquired rodent long-term sleep monitoring original data are read into a computer memory, and the data format is not limited as long as the data protocol is disclosed. The raw data needs to contain at least one EEG channel and one EMG channel.
2. Data preprocessing (S20)
The preprocessing steps mainly include EEG channel selection, filtering and downsampling (as in fig. 2).
S201 channel selection
If multiple EEG channels exist in the original data, some simple rules can be set to select one channel with fewer artifacts for subsequent analysis. For example, a larger threshold value exceeding the conventional electroencephalogram amplitude range is set, and one of the channels whose total length of time is the shortest in all the sections exceeding the threshold value is selected.
S202 filtering
In view of the small upper limit of the cut-off frequency of the frequency band involved in the feature extraction of sleep electroencephalogram (EEG) stage, the cut-off frequency can be set at 40Hz or lower, the cut-off frequency can be set at 0.4Hz or lower, and the EMG channel can be subjected to bandpass filtering, such as 10-100Hz.
S203 downsampling
The sampling rate of the original collected data is generally higher and reaches 1kHz or even higher, the concerned characteristic frequency band in the sleep stage does not need to be characterized by the high sampling rate, and in order to reduce the calculation amount, save the memory occupation of the system and reduce the computer configuration requirement, the original EEG and EMG data can be downsampled to a certain degree, such as to 200Hz or even 100Hz.
3. Feature extraction (S30)
The feature extraction mainly comprises the steps of intercepting data, carrying out FFT conversion on EEG channel data in a selected time window, calculating delta frequency band, namely 0.5-4 Hz energy pow_delta, calculating EMG channel data in the selected time window to obtain EMG level EMG_level, and carrying out smoothing treatment on the extracted feature values of all frames (as shown in figure 3).
S301 data interception
The decision on sleep stage requires a small data area (analysis time window) to be selected first, the smaller the window length, the finer the sleep stage result, and for rodent sleep stage, more 10s or 4s are used, and generally non-overlapping windows are adopted.
S302:FFT
And converting the EEG channel waveform in the selected time window into a frequency domain through FFT, and calculating the energy corresponding to each frequency point.
S303 band energy calculation
And calculating delta frequency band (0.5-4 Hz) energy Pow_delta according to the frequency and energy corresponding to each frequency point after FFT, namely the energy sum of the frequency points in the frequency range.
S304 EMG level calculation
The EMG level emg_level may be obtained by calculating the root mean square value or average absolute value of the EMG waveform over a selected time window.
S305, eigenvalue smoothing
To reduce outlier interference and prevent too frequent switching of sleep stages, after extracting eigenvalues of all frames, the eigenvalues pow_delta and emg_level are moderately smoothed, which may be performed in a weighted moving average manner or in a convolution manner using a kernel function such as a gaussian kernel.
4. Adaptive threshold calculation method (S40)
The self-adaptive threshold setting provided by the invention firstly carries out two classifications on sleep data based on EMG level data, roughly classifies the sleep data into awake and sleep periods, and then determines thresholds of EMG level and brain electrical characteristics. The method mainly comprises the steps of calculating an EMG level change base line, calculating an EMG base line level distinguishing degree, calculating an EMG base line level threshold value, detecting an EMG level section, calculating an EMG base line dynamic threshold value, rough sleep phase division, calculating an EMG level threshold value and determining an EEG characteristic threshold value (shown in figure 4).
S401 calculating EMG level Change Baseline
Coarse granularity is carried out on the EMG level change trend by adopting a method of calculating the median value by using a moving window, the window length is set to 300s, and the window moving step length is set to 100s, so that an EMG level change baseline L is obtained.
S402, calculating EMG baseline level differentiation
In view of the fact that the adaptive threshold setting mode used in the invention is relatively dependent on the change of the EMG level, if the change of the EMG level is not distinguished obviously due to the data acquisition problem, the subsequent threshold setting is affected, and then the sleep stage result is affected. Therefore, the degree of discrimination of the EMG baseline level in the file is detected here by prompting if it is too small.
1) Arranging the values of the EMG level change base line L from small to large;
2) Values were obtained for the 10% and 90% ranks, representing low and high EMG levels, respectively;
3) Calculating the difference between the high and low EMG levels, namely the level differentiation of the EMG base line;
4) If the threshold value is lower than the threshold value, prompting is carried out, and the automatic stage result obtained under the condition is unreliable and a larger range of result correction is needed.
S403, calculating an EMG baseline level difference threshold
The two thresholds are calculated for detecting the high myoelectricity level section by adopting a double-threshold method, and the method is as follows
1) Acquiring a front-rear point differential signal D of L;
2) Obtaining an absolute value D_abs of the differential signal;
3) Calculating a smaller threshold value TH_D_lo which is the median value of D_abs;
4) Calculating a larger threshold value TH_D_hi, namely, firstly, carrying out ascending arrangement on D_abs, and then obtaining a 98% ranking value;
5) Correcting the TH_D_hi by firstly calculating 50% value of the TH_D_hi and average value of the TH_D_lo and the TH_D_hi, and taking larger value as corrected TH_D_hi compared with the average value of the TH_D_lo and the TH_D_hi;
6) The TH_D_lo is corrected by firstly calculating a3 times value of the TH_D_lo, and then comparing the value with the corrected TH_D_hi, and taking a smaller value as the corrected TH_D_lo, namely TH_D_lo is less than or equal to TH_D_hi.
S404, detecting a high EMG horizontal segment
The main calculation process is as follows:
1) Acquiring each moment of D > TH_D_hi as a candidate starting moment of detection of each high EMG section;
2) Whether each candidate time can be used as the starting time of the high EMG section detection is judged by the following method, assuming that the index position corresponding to the current candidate time is id, if the following condition is satisfied,
(L (id+1) -L (id) > TH_D_lo and L (id+2) -L (id+1) > TH_D_lo) or L (id+1) -L (id) > TH_D_hi
The starting time of a high EMG section is judged to be ST, the detection of the subsequent ending time is carried out, and otherwise, the judgment of the next candidate starting time is carried out;
3) The termination time of each high EMG section is calculated by starting from ST+1 index to L length, assuming the loop index is j, and determining whether the following condition is satisfied
L (j) -L (j-1) < = -th_d_lo and L (j+1) -L (j) > -th_d_lo and abs (L (j) -L (ST)) < th_d_hi
If the condition is met, finding a termination index SE of the high EMG section corresponding to the ST start, terminating the cycle of the termination index detection, returning to 2), and judging the next candidate start time;
s405 calculating EMG baseline dynamic threshold
The method mainly comprises the following steps:
1) Assuming that the vector LW represents the awake level, the length is equal to the length of L, the element values in the vector are 0 or 1,0 represents the sleep period, 1 represents the awake period, all elements are initialized to 0 first, and then the index positions of all the high myoelectricity level intervals detected in S404 are 1, so as to obtain a coarse-granularity binary sleep stage sequence.
2) Assume that another vector BL characterizes the coarse-grained dynamic EMG baseline threshold, initialized to the value of the L vector. The threshold value of the high EMG level interval obtained in S404 is then calculated by, for each high EMG level interval, assuming ST as its start index, SE as its end index, traversing the loop variable j from ST-1 to 5, if the following conditions are satisfied
LW (j) +LW (j-1) +LW (j-2) +LW (j-3) +LW (j-4) =0 and
Abs ((L (j) -L (j-1))) < TH_D_lo and
Abs ((L (j-1) -L (j-2))) < TH_D_lo and
Abs ((L (j-2) -L (j-3))) < TH_D_lo and
abs((L(j-3)-L(j-4)))<TH_D_lo
The method comprises the steps of taking the average value of the current index j and 5L vector elements corresponding to the four index positions in front of the current index j (taking the average value as BL values of all moments of the current high EMG zone (ST to SE moment)), and then entering BL value correction of the next high EMG zone.
S406, sleeping time phase rough division
1) The coarse-granularity vectors BL and LW acquired in S405 are restored to fine-granularity vectors corresponding to the frame length, assuming BLrs and LWrs, respectively, by using a linear interpolation method. A value of LWrs above 0.5 is set to 1 and a value below 0.5 is set to 0.
2) Calculating sleep frame index, assuming frame index i, if it is satisfied
LWRs (i) =0 and EMG_level (i) -BLrs (i) < TH_D_lo
Wherein LWRs (i) is a fine granularity awake level value at the i-th moment, EMG_level (i) is a myoelectricity level value at the i-th moment, BLrs (i) is a fine granularity EMG baseline threshold at the i-th moment, and the frame is set as a sleep frame and frames except the sleep frame are set as awake frames;
3) And respectively acquiring EMG level characteristic values corresponding to sleep and awake frame indexes, and correspondingly defining the EMG level characteristic values as vectors BLs and BLw.
S407 calculating EMG level threshold
To adaptively obtain two EMG level thresholds, a higher threshold for distinguishing sleep from wakefulness and a lower threshold for distinguishing REM from NREM, the following method is set:
1) Calculating an EMG level candidate threshold TH1 by taking the average value of the median value of BLs and the median value of BLw;
2) Calculating another EMG level candidate threshold TH2 by adding 3 times of standard deviation to the BLs mean;
3) Two thresholds of EMG levels are obtained for later sleep stage decisions. The higher threshold of EMG level TH_EMG_hi is taken as the smaller of TH1 and TH2 for distinguishing sleep from wakefulness, and the lower threshold of EMG level TH_EMG_lo is taken as the median of BLs for distinguishing REM from NREM.
S408 determining EEG characteristic threshold
Based on experience, the number of frames in NREM period is far greater than that in REM period, and delta energy in NREM period is higher than that in REM, the following method is set for adaptively obtaining threshold value for distinguishing EEG characteristics of REM and NREM
1) Acquiring a value of the sleep frame index position calculated in the corresponding S406 of the EEG feature vector, and setting the value as Pow_delta_s;
2) The data distribution of the Pow_delta_s is calculated, the extreme points in the Pow_delta_s are removed firstly, the rest data are divided into 10 equally divided intervals, the number of data points falling into each interval is counted, the interval vector is assumed to be x, and the number of corresponding intervals is assumed to be vector n;
3) Calculating the ratio of the number of each interval to the n average value, and setting the ratio as a vector r, wherein r represents the average value number of which the number of each interval is several times;
4) Setting a quantity threshold value TH, finding a first index position meeting the quantity higher than TH in an n vector, and setting p, wherein a calculation formula of TH is as follows
TH = mean(n)*(floor(max(r))-0.5)
5) Setting a loop variable i, traversing p to 10, obtaining the following two accumulated values S1 and C1, the formula is as follows
The eigenvalue F1 of the high eigenvalue area (with higher probability of NREM period) is calculated as follows
6) In a similar way, a feature value F2 of a low feature value region (with a large REM probability) is obtained as follows
7) The delta energy threshold, TH _ delta, is calculated, distinguishing NREM from REM, as follows,
Calculating a candidate threshold TH1, which is the average value of F1 and F2;
Calculating a candidate threshold value TH2, and adding one time of standard deviation to the average value of the pow_delta_s vector;
Th_delta is set to be the smaller of both TH1 and TH 2.
5. Sleep stage determination (S50)
1) Acquiring an index position of which the myoelectricity level characteristic value is lower than the higher myoelectricity level threshold value TH_EMG_hi calculated in the step S407, acquiring a vector consisting of delta energy characteristic values of corresponding positions, and setting the vector as Pow_delta_s1;
2) Performing peak detection on the reverse waveform of the Pow_delta_s1 waveform, setting a limit condition, wherein the detected peak value must be highlighted around the peak by at least P, the value of P is 0.3 times of the difference between the maximum value and the minimum value in the Pow_delta_s vector, the distance between the peaks needs to be at least 30 seconds, and the positions of the detected peak values can be the region where REM phase exists;
detection of low delta energy regions
A. for each detected peak position, let be loc, find the start and end positions of the low delta energy region to the left and right, respectively.
For the starting position search, a loop variable j is set, the index of loc-1 to 2 is traversed, if the following condition is satisfied,
Pow_delta (j) < Pow_delta (j+1) and Pow_delta (j-1) < Pow_delta (j)
The traversal is terminated, and the current index j is recorded as the starting position index ST;
for the end position seek, a loop variable j is set, the index of loc+1 to frame length-1 is traversed, if the following condition is satisfied,
Pow_delta (j) < Pow_delta (j-1) and Pow_delta (j+1) < Pow_delta (j)
The traversal is terminated, and the current index j-1 is recorded as a termination position index SE;
b. the start-stop position of the above-obtained section is corrected as follows
Calculating the absolute difference of the characteristic value pow_delta of the start and stop index position of the section, and if the absolute difference is higher than 0.8 times of the P value calculated in the step 2, correcting the start and stop index position by the following method
If the Pow_delta value corresponding to the start index is lower than the Pow_delta value of the end index, continuing to search the start position forwards, and traversing the indexes of ST-2 to 2 by assuming a loop variable j similarly to the above method, if the following conditions are satisfied
Pow_delta (j) < Pow_delta (j+1) and Pow_delta (j-1) < Pow_delta (j)
The traversal is terminated, and the current index j is recorded as the corrected starting position index ST;
if the Pow_delta value corresponding to the start index is higher than the Pow_delta value of the end index, continuing to search the start position backwards, and traversing the indexes from SE+2 to frame number-1 by assuming a loop variable j similar to the above method, if the following conditions are satisfied
Pow_delta (j) < Pow_delta (j-1) and Pow_delta (j+1) < Pow_delta (j)
The traversal is terminated, and the current index j-1 is recorded as a corrected termination position index SE;
And (3) circulating the process until the absolute difference value of the Pow_delta corresponding to the updated start and stop index position is smaller than P0.8, stopping correction, and entering detection and correction of the next REM area.
4) Sleep staging, the method is as follows
Firstly, all frames are set as NREM period, those frames in which EMG level characteristic value is higher than TH_EMG_hi are corrected as awake period, then REM is set, the method is as follows, for each low delta energy region start-stop index position obtained in step 3, the continuous frames in the corresponding start-stop index position are further screened, the frames in which wakefulness has been classified are removed, the frames in which delta energy is higher than TH_delta obtained by calculation in S408 are removed, the frames in which myoelectricity level is higher than the average value of both TH_EMG_lo and TH_EMG_hi are removed, and the rest frames are classified into REM. Thus, the sleep stage of the whole file is completed.
The sleep stage algorithm result provided by the invention is largely calculated based on the self-adaptive threshold, so that the sleep data cannot be too short and each sleep phase should be covered in order to make the stage result as accurate as possible.
Examples
The method of the invention is used for carrying out automatic sleep stage on the sleep monitoring data of a 4-hour mouse, the frame length is set to be 10s, and the results are shown in figure 5, namely an EEG waveform diagram, an EEG time-frequency diagram, an EMG level diagram and a sleep time-phase sequence diagram (W: awake, N: NREM, R: REM) from top to bottom. Therefore, the method can obtain more accurate sleep stage results. One example of frame data (fig. 6) automatically divided into NREM is that of the current frame, the top of the graph is EEG waveform of the current frame, the middle of the graph is displayed with the time-frequency chart of the EEG waveform of the current frame and 20 frames on the left and right of the current frame, the left-most side of the lower graph is displayed with the spectrogram of the current frame, the delta frequency band with higher energy can be seen, the middle graph below is displayed with the relative energy of 3 frequency bands (delta: 0.5-4 Hz, theta: 5-9 Hz, alpha: 9-12 Hz), the right-hand graph below is displayed with myoelectricity level of the current frame and the front and back 5 frames thereof, the current frame is marked with red, the two transverse dotted lines in the graph are respectively upper and lower EMG level thresholds calculated in an adaptive manner, namely, the rose line is TH_EMG_hi, and the green line is TH_EMG_lo. One example of frame data automatically divided into REM (FIG. 7) shows that the brain wave theta rhythm is obvious, and the threshold setting of myoelectric level can be seen reasonably in the myoelectric level diagram. One example of frame data (fig. 8) that is automatically divided into wakefulness is that the brain wave theta rhythm is obvious, and the central frequency of theta frequency band in wakefulness can be seen to be slightly higher than REM period in frequency spectrum, and the myoelectricity level diagram at the lower right shows that the myoelectricity level of the current frame is higher than TH_EMG_hi. The interval of fig. 5 is enlarged, and an automatic staging result (fig. 9) before and after the REM period is displayed, so that the sensitivity of the automatic identification result of the method can be seen to be higher.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above embodiments are only some of the preferred embodiments of the present invention, but are not intended to limit the present invention. Various changes and modifications may be made by one of ordinary skill in the pertinent art without departing from the spirit and scope of the present invention. Therefore, all the technical schemes obtained by adopting the equivalent substitution or equivalent transformation are within the protection scope of the invention.

Claims (10)

CN202510714596.XA2025-05-302025-05-30 Method, system and storage medium for automated sleep staging of rodentsActiveCN120257176B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202510714596.XACN120257176B (en)2025-05-302025-05-30 Method, system and storage medium for automated sleep staging of rodents

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202510714596.XACN120257176B (en)2025-05-302025-05-30 Method, system and storage medium for automated sleep staging of rodents

Publications (2)

Publication NumberPublication Date
CN120257176Atrue CN120257176A (en)2025-07-04
CN120257176B CN120257176B (en)2025-08-29

Family

ID=96187392

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202510714596.XAActiveCN120257176B (en)2025-05-302025-05-30 Method, system and storage medium for automated sleep staging of rodents

Country Status (1)

CountryLink
CN (1)CN120257176B (en)

Citations (14)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN104970773A (en)*2015-07-212015-10-14西安交通大学Automatic sleep stage classification method based on dual character filtering
CN106709469A (en)*2017-01-032017-05-24中国科学院苏州生物医学工程技术研究所Automatic sleep staging method based on multiple electroencephalogram and electromyography characteristics
WO2020248008A1 (en)*2019-06-142020-12-17The University Of AdelaideA method and system for classifying sleep related brain activity
CN112370013A (en)*2020-07-312021-02-19新绎健康科技有限公司Method and system for determining sleep stage
CN114052662A (en)*2021-11-112022-02-18四川省医学科学院·四川省人民医院Method for analyzing sleep stages by combining brain, cerebellar electroencephalogram and myoelectricity integration
CN115040072A (en)*2022-03-092022-09-13中国人民解放军空军特色医学中心Multi-modal sleep staging method and device based on dynamic fusion
RU2781740C1 (en)*2022-01-102022-10-17Федеральное государственное бюджетное образовательное учреждение высшего образования "Саратовский национальный исследовательский государственный университет имени Н.Г. Чернышевского"Method for detecting the state of deep sleep
CN116548982A (en)*2023-03-202023-08-08上海数药智能科技有限公司Sleep stage identification method, apparatus and computer readable storage medium
CN118383720A (en)*2024-02-262024-07-26山东第一医科大学第一附属医院(山东省千佛山医院)Biological sleep-wake stage method and system based on brain electromyographic signals
WO2024249524A1 (en)*2023-05-312024-12-05Neurovigil, Inc.Rapid eye movement sleep disorder detection to facilitate selective screening for parkinson's disorder
US20240415449A1 (en)*2023-06-142024-12-19Korea Institute Of Science And TechnologyDevice and method for monitoring sleep state of community, and recording medium for performing method
CN119791610A (en)*2025-03-122025-04-11浙江普可医疗科技有限公司Sleep monitoring method and device
CN119837545A (en)*2024-12-302025-04-18南京邮电大学Forehead electroencephalogram rhythm driven sleep state staging method based on multidimensional features
CN119924774A (en)*2024-12-252025-05-06杭州电子科技大学 Sleep staging system based on multi-threshold neighborhood extreme value pattern statistics

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN104970773A (en)*2015-07-212015-10-14西安交通大学Automatic sleep stage classification method based on dual character filtering
CN106709469A (en)*2017-01-032017-05-24中国科学院苏州生物医学工程技术研究所Automatic sleep staging method based on multiple electroencephalogram and electromyography characteristics
WO2020248008A1 (en)*2019-06-142020-12-17The University Of AdelaideA method and system for classifying sleep related brain activity
CN112370013A (en)*2020-07-312021-02-19新绎健康科技有限公司Method and system for determining sleep stage
CN114052662A (en)*2021-11-112022-02-18四川省医学科学院·四川省人民医院Method for analyzing sleep stages by combining brain, cerebellar electroencephalogram and myoelectricity integration
RU2781740C1 (en)*2022-01-102022-10-17Федеральное государственное бюджетное образовательное учреждение высшего образования "Саратовский национальный исследовательский государственный университет имени Н.Г. Чернышевского"Method for detecting the state of deep sleep
CN115040072A (en)*2022-03-092022-09-13中国人民解放军空军特色医学中心Multi-modal sleep staging method and device based on dynamic fusion
CN116548982A (en)*2023-03-202023-08-08上海数药智能科技有限公司Sleep stage identification method, apparatus and computer readable storage medium
WO2024249524A1 (en)*2023-05-312024-12-05Neurovigil, Inc.Rapid eye movement sleep disorder detection to facilitate selective screening for parkinson's disorder
US20240415449A1 (en)*2023-06-142024-12-19Korea Institute Of Science And TechnologyDevice and method for monitoring sleep state of community, and recording medium for performing method
CN118383720A (en)*2024-02-262024-07-26山东第一医科大学第一附属医院(山东省千佛山医院)Biological sleep-wake stage method and system based on brain electromyographic signals
CN119924774A (en)*2024-12-252025-05-06杭州电子科技大学 Sleep staging system based on multi-threshold neighborhood extreme value pattern statistics
CN119837545A (en)*2024-12-302025-04-18南京邮电大学Forehead electroencephalogram rhythm driven sleep state staging method based on multidimensional features
CN119791610A (en)*2025-03-122025-04-11浙江普可医疗科技有限公司Sleep monitoring method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
LI, YJ: "Temporal correlation between two channels EEG of bipolar lead in the head midline is associated with sleep-wake stages", 《 AUSTRALASIAN PHYSICAL & ENGINEERING SCIENCES IN MEDICINE》, 1 March 2016 (2016-03-01)*
吕甜甜;王心醉;俞乾;贾朋飞;陈骁;吴成雄;: "基于多参数特征融合的自动睡眠分期方法", 计算机应用, no. 2, 20 December 2017 (2017-12-20)*

Also Published As

Publication numberPublication date
CN120257176B (en)2025-08-29

Similar Documents

PublicationPublication DateTitle
Singh et al.A novel approach osa detection using single-lead ECG scalogram based on deep neural network
CN105496363B (en)The method classified based on detection sleep cerebral electricity signal to sleep stage
CN109758145B (en) An automatic sleep staging method based on the causal relationship of EEG signals
Zhang et al.VLSI friendly ECG QRS complex detector for body sensor networks
Babadi et al.DiBa: a data-driven Bayesian algorithm for sleep spindle detection
CN113180691B (en)Three-channel sleep apnea and hypopnea syndrome recognition device
CN115120248B (en) Method and device for adaptive threshold R-peak detection and heart rhythm classification based on histogram
AU2020103949A4 (en)EEG Signal Mixed Noise Processing Method, Equipment and Storage Medium
CN112450885B (en)Epileptic electroencephalogram-oriented identification method
US10499846B2 (en)EOG-based sleep staging method, computer program product with stored programs, computer readable medium with stored programs, and electronic apparatuses
CN110742581A (en) BCG signal processing method and device
CN113974653A (en)Optimized spike detection method and device based on Joyston index, storage medium and terminal
CN115989997A (en)Sleep electroencephalogram signal staging method, equipment and medium for unsupervised clustering
CN115969398B (en)Blink detection method and device
CN116035594B (en) A method for removing EEG artifacts based on segmentation-denoising network
Kempfner et al.Automatic SLEEP staging: From young aduslts to elderly patients using multi-class support vector machine
CN119564229B (en) Electroencephalogram (EEG) denoising method, device, and medium based on neural network architecture search
CN120257176B (en) Method, system and storage medium for automated sleep staging of rodents
CN111368793B (en)Automatic neuron cell body recognition system based on fluorescence video
CN106333674B (en)Sleep cycle detection method and system in sleep state analysis
CN114631790A (en)Sleep staging method, device, equipment and storage medium based on wearable equipment
CN117668512A (en)Sleep stage method and system based on reinforcement learning
Currey et al.Cross-site epileptic seizure detection using convolutional neural networks
CN115067881A (en)Electroencephalogram sleep staging device
Yadav et al.A novel dual-stage classifier for automatic detection of epileptic seizures

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp