Movatterモバイル変換


[0]ホーム

URL:


CN116548982A - Sleep stage identification method, apparatus and computer readable storage medium - Google Patents

Sleep stage identification method, apparatus and computer readable storage medium
Download PDF

Info

Publication number
CN116548982A
CN116548982ACN202310265649.5ACN202310265649ACN116548982ACN 116548982 ACN116548982 ACN 116548982ACN 202310265649 ACN202310265649 ACN 202310265649ACN 116548982 ACN116548982 ACN 116548982A
Authority
CN
China
Prior art keywords
power value
target
user
electroencephalogram signal
stage
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.)
Pending
Application number
CN202310265649.5A
Other languages
Chinese (zh)
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.)
Shanghai Shuyao Intelligent Technology Co ltd
Original Assignee
Shanghai Shuyao Intelligent Technology Co ltd
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 Shanghai Shuyao Intelligent Technology Co ltdfiledCriticalShanghai Shuyao Intelligent Technology Co ltd
Priority to CN202310265649.5ApriorityCriticalpatent/CN116548982A/en
Publication of CN116548982ApublicationCriticalpatent/CN116548982A/en
Pendinglegal-statusCriticalCurrent

Links

Classifications

Landscapes

Abstract

The invention provides a sleep stage identification method, a sleep stage identification device and a computer readable storage medium, wherein the sleep stage identification method comprises the following steps: acquiring an electroencephalogram signal fragment of a user; calculating a power value at a target frequency in the electroencephalogram signal segment; and identifying whether the sleep stage of the user is a awake stage or a rapid eye movement stage according to the power value of the target frequency in the electroencephalogram signal segment. According to the invention, after the electroencephalogram signal fragments of the user are obtained, the power value at the specific frequency in the electroencephalogram signal fragments is calculated, whether the user is in a awake period or a rapid eye movement period is identified, the calculation complexity is low, the stage separation accuracy is high, then the electroencephalogram signal fragments are processed by using a machine learning algorithm, and whether the user is in a deep sleep period or a shallow sleep period is determined, and because the machine learning algorithm only needs to identify two stages of the deep sleep period and the shallow sleep period, the calculation complexity is obviously reduced compared with the prior art, and meanwhile, the high stage separation identification accuracy is maintained.

Description

Translated fromChinese
睡眠分期识别方法、装置以及计算机可读存储介质Sleep stage identification method, device and computer-readable storage medium

技术领域technical field

本发明涉及计算机技术领域,具体涉及一种睡眠分期识别方法、装置以及计算机可读存储介质。The present invention relates to the field of computer technology, in particular to a sleep stage recognition method, device and computer-readable storage medium.

背景技术Background technique

睡眠质量问题已成为当今社会愈发重视的健康问题,由此催生出大量对于睡眠监测和睡眠质量改善设备的需求。脑电数据是经典且主要的睡眠分期依据,而其中前额叶(位于大脑前端的皮层区域,主要负责高级认知功能,如:决策、计划、抽象思维等)脑电包含了较为全面的睡眠分期相关特征波形。同时,前额叶单通道电极也可以实现较高的睡眠舒适度,是目前可行性较高的轻量级睡眠监测设备的技术路径。目前学术界基于单通道脑电信号进行睡眠分期,主要采用以下方法:The problem of sleep quality has become an increasingly important health issue in today's society, which has created a large demand for sleep monitoring and sleep quality improvement equipment. EEG data is the classic and main basis for sleep staging, and the prefrontal cortex (the cortical area located at the front of the brain, which is mainly responsible for advanced cognitive functions, such as: decision-making, planning, abstract thinking, etc.) EEG contains a more comprehensive sleep staging Related characteristic waveforms. At the same time, single-channel electrodes in the prefrontal cortex can also achieve high sleep comfort, which is a technical path for lightweight sleep monitoring equipment with high feasibility. At present, the academic community conducts sleep staging based on single-channel EEG signals, mainly using the following methods:

(1)人工手动分期:由脑电分期专家通过鉴别脑电波形特征,对睡眠进行分期。此方法需耗费较大量的人力和时间,成本较高,仅适用于小规模数据的精细分析,不适用于大规模数据的批量快速分析。(1) Manual staging: experts in EEG staging stage sleep by identifying the characteristics of EEG waveforms. This method requires a lot of manpower, time and high cost, and is only suitable for fine analysis of small-scale data, not for batch rapid analysis of large-scale data.

(2)机器学习分类:通过机器学习算法(如:支持向量机、卷积神经网络、随机森林,等等),以有监督或无监督的方式训练分类模型,随后通过已训练好的模型来对睡眠脑电数据进行自动化分期。此方法适用于大规模数据的批量快速分析,但需要较大量的前期参数调试步骤以及较高质量的训练集数据,才能保证较好的分类准确率。(2) Machine learning classification: through machine learning algorithms (such as: support vector machine, convolutional neural network, random forest, etc.), train the classification model in a supervised or unsupervised manner, and then use the trained model to Automated staging of sleep EEG data. This method is suitable for batch rapid analysis of large-scale data, but requires a large number of early parameter debugging steps and high-quality training set data to ensure better classification accuracy.

然而,目前基于前额叶单通道脑电数据进行睡眠分期,仍存在着分期准确率不够高、分期算法复杂度较高等问题,不利于相关产品的大规模商用。因此,本发明旨在提出一种计算复杂度较低(从而可实现大规模、并行、快速响应的睡眠分期运算),并且有潜力实现较高睡眠分期准确率(从而保证产品的有效性)的技术方案。However, the current sleep staging based on the single-channel EEG data of the prefrontal cortex still has problems such as insufficient staging accuracy and high complexity of the staging algorithm, which is not conducive to large-scale commercial use of related products. Therefore, the present invention aims to propose a sleep staging operation with low computational complexity (thus enabling large-scale, parallel, and fast-response sleep staging operations) and having the potential to achieve higher sleep staging accuracy (thus ensuring the effectiveness of the product) Technical solutions.

发明内容Contents of the invention

为了克服上述缺陷,提出了本发明,以提供计算复杂程度低且分期准确率高的睡眠分期识别方法、装置以及计算机可读存储介质。In order to overcome the above-mentioned defects, the present invention is proposed to provide a sleep stage recognition method, device and computer-readable storage medium with low calculation complexity and high stage accuracy.

第一方面,本发明提供一种睡眠分期识别方法,所述方法包括:获取用户的脑电信号片段;计算所述脑电信号片段中目标频率处的功率值;根据所述脑电信号片段中目标频率处的功率值的大小,识别所述用户所处的睡眠分期是否为清醒期或快速眼动期。In a first aspect, the present invention provides a method for identifying sleep stages, the method comprising: acquiring a segment of the user's EEG signal; calculating a power value at a target frequency in the segment of the EEG signal; The magnitude of the power value at the target frequency identifies whether the sleep stage of the user is an awake stage or a rapid eye movement stage.

优选地,前述的睡眠分期识别方法,在所述目标频率高于预设的第一频率时,“根据所述脑电信号片段中目标频率处的功率值的大小,识别所述用户所处的睡眠分期是否为清醒期或快速眼动期”的步骤包括:将所述脑电信号片段中所述目标频率处的功率值与预设的第一目标功率值进行比较,在所述脑电信号片段中所述目标频率处的功率值高于所述第一目标功率值时,判定所述用户所处的睡眠分期为清醒期。Preferably, in the aforementioned method for identifying sleep stages, when the target frequency is higher than the preset first frequency, "according to the magnitude of the power value at the target frequency in the EEG signal segment, identify where the user is." The step of "whether the sleep stage is the awake period or the rapid eye movement period" includes: comparing the power value at the target frequency in the EEG signal segment with the preset first target power value, in the EEG signal When the power value at the target frequency in the segment is higher than the first target power value, it is determined that the sleep stage of the user is an awake stage.

优选地,前述的睡眠分期识别方法,在“将所述脑电信号片段中所述目标频率处的功率值与预设的第一目标功率值进行比较”的步骤之前,还包括:根据所述用户的多个脑电信号片段中所述目标频率处的功率值的均值,设置所述第一目标功率值。Preferably, before the step of "comparing the power value at the target frequency in the EEG signal segment with the preset first target power value", the aforementioned sleep stage recognition method further includes: according to the The first target power value is set as an average value of the power values at the target frequency in the multiple EEG signal segments of the user.

