CN116763255A - Offline sleep slow wave detection system - Google Patents

Offline sleep slow wave detection system Download PDF

Info

Publication number
CN116763255A
CN116763255A CN202310713137.0A CN202310713137A CN116763255A CN 116763255 A CN116763255 A CN 116763255A CN 202310713137 A CN202310713137 A CN 202310713137A CN 116763255 A CN116763255 A CN 116763255A
Authority
CN
China
Prior art keywords
sleep
slow wave
electroencephalogram
module
covariance matrix
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
CN202310713137.0A
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.)
Xidian University
Original Assignee
Xidian 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 Xidian University filed Critical Xidian University
Priority to CN202310713137.0A priority Critical patent/CN116763255A/en
Publication of CN116763255A publication Critical patent/CN116763255A/en
Pending legal-status Critical Current

Links

Classifications

    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/48Other medical applications
    • A61B5/4806Sleep evaluation
    • A61B5/4809Sleep detection, i.e. determining whether a subject is asleep or not
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/24Detecting, measuring or recording bioelectric or biomagnetic signals of the body or parts thereof
    • A61B5/316Modalities, i.e. specific diagnostic methods
    • A61B5/369Electroencephalography [EEG]
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/24Detecting, measuring or recording bioelectric or biomagnetic signals of the body or parts thereof
    • A61B5/316Modalities, i.e. specific diagnostic methods
    • A61B5/389Electromyography [EMG]
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/24Detecting, measuring or recording bioelectric or biomagnetic signals of the body or parts thereof
    • A61B5/316Modalities, i.e. specific diagnostic methods
    • A61B5/398Electrooculography [EOG], e.g. detecting nystagmus; Electroretinography [ERG]
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/48Other medical applications
    • A61B5/4806Sleep evaluation
    • A61B5/4812Detecting sleep stages or cycles
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/48Other medical applications
    • A61B5/4806Sleep evaluation
    • A61B5/4815Sleep quality
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/72Signal processing specially adapted for physiological signals or for diagnostic purposes
    • A61B5/7203Signal processing specially adapted for physiological signals or for diagnostic purposes for noise prevention, reduction or removal
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/72Signal processing specially adapted for physiological signals or for diagnostic purposes
    • A61B5/7225Details of analog processing, e.g. isolation amplifier, gain or sensitivity adjustment, filtering, baseline or drift compensation
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/72Signal processing specially adapted for physiological signals or for diagnostic purposes
    • A61B5/7235Details of waveform analysis
    • A61B5/725Details of waveform analysis using specific filters therefor, e.g. Kalman or adaptive filters
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/72Signal processing specially adapted for physiological signals or for diagnostic purposes
    • A61B5/7235Details of waveform analysis
    • A61B5/7264Classification of physiological signals or data, e.g. using neural networks, statistical classifiers, expert systems or fuzzy systems
    • A61B5/7267Classification of physiological signals or data, e.g. using neural networks, statistical classifiers, expert systems or fuzzy systems involving training the classification device

Landscapes

  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Public Health (AREA)
  • Veterinary Medicine (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Heart & Thoracic Surgery (AREA)
  • Medical Informatics (AREA)
  • Molecular Biology (AREA)
  • Surgery (AREA)
  • Animal Behavior & Ethology (AREA)
  • General Health & Medical Sciences (AREA)
  • Pathology (AREA)
  • Signal Processing (AREA)
  • Artificial Intelligence (AREA)
  • Psychiatry (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physiology (AREA)
  • Ophthalmology & Optometry (AREA)
  • Anesthesiology (AREA)
  • Psychology (AREA)
  • Evolutionary Computation (AREA)
  • Fuzzy Systems (AREA)
  • Mathematical Physics (AREA)
  • Power Engineering (AREA)
  • Measurement And Recording Of Electrical Phenomena And Electrical Characteristics Of The Living Body (AREA)

Abstract

The invention discloses an off-line sleep slow wave detection system, which comprises: the sleep electroencephalogram acquisition module is used for acquiring and storing sleep electroencephalogram signals of a target to be detected and transmitting the sleep electroencephalogram signals to the data processing and visualizing module through the data transmission module; the data processing and visualizing module is used for processing the received sleep electroencephalogram signals, selecting specific sleep electroencephalogram signals in the processed sleep electroencephalogram signals, and detecting slow waves in the specific sleep electroencephalogram signals according to an improved matching pursuit algorithm realized based on a pre-constructed dictionary; according to the invention, the dictionary is constructed by limiting the basis function to the preset function similar to the sleep slow wave state, the dictionary and the matching pursuit algorithm are combined to finish the slow wave detection, and the detection process depends on the waveform instead of the hard amplitude index, so that the method is suitable for the crowd with lower amplitude, has wider application scene, can greatly reduce the labor cost, and has high sleep slow wave detection efficiency, accuracy and reliability.

Description

Offline sleep slow wave detection system
Technical Field
The invention belongs to the field of sleep slow wave detection, and particularly relates to an off-line sleep slow wave detection system.
Background
In sleep, slow wave sleep is one of the biggest nerve cooperation, the slow wave sleep proportion of normal adults is about 20% -25%, and the sleep device can help a human body to relieve fatigue, reform and memory of the brain and remove metabolic wastes in one day, protect brain health, is an important sleep stage for guaranteeing sleep quality, and is the most important sign of the slow wave sleep stage, and has decisive effects in numerous functions.
The slow wave is an important signal in the sleeping process, is one of important indexes for judging sleeping quality, and parameters such as frequency and amplitude of occurrence of the slow wave can reflect sleeping depth and sleeping quality of a human body, so that the detection of the sleeping slow wave can be used for evaluating sleeping quality; meanwhile, certain relation exists between the slow wave and the mental diseases, and diagnosis and treatment of the mental diseases can be assisted by detecting the sleep slow wave; in addition, the amplitude and the density of the sleep slow wave are also related to the occurrence of cerebral apoplexy, and the detection of the sleep slow wave can evaluate the risk of cerebral apoplexy and provide help for preventing and diagnosing cerebral apoplexy, so that the detection of the sleep slow wave has wide application value and significance.
The traditional sleep slow wave detection algorithm is an expert in the sleep field, and sleep brain electrical signals are observed by naked eyes and manually marked. Although the method is accurate, a large amount of time and labor cost are consumed, the method is a task with high cost, and the detection result has a certain error and insufficient robustness due to the influence of the subjectivity of an expert.
Currently, the sleep slow wave offline automatic detection algorithm on the market can be classified into one category, for example, chinese patent CN113907709a, which uses a method of filtering an electroencephalogram signal to a delta frequency band (0.3-4 Hz), then identifying zero crossings, peaks and valleys in the electroencephalogram signal, and detecting slow waves according to the standard of amplitude and the standard of duration. However, the method has the problems of narrow-band distortion, low accuracy of slow wave detection, easy false alarm omission, and inapplicability to people with low electroencephalogram signal amplitude, such as the old and the patients with mental diseases, due to the rigid standard of the algorithm based on amplitude.
Disclosure of Invention
In order to solve the problems in the prior art, the invention provides an off-line sleep slow wave detection system. The technical problems to be solved by the invention are realized by the following technical scheme:
An offline sleep slow wave detection system, comprising: a sleep electroencephalogram acquisition module, a data transmission module and a data processing and visualizing module, wherein,
the sleep electroencephalogram acquisition module is used for acquiring and storing sleep electroencephalogram signals of a target to be detected and transmitting the sleep electroencephalogram signals to the data processing and visualizing module through the data transmission module;
the data processing and visualizing module is used for processing the received sleep electroencephalogram signals, selecting specific sleep electroencephalogram signals in the processed sleep electroencephalogram signals, and detecting slow waves in the specific sleep electroencephalogram signals according to an improved matching pursuit algorithm realized based on a pre-constructed dictionary; wherein the basis functions of the pre-built dictionary are limited to preset functions similar to sleep slow waveform states.
In one embodiment of the present invention, the sleep electroencephalogram acquisition module acquires and stores sleep electroencephalogram signals of a target to be detected, including:
acquiring original sleep electroencephalogram signals of a target to be detected by utilizing electrode wires and a plurality of preset acquisition channels determined based on a 10-20 system according to a preset sampling rate, wherein the plurality of preset acquisition channels comprise a plurality of channels of electroencephalogram, electrooculogram and myoelectricity;
Amplifying and denoising the original sleep brain electrical signal, and storing the obtained sleep brain electrical signal.
In one embodiment of the present invention, the plurality of preset acquisition channels determined based on the 10-20 system includes:
c3, C4, FP1, FP2 in the electroencephalogram channel; EOG1 and EOG2 in the ocular electrical channel, and CHINZ and chn 1 in the myoelectrical channel.
In one embodiment of the present invention, the process of processing the received sleep electroencephalogram signal by the data processing and visualizing module includes:
the method comprises the steps that a filtering module in the data processing and visualizing module is utilized, a preset filter is adopted for filtering the received sleep brain electrical signals, and the sleep brain electrical signals after filtering are obtained, wherein the sleep brain electrical signals of the brain electrical channels, the eye electrical channels and the myoelectrical channels adopt respective corresponding filtering frequency ranges;
detecting and marking the artifacts in the filtered sleep electroencephalogram signals based on a preset artifact processing algorithm by utilizing an artifact processing module in the data processing and visualization module to obtain the sleep electroencephalogram signals after artifact processing;
performing epoch division on the sleep electroencephalogram after artifact processing by using a stage division module in the data processing and visualization module, and performing sleep stage classification on the sleep electroencephalogram of each epoch by using a classification model obtained by pre-training to obtain the sleep electroencephalogram of each epoch carrying a sleep stage label as the sleep electroencephalogram after processing; the sleep stages comprise five stages in total of wake, N1, N2, N3 and rem; the classification model is constructed based on a machine learning method and is obtained through training according to a sample sleep electroencephalogram signal with a sleep stage mark.
In one embodiment of the present invention, the preset artifact processing algorithm includes an artifact processing algorithm based on a Potato algorithm;
correspondingly, the method for detecting and marking the artifacts in the filtered sleep electroencephalogram based on the preset artifact processing algorithm to obtain the sleep electroencephalogram after artifact processing comprises the following steps:
step a1, performing data cutting on the filtered sleep brain signals by using a data window with a preset size to obtain window data corresponding to the current iteration;
step a2, calculating a covariance matrix of window data corresponding to the current iteration;
step a3, calculating a reference covariance matrix corresponding to the current iteration based on the Potato algorithm, the covariance matrix corresponding to the current iteration and the input reference covariance matrix; the input reference covariance matrix is a covariance matrix corresponding to the first iteration, and is the latest reference covariance matrix obtained after the last iteration for any iteration started by the second iteration;
step a4, calculating Euclidean distance corresponding to the current iteration based on the joint eigenvalue of the covariance matrix corresponding to the current iteration and the reference covariance matrix, so as to represent the distance between the corresponding covariance matrix and the reference covariance matrix in the current iteration;
Step a5, determining an artifact threshold value used in the current iteration according to the Euclidean distance set obtained at present;
step a6, judging whether the Euclidean distance corresponding to the current iteration is larger than an artifact threshold value used by the current iteration; if not, executing the step a7, if yes, executing the step a8;
step a7, marking window data corresponding to the current iteration as non-artifacts, taking a reference covariance matrix corresponding to the current iteration as the latest reference covariance matrix obtained after the current iteration, adding Euclidean distances corresponding to the current iteration into a Euclidean distance set obtained currently, finishing updating of the reference covariance matrix and the Euclidean distance set, and executing step a2 for the next window data;
and a step a8, marking window data corresponding to the current iteration as artifacts, not updating the reference covariance matrix and the Euclidean distance set, and executing a step a2 for the next window data.
In one embodiment of the present invention, the determining the artifact threshold used in the current iteration according to the current obtained euclidean distance set includes:
calculating the average value and standard deviation of all Euclidean distances in the Euclidean distance set obtained at present;
And determining the sum of the 2 times of the standard deviation and the average value as an artifact threshold value used in the current iteration.
In one embodiment of the present invention, the selecting a specific sleep electroencephalogram from the processed sleep electroencephalograms, detecting a slow wave from the specific sleep electroencephalogram according to an improved matching pursuit algorithm implemented based on a pre-constructed dictionary, includes:
determining sleep electroencephalogram signals marked as non-artifacts and with sleep stage labels of N2 and N3 in the processed sleep electroencephalogram signals as specific sleep electroencephalogram signals by utilizing a slow wave detection module in the data processing and visualization module;
and detecting the slow wave in the specific sleep electroencephalogram signal according to an improved matching pursuit algorithm realized based on a pre-constructed dictionary.
In one embodiment of the present invention, the dictionary construction process includes:
limiting the basis functions of the dictionary to Gabor functions similar to the morphology of sleep slow waves, wherein the standard formula isWherein K (γ) represents a normalization coefficient; y= { u, ω, s, Φ }; u represents the center position of the Gabor function; ω represents the angular frequency of the Gabor function; s represents the scale parameter of the Gabor function; phi represents the phase parameter of the Gabor function;
And setting parameters of a Gabor function by utilizing the characteristic of the sleep slow wave, wherein the parameters of the Gabor function comprise Y.
In one embodiment of the present invention, the setting the parameters of the Gabor function by using the characteristics of the sleep slow wave includes:
setting upAngular frequency as a function of Gabor, where F s Representing the sampling rate, f is determined as f E according to the frequency range of the standard sleep slow wave[0.5,2]Hz, and the step size is set to 0.1Hz;
each sleep slow wave is used as an independent time to detect, and one sleep slow wave only represents one oscillation, so that the scale parameter of the Gabor function is set as
For each frequency value, selecting a separate value of ω (f) and s (f) to ensure that the exponential component of the Gabor function and the frequency of the cosine function are compatible;
setting phase parametersAnd the step size is +.>To ensure that the positive and negative oscillation amplitudes of the Gabor function are large enough to capture the negative and positive deflections of the sleep slow wave signal;
to ensure that the center position of the Gabor function matches the zero position between the negative and positive deflections of the slow sleep wave, the formula is usedCalculating the center position of the Gabor function; where z represents the negative to positive zero position in the signal.
In one embodiment of the present invention, the detecting, by using the slow wave detection module in the data processing and visualization module, the slow wave in the specific sleep electroencephalogram signal according to the improved matching pursuit algorithm implemented based on a pre-constructed dictionary includes:
Step b1, receiving the specific sleep electroencephalogram signal by utilizing a sliding window with preset duration and performing filtering treatment to obtain a current window signal;
step b2, detecting all zero crossing points in the current window signal, and taking the zero crossing points from negative to positive as candidate points;
step b3, calculating the candidate point attachment for each obtained candidate pointNegative to positive zero crossing frequency f within a near preset time period zero
Step b4, judging f zero Whether greater than a given threshold; if yes, executing the step b5, and if not, executing the step b6;
step b5, removing the candidate points;
step b6, determining the candidate point as a reserved candidate point;
step b7, processing each reserved candidate point obtained by the current window signal by utilizing a matching pursuit algorithm and the dictionary, selecting an atom with the largest scalar product as the atom which is most matched with the current residual signal, and updating the current residual signal by utilizing the obtained largest scalar product;
step b8, judging whether the obtained maximum scalar product is larger than a preset scalar product threshold value; if not, executing the step b9, if yes, executing the step b10;
step b9, determining that the reserved candidate point is not a slow wave, executing step b7, and executing step b1 after the reserved candidate point obtained by the current window signal is traversed;
Step b10, adding the reserved candidate points into a candidate slow wave list, executing step b7, and executing step b1 after the reserved candidate points obtained by the current window signal are traversed;
and b11, filtering signals near each reserved candidate point in the candidate slow wave list to a preset frequency range, setting the starting point of the slow wave as the first zero crossing point from positive to negative before the reserved candidate point, setting the ending point as the first zero crossing point after the reserved candidate point, judging whether the duration time is in the preset duration time, and if so, judging the corresponding waveform as the slow wave.
The invention has the beneficial effects that:
the off-line sleep slow wave detection system provided by the embodiment of the invention comprises a sleep electroencephalogram acquisition module, a data transmission module and a data processing and visualization module, and has a complete set of analysis algorithms for sleep electroencephalogram acquisition, storage, transmission, data processing and slow wave detection, so that the portability of the system is good, the limitations of high use cost and high place requirements of the traditional PSG equipment are avoided, and the work of sleep electroencephalogram acquisition and slow wave detection can be completed on the premise of having the least influence on sleep. The system provides an improved matching pursuit algorithm for slow wave detection, a dictionary is constructed by limiting a basis function to a preset function similar to a sleep slow wave state, and the dictionary is combined with a traditional matching pursuit algorithm to finish sleep slow wave detection. The detection process of the algorithm depends on waveforms instead of rigid amplitude indexes, so that the algorithm is also suitable for people with low amplitudes and has wider application scenes.
Drawings
FIG. 1 is a schematic diagram of an offline sleep slow wave detection system according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of an offline sleep slow wave detection system according to an embodiment of the present invention;
FIG. 3 is a schematic diagram illustrating a structure of a data processing and visualization module according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a classification process of a classification model according to an embodiment of the invention;
FIG. 5 is a standard waveform diagram of slow waves;
FIG. 6 is a dictionary library diagram of an embodiment of the present invention;
fig. 7 is a schematic diagram of a slow wave detection flow according to an embodiment of the invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
As shown in fig. 1, an offline sleep slow wave detection system provided by an embodiment of the present invention may include:
a sleep electroencephalogram acquisition module, a data transmission module and a data processing and visualizing module, wherein,
The sleep electroencephalogram acquisition module is used for acquiring and storing sleep electroencephalogram signals of a target to be detected and transmitting the sleep electroencephalogram signals to the data processing and visualizing module through the data transmission module;
the data processing and visualizing module is used for processing the received sleep electroencephalogram signals, selecting specific sleep electroencephalogram signals in the processed sleep electroencephalogram signals, and detecting slow waves in the specific sleep electroencephalogram signals according to an improved matching pursuit algorithm realized based on a pre-constructed dictionary; wherein the basis functions of the pre-built dictionary are limited to preset functions similar to sleep slow waveform states.
The respective modules will be described below. Also, for an alternative embodiment, please refer to an architecture diagram of the offline sleep slow wave detection system shown in fig. 2 for an understanding.
(1) Sleep brain electricity acquisition module
Wherein the target to be measured may include a human being and other animals; the sleep electroencephalogram acquisition module can acquire electroencephalogram signals generated by the target to be detected in a sleep stage based on any existing virtual brain electrode positioning system, and the virtual brain electrode positioning system comprises a 10-10 system, a 10-20 system, a 64-lead system and the like, and is not particularly limited.
In an optional implementation manner, a 10-20 system may be adopted, specifically, the sleep electroencephalogram acquisition module acquires and stores sleep electroencephalogram signals of a target to be detected, including:
1) Acquiring original sleep electroencephalogram signals of a target to be detected by utilizing electrode wires and a plurality of preset acquisition channels determined based on a 10-20 system according to a preset sampling rate, wherein the plurality of preset acquisition channels comprise a plurality of channels of electroencephalogram, electrooculogram and myoelectricity;
according to the embodiment of the invention, the electrodes can be respectively arranged at a plurality of positions of the target cranium to be detected, which are positioned by a 10-20 system and aim at the electroencephalogram, the electrooculogram and the myoelectricity, the sleep electroencephalogram of the corresponding channels of each position is acquired by utilizing the electrode wire at a preset sampling rate, and the acquired sleep electroencephalogram of all channels is used as an original sleep electroencephalogram. The plurality of positions of the electroencephalogram, the electrooculogram and the myoelectricity and the preset sampling rate can be selected according to requirements, and the specific limitation is not adopted here.
For example, in an optional implementation manner, the multiple preset acquisition channels determined based on the 10-20 system include:
c3, C4, FP1, FP2 in the electroencephalogram channel; EOG1 and EOG2 in the ocular electrical channel, and CHINZ and chn 1 in the myoelectrical channel.
The sleep electroencephalogram acquisition module in the embodiment of the invention can be realized based on one acquisition board, for example, in an optional implementation manner, the acquisition board can be built based on an ADS1299 chip, and 10 interfaces are totally included, wherein 8 acquisition channels are included, the sampling rate can be 250Hz, and the acquisition channels are electroencephalograms: c3, C4, FP1, FP2; electrooculogram: EOG1 representing left eye electricity, EOG2 representing right eye electricity; myoelectricity: CHINZ and chn 1.
The above-mentioned acquisition channel of the 10-20 system is understood by referring to the related content of the 10-20 system, and will not be described in detail herein. Of course, the plurality of preset acquisition channels of the embodiments of the present invention are not limited to the above.
2) Amplifying and denoising the original sleep brain electrical signal, and storing the obtained sleep brain electrical signal.
In the above example of the acquisition board, an amplifier, a filtering module and the like may be included in the acquisition board for performing amplification and noise reduction processing, respectively, wherein the specific type of the device is not limited herein. The sleep electroencephalogram signals obtained after the amplification and noise reduction treatment can be stored in an SD card in the acquisition board, and the like.
(2) Data transmission module
The data transmission module in the embodiment of the invention can be a mobile terminal, such as a mobile phone and the like. The data transmission module can receive the sleep brain electrical signals sent by the sleep brain electrical acquisition module and can transmit the sleep brain electrical signals to the data processing and visualization module in a Bluetooth mode and the like.
Alternatively, the data transmission module may be integrated on the sleep electroencephalogram acquisition module, which is reasonable.
(3) Data processing and visualization module
In an alternative embodiment, please refer to the schematic structure diagram of the data processing and visualizing module shown in fig. 3, which may include a filtering module, an artifact processing module, a stage dividing module, and a slow wave detecting module.
The filtering module, the artifact processing module and the stage dividing module in the data processing and visualizing module jointly complete the process of processing the received sleep brain electrical signals.
In an optional implementation manner, the process of processing the received sleep electroencephalogram signal by the data processing and visualizing module includes:
1) The method comprises the steps that a filtering module in the data processing and visualizing module is utilized, a preset filter is adopted for filtering the received sleep brain electrical signals, and the sleep brain electrical signals after filtering are obtained, wherein the sleep brain electrical signals of the brain electrical channels, the eye electrical channels and the myoelectrical channels adopt respective corresponding filtering frequency ranges;
wherein the preset filter may include a butterworth filter or the like. The filtering frequency ranges corresponding to the sleep brain signals of the brain channel, the eye channel and the myoelectric channel can be reasonably selected according to the needs, and the sleep brain signals are not limited.
The filtering module can filter the input sleep brain signals of all channels by using a five-order Butterworth filter, the filtering frequency range of the brain signals can be 0.5-35 Hz, the filtering range of the eye signals can be 0.05-35 Hz, and the filtering range of myoelectricity can be 10-100 Hz.
2) Detecting and marking the artifacts in the filtered sleep electroencephalogram signals based on a preset artifact processing algorithm by utilizing an artifact processing module in the data processing and visualization module to obtain the sleep electroencephalogram signals after artifact processing;
the artifact processing can mark irrelevant interference data to improve the accuracy of subsequent sleep stage division and slow wave waveform detection.
The embodiment of the invention can adopt any existing artifact processing algorithm for processing, and is not limited in this regard. For example, in an alternative embodiment, the preset artifact processing algorithm includes an artifact processing algorithm based on a potto algorithm, where the algorithm is modified based on the potto algorithm. The Potato algorithm is a distance-based clustering algorithm, and uses a Riemann geometry method to calculate distances between covariance matrices. It may cluster similar covariance matrices into one class and derive a reference covariance matrix therefrom. The Potato algorithm can improve the accuracy and the robustness of noise detection, and has higher applicability and reliability for processing multichannel physiological signal data.
Taking the post algorithm-based artifact processing algorithm as an example, in an optional implementation manner, the detecting and marking the artifact in the filtered sleep electroencephalogram based on the preset artifact processing algorithm to obtain the sleep electroencephalogram after artifact processing may include:
step a1, performing data cutting on the filtered sleep brain signals by using a data window with a preset size to obtain window data corresponding to the current iteration;
the preset size of the data window may be set according to the data size requirement of the cut, for example, may be 5 seconds.
It can be understood that the sleep electroencephalogram signal after filtering slides into the data window according to the time sequence, when the size of the data reaches the preset size of the data window, data cutting is performed once to obtain window data, and then a plurality of window data can be cut out in the process that the sleep electroencephalogram signal after filtering continuously enters the data window. The embodiment of the invention corresponds one window data to one iteration. The following description will be made by taking window data corresponding to the current iteration as an example.
Step a2, calculating a covariance matrix of window data corresponding to the current iteration;
Specifically, let the matrix corresponding to the filtered sleep brain signal of the (x+1) th data window be E x+1 The covariance matrix is calculated by the following formula:
wherein, sigma x+1 A covariance matrix representing window data corresponding to the current iteration for the (x+1) th data window, wherein the covariance matrix is a symmetric positive definite matrix for multi-channel signal data and describes the relation between different channels; n represents the data length of the sleep electroencephalogram signal after filtering of the (x+1) th data window; e (E) x+1 T Representation E x+1 Is a transpose of (a).
Step a3, calculating a reference covariance matrix corresponding to the current iteration based on the Potato algorithm, the covariance matrix corresponding to the current iteration and the input reference covariance matrix;
the step is based on the Potato algorithm to perform clustering operation on covariance matrixes of all data windows, similar covariance matrixes are gathered into one type to obtain a reference covariance matrix, and an iterative clustering mode is adopted to adaptively adjust the reference covariance matrix in different iterations.
The calculation formula of the reference covariance matrix corresponding to the current iteration is as follows:
wherein,,representing a reference covariance matrix corresponding to the current iteration;Representing an input reference covariance matrix; sigma (sigma) x+1 Representing the current iterationCovariance matrix of corresponding window data.
For the first iteration, the input reference covariance matrix is the covariance matrix corresponding to the first iteration, and for any iteration started by the second iteration, the input reference covariance matrix is the latest reference covariance matrix obtained after the last iteration.
Step a4, calculating Euclidean distance corresponding to the current iteration based on the joint eigenvalue of the covariance matrix corresponding to the current iteration and the reference covariance matrix, so as to represent the distance between the corresponding covariance matrix and the reference covariance matrix in the current iteration;
for the covariance matrix of the window data corresponding to the current iteration, the step uses the algorithm of the Riemann geometry to calculate the distance between the covariance matrix and the corresponding reference covariance matrix. Specifically, calculating the distance between two covariance matrices requires logarithmic conversion of eigenvalues of the covariance matrices, and then calculating euclidean distances between the eigenvalues. Therefore, the step firstly calculates and obtains the joint eigenvalue lambda of the covariance matrix corresponding to the current iteration and the reference covariance matrix i Which isTherefore, for the window data corresponding to the current iteration, there are a plurality of lambda i
The Euclidean distance is then calculated using the following formula:
wherein d x+1 Representing the euclidean distance corresponding to the current iteration.
Step a5, determining an artifact threshold value used in the current iteration according to the Euclidean distance set obtained at present;
the Euclidean distance set comprises Euclidean distances calculated by each segment of non-artifact window data; aiming at the first iteration, the Euclidean distance set obtained currently is the Euclidean distance set corresponding to one all data window obtained under the condition that all data are assumed to be non-artifacts; for each iteration starting with the second iteration, the current set of euclidean distances is the set of euclidean distances most recently determined for the last iteration, as will be understood with reference to the following related description.
In an optional embodiment, the determining the artifact threshold used in the current iteration according to the current obtained euclidean distance set includes:
1) Calculating the average value and standard deviation of all Euclidean distances in the Euclidean distance set obtained at present;
specifically, the average value may be expressed as μ, and the standard deviation may be expressed as σ.
2) And determining the sum of the 2 times of the standard deviation and the average value as an artifact threshold value used in the current iteration.
The artifact threshold used by the current iteration may be expressed as th x+1 ,th x+1 =μ+2σ。
Step a6, judging whether the Euclidean distance corresponding to the current iteration is larger than an artifact threshold value used by the current iteration; if not, executing the step a7, if yes, executing the step a8;
specifically, this step is to determine whether d is present x+1 >th x+1
Step a7, marking window data corresponding to the current iteration as non-artifacts, taking a reference covariance matrix corresponding to the current iteration as the latest reference covariance matrix obtained after the current iteration, adding Euclidean distances corresponding to the current iteration into a Euclidean distance set obtained currently, finishing updating of the reference covariance matrix and the Euclidean distance set, and executing step a2 for the next window data;
if d x+1 ≤th x+1 Marking window data corresponding to the current iteration as non-artifacts, and taking a reference covariance matrix corresponding to the current iteration as the latest reference covariance matrix obtained after the current iteration, namely, taking the latest reference covariance matrix as the next iterationA reference covariance matrix is input. And meanwhile, adding the Euclidean distance corresponding to the current iteration into the Euclidean distance set obtained at present, so that the Euclidean distance set obtained in the next iteration contains the Euclidean distance.
And a step a8, marking window data corresponding to the current iteration as artifacts, not updating the reference covariance matrix and the Euclidean distance set, and executing a step a2 for the next window data.
If d x+1 >th x+1 And marking window data corresponding to the current iteration as artifacts, and not updating the reference covariance matrix, namely, the calculated reference covariance matrix corresponding to the current iteration is not used as an input reference covariance matrix of the next iteration. And meanwhile, the Euclidean distance set is not updated, namely the Euclidean distance corresponding to the current iteration is not added into the Euclidean distance set.
It can be understood that after each window data is obtained in the embodiment of the present invention, covariance matrix calculation, reference covariance matrix calculation, euclidean distance calculation, artifact threshold determination, euclidean distance determination, and artifact/non-artifact marking are performed, and then the above processing procedure is performed again for the next window data obtained in step a 1.
3) Performing epoch division on the sleep electroencephalogram after artifact processing by using a stage division module in the data processing and visualization module, and performing sleep stage classification on the sleep electroencephalogram of each epoch by using a classification model obtained by pre-training to obtain the sleep electroencephalogram of each epoch carrying a sleep stage label as the sleep electroencephalogram after processing;
The epoch division may be completed according to a set duration, for example, may be 30 seconds, etc., and may be specifically selected according to needs, which is not limited herein.
Specifically, according to the sleep stage classification standard established by the american society of sleep medicine (AASM), the sleep stages can be divided into five stages of wake, N1, N2, N3, REM (rapid eye movement), wherein n1+n2+n3 are taken together, or all belong to NREM (non rapid eye movement) stage, as will be understood in the related art. Thus, in an embodiment of the present invention, the sleep stages include five stages in total of wake, N1, N2, N3, and rem.
The classification model is constructed based on a machine learning method and is obtained through training according to a sample sleep electroencephalogram signal with a sleep stage mark. The sample sleep electroencephalogram signals are acquired by the sleep electroencephalogram acquisition module and then are processed by the filtering module and the artifact processing module, and the sleep stages are known, for example, the sleep stage classification marks can be realized in modes such as manual marks, other algorithm marks and the like.
The classification model may be implemented using existing neural networks and the like. For example, in an alternative embodiment, the multi-class classification may be implemented by embedding a plurality of Support Vector Machines (SVMs) into a decision tree framework to build the classification model. The classification process of the classification model can be understood with reference to fig. 4, and fig. 4 is a schematic diagram of the classification process of a classification model according to an embodiment of the present invention.
First, the built classification model may be trained and tested using data in the public dataset MASS, for example. Wherein 80% of the data in the dataset may be used for training and the remaining 20% of the data tested to verify the validity of the model classification. The training process for the classification model may be implemented based on the training process of the existing machine learning model or the neural network model, which will not be described in detail herein.
In fig. 4, electroencephalogram, electrooculogram, myoelectric data refer to sleep electroencephalogram signals input into the classification model.
The feature extraction and dimension reduction part is to extract 102 features including time domain features, frequency domain features and nonlinear features for each sleep stage, and after all the features are extracted, the feature space is reduced to 32 features by eliminating abnormal features (abnormal features are features with values twice higher than standard deviation of all values of the same feature in the same class) and features which are not obvious enough by standard t test in statistical analysis.
And the feature subset selecting part uses a standard sequential forward process selecting method for finding a feature subset which is smaller and has larger influence on model performance in a high-dimensional feature space, specifically, by adopting the forward process selecting method for each node of a decision tree, an optimal feature subset is selected for each SVM, and when the decision tree is provided with optimal parameters and data features of each SVM, sleep data can be classified to obtain a predicted sleep stage label.
The average accuracy of the results of the classification model which adopts 10-fold cross validation can reach 80.77%, and the average accuracy of the results of the test set can reach 80.49%, so that the classification model has good sleep stage division accuracy.
The classification model is only an optional example, and is not limited to the classification model according to the embodiment of the present invention, and the classification model according to the embodiment of the present invention may be implemented by any model capable of classifying sleep stages of sleep brain signals, and the specific form is not limited herein.
For the filtering slow wave detection module in the data processing and visualization module, the functions thereof can include: processing the received sleep electroencephalogram signals, selecting a specific sleep electroencephalogram signal in the processed sleep electroencephalogram signals, and detecting slow waves in the specific sleep electroencephalogram signals according to an improved matching pursuit algorithm realized based on a pre-constructed dictionary. The method also comprises the step of visually displaying the detected slow wave and other data or information, such as displaying in the APP of the mobile phone.
In an optional implementation manner, the selecting a specific sleep electroencephalogram from the processed sleep electroencephalograms, detecting a slow wave from the specific sleep electroencephalogram according to an improved matching pursuit algorithm implemented based on a pre-constructed dictionary, includes:
i) Determining sleep electroencephalogram signals marked as non-artifacts and with sleep stage labels of N2 and N3 in the processed sleep electroencephalogram signals as specific sleep electroencephalogram signals by utilizing a slow wave detection module in the data processing and visualization module;
slow Wave Sleep (SWS) refers to Sleep in the N3 stage, which is a deep Sleep stage in which low frequency, high amplitude Slow waves appear on the electroencephalogram. While the N2 stage also has some slow waves, but they are less than the N3 stage. Thus, the detection of sleep slow waves is mainly directed to the N3 stage, but slow waves of the N2 stage are also used as auxiliary references. Therefore, the embodiment of the invention only carries out slow wave detection on the sleep electroencephalogram signals marked as non-artifacts and the sleep stage labels of N2 and N3 in the processed sleep electroencephalogram signals as specific sleep electroencephalograms signals.
It can be understood that the processed sleep electroencephalogram signals input into the slow wave detection module are all provided with non-artifact/artifact marks and sleep stage labels, so that the slow wave detection module only needs to check the marks and the sleep stage labels in the input processed sleep electroencephalogram signals, and the specific sleep electroencephalogram signals meeting the requirements are determined to be subjected to subsequent processing.
ii) detecting slow waves in the specific sleep brain electrical signal according to a modified matching pursuit algorithm implemented based on a pre-constructed dictionary.
The Matched Filter algorithm is a commonly used signal processing algorithm, mainly used for extracting a target signal from a noise background. The basic idea of the matching pursuit algorithm is to convolve the target signal with a set of filters to obtain a filtered output signal, and then analyze the filtered output signal to extract the relevant characteristics of the target signal, so as to realize the functions of signal detection, recognition, positioning and the like.
The slow wave detection module in the embodiment of the invention improves the matching pursuit algorithm by selecting a group of more accurate dictionaries to form an improved matching pursuit algorithm, and the sleep slow wave is identified and extracted from the sleep brain electrical signals input by the slow wave detection module. The improved matching pursuit algorithm has the core idea of approximating signals through linear combination of atoms in a constructed dictionary, so that one of the cores of the improved matching pursuit algorithm is the selection of the dictionary.
In order to facilitate understanding of the improved matching pursuit algorithm provided by the embodiment of the present invention, a dictionary construction process will be described first.
The basis functions of the dictionary constructed in advance in the embodiment of the invention are limited to preset functions similar to the sleep slow waveform states. The preset function can be reasonably selected according to the needs. For example, the preset function may include a Gabor function, or the like.
Taking Gabor function as an example, in an optional implementation manner, the construction process of the dictionary includes:
1) Limiting the basis functions of the dictionary to Gabor functions similar to the morphology of sleep slow waves, wherein the standard formula is
Wherein K (γ) represents a normalization coefficient; y= { u, ω, s, Φ }; u represents the center position of the Gabor function; ω represents the angular frequency of the Gabor function; s represents the scale parameter of the Gabor function; phi represents the phase parameter of the Gabor function;
specifically, the dictionary of the embodiment of the invention selects a group of Gabor functions, the base functions can provide the optimal time-frequency resolution, the base functions similar to typical waveforms of slow waves can be easily obtained by using the Gabor functions, and most of basic morphological characteristics of the sleep slow waves can be reproduced, and the standard waveforms of the slow waves are shown in fig. 5. Wherein the horizontal axis represents time in seconds (sec); the vertical axis represents voltage in microvolts (μv); A. b, C, D, E the corresponding distance; negative peak; positive peak represents a Positive peak; mid-cross represents zero crossing; start and End represent the Start and End points of the waveform, respectively.
2) And setting parameters of a Gabor function by utilizing the characteristic of the sleep slow wave, wherein the parameters of the Gabor function comprise Y.
Since the basis functions of the dictionary are limited to Gabor functions similar to the morphology of the sleep slow wave, the parameters y= { u, ω, s, Φ } and the like need to be set by using the characteristics of the sleep slow wave.
In an optional implementation manner, the setting the parameter of the Gabor function by using the feature of the sleep slow wave includes:
(1) Setting upAngular frequency as a function of Gabor, where F s Representing the sampling rate, f is determined to be f E [0.5,2 ] according to the frequency range of the standard sleep slow wave]Hz, and the step size is set to 0.1Hz;
in particular, the frequency of the standard sleep slow wave is between 0.5 and 2Hz, so thatf∈[0.5,2]Hz, and the step size is 0.1Hz, frequency as a function of Gabor.
(2) Each sleep slow wave is used as an independent time to detect, and one sleep slow wave only represents one oscillation, so that the scale parameter of the Gabor function is set as
In particular, the idea of this criterion is to ensure that the Gabor function has a duration of one oscillation period at the frequency of the sleep slow wave, in other words, the Gabor function should be able to capture the entire oscillation of the sleep slow wave for its duration, by setting the scale parameter s in such a way that it can be ensured that the Gabor function has an appropriate duration to capture the sleep slow wave.
(3) For each frequency value, selecting a separate value of ω (f) and s (f) to ensure that the exponential component of the Gabor function and the frequency of the cosine function are compatible;
in particular, the embodiment of the present invention needs to ensure that the frequency of the frequency component of the Gabor function is adapted to the frequency of the cosine function, and for each frequency value, a separate value of ω (f) and s (f) needs to be selected, because two important parts are included in the Gabor function: an exponential component and a cosine function. The exponential component, commonly referred to as the gaussian envelope, controls the time and frequency characteristics of the Gabor function, while the cosine function controls the phase characteristics of the Gabor function, and is adapted to the frequency of the cosine function by adjusting the parameters of the Gabor function.
(4) Setting phase parametersAnd the step size is +.>To ensure that the positive and negative oscillation amplitudes of the Gabor function are large enough to capture the negative and positive deflections of the sleep slow wave signal;
specifically, in a sleep slow wave signal, negative and positive deflections occur, i.e., the signal deflects downward and then upward. In order to ensure that the Gabor function captures both deflections, embodiments of the present invention require setting appropriate phase parameters, in a slow wave detection module, the phase parameters phi are fixed at And->And (2) the following steps:And let the step length be +.>By limiting the phase of the Gabor function within this range, it is ensured that the positive and negative oscillation amplitudes of the Gabor function are sufficiently large so that the negative and positive deflections of the sleep slow wave signal can be captured. />
(5) To ensure that the center position of the Gabor function matches the zero position between the negative and positive deflections of the slow sleep wave, the formula is usedCalculating the center position of the Gabor function;
specifically, in a sleep slow wave signal, the sleep slow wave generally occurs at a zero position between negative and positive deflections of the signal. Therefore, the embodiment of the invention hopes that the Gabor function has the same negative-to-positive zero point position so as to better capture the sleep slow wave signal, so that the central position of the Gabor function can be calculated by using the formula in the detection of the sleep slow wave. Wherein z represents the negative to positive zero position in the signal; ω (f) is the angular frequency of the Gabor function; phi is the phase parameter of the Gabor function. This formula ensures that the center position of the Gabor function matches the zero position between the negative and positive deflections of the slow sleep wave. Since the sleep slow wave signal only occurs at zero crossings between positive deflections of the negative deflections of the signal, embodiments of the present invention only need to consider the negative to positive zero positions of the signal as candidate points.
In summary, according to the embodiment of the present invention, by selecting the appropriate Gabor function parameters and calculating the center position of the Gabor function, a dictionary matrix that only includes the states similar to the sleep slow wave can be constructed, so that the accuracy and efficiency of sleep slow wave detection are improved, and the final dictionary library image is shown in fig. 6.
The above is a construction process of the dictionary according to the embodiment of the present invention, and the improved matching pursuit algorithm according to the embodiment of the present invention is implemented using a conventional matching pursuit algorithm and the dictionary, and is described next.
In an optional implementation manner, the detecting, by using a slow wave detection module in the data processing and visualization module, a slow wave in the specific sleep electroencephalogram signal according to a modified matching pursuit algorithm implemented based on a pre-constructed dictionary includes:
step b1, receiving the specific sleep electroencephalogram signal by utilizing a sliding window with preset duration and performing filtering treatment to obtain a current window signal;
the preset duration and the filter adopted in the filtering process can be selected according to requirements, and are not limited herein. For example, the preset duration may be 30 seconds, etc., and the filter may be a butterworth filter, etc.
An example of this step is given below: setting a sliding window to be 30 seconds, and receiving the specific sleep electroencephalogram signal, wherein the overlap is 2 seconds; and then a 5-order Butterworth band-pass filter is used for carrying out band-pass filtering on the received specific sleep brain signals, wherein the filtering range is 0.5-35Hz. Wherein the effect of overlap may be such that the signal at the window edge is also detected.
Step b2, detecting all zero crossing points in the current window signal, and taking the zero crossing points from negative to positive as candidate points;
step b3, for each obtained candidate point, calculating the negative-to-positive zero crossing point frequency f within a preset time length near the candidate point zero
The preset time period may be 2 seconds, and the like, and is not limited herein. Taking this as an example, f zero The calculation process of (1) can be as follows: by calculating the ratio of the number of all candidate points appearing within 2 seconds around the candidate point to the length of 2 seconds data to obtain f zero
Step b4, judging f zero Whether greater than a given threshold; if yes, executing the step b5, and if not, executing the step b6;
due to f zero The magnitude of this value reflects whether or not there is a slow oscillation signal near the current candidate point, and if there is an excessive zero crossing point in a short time, it is considered that there is no slow wave, and it is necessary to exclude it. Thus if the value is greater than a given threshold, the candidate point is removed.
Wherein the given threshold may be 4 or the like, without limitation.
Step b5, removing the candidate points;
step b6, determining the candidate point as a reserved candidate point;
step b7, processing each reserved candidate point obtained by the current window signal by utilizing a matching pursuit algorithm and the dictionary, selecting an atom with the largest scalar product as the atom which is most matched with the current residual signal, and updating the current residual signal by utilizing the obtained largest scalar product;
for each retained candidate point, a matching pursuit algorithm and a dictionary defined before are used, i.e. the processing with the improved matching pursuit algorithm is:
first traverse dictionaryFor each atom in the dictionary, it is compared with the current residual signal R n (y) dot-multiplication (inner product), i.e. calculating scalar product |<ω i ,R n (y)>I, here ω i Representing atoms in a dictionary, R n (y) represents the current residual signal. In this step it is necessary to find the scalar product|<ω i ,R n (y)>The atom of the maximized, in other words, the atom that best matches the current residual signal is to be found. At this time, the maximum scalar product k= |can be obtained<ω n ,R n (y)>| a. The invention relates to a method for producing a fibre-reinforced plastic composite. The atom with the largest scalar product is the atom that best matches the current residual signal. The residual signal refers to the difference between the input and the predicted signal, and is understood with reference to the matching pursuit algorithm, and will not be described in detail herein.
For subsequent iterations, the residual signal needs to be updated. Specifically, atom ω to be found n The scalar product k corresponding thereto is multiplied and then subtracted from the current residual signal ω n And subtracting this product. This will result in a new residual signal:
R n+1 (y)=R n (y)-<R n (y),ω nn
the above process is repeated until the condition of the residual energy threshold minimum criterion is met. The condition refers to a stop condition of this iterative process, in which the lower the residual, the more matched the description, and when the residual energy is below a certain threshold, the iteration is stopped.
This step is understood with specific reference to the matching pursuit algorithm and is not described in detail herein.
Step b8, judging whether the obtained maximum scalar product is larger than a preset scalar product threshold value; if not, executing the step b9, if yes, executing the step b10;
the preset scalar product threshold may be set as desired, such as 40, etc., and is not limited herein.
Step b9, determining that the reserved candidate point is not a slow wave, executing step b7, and executing step b1 after the reserved candidate point obtained by the current window signal is traversed;
if the obtained maximum scalar product is smaller than or equal to the preset scalar product threshold, determining that the waveform of the reserved candidate point does not represent sleep slow waves, determining that the reserved candidate point is not slow waves, and then executing step b7 to judge the next reserved candidate point obtained by the current window signal. And if the traversing of the reserved candidate points obtained by the current window signal is completed, executing the step b1, obtaining the next window signal and carrying out the processing after the step b 1.
Step b10, adding the reserved candidate points into a candidate slow wave list, executing step b7, and executing step b1 after the reserved candidate points obtained by the current window signal are traversed;
if the obtained maximum scalar product is greater than the preset scalar product threshold, adding the reserved candidate point into the candidate slow wave list, and then executing step b7 to judge the next reserved candidate point obtained by the current window signal. Similarly, if the traversing of the reserved candidate points obtained by the current window signal is completed, the step b1 is executed, and the next window signal is obtained to perform the processing after the step b 1.
And b11, filtering signals near each reserved candidate point in the candidate slow wave list to a preset frequency range, setting the starting point of the slow wave as the first zero crossing point from positive to negative before the reserved candidate point, setting the ending point as the first zero crossing point after the reserved candidate point, judging whether the duration time is in the preset duration time, and if so, judging the corresponding waveform as the slow wave.
This step is the process of slow wave extraction and verification. The preset frequency range and the preset duration time can be set according to needs, for example, the preset frequency range can be 0.5-4 Hz, etc., and the preset duration time can be 0.5-2 seconds, etc.
The slow wave detection process according to the embodiment of the present invention can be understood with reference to fig. 7, and the description thereof will not be repeated here.
The off-line sleep slow wave detection system provided by the embodiment of the invention comprises a sleep electroencephalogram acquisition module, a data transmission module and a data processing and visualization module, and has a complete set of analysis algorithms for sleep electroencephalogram acquisition, storage, transmission, data processing and slow wave detection, so that the portability of the system is good, the limitations of high use cost and high place requirements of the traditional PSG equipment are avoided, and the work of sleep electroencephalogram acquisition and slow wave detection can be completed on the premise of having the least influence on sleep. The system provides an improved matching pursuit algorithm for slow wave detection, a dictionary is constructed by limiting a basis function to a preset function similar to a sleep slow wave state, and the dictionary is combined with a traditional matching pursuit algorithm to finish sleep slow wave detection. The detection process of the algorithm depends on waveforms instead of rigid amplitude indexes, so that the algorithm is also suitable for people with low amplitudes and has wider application scenes.
In an alternative embodiment, the data processing and visualization module may further include a sleep quality assessment module.
The sleep quality assessment module can calculate parameters related to sleep quality and sleep structure based on the sleep stage result of the previous stage division module, and the parameters of the sleep quality can comprise total sleep time, sleep efficiency, sleep latency, waking frequency and the like; the sleep structure parameters comprise sleep time of each sleep stage, sleep ratio of each sleep stage and the like; the module also calculates parameters related to the slow wave based on the slow wave result of the previous slow wave detection module, including slow wave duration, slow wave frequency, slow wave density, slow wave peak value, slow wave slope, etc. Meanwhile, the sleep quality evaluation module can comprehensively evaluate the night sleep quality and give out a final sleep score based on the weighted values of the parameters, so that comprehensive sleep health analysis is provided for the user. The specific weighting calculation and sleep scoring modes can be designed according to the needs, and are not particularly limited herein. In addition, all parameters and results in the whole scheme process can be visualized and displayed in the APP mobile terminal.
Therefore, the scheme provided by the embodiment of the invention can further realize sleep quality evaluation, can be beneficial to improving the sleep quality, and expands other applications related to the sleep quality.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims (10)