优选地,前述的睡眠分期识别方法,在所述目标功率为多个时,在“将所述脑电信号片段中所述目标频率处的功率值与预设的第一目标功率值进行比较”的步骤之前,还包括:根据所述用户的多个脑电信号片段中多个目标频率处的功率值之和的预设幅度置信区间的上界,设置所述第一目标功率值;“将所述脑电信号片段中目标频率处的功率值与预设的第一目标功率值进行比较”的步骤包括:计算所述脑电信号片段中多个目标频率处的功率值之和,并与所述第一目标功率值进行比较。Preferably, in the aforementioned sleep stage identification method, when there are multiple target powers, "comparing the power value at the target frequency in the EEG signal segment with the preset first target power value" Before the step, it also includes: setting the first target power value according to the upper bound of the preset amplitude confidence interval of the sum of power values at multiple target frequencies in multiple EEG signal segments of the user; The step of "comparing the power value at the target frequency in the EEG signal segment with the preset first target power value" includes: calculating the sum of the power values at multiple target frequencies in the EEG signal segment, and comparing with The first target power value is compared.

优选地,前述的睡眠分期识别方法,在所述目标频率低于预设的第二频率时,“根据所述脑电信号片段中目标频率处的功率值的大小,识别所述用户所处的睡眠分期是否为清醒期或快速眼动期”的步骤包括:将所述脑电信号片段中所述目标频率处的功率值与预设的第二目标功率值进行比较,在所述脑电信号片段中所述目标频率处的功率值低于所述第二目标功率值时,判定所述用户所处的睡眠分期为快速眼动期。Preferably, in the aforementioned sleep stage identification method, when the target frequency is lower than the preset second frequency, "according to the magnitude of the power value at the target frequency in the EEG signal segment, identify the The step of "whether the sleep stage is the awake period or the rapid eye movement period" includes: comparing the power value at the target frequency in the EEG signal segment with a preset second target power value, in the EEG signal When the power value at the target frequency in the segment is lower than the second target power value, it is determined that the sleep stage of the user is the rapid eye movement stage.

优选地,前述的睡眠分期识别方法,在“将所述脑电信号片段中所述目标频率处的功率值与预设的第二目标功率值进行比较”的步骤之前,还包括:根据所述用户的多个脑电信号片段中所述目标频率处的功率值的均值,设置所述第二目标功率值。Preferably, before the step of "comparing the power value at the target frequency in the EEG signal segment with the preset second target power value", the aforementioned sleep stage identification method further includes: according to the The average value of the power values at the target frequency in the multiple EEG signal segments of the user is used to set the second target power value.

优选地,前述的睡眠分期识别方法,在所述目标功率为多个时,在“将所述脑电信号片段中所述目标频率处的功率值与预设的第二目标功率值进行比较”的步骤之前,还包括:根据所述用户的多个脑电信号片段中多个目标频率处的功率值之和的预设幅度置信区间的下界,设置所述第二目标功率值;“将所述脑电信号片段中所述目标频率处的功率值与预设的第二目标功率值进行比较”的步骤包括:计算所述脑电信号片段中多个目标频率处的功率值之和,并与所述第二目标功率值进行比较。Preferably, in the aforementioned sleep stage recognition method, when there are multiple target powers, "comparing the power value at the target frequency in the EEG signal segment with the preset second target power value" Before the step, it also includes: setting the second target power value according to the lower bound of the preset amplitude confidence interval of the sum of the power values at multiple target frequencies in the multiple EEG signal segments of the user; The step of comparing the power value at the target frequency in the EEG signal segment with the preset second target power value" includes: calculating the sum of the power values at multiple target frequencies in the EEG signal segment, and compared with the second target power value.

优选地,前述的睡眠分期识别方法,在“根据所述脑电信号片段中目标频率处的功率值的大小,识别所述用户所处的睡眠分期是否为清醒期或快速眼动期”的步骤之后,还包括:在所述用户所处的睡眠分期非清醒期或快速眼动期时,基于预设的机器学习算法对所述脑电信号片段进行处理,确定所述用户所处的睡眠分期是否为深睡期或浅睡期。Preferably, in the aforementioned sleep stage identification method, in the step of "according to the magnitude of the power value at the target frequency in the EEG signal segment, identify whether the user's sleep stage is the awake stage or the rapid eye movement stage" Afterwards, it also includes: when the sleep stage of the user is in the non-awake stage or the rapid eye movement stage, processing the EEG signal segments based on a preset machine learning algorithm to determine the sleep stage of the user Whether it is a deep sleep period or a light sleep period.

第二方面,本发明提供一种睡眠分期识别装置,包括:脑电获取模块,获取用户的脑电信号片段;功率计算模块,计算所述脑电信号片段中目标频率处的功率值;分期识别模块,根据所述脑电信号片段中目标频率处的功率值的大小,识别所述用户所处的睡眠分期是否为清醒期或快速眼动期。In the second aspect, the present invention provides a sleep stage identification device, including: an EEG acquisition module, which acquires the user's EEG signal segment; a power calculation module, which calculates the power value at the target frequency in the EEG signal segment; stage recognition A module for identifying whether the user's sleep stage is awake or rapid eye movement according to the magnitude of the power value at the target frequency in the EEG signal segment.

第三方面,提供一种计算机可读存储介质,该计算机可读存储介质其中存储有多条程序代码,所述程序代码适于由处理器加载并运行以执行上述睡眠分期识别方法的技术方案中任一项技术方案所述的上述睡眠分期识别方法。In a third aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a plurality of program codes, and the program codes are adapted to be loaded and run by a processor to perform the technical solution of the sleep stage identification method described above The above sleep stage recognition method described in any one of the technical solutions.

本发明上述一个或多个技术方案,至少具有如下一种或多种有益效果:The above-mentioned one or more technical solutions of the present invention have at least one or more of the following beneficial effects:

本发明的技术方案与现有技术不同,并非仅使用机器学习方法进行睡眠分期识别,由于用户处于清醒期或快速眼动期时,其脑电信号中特定频率处的功率值会显著过高或过低,所以本发明中在获取用户脑电信号片段后,对脑电信号片段中特定频率处的功率值进行计算,根据特定频率处的功率值大小能够准确识别用户是否处于清醒期或快速眼动期,该过程计算复杂度低且分期准确率高,在通过该过程确定用户并未处于清醒期或快速眼动期时,再使用机器学习算法对脑电信号片段进行处理,确定用户处于深睡期还是浅睡期,由于机器学习算法仅需对针对深睡期、浅睡期两种分期进行识别,所以计算复杂度较现有技术显著下降,同时保持高分期识别准确率。The technical solution of the present invention is different from the prior art. It does not only use machine learning methods for sleep stage recognition. Because when the user is in the awake period or the rapid eye movement period, the power value at a specific frequency in the EEG signal will be significantly too high or is too low, so in the present invention, after the user's EEG signal segment is obtained, the power value at a specific frequency in the EEG signal segment is calculated, and it can be accurately identified whether the user is in the awake period or rapid eye according to the power value at the specific frequency During this process, the calculation complexity is low and the staging accuracy is high. When it is determined through this process that the user is not in the awake stage or the rapid eye movement stage, the machine learning algorithm is used to process the EEG signal fragments to determine that the user is in the deep stage. Sleep period or light sleep period, since the machine learning algorithm only needs to identify the two stages of deep sleep period and light sleep period, the computational complexity is significantly reduced compared with the existing technology, while maintaining a high accuracy of stage recognition.

附图说明Description of drawings

参照附图,本发明的公开内容将变得更易理解。本领域技术人员容易理解的是:这些附图仅仅用于说明的目的,而并非意在对本发明的保护范围组成限制。其中:The disclosure of the present invention will become more comprehensible with reference to the accompanying drawings. Those skilled in the art can easily understand that: these drawings are only for the purpose of illustration, and are not intended to limit the protection scope of the present invention. in:

图1是根据本发明的一个实施例的睡眠分期识别方法的流程图;Fig. 1 is the flowchart of the method for identifying sleep stages according to one embodiment of the present invention;

图2是根据本发明的一个实施例的睡眠分期识别方法的流程图;Fig. 2 is a flowchart of a method for identifying sleep stages according to an embodiment of the present invention;

图3是根据本发明的一个实施例的睡眠分期识别方法的示意图;Fig. 3 is a schematic diagram of a method for identifying sleep stages according to an embodiment of the present invention;

图4是根据本发明的一个实施例的睡眠分期识别方法的示意图;Fig. 4 is a schematic diagram of a method for identifying sleep stages according to an embodiment of the present invention;

图5是根据本发明的一个实施例的睡眠控制装置的框图。FIG. 5 is a block diagram of a sleep control device according to one embodiment of the present invention.

具体实施方式Detailed ways

下面参照附图来描述本发明的一些实施方式。本领域技术人员应当理解的是,这些实施方式仅仅用于解释本发明的技术原理,并非旨在限制本发明的保护范围。Some embodiments of the present invention are described below with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are only used to explain the technical principles of the present invention, and are not intended to limit the protection scope of the present invention.

在本发明的描述中,“模块”、“处理器”可以包括硬件、软件或者两者的组合。一个模块可以包括硬件电路,各种合适的感应器,通信端口,存储器,也可以包括软件部分,比如程序代码,也可以是软件和硬件的组合。处理器可以是中央处理器、微处理器、图像处理器、数字信号处理器或者其他任何合适的处理器。处理器具有数据和/或信号处理功能。处理器可以以软件方式实现、硬件方式实现或者二者结合方式实现。非暂时性的计算机可读存储介质包括任何合适的可存储程序代码的介质,比如磁碟、硬盘、光碟、闪存、只读存储器、随机存取存储器等等。术语“A和/或B”表示所有可能的A与B的组合,比如只是A、只是B或者A和B。术语“至少一个A或B”或者“A和B中的至少一个”含义与“A和/或B”类似,可以包括只是A、只是B或者A和B。单数形式的术语“一个”、“这个”也可以包含复数形式。In the description of the present invention, "module" and "processor" may include hardware, software or a combination of both. A module may include hardware circuits, various suitable sensors, communication ports, memory, and may also include software parts, such as program codes, or a combination of software and hardware. The processor may be a central processing unit, a microprocessor, an image processor, a digital signal processor or any other suitable processor. The processor has data and/or signal processing functions. The processor can be implemented in software, hardware or a combination of both. The non-transitory computer readable storage medium includes any suitable medium that can store program code, such as magnetic disks, hard disks, optical disks, flash memory, read only memory, random access memory, and the like. The term "A and/or B" means all possible combinations of A and B, such as only A, only B or A and B. The term "at least one of A or B" or "at least one of A and B" has a similar meaning to "A and/or B" and may include only A, only B or both A and B. The terms "a" and "the" in the singular may also include plural forms.

如图1所示,本发明的一个实施例中提供了一种睡眠分期识别方法,方法包括:As shown in Figure 1, a method for identifying sleep stages is provided in one embodiment of the present invention, the method includes:

步骤S110,获取用户的脑电信号片段。Step S110, acquiring the segment of the user's EEG signal.

在本实施例中,对脑电信号片段的时间长度不进行限制,可以是30秒或其他时长。脑电信号是通过电极在头皮表面采集到的电压信号,可反映大脑神经细胞的群体电活动,常用于大脑功能研究。In this embodiment, the time length of the EEG signal segment is not limited, and may be 30 seconds or other time lengths. EEG signals are voltage signals collected on the surface of the scalp through electrodes, which can reflect the group electrical activity of brain nerve cells and are often used in brain function research.

步骤S120,计算脑电信号片段中目标频率处的功率值。Step S120, calculating the power value at the target frequency in the EEG signal segment.

在本实施例中,对目标频率不进行限制。根据先验知识,用户处于清醒期时,脑电信号中12-16Hz处的功率值处于较高水平,而用户处于REM期时,脑电信号中2-4Hz处的功率值处于较低水平,所以本实施例中,目标频率可以在2-4Hz、12-16Hz中取一个或多个值。通常将睡眠分为4个阶段:清醒期、浅睡期、深睡期、REM(快速眼动)期,不同的睡眠分期对应了不同的生理(脑电、心电、肌电,等等)特征,也与不同的大脑功能(如:记忆的巩固)有关联。REM期是快速眼动(Rapid-Eye-Movement)期的简称,处于REM期的睡眠者的特征表现为眼球快速运动,从而与浅睡、深睡阶段区分开来,学界通常认为睡眠者往往在REM期间做梦。In this embodiment, no limitation is imposed on the target frequency. According to prior knowledge, when the user is in the awake period, the power value at 12-16Hz in the EEG signal is at a high level, and when the user is in the REM period, the power value at 2-4Hz in the EEG signal is at a low level. Therefore, in this embodiment, the target frequency can take one or more values in 2-4 Hz and 12-16 Hz. Sleep is usually divided into 4 stages: awake period, light sleep period, deep sleep period, REM (rapid eye movement) period, different sleep stages correspond to different physiology (brain electricity, heart electricity, myoelectricity, etc.) traits, and are also associated with different brain functions such as memory consolidation. The REM period is short for Rapid-Eye-Movement period. Sleepers in the REM period are characterized by rapid eye movement, which can be distinguished from light sleep and deep sleep. The academic circles generally believe that sleepers tend to sleep during sleep. Dreaming during REM.

步骤S130,根据脑电信号片段中目标频率处的功率值的大小,识别用户所处的睡眠分期是否为清醒期或快速眼动期。Step S130, according to the magnitude of the power value at the target frequency in the EEG signal segment, identify whether the sleep stage of the user is the awake stage or the rapid eye movement stage.

根据本实施例的技术方案,由于用户处于清醒期或快速眼动期时,其脑电信号中特定频率处的功率值会显著过高或过低,所以本实施例在获取用户脑电信号片段后,对脑电信号片段中特定频率处的功率值进行计算,根据特定频率处的功率值大小能够准确识别用户是否处于清醒期或快速眼动期,该过程计算复杂度低且分期准确率高,在通过该过程确定用户并未处于清醒期或快速眼动期时,再使用机器学习算法对脑电信号片段进行处理,确定用户处于深睡期还是浅睡期,由于机器学习算法仅需对针对深睡期、浅睡期两种分期进行识别,所以计算复杂度较现有技术显著下降,同时保持高分期识别准确率。According to the technical solution of this embodiment, since the power value at a specific frequency in the user's EEG signal will be significantly too high or too low when the user is in the waking period or the rapid eye movement period, so this embodiment obtains the user's EEG signal segment Finally, calculate the power value at a specific frequency in the EEG signal segment. According to the power value at a specific frequency, it can accurately identify whether the user is in the awake period or the rapid eye movement period. This process has low computational complexity and high staging accuracy. , when it is determined through this process that the user is not in the awake period or the rapid eye movement period, the machine learning algorithm is used to process the EEG signal fragments to determine whether the user is in the deep sleep period or the light sleep period. Since the machine learning algorithm only needs to The two stages of deep sleep and light sleep are identified, so the computational complexity is significantly reduced compared with the existing technology, while maintaining a high accuracy of stage recognition.

如图2示,本发明的一个实施例中提供了一种睡眠分期识别方法,方法包括:As shown in Figure 2, an embodiment of the present invention provides a sleep stage identification method, the method includes:

步骤S210,获取用户的脑电信号片段。Step S210, acquiring the segment of the user's EEG signal.

本实施例中,可以通过脑电设备实时采集睡眠脑电信号。In this embodiment, the sleep EEG signal can be collected in real time by the EEG device.

步骤S220,计算脑电信号片段中目标频率处的功率值。Step S220, calculating the power value at the target frequency in the EEG signal segment.

步骤S230,在目标频率高于预设的第一频率时,将脑电信号片段中目标频率处的功率值与预设的第一目标功率值进行比较,在脑电信号片段中目标频率处的功率值高于第一目标功率值时,判定用户所处的睡眠分期为清醒期。Step S230, when the target frequency is higher than the preset first frequency, compare the power value at the target frequency in the EEG signal segment with the preset first target power value, and the power value at the target frequency in the EEG signal segment When the power value is higher than the first target power value, it is determined that the sleep stage of the user is the awake stage.

本实施例中,对于第一频率不进行限制,例如可以是10-12Hz中的任一频率。In this embodiment, there is no limitation on the first frequency, for example, it may be any frequency in 10-12 Hz.

此处,第一目标功率值的设置方式有:Here, the setting methods of the first target power value are:

(1)将第一目标功率值设置为固定值。(1) Setting the first target power value as a fixed value.

本实施例中,固定值可以通过实验预先测定。In this embodiment, the fixed value can be determined in advance through experiments.

(2)根据用户的多个脑电信号片段中目标频率处的功率值的均值,设置第一目标功率值。(2) Set the first target power value according to the mean value of the power values at the target frequency in the multiple EEG signal segments of the user.

本实施例中,例如,目标功率为12Hz时,则可以根据用户的多个脑电信号片段中12Hz处的功率值的均值,设置第一目标功率值,目标功率为16Hz时,则可以根据用户的多个脑电信号片段中16Hz处的功率值的均值,设置第一目标功率值,目标功率为12Hz、16Hz两个频率时,则可以根据用户的多个脑电信号片段中12Hz、16Hz处的功率值之和的均值,设置第一目标功率值。In this embodiment, for example, when the target power is 12Hz, the first target power value can be set according to the mean value of the power values at 12Hz in multiple EEG signal segments of the user; when the target power is 16Hz, the first target power value can be set according to the user The average value of the power values at 16Hz in the multiple EEG signal segments of the user is used to set the first target power value. When the target power is two frequencies of 12Hz and 16Hz, it can The average value of the sum of the power values is set as the first target power value.

(3)在高于第一频率的目标频率为多个时,根据用户的多个脑电信号片段中多个目标频率处的功率值之和的预设幅度置信区间的上界,设置第一目标功率值。(3) When there are multiple target frequencies higher than the first frequency, according to the upper bound of the preset amplitude confidence interval of the sum of the power values at multiple target frequencies in multiple EEG signal segments of the user, set the first Target power value.

本实施例中,对预设幅度不进行限制,例如,可以取用户多个脑电信号片段的12Hz、16Hz处功率值之和的95%置信区间的上界。In this embodiment, there is no limit to the preset amplitude. For example, the upper bound of the 95% confidence interval of the sum of the power values at 12 Hz and 16 Hz of multiple EEG signal segments of the user may be taken.

在高于第一频率的目标频率为多个时,还需要计算脑电信号片段中多个目标频率处的功率值之和,再与第一目标功率值进行比较。When there are multiple target frequencies higher than the first frequency, it is also necessary to calculate the sum of the power values at multiple target frequencies in the EEG signal segment, and then compare it with the first target power value.

本实施例中,例如,计算用户脑电信号片段在12Hz、16Hz处的功率值之和后再进行比较。In this embodiment, for example, the sum of the power values of the user's EEG signal segments at 12 Hz and 16 Hz is calculated and then compared.

步骤S240,在目标频率低于预设的第二频率时,将脑电信号片段中目标频率处的功率值与预设的第二目标功率值进行比较,在脑电信号片段中目标频率处的功率值低于第二目标功率值时,判定用户所处的睡眠分期为快速眼动期。Step S240, when the target frequency is lower than the preset second frequency, compare the power value at the target frequency in the EEG signal segment with the preset second target power value, and the power value at the target frequency in the EEG signal segment When the power value is lower than the second target power value, it is determined that the sleep stage of the user is the rapid eye movement stage.

本实施例中,对于第二频率不进行限制,例如可以是4-10Hz中的任一频率。In this embodiment, there is no limitation on the second frequency, for example, it may be any frequency in 4-10 Hz.

此处,第二目标功率值的设置方式有:Here, the setting methods of the second target power value are:

(1)将第二目标功率值设置为固定值。(1) Setting the second target power value as a fixed value.

本实施例中,固定值可以通过实验预先测定。In this embodiment, the fixed value can be determined in advance through experiments.

(2)根据用户的多个脑电信号片段中目标频率处的功率值的均值,设置第二目标功率值。(2) Set the second target power value according to the mean value of the power values at the target frequency in the multiple EEG signal segments of the user.

本实施例中,例如,目标功率为2Hz时,则可以根据用户的多个脑电信号片段中2Hz处的功率值的均值,设置第二目标功率值,目标功率为3Hz时,则可以根据用户的多个脑电信号片段中3Hz处的功率值的均值,设置第二目标功率值,目标功率为4Hz时,则可以根据用户的多个脑电信号片段中4Hz处的功率值的均值,设置第二目标功率值,目标功率为2Hz、3Hz、4Hz三个频率时,则可以根据用户的多个脑电信号片段中2Hz、3Hz、4Hz处的功率值之和的均值,设置第二目标功率值。In this embodiment, for example, when the target power is 2Hz, the second target power value can be set according to the average value of the power values at 2Hz in the user's multiple EEG signal segments; when the target power is 3Hz, then the second target power value can be set according to the user The average value of the power values at 3Hz in the multiple EEG signal segments of the user, and set the second target power value. When the target power is 4Hz, it can be set according to the average value of the power values at 4Hz in the multiple EEG signal segments of the user. The second target power value, when the target power is three frequencies of 2Hz, 3Hz, and 4Hz, the second target power can be set according to the average value of the sum of the power values at 2Hz, 3Hz, and 4Hz in multiple EEG signal segments of the user value.

(3)在低于第二频率的目标频率为多个时,根据用户的多个脑电信号片段中多个目标频率处的功率值之和的预设幅度置信区间的下界,设置第二目标功率值。(3) When there are multiple target frequencies lower than the second frequency, set the second target according to the lower bound of the preset amplitude confidence interval of the sum of the power values at multiple target frequencies in multiple EEG signal segments of the user power value.

本实施例中,对预设幅度不进行限制,例如,可以取用户多个脑电信号片段的2Hz、3Hz、4Hz处功率值之和的95%置信区间的下界。In this embodiment, the preset amplitude is not limited. For example, the lower bound of the 95% confidence interval of the sum of the power values at 2Hz, 3Hz, and 4Hz of multiple EEG signal segments of the user may be taken.

在低于第二频率的目标频率为多个时,还需要计算脑电信号片段中多个目标频率处的功率值之和,再与第二目标功率值进行比较。When there are multiple target frequencies lower than the second frequency, it is also necessary to calculate the sum of the power values at multiple target frequencies in the EEG signal segment, and then compare it with the second target power value.

本实施例中,例如,计算用户脑电信号片段在2Hz、3Hz、4Hz处的功率值之和后再进行比较。In this embodiment, for example, the sum of the power values at 2 Hz, 3 Hz, and 4 Hz of the user's EEG signal segments is calculated and then compared.

步骤S250,在用户所处的睡眠分期非清醒期或快速眼动期时,基于预设的机器学习算法对脑电信号片段进行处理,确定用户所处的睡眠分期是否为深睡期或浅睡期。Step S250, when the user's sleep stage is non-awake or rapid eye movement stage, based on the preset machine learning algorithm, the EEG signal segment is processed to determine whether the user's sleep stage is deep sleep or light sleep Expect.

本实施例的一个具体实施方式如图3所示:A specific implementation of this embodiment is shown in Figure 3:

步骤1:通过脑电设备实时采集睡眠脑电信号,并每隔30秒获取一次睡眠脑电数据,储存为数据片段S(S是随时间变化的电压数据)。时长设置为30秒,是因为经典睡眠脑电的分割方式是以30秒为基本单位。片段过长将导致分割较为粗糙,精细程度不足;片段过短则将导致每次判断基于的数据量不足,影响判断准确性。Step 1: Collect sleep EEG signals in real time through EEG equipment, and acquire sleep EEG data every 30 seconds, and store them as data segments S (S is voltage data that changes with time). The duration is set to 30 seconds because the classic sleep EEG segmentation method uses 30 seconds as the basic unit. If the segment is too long, the segmentation will be rough and the fineness is insufficient; if the segment is too short, the amount of data based on each judgment will be insufficient, which will affect the accuracy of the judgment.

步骤2:对当前片段的脑电信号S进行带通滤波,只保留频率范围在1~20Hz内的数据,而将此范围以外的频率成分剔除,得到滤波后数据S’。此步骤是脑电数据预处理的固定流程,目的是去除整体大波动(通常由出汗等原因引起的皮肤电阻值缓慢变化而导致)或高频无关信号(例如工频噪声、不能反映脑电活动的高频成分)的干扰,便于后续提取有价值的脑电特征信息。本步骤采用的带通滤波器是FIR(有限长单位冲激响应,Finite ImpulseResponse)滤波器,是脑电信号预处理领域常用的滤波方式。Step 2: Perform band-pass filtering on the EEG signal S of the current segment, and only keep data within the frequency range of 1-20 Hz, and remove frequency components outside this range to obtain filtered data S'. This step is a fixed process of EEG data preprocessing, the purpose is to remove the overall large fluctuations (usually caused by slow changes in skin resistance caused by sweating and other reasons) or high-frequency irrelevant signals (such as power frequency noise, which cannot reflect EEG The interference of high-frequency components of activities) facilitates the subsequent extraction of valuable EEG feature information. The bandpass filter used in this step is an FIR (Finite Impulse Response) filter, which is a commonly used filtering method in the field of EEG signal preprocessing.

滤波是指通过傅里叶变换或小波变换等方式,将原始数据的特定频率成分保留或剔除的计算过程。带通滤波是指在滤波运算中,保留一段频率区间(例如:1~40Hz)内的成分,而将其余频段的成分剔除。Filtering refers to the calculation process of retaining or eliminating specific frequency components of the original data by means of Fourier transform or wavelet transform. Band-pass filtering refers to retaining components in a frequency range (for example: 1-40 Hz) and removing components in other frequency bands in the filtering operation.

步骤3:计算滤波后数据S’在特定频率F(取值为2、3、4、12、16Hz)处的功率值,分别记为P2、P3、P4、P12、P16。Step 3: Calculate the power values of the filtered data S' at specific frequencies F (values of 2, 3, 4, 12, and 16 Hz), which are respectively recorded as P2, P3, P4, P12, and P16.

步骤4:判断当前片段的P16是否大于阈值L1(L1根据预先实验测定,是清醒期脑电在16Hz处的功率值下限),若大于,则判断当前片段为清醒期,否则进入下一步骤。Step 4: Determine whether the P16 of the current segment is greater than the threshold L1 (L1 is determined according to the pre-experiment, which is the lower limit of the power value of the EEG in the awake period at 16 Hz), if greater, then determine that the current segment is in the awake period, otherwise enter the next step.

步骤5:判断当前片段的P12是否大于阈值L2(L2根据预先实验测定,是清醒期脑电在12Hz处的功率值下限),若大于,则判断当前片段为清醒期,否则进入下一步骤。Step 5: Determine whether the P12 of the current segment is greater than the threshold L2 (L2 is determined according to the pre-experiment, which is the lower limit of the power value of the EEG in the waking period at 12 Hz), if greater, then determine that the current segment is in the waking period, otherwise enter the next step.

步骤6:判断当前片段的P2、P3、P4之和是否小于阈值L3(L3根据预先实验测定,是REM期脑电的P2、P3、P4之和的功率值上限),若小于,则判断当前片段为REM期,否则进入下一步骤。Step 6: Judging whether the sum of P2, P3, and P4 of the current segment is less than the threshold value L3 (L3 is determined according to the pre-experiment, and is the upper limit of the power value of the sum of P2, P3, and P4 of the EEG in the REM period), if less than, then judge the current The segment is in the REM period, otherwise go to the next step.

步骤7:将当前片段S’输入机器学习算法,进行“深睡、浅睡”二分类判断。若机器学习算法判断当前片段为浅睡期,则将当前片段标记为“浅睡期”,否则,将当前片段标记为“深睡期”。Step 7: Input the current segment S' into the machine learning algorithm to make a two-category judgment of "deep sleep, light sleep". If the machine learning algorithm judges that the current segment is a light sleep period, the current segment is marked as a "light sleep period", otherwise, the current segment is marked as a "deep sleep period".

步骤8:输出并汇总当前片段的睡眠分期结果。Step 8: Output and summarize the sleep staging results of the current segment.

步骤9:将所有片段的睡眠分期结果汇总,得到整夜的睡眠分期数据。Step 9: Summarize the sleep staging results of all segments to obtain the sleep staging data of the whole night.

本实施例的一个具体实施方式如图4所示:A specific implementation of this embodiment is shown in Figure 4:

步骤1:通过脑电设备实时采集睡眠脑电信号,并每隔30秒获取一次睡眠脑电数据,储存为数据片段S(S是随时间变化的电压数据)。时长设置为30秒,是因为经典睡眠脑电的分割方式是以30秒为基本单位。片段过长将导致分割较为粗糙,精细程度不足;片段过短则将导致每次判断基于的数据量不足,影响判断准确性。Step 1: Collect sleep EEG signals in real time through EEG equipment, and acquire sleep EEG data every 30 seconds, and store them as data segments S (S is voltage data that changes with time). The duration is set to 30 seconds because the classic sleep EEG segmentation method uses 30 seconds as the basic unit. If the segment is too long, the segmentation will be rough and the fineness is insufficient; if the segment is too short, the amount of data based on each judgment will be insufficient, which will affect the accuracy of the judgment.

步骤2:对当前片段的脑电信号S进行带通滤波,只保留频率范围在1~20Hz内的数据,而将此范围以外的频率成分剔除,得到滤波后数据S’。此步骤是脑电数据预处理的固定流程,目的是去除整体大波动(通常由出汗等原因引起的皮肤电阻值缓慢变化而导致)或高频无关信号(例如工频噪声、不能反映脑电活动的高频成分)的干扰,便于后续提取有价值的脑电特征信息。本步骤采用的带通滤波器是FIR(有限长单位冲激响应,Finite ImpulseResponse)滤波器,是脑电信号预处理领域常用的滤波方式。Step 2: Perform band-pass filtering on the EEG signal S of the current segment, and only keep data within the frequency range of 1-20 Hz, and remove frequency components outside this range to obtain filtered data S'. This step is a fixed process of EEG data preprocessing, the purpose is to remove the overall large fluctuations (usually caused by slow changes in skin resistance caused by sweating and other reasons) or high-frequency irrelevant signals (such as power frequency noise, which cannot reflect EEG The interference of high-frequency components of activities) facilitates the subsequent extraction of valuable EEG feature information. The bandpass filter used in this step is an FIR (Finite Impulse Response) filter, which is a commonly used filtering method in the field of EEG signal preprocessing.

步骤3:计算滤波后数据S’在特定频率F(取值为2、3、4、12、16Hz)处的功率值,分别记为P2、P3、P4、P12、P16。Step 3: Calculate the power values of the filtered data S' at specific frequencies F (values of 2, 3, 4, 12, and 16 Hz), which are respectively recorded as P2, P3, P4, P12, and P16.

步骤4:判断当前片段的P16是否大于所有片段P16的均值,若大于,则判断当前片段为清醒期,否则进入下一步骤。Step 4: Judging whether the P16 of the current segment is greater than the average value of P16 of all segments, if greater, then judging that the current segment is in the awake period, otherwise proceed to the next step.

步骤5:判断当前片段的P12是否大于所有片段P12的均值,若大于,则判断当前片段为清醒期,否则进入下一步骤。Step 5: Judging whether the P12 of the current segment is greater than the average value of P12 of all segments, if greater, then judging that the current segment is in the awake period, otherwise proceed to the next step.

步骤6:判断当前片段的P2、P3、P4之和是否小于所有片段的P2、P3、P4之和的95%置信区间(左尾)的下界M,若小于,则判断当前片段为REM期,否则进入下一步骤。95%置信区间(左尾)下界M的计算方法为:假设一共有n个睡眠片段,则这些片段的P2、P3、P4之和也有n个(记为A1、A2、……An,统称为集合A),集合A的元素服从t分布,计算该t分布的左尾95%置信区间的下界,即为M的取值。Step 6: judge whether the sum of P2, P3, and P4 of the current segment is less than the lower bound M of the 95% confidence interval (left tail) of the sum of P2, P3, and P4 of all segments, if less than, then judge that the current segment is the REM period, Otherwise go to the next step. The calculation method of the lower bound M of the 95% confidence interval (left tail) is: assuming that there are n sleep segments in total, the sum of P2, P3, and P4 of these segments also has n (recorded as A1, A2, ... An, collectively referred to as Set A), the elements of set A obey the t distribution, and calculate the lower bound of the 95% confidence interval of the left tail of the t distribution, which is the value of M.

步骤7:将当前片段S’输入机器学习算法,进行“深睡、浅睡”二分类判断。若机器学习算法判断当前片段为浅睡期,则将当前片段标记为“浅睡期”,否则,将当前片段标记为“深睡期”。Step 7: Input the current segment S' into the machine learning algorithm to make a two-category judgment of "deep sleep, light sleep". If the machine learning algorithm judges that the current segment is a light sleep period, the current segment is marked as a "light sleep period", otherwise, the current segment is marked as a "deep sleep period".

步骤8:输出并汇总当前片段的睡眠分期结果。Step 8: Output and summarize the sleep staging results of the current segment.

步骤9:将所有片段的睡眠分期结果汇总,得到整夜的睡眠分期数据。Step 9: Summarize the sleep staging results of all segments to obtain the sleep staging data of the whole night.

本实施例的技术方案,将基于先验知识的阈值分类法和机器学习结合,充分利用已知能够有效判断睡眠觉醒期和REM期的先验知识,将原本的四分类问题简化为二分类,可进一步提升后续机器学习算法的判断准确度,从而提升整体判断准确度;通过灵活设置功率阈值,将功率阈值设置为固定值或基于群体统计的数值,可以实现对睡眠分期的实时判断或事后判断,前者可将服务器运算压力均摊到睡眠期间,从而避免第二天上午大量用户集中提出运算需求,造成计算挤兑甚至服务器宕机等情况,后者适用于对睡眠数据进行后期研究分析,方便研究人员进行算法优化操作。In the technical solution of this embodiment, the threshold classification method based on prior knowledge is combined with machine learning, and the prior knowledge known to be able to effectively determine the sleep awakening period and the REM period is fully utilized to simplify the original four-category problem into two categories. It can further improve the judgment accuracy of the follow-up machine learning algorithm, thereby improving the overall judgment accuracy; by flexibly setting the power threshold, setting the power threshold to a fixed value or a value based on group statistics, real-time judgment or post-event judgment of sleep stages can be realized , the former can spread the computing pressure of the server evenly during the sleep period, so as to avoid a large number of users concentrating on computing demands in the next morning, resulting in a computing run and even server downtime, etc. The latter is suitable for later research and analysis of sleep data, which is convenient for researchers Perform algorithm optimization operations.

如图5所示,本发明的一个实施例中提供了一种睡眠分期识别装置,装置包括:As shown in Figure 5, an embodiment of the present invention provides a sleep stage identification device, the device includes:

脑电获取模块510,获取用户的脑电信号片段。The EEG acquisition module 510 acquires segments of the user's EEG signals.

在本实施例中,对脑电信号片段的时间长度不进行限制,可以是30秒或其他时长。脑电信号是通过电极在头皮表面采集到的电压信号,可反映大脑神经细胞的群体电活动,常用于大脑功能研究。In this embodiment, the time length of the EEG signal segment is not limited, and may be 30 seconds or other time lengths. EEG signals are voltage signals collected on the surface of the scalp through electrodes, which can reflect the group electrical activity of brain nerve cells and are often used in brain function research.

功率计算模块520,计算脑电信号片段中目标频率处的功率值。The power calculation module 520 calculates the power value at the target frequency in the EEG signal segment.

在本实施例中,对目标频率不进行限制。根据先验知识,用户处于清醒期时,脑电信号中12-16Hz处的功率值处于较高水平,而用户处于REM期时,脑电信号中2-4Hz处的功率值处于较低水平,所以本实施例中,目标频率可以在2-4Hz、12-16Hz中取一个或多个值。通常将睡眠分为4个阶段:清醒期、浅睡期、深睡期、REM(快速眼动)期,不同的睡眠分期对应了不同的生理(脑电、心电、肌电,等等)特征,也与不同的大脑功能(如:记忆的巩固)有关联。REM期是快速眼动(Rapid-Eye-Movement)期的简称,处于REM期的睡眠者的特征表现为眼球快速运动,从而与浅睡、深睡阶段区分开来,学界通常认为睡眠者往往在REM期间做梦。In this embodiment, no limitation is imposed on the target frequency. According to prior knowledge, when the user is in the awake period, the power value at 12-16Hz in the EEG signal is at a high level, and when the user is in the REM period, the power value at 2-4Hz in the EEG signal is at a low level. Therefore, in this embodiment, the target frequency can take one or more values in 2-4 Hz and 12-16 Hz. Sleep is usually divided into 4 stages: awake period, light sleep period, deep sleep period, REM (rapid eye movement) period, different sleep stages correspond to different physiology (brain electricity, heart electricity, myoelectricity, etc.) traits, and are also associated with different brain functions such as memory consolidation. The REM period is short for Rapid-Eye-Movement period. Sleepers in the REM period are characterized by rapid eye movement, which can be distinguished from light sleep and deep sleep. The academic circles generally believe that sleepers tend to sleep during sleep. Dreaming during REM.

分期识别模块530,根据脑电信号片段中目标频率处的功率值的大小,识别用户所处的睡眠分期是否为清醒期或快速眼动期。The stage recognition module 530, according to the magnitude of the power value at the target frequency in the EEG signal segment, identifies whether the sleep stage of the user is the awake stage or the rapid eye movement stage.

根据本实施例的技术方案,由于用户处于清醒期或快速眼动期时,其脑电信号中特定频率处的功率值会显著过高或过低,所以本实施例在获取用户脑电信号片段后,对脑电信号片段中特定频率处的功率值进行计算,根据特定频率处的功率值大小能够准确识别用户是否处于清醒期或快速眼动期,该过程计算复杂度低且分期准确率高,在通过该过程确定用户并未处于清醒期或快速眼动期时,再使用机器学习算法对脑电信号片段进行处理,确定用户处于深睡期还是浅睡期,由于机器学习算法仅需对针对深睡期、浅睡期两种分期进行识别,所以计算复杂度较现有技术显著下降,同时保持高分期识别准确率。According to the technical solution of this embodiment, since the power value at a specific frequency in the user's EEG signal will be significantly too high or too low when the user is in the waking period or the rapid eye movement period, so this embodiment obtains the user's EEG signal segment Finally, calculate the power value at a specific frequency in the EEG signal segment. According to the power value at a specific frequency, it can accurately identify whether the user is in the awake period or the rapid eye movement period. This process has low computational complexity and high staging accuracy. , when it is determined through this process that the user is not in the awake period or the rapid eye movement period, the machine learning algorithm is used to process the EEG signal fragments to determine whether the user is in the deep sleep period or the light sleep period. Since the machine learning algorithm only needs to The two stages of deep sleep and light sleep are identified, so the computational complexity is significantly reduced compared with the existing technology, while maintaining a high accuracy of stage recognition.

本发明的一个实施例中提供了一种睡眠分期识别装置,装置包括:An embodiment of the present invention provides a sleep stage identification device, the device includes:

脑电获取模块510,获取用户的脑电信号片段。The EEG acquisition module 510 acquires segments of the user's EEG signals.

本实施例中,可以通过脑电设备实时采集睡眠脑电信号。In this embodiment, the sleep EEG signal can be collected in real time by the EEG device.

功率计算模块520,计算脑电信号片段中目标频率处的功率值。The power calculation module 520 calculates the power value at the target frequency in the EEG signal segment.

分期识别模块530,在目标频率高于预设的第一频率时,将脑电信号片段中目标频率处的功率值与预设的第一目标功率值进行比较,在脑电信号片段中目标频率处的功率值高于第一目标功率值时,判定用户所处的睡眠分期为清醒期。The stage identification module 530, when the target frequency is higher than the preset first frequency, compares the power value at the target frequency in the EEG signal segment with the preset first target power value, and the target frequency in the EEG signal segment is When the power value at is higher than the first target power value, it is determined that the sleep stage that the user is in is the awake stage.

本实施例中,对于第一频率不进行限制,例如可以是10-12Hz中的任一频率。In this embodiment, there is no limitation on the first frequency, for example, it may be any frequency in 10-12 Hz.

此处,第一目标功率值的设置方式有:Here, the setting methods of the first target power value are:

(1)将第一目标功率值设置为固定值。(1) Setting the first target power value as a fixed value.

本实施例中,固定值可以通过实验预先测定。In this embodiment, the fixed value can be determined in advance through experiments.

(2)根据用户的多个脑电信号片段中目标频率处的功率值的均值,设置第一目标功率值。(2) Set the first target power value according to the mean value of the power values at the target frequency in the multiple EEG signal segments of the user.

本实施例中,例如,目标功率为12Hz时,则可以根据用户的多个脑电信号片段中12Hz处的功率值的均值,设置第一目标功率值,目标功率为16Hz时,则可以根据用户的多个脑电信号片段中16Hz处的功率值的均值,设置第一目标功率值,目标功率为12Hz、16Hz两个频率时,则可以根据用户的多个脑电信号片段中12Hz、16Hz处的功率值之和的均值,设置第一目标功率值。In this embodiment, for example, when the target power is 12Hz, the first target power value can be set according to the mean value of the power values at 12Hz in multiple EEG signal segments of the user; when the target power is 16Hz, the first target power value can be set according to the user The average value of the power values at 16Hz in the multiple EEG signal segments of the user is used to set the first target power value. When the target power is two frequencies of 12Hz and 16Hz, it can The average value of the sum of the power values is set as the first target power value.

(3)在高于第一频率的目标频率为多个时,根据用户的多个脑电信号片段中多个目标频率处的功率值之和的预设幅度置信区间的上界,设置第一目标功率值。(3) When there are multiple target frequencies higher than the first frequency, according to the upper bound of the preset amplitude confidence interval of the sum of the power values at multiple target frequencies in multiple EEG signal segments of the user, set the first Target power value.

本实施例中,对预设幅度不进行限制,例如,可以取用户多个脑电信号片段的12Hz、16Hz处功率值之和的95%置信区间的上界。In this embodiment, there is no limit to the preset amplitude. For example, the upper bound of the 95% confidence interval of the sum of the power values at 12 Hz and 16 Hz of multiple EEG signal segments of the user may be taken.

在高于第一频率的目标频率为多个时,还需要计算脑电信号片段中多个目标频率处的功率值之和,再与第一目标功率值进行比较。When there are multiple target frequencies higher than the first frequency, it is also necessary to calculate the sum of the power values at multiple target frequencies in the EEG signal segment, and then compare it with the first target power value.

本实施例中,例如,计算用户脑电信号片段在12Hz、16Hz处的功率值之和后再进行比较。In this embodiment, for example, the sum of the power values of the user's EEG signal segments at 12 Hz and 16 Hz is calculated and then compared.

分期识别模块530在目标频率低于预设的第二频率时,将脑电信号片段中目标频率处的功率值与预设的第二目标功率值进行比较,在脑电信号片段中目标频率处的功率值低于第二目标功率值时,判定用户所处的睡眠分期为快速眼动期。The stage recognition module 530 compares the power value at the target frequency in the EEG signal segment with the preset second target power value when the target frequency is lower than the preset second frequency, and the target frequency in the EEG signal segment is When the power value of is lower than the second target power value, it is determined that the sleep stage of the user is the rapid eye movement stage.

本实施例中,对于第二频率不进行限制,例如可以是4-10Hz中的任一频率。In this embodiment, there is no limitation on the second frequency, for example, it may be any frequency in 4-10 Hz.

此处,第二目标功率值的设置方式有:Here, the setting methods of the second target power value are:

(1)将第二目标功率值设置为固定值。(1) Setting the second target power value as a fixed value.

本实施例中,固定值可以通过实验预先测定。In this embodiment, the fixed value can be determined in advance through experiments.

(2)根据用户的多个脑电信号片段中目标频率处的功率值的均值,设置第二目标功率值。(2) Set the second target power value according to the mean value of the power values at the target frequency in the multiple EEG signal segments of the user.

本实施例中,例如,目标功率为2Hz时,则可以根据用户的多个脑电信号片段中2Hz处的功率值的均值,设置第二目标功率值,目标功率为3Hz时,则可以根据用户的多个脑电信号片段中3Hz处的功率值的均值,设置第二目标功率值,目标功率为4Hz时,则可以根据用户的多个脑电信号片段中4Hz处的功率值的均值,设置第二目标功率值,目标功率为2Hz、3Hz、4Hz三个频率时,则可以根据用户的多个脑电信号片段中2Hz、3Hz、4Hz处的功率值之和的均值,设置第二目标功率值。In this embodiment, for example, when the target power is 2Hz, the second target power value can be set according to the average value of the power values at 2Hz in the user's multiple EEG signal segments; when the target power is 3Hz, then the second target power value can be set according to the user The average value of the power values at 3Hz in the multiple EEG signal segments of the user, and set the second target power value. When the target power is 4Hz, it can be set according to the average value of the power values at 4Hz in the multiple EEG signal segments of the user. The second target power value, when the target power is three frequencies of 2Hz, 3Hz, and 4Hz, the second target power can be set according to the average value of the sum of the power values at 2Hz, 3Hz, and 4Hz in multiple EEG signal segments of the user value.

(3)在低于第二频率的目标频率为多个时,根据用户的多个脑电信号片段中多个目标频率处的功率值之和的预设幅度置信区间的下界,设置第二目标功率值。(3) When there are multiple target frequencies lower than the second frequency, set the second target according to the lower bound of the preset amplitude confidence interval of the sum of the power values at multiple target frequencies in multiple EEG signal segments of the user power value.

本实施例中,对预设幅度不进行限制,例如,可以取用户多个脑电信号片段的2Hz、3Hz、4Hz处功率值之和的95%置信区间的下界。In this embodiment, the preset amplitude is not limited. For example, the lower bound of the 95% confidence interval of the sum of the power values at 2Hz, 3Hz, and 4Hz of multiple EEG signal segments of the user may be taken.

在低于第二频率的目标频率为多个时,还需要计算脑电信号片段中多个目标频率处的功率值之和,再与第二目标功率值进行比较。When there are multiple target frequencies lower than the second frequency, it is also necessary to calculate the sum of the power values at multiple target frequencies in the EEG signal segment, and then compare it with the second target power value.

本实施例中,例如,计算用户脑电信号片段在2Hz、3Hz、4Hz处的功率值之和后再进行比较。In this embodiment, for example, the sum of the power values at 2 Hz, 3 Hz, and 4 Hz of the user's EEG signal segments is calculated and then compared.

分期识别模块530在用户所处的睡眠分期非清醒期或快速眼动期时,基于预设的机器学习算法对脑电信号片段进行处理,确定用户所处的睡眠分期是否为深睡期或浅睡期。The stage identification module 530 processes the EEG signal segments based on the preset machine learning algorithm when the user is in the sleep stage of non-awake stage or rapid eye movement stage, and determines whether the user's sleep stage is deep sleep stage or light sleep stage. sleep period.

本实施例的技术方案,将基于先验知识的阈值分类法和机器学习结合,充分利用已知能够有效判断睡眠觉醒期和REM期的先验知识,将原本的四分类问题简化为二分类,可进一步提升后续机器学习算法的判断准确度,从而提升整体判断准确度;通过灵活设置功率阈值,将功率阈值设置为固定值或基于群体统计的数值,可以实现对睡眠分期的实时判断或事后判断,前者可将服务器运算压力均摊到睡眠期间,从而避免第二天上午大量用户集中提出运算需求,造成计算挤兑甚至服务器宕机等情况,后者适用于对睡眠数据进行后期研究分析,方便研究人员进行算法优化操作。In the technical solution of this embodiment, the threshold classification method based on prior knowledge is combined with machine learning, and the prior knowledge known to be able to effectively determine the sleep awakening period and the REM period is fully utilized to simplify the original four-category problem into two categories. It can further improve the judgment accuracy of the follow-up machine learning algorithm, thereby improving the overall judgment accuracy; by flexibly setting the power threshold, setting the power threshold to a fixed value or a value based on group statistics, real-time judgment or post-event judgment of sleep stages can be realized , the former can spread the computing pressure of the server evenly during the sleep period, so as to avoid a large number of users concentrating on computing demands in the next morning, resulting in a computing run and even server downtime, etc. The latter is suitable for later research and analysis of sleep data, which is convenient for researchers Perform algorithm optimization operations.

本发明还提供了一种计算机可读存储介质。在根据本发明的一个计算机可读存储介质实施例中,计算机可读存储介质可以被配置成存储执行上述方法实施例的睡眠分期识别方法的程序,该程序可以由处理器加载并运行以实现上述睡眠分期识别方法。为了便于说明,仅示出了与本发明实施例相关的部分,具体技术细节未揭示的,请参照本发明实施例方法部分。该计算机可读存储介质可以是包括各种电子设备形成的存储装置设备,可选的,本发明实施例中计算机可读存储介质是非暂时性的计算机可读存储介质。The present invention also provides a computer-readable storage medium. In an embodiment of a computer-readable storage medium according to the present invention, the computer-readable storage medium may be configured to store a program for executing the sleep stage identification method of the above-mentioned method embodiment, and the program may be loaded and run by a processor to realize the above-mentioned Sleep stage recognition method. For ease of description, only the parts related to the embodiments of the present invention are shown, and for specific technical details not disclosed, please refer to the method part of the embodiments of the present invention. The computer-readable storage medium may be a storage device formed by various electronic devices. Optionally, the computer-readable storage medium in this embodiment of the present invention is a non-transitory computer-readable storage medium.

在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。The algorithms and displays presented herein are not inherently related to any particular computer, virtual system, or other device. Various generic systems can also be used with the teachings based on this. The structure required to construct such a system is apparent from the above description. Furthermore, the present invention is not specific to any particular programming language. It should be understood that various programming languages can be used to implement the content of the present invention described herein, and the above description of specific languages is for disclosing the best mode of the present invention.

在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure the understanding of this description.

类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, in order to streamline this disclosure and to facilitate an understanding of one or more of the various inventive aspects, various features of the invention are sometimes grouped together in a single embodiment, figure, or its description. This method of disclosure, however, is not to be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the Detailed Description are hereby expressly incorporated into this Detailed Description, with each claim standing on its own as a separate embodiment of this invention.

本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art can understand that the modules in the device in the embodiment can be adaptively changed and arranged in one or more devices different from the embodiment. Modules or units or components in the embodiments may be combined into one module or unit or component, and furthermore may be divided into a plurality of sub-modules or sub-units or sub-assemblies. All features disclosed in this specification (including accompanying claims, abstract and drawings) and any method or method so disclosed may be used in any combination, except that at least some of such features and/or processes or units are mutually exclusive. All processes or units of equipment are combined. Each feature disclosed in this specification (including accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.

此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。Furthermore, those skilled in the art will understand that although some embodiments described herein include some features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the invention. and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.

本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的移动终端的处理装置中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) may be used in practice to implement some or all functions of some or all components in the processing device of the mobile terminal according to the embodiments of the present invention. The present invention can also be implemented as an apparatus or an apparatus program (for example, a computer program and a computer program product) for performing a part or all of the methods described herein. Such a program for realizing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet site, or provided on a carrier signal, or provided in any other form.

应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means can be embodied by one and the same item of hardware. The use of the words first, second, and third, etc. does not indicate any order. These words can be interpreted as names.

Claims (10)

CN202310265649.5A2023-03-202023-03-20Sleep stage identification method, apparatus and computer readable storage mediumPendingCN116548982A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202310265649.5ACN116548982A (en)2023-03-202023-03-20Sleep stage identification method, apparatus and computer readable storage medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202310265649.5ACN116548982A (en)2023-03-202023-03-20Sleep stage identification method, apparatus and computer readable storage medium

Publications (1)

Publication NumberPublication Date
CN116548982Atrue CN116548982A (en)2023-08-08

Family

ID=87502642

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202310265649.5APendingCN116548982A (en)2023-03-202023-03-20Sleep stage identification method, apparatus and computer readable storage medium

Country Status (1)

CountryLink
CN (1)CN116548982A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN120257176A (en)*2025-05-302025-07-04浙大城市学院 A method, system and storage medium for automated sleep staging of rodents

Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20070016095A1 (en)*2005-05-102007-01-18Low Philip SAutomated detection of sleep and waking states
CN105105714A (en)*2015-08-262015-12-02吴建平Sleep period separating method and system
CN105942974A (en)*2016-04-142016-09-21禅客科技(上海)有限公司Sleep analysis method and system based on low frequency electroencephalogram
CN109044280A (en)*2018-08-202018-12-21深圳和而泰数据资源与云技术有限公司A kind of sleep stage method and relevant device
CN115281686A (en)*2022-07-182022-11-04上海数药智能科技有限公司Sleep stage identification method and device and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20070016095A1 (en)*2005-05-102007-01-18Low Philip SAutomated detection of sleep and waking states
CN105105714A (en)*2015-08-262015-12-02吴建平Sleep period separating method and system
CN105942974A (en)*2016-04-142016-09-21禅客科技(上海)有限公司Sleep analysis method and system based on low frequency electroencephalogram
CN109044280A (en)*2018-08-202018-12-21深圳和而泰数据资源与云技术有限公司A kind of sleep stage method and relevant device
CN115281686A (en)*2022-07-182022-11-04上海数药智能科技有限公司Sleep stage identification method and device and computer readable storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN120257176A (en)*2025-05-302025-07-04浙大城市学院 A method, system and storage medium for automated sleep staging of rodents

Similar Documents

PublicationPublication DateTitle
CN110070105B (en)Electroencephalogram emotion recognition method and system based on meta-learning example rapid screening
US20200367800A1 (en)Method for identifying driving fatigue based on cnn-lstm deep learning model
CN101474070B (en) A method for removing oculograph artifacts in EEG signals
CN105894039A (en)Emotion recognition modeling method, emotion recognition method and apparatus, and intelligent device
CN111803065B (en)Dangerous traffic scene identification method and system based on electroencephalogram data
CN107361765B (en)Brain wave analysis method and device
CN106128032A (en)A kind of fatigue state monitoring and method for early warning and system thereof
CN110215206A (en)Stereoscopic display visual fatigue evaluation method, system, device based on EEG signals
CN114469138B (en) Detection method, system and medium of EEG burst suppression mode based on time-frequency domain
CN106580350A (en)Fatigue condition monitoring method and device
CN116548982A (en)Sleep stage identification method, apparatus and computer readable storage medium
CN113974653A (en)Optimized spike detection method and device based on Joyston index, storage medium and terminal
CN109953757A (en) Real-time monitoring method of mental load for continuous tracking control and shooting tasks
CN116636859A (en)Evaluation method and system for visual cognition capability based on electroencephalogram signals
CN119830140A (en)Hierarchical depression emotion state early warning method and system based on brain-computer interface technology
Saranya et al.An Explainable Machine Learning Network for Classification of Autism Spectrum Disorder using Optimal Frequency Band Identification from Brain EEG
CN115281686A (en)Sleep stage identification method and device and computer readable storage medium
CN116491909B (en)Sleep dynamics characterization method based on amplitude modulation multi-scale entropy
CN111990991A (en) A method and application of EEG signal analysis based on complex network
CN114366101B (en)Motor imagery electroencephalogram signal classification method, device, equipment and storage medium
CN111671419A (en) A method and system for early detection and recognition of epilepsy based on EEG signals
CN118806295A (en) Method and device for localizing and analyzing brain power source of the influence of emotions on decision-making
CN109117787A (en)A kind of emotion EEG signal identification method and system
Gao et al.Multi-head self-attention enhanced convolutional neural network for driver fatigue detection using eeg signals
Coyle et al.Creating a nonparametric brain-computer interface with neural time-series prediction preprocessing

Legal Events

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

[8]ページ先頭

©2009-2025 Movatter.jp