1. An offline sleep slow wave detection system, comprising: a sleep electroencephalogram acquisition module, a data transmission module and a data processing and visualizing module, wherein,
the sleep electroencephalogram acquisition module is used for acquiring and storing sleep electroencephalogram signals of a target to be detected and transmitting the sleep electroencephalogram signals to the data processing and visualizing module through the data transmission module;
the data processing and visualizing module is used for processing the received sleep electroencephalogram signals, selecting specific sleep electroencephalogram signals in the processed sleep electroencephalogram signals, and detecting slow waves in the specific sleep electroencephalogram signals according to an improved matching pursuit algorithm realized based on a pre-constructed dictionary; wherein the basis functions of the pre-built dictionary are limited to preset functions similar to sleep slow waveform states.
2. The offline sleep slow wave detection system according to claim 1, wherein the sleep electroencephalogram acquisition module acquires and stores sleep electroencephalogram signals of a target to be detected, and the offline sleep slow wave detection system comprises:
acquiring original sleep electroencephalogram signals of a target to be detected by utilizing electrode wires and a plurality of preset acquisition channels determined based on a 10-20 system according to a preset sampling rate, wherein the plurality of preset acquisition channels comprise a plurality of channels of electroencephalogram, electrooculogram and myoelectricity;
amplifying and denoising the original sleep brain electrical signal, and storing the obtained sleep brain electrical signal.
3. The offline sleep slow wave detection system according to claim 2, wherein the plurality of preset acquisition channels determined based on the 10-20 system comprises:
c3, C4, FP1, FP2 in the electroencephalogram channel; EOG1 and EOG2 in the ocular electrical channel, and CHINZ and chn 1 in the myoelectrical channel.
4. An off-line sleep slow wave detection system as claimed in claim 1 or 3, characterized in that, the process of processing the received sleep brain signals by the data processing and visualizing module comprises:
the method comprises the steps that a filtering module in the data processing and visualizing module is utilized, a preset filter is adopted for filtering the received sleep brain electrical signals, and the sleep brain electrical signals after filtering are obtained, wherein the sleep brain electrical signals of the brain electrical channels, the eye electrical channels and the myoelectrical channels adopt respective corresponding filtering frequency ranges;
Detecting and marking the artifacts in the filtered sleep electroencephalogram signals based on a preset artifact processing algorithm by utilizing an artifact processing module in the data processing and visualization module to obtain the sleep electroencephalogram signals after artifact processing;
performing epoch division on the sleep electroencephalogram after artifact processing by using a stage division module in the data processing and visualization module, and performing sleep stage classification on the sleep electroencephalogram of each epoch by using a classification model obtained by pre-training to obtain the sleep electroencephalogram of each epoch carrying a sleep stage label as the sleep electroencephalogram after processing; the sleep stages comprise five stages in total of wake, N1, N2, N3 and rem; the classification model is constructed based on a machine learning method and is obtained through training according to a sample sleep electroencephalogram signal with a sleep stage mark.
5. The offline sleep slow wave detection system according to claim 4, wherein the preset artifact processing algorithm comprises a Potato algorithm-based artifact processing algorithm;
correspondingly, the method for detecting and marking the artifacts in the filtered sleep electroencephalogram based on the preset artifact processing algorithm to obtain the sleep electroencephalogram after artifact processing comprises the following steps:
Step a1, performing data cutting on the filtered sleep brain signals by using a data window with a preset size to obtain window data corresponding to the current iteration;
step a2, calculating a covariance matrix of window data corresponding to the current iteration;
step a3, calculating a reference covariance matrix corresponding to the current iteration based on the Potato algorithm, the covariance matrix corresponding to the current iteration and the input reference covariance matrix; the input reference covariance matrix is a covariance matrix corresponding to the first iteration, and is the latest reference covariance matrix obtained after the last iteration for any iteration started by the second iteration;
step a4, calculating Euclidean distance corresponding to the current iteration based on the joint eigenvalue of the covariance matrix corresponding to the current iteration and the reference covariance matrix, so as to represent the distance between the corresponding covariance matrix and the reference covariance matrix in the current iteration;
step a5, determining an artifact threshold value used in the current iteration according to the Euclidean distance set obtained at present;
step a6, judging whether the Euclidean distance corresponding to the current iteration is larger than an artifact threshold value used by the current iteration; if not, executing the step a7, if yes, executing the step a8;
Step a7, marking window data corresponding to the current iteration as non-artifacts, taking a reference covariance matrix corresponding to the current iteration as the latest reference covariance matrix obtained after the current iteration, adding Euclidean distances corresponding to the current iteration into a Euclidean distance set obtained currently, finishing updating of the reference covariance matrix and the Euclidean distance set, and executing step a2 for the next window data;
and a step a8, marking window data corresponding to the current iteration as artifacts, not updating the reference covariance matrix and the Euclidean distance set, and executing a step a2 for the next window data.
6. The offline sleep slow wave detection system according to claim 5, wherein the determining the artifact threshold used in the current iteration according to the current obtained euclidean distance set comprises:
calculating the average value and standard deviation of all Euclidean distances in the Euclidean distance set obtained at present;
and determining the sum of the 2 times of the standard deviation and the average value as an artifact threshold value used in the current iteration.
7. The offline sleep slow wave detection system according to claim 6, wherein the selecting a specific sleep electroencephalogram from among the processed sleep electroencephalograms, detecting slow waves in the specific sleep electroencephalogram according to a modified matching pursuit algorithm implemented based on a pre-constructed dictionary, comprises:
Determining sleep electroencephalogram signals marked as non-artifacts and with sleep stage labels of N2 and N3 in the processed sleep electroencephalogram signals as specific sleep electroencephalogram signals by utilizing a slow wave detection module in the data processing and visualization module;
and detecting the slow wave in the specific sleep electroencephalogram signal according to an improved matching pursuit algorithm realized based on a pre-constructed dictionary.
8. The offline sleep slow wave detection system according to claim 7, wherein the dictionary building process comprises:
limiting the basis functions of the dictionary to Gabor functions similar to the morphology of sleep slow waves, wherein the standard formula isWherein K (γ) represents a normalization coefficient; y= { u, ω, s, Φ }; u represents the center position of the Gabor function; ω represents the angular frequency of the Gabor function; s represents the scale parameter of the Gabor function; phi represents the phase parameter of the Gabor function;
and setting parameters of a Gabor function by utilizing the characteristic of the sleep slow wave, wherein the parameters of the Gabor function comprise Y.
9. The offline sleep slow wave detection system according to claim 8, wherein the setting of parameters of the Gabor function using the characteristics of the sleep slow wave comprises:
Setting upAngular frequency as a function of Gabor, where F s Representing the sampling rate, f is determined to be f E [0.5,2 ] according to the frequency range of the standard sleep slow wave]Hz, and the step size is set to 0.1Hz;
each sleep slow wave is used as an independent time to detect, and one sleep slow wave only represents one oscillation, so that the scale parameter of the Gabor function is set as
For each frequency value, selecting a separate value of ω (f) and s (f) to ensure that the exponential component of the Gabor function and the frequency of the cosine function are compatible;
setting phase parametersAnd the step size is +.>To ensure that the positive and negative oscillation amplitudes of the Gabor function are large enough to capture the negative and positive deflections of the sleep slow wave signal;
to ensure that the center position of the Gabor function matches the zero position between the negative and positive deflections of the slow sleep wave, the formula is usedCalculating the center position of the Gabor function; wherein z represents the negative to positive zero bit in the signalAnd (5) placing.
10. The offline sleep slow wave detection system according to claim 9, wherein the detecting slow waves in the specific sleep electroencephalogram signal according to the improved matching pursuit algorithm implemented based on a pre-constructed dictionary using a slow wave detection module in the data processing and visualization module comprises:
Step b1, receiving the specific sleep electroencephalogram signal by utilizing a sliding window with preset duration and performing filtering treatment to obtain a current window signal;
step b2, detecting all zero crossing points in the current window signal, and taking the zero crossing points from negative to positive as candidate points;
step b3, for each obtained candidate point, calculating the negative-to-positive zero crossing point frequency f within a preset time length near the candidate point zero
Step b4, judging f zero Whether greater than a given threshold; if yes, executing the step b5, and if not, executing the step b6;
step b5, removing the candidate points;
step b6, determining the candidate point as a reserved candidate point;
step b7, processing each reserved candidate point obtained by the current window signal by utilizing a matching pursuit algorithm and the dictionary, selecting an atom with the largest scalar product as the atom which is most matched with the current residual signal, and updating the current residual signal by utilizing the obtained largest scalar product;
step b8, judging whether the obtained maximum scalar product is larger than a preset scalar product threshold value; if not, executing the step b9, if yes, executing the step b10;
step b9, determining that the reserved candidate point is not a slow wave, executing step b7, and executing step b1 after the reserved candidate point obtained by the current window signal is traversed;
Step b10, adding the reserved candidate points into a candidate slow wave list, executing step b7, and executing step b1 after the reserved candidate points obtained by the current window signal are traversed;
and b11, filtering signals near each reserved candidate point in the candidate slow wave list to a preset frequency range, setting the starting point of the slow wave as the first zero crossing point from positive to negative before the reserved candidate point, setting the ending point as the first zero crossing point after the reserved candidate point, judging whether the duration time is in the preset duration time, and if so, judging the corresponding waveform as the slow wave.
CN202310713137.0A 2023-06-15 2023-06-15 Offline sleep slow wave detection system Pending CN116763255A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310713137.0A CN116763255A (en) 2023-06-15 2023-06-15 Offline sleep slow wave detection system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310713137.0A CN116763255A (en) 2023-06-15 2023-06-15 Offline sleep slow wave detection system

Publications (1)

Publication Number Publication Date
CN116763255A true CN116763255A (en) 2023-09-19

Family

ID=87992442

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310713137.0A Pending CN116763255A (en) 2023-06-15 2023-06-15 Offline sleep slow wave detection system

Country Status (1)

Country Link
CN (1) CN116763255A (en)

Similar Documents

Publication Publication Date Title
CN110811609B (en) Epileptic spike intelligent detection device based on self-adaptive template matching and machine learning algorithm fusion
US20240023886A1 (en) Noninvasive method and system for sleep apnea detection
CN110338786B (en) Epileptic discharge identification and classification method, system, device and medium
CN107361766B (en) Emotion electroencephalogram signal identification method based on EMD domain multi-dimensional information
CN110135285B (en) Electroencephalogram resting state identity authentication method and device using single-lead equipment
CN108577865A (en) A kind of psychological condition determines method and device
CN109602417A (en) Sleep stage method and system based on random forest
CN113057648A (en) ECG signal classification method based on composite LSTM structure
CN107822645B (en) Emotion recognition method based on WiFi signal
CN109871831B (en) Emotion recognition method and system
CN106725452A (en) Based on the EEG signal identification method that emotion induces
CN106874722A (en) A kind of personal identification method and its device based on electrocardiosignal
CN109620218A (en) Brain wave intelligence screening method and system
CN110786849B (en) Electrocardiosignal identity recognition method and system based on multi-view discriminant analysis
CN112426160A (en) Electrocardiosignal type identification method and device
CN114781465A (en) rPPG-based non-contact fatigue detection system and method
CN111920420A (en) Patient behavior multi-modal analysis and prediction system based on statistical learning
CN108875799A (en) A kind of Mental imagery classifying identification method based on improvement S-transformation
CN116649913A (en) Sleep quality assessment system based on global slow waves
CN117883082A (en) Abnormal emotion recognition method, system, equipment and medium
CN114578963A (en) Electroencephalogram identity recognition method based on feature visualization and multi-mode fusion
CN117918863A (en) Method and system for processing brain electrical signal real-time artifacts and extracting features
Hurtado-Rincon et al. Motor imagery classification using feature relevance analysis: An Emotiv-based BCI system
JP2017042562A (en) Music hearing experience presence/absence estimation method, music hearing experience presence/absence estimation device and music hearing experience presence/absence estimation program
CN113178195B (en) Speaker identification method based on sound-induced electroencephalogram signals

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination