A sleep quality monitoring method that integrates multiscale features.
Patent Information
- Application Number
- JP2026060782
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2025-09-17
- Filing Date
- 2026-04-02
- Publication Date
- 2026-09-01
- Estimated Expiration
- 2046-04-02
AI Technical Summary
【0039】 本発明は、従来技術と比較して、以下の有益な効果を有する。 1.本発明は、状態空間モデル(SSM)に基づくMambaフレームワークを初めてMTS解析に導入し、従来のTransformerアーキテクチャに代替した。線形時間計算量O(L)により動的な時間依存性を捕捉し、TransformerのO(L2)と比較して計算オーバーヘッドを大幅に低減する。特に、長系列のMTSデータ(例えば、脳波EEG信号)において、Mambaフレームワークは、時間スタンプ間の動的相関性を高効率にモデル化し、複雑な時間パターンに対するモデルの適応性を向上させる。
Smart Images

Figure 0007913796000001_ABST
Abstract
Description
[Technical Field]
[0001] The present invention belongs to the technical field of sleep stage classification, and particularly relates to a sleep quality monitoring method fusing multi-scale features. [Background Art]
[0002] Sleep stage classification is an important topic in neuroscience and clinical medicine. By analyzing physiological signals such as electroencephalogram (EEG), electrooculogram (EOG) and electromyogram (EMG), sleep can be classified into different stages including wakefulness, rapid eye movement (REM) and non-rapid eye movement (NREM), so as to evaluate sleep quality and diagnose sleep disorders such as obstructive sleep apnea syndrome (OSA). With the rapid development of machine learning technology and the advancement of open data promotion, the field of automatic sleep stage classification has made remarkable progress. Conventional sleep stage determination relies on a method in which human experts manually score consecutive 30-second physiological signals based on the criteria of Rechtschaffen and Kales (R&K) or the American Academy of Sleep Medicine (AASM). This process is not only time-consuming but also subjective, which may lead to inconsistencies among evaluators.
[0003] Although existing methods have achieved remarkable improvement in the accuracy of sleep stage classification, there are still clear limitations. First, conventional methods based on Recurrent Neural Network (RNN) and Convolutional Neural Network (CNN) often process the time dimension independently and ignore the spatial correlation between different channels. Second, although existing methods based on Graph Neural Network (GNN) can model the spatial dependency between sensors, they usually rely on a static graph structure and assume that the relationship between sensors is invariant in the time dimension. Such an assumption cannot sufficiently capture the dynamic correlation between sensors at different time stamps. [Summary of the Invention]
[0004] In view of the above points, the present invention provides a sleep quality monitoring method fusing multi-scale features for improving the accuracy of sleep stage classification while ensuring the high efficiency of sleep stage classification.
[0005] In a first aspect, the present invention provides a sleep quality monitoring method fusing multi-scale features, comprising the following step 1 to step 4: Step 1: Preprocessing an input signal to unify signal amplitude, then inputting the preprocessed signal into a multi-modal sleep signal analysis network, wherein the input signal comprises an electroencephalogram (EEG) signal, an electrooculogram (EOG) signal and an electromyogram (EMG) signal, Step 2: Based on step 1, capturing features of multiple time scales by using a multi-granularity feature learning module, and performing feature fusion, Step 3: Based on step 2, integrating spatial information by using a spatio-temporal feature enhancement module, and mapping three-dimensional features to a two-dimensional time-series feature sequence, Step 4: Based on step 3, modeling long-distance temporal dependencies with linear computational complexity by a Mamba-based temporal context module, performing average aggregation on features along the temporal dimension through a classification module, and outputting a classification result through a fully connected layer and an activation function Softmax.
[0006] Optionally, the preprocessing in step 1 comprises dimension adjustment, low-pass filtering, channel selection and signal normalization, First, dimensional adjustment is performed to expand the original three-dimensional data of the input signal into a four-dimensional format. Next, high-frequency noise is removed by low-pass filtering, specifically using a Butterworth filter to achieve 40Hz low-pass filtering. Zero-phase filtering is employed during the filtering process. Subsequently, channel selection is performed, selecting relevant signal channels according to research needs and specific channels for different datasets. Finally, the input signal is normalized through a learnable scaling layer, and adaptive adjustment of the signal amplitude is achieved by applying independent scaling factors and offsets to each channel.
[0007] Optionally, in step 2 above, The multi-granularity feature learning module includes two submodules: a multi-scale convolution module and a feature fusion module. The multiscale convolutional module extracts features from the input signal at different time resolutions through a parallel multiscale processing architecture, and the multiscale convolutional module first applies different scale factors to the input signal.
number
number
number
number
[0008] Optionally, the feature fusion module employs a multimodal branching architecture to perform independent feature extraction and enhancement for different types of input signals. The feature fusion module first divides the input features into three processing channels according to the type of input signal: an EEG signal processing channel, an EOG signal processing channel, and an EMG signal processing channel. Each processing channel employs a two-dimensional convolutional layer to extract specific patterns for each signal type. Subsequently, through a channel attention mechanism, the representation intensity of important feature channels is adaptively enhanced. The features processed by the three processing channels are concatenated on the feature dimension, and after batch normalization, nonlinear activation, and dropout regularization, a fused multimodal feature representation is formed. The entire process is expressed by the following equation:
number
number
[0009] Optionally, in step 3 above, The spatiotemporal feature enhancement module integrates the spatial relationships of multi-channel input signals through cross-channel convolution. The module first applies a two-dimensional convolutional layer with a convolution kernel covering the spatial dimensions of all channels to perform cross-channel feature extraction. Next, it adaptively enhances the expressive strength of important feature channels using a channel attention mechanism. Then, it improves the stability and expressive power of the features through batch normalization and a nonlinear activation function. Finally, it removes the integrated spatial dimensions, transforming the features into a two-dimensional time-series feature sequence suitable for subsequent time-series modeling. The entire process is represented by the following equation:
number
number
number
[0010] Optionally, step 4 above is: The Mamba-based time-context module dynamically updates the signal state through a selective state-space model (SSM), capturing the time-dependency and complex change features of the EEG signal, and the time-context module outputs X from the spatiotemporal feature enhancement module.spatial is received. First, it is adapted to the input through dimensional transformation, and the feature dimension is mapped to the predefined embedding space dimension embed_dim through linear transformation, that is,
Mathematical Expression
Mathematical Expression
Mathematical Expression
[0011] Optionally, the processing process of the Mamba-based temporal context module includes the following state update, output calculation and residual connection, (1) State update: input vector X at the current time step t t dynamically generates parameters A t , B t based thereon, and the state equation h t =A t h t-1 +B tX t Using the hidden state h t By updating h, we capture long-range time dependencies, where h t represents the hidden state vector at time step t, and h t-1 represents the hidden state vector of the previous time step t-1, and A t This represents the state transition matrix, which changes dynamically in response to input and is used to update the hidden state, B t represents the dynamic input projection matrix, and the input vector X t Used to map to the hidden state space, (2) Output calculation: Dynamic projection C t Combine this with the skip weight D, y t =C t h t +DX t Outputs, and here, y t represents the output feature vector at time step t, and C t represents the dynamic output projection matrix, used to map the hidden state to the feature space, and D represents the learnable skip connection weights. (3) Residual connection: Output y t and the original input X t Add the output of the time context module.
number
[0012] Optionally, applying independent scaling factors and offsets to each channel includes the following axis swapping operations, application of scaling factors, application of offsets, and restoration of the original axis order. a. Axis swapping operation: Swap the second and third axes of the input tensor. b. Application of scaling factors: The multiplication operation x*self.weights applies an independent scaling factor to each channel, and due to PyTorch's broadcast mechanism, the shape of self.weights is [num_features], which is automatically expanded to match the dimension of the input tensor, thereby scaling each channel individually. c. Application of offsets: An independent offset is applied to each channel by the addition operation x + self.bias, and similarly, self.bias is extended to the appropriate dimension through the broadcast mechanism. d. Restoring the original axis order: Finally, swap the second and third axes again to return the tensor to its original dimensional order.
[0013] In a second aspect, an embodiment of the present invention provides a computer-readable storage medium. The computer-readable storage medium includes a stored program, and when the program is executed, it controls a device on which the computer-readable storage medium is located to execute a multiscale feature-integrated sleep quality monitoring method according to the first aspect or a possible embodiment of either aspect.
[0014] In a third aspect, an embodiment of the present invention provides an electronic device comprising one or more processors, memory, and one or more computer programs, the one or more computer programs being stored in the memory, the one or more computer programs including instructions, and when the instructions are executed by the electronic device, the electronic device is caused to perform a sleep quality monitoring method integrating multiscale features according to the first aspect or any possible embodiment of the first aspect.
[0015] In the technical solution provided by the present invention, the method involves preprocessing the input signal to match its amplitude, then inputting it into a multimodal sleep signal analysis network, capturing features from multiple time scales through a multi-granularity feature learning module and performing feature fusion, integrating spatial information using a spatiotemporal feature enhancement module, mapping three-dimensional features to a two-dimensional time-series feature sequence, further modeling long-range time dependencies with linear computation complexity using a Mamba-based time-context module, averaging and aggregating features along the time dimension via a classification module, and outputting classification results using a fully connected layer and the Softmax activation function. This ensures high efficiency in sleep stage classification and improves the accuracy of sleep stage classification. [Brief explanation of the drawing]
[0016] To more clearly explain the technical means of the embodiments of the present invention, the accompanying drawings used in the embodiments are briefly described below. As is clear, the accompanying drawings in the following description represent only some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these without requiring any creative effort.
[0017] [Figure 1] This is a flowchart of a sleep quality monitoring method that integrates multiscale features, as provided in an embodiment of the present invention. [Figure 2] This is a flowchart of a sleep quality monitoring method that integrates other multiscale features, as provided in an embodiment of the present invention. [Figure 3] This is a schematic diagram of an electronic device provided in an embodiment of the present invention. [Modes for carrying out the invention]
[0018] To further clarify the objectives, technical solutions, and advantages of the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings relating to the embodiments of the present invention. It will be clear that the embodiments described are only some, not all, embodiments of the present invention. All other embodiments that can be obtained by those skilled in the art without creative effort based on the embodiments of the present invention are within the scope of the protection of the present invention.
[0019] The examples described herein represent only a portion of the present invention, not all of it. All other examples that a person skilled in the art could obtain without creative effort based on the examples of the present invention are within the scope of protection of the present invention.
[0020] The terms used in the embodiments of the present invention are for the purpose of describing specific embodiments only and are not intended to limit the invention. The singular forms "one kind," "the said," and "the said" used in the embodiments of the present invention shall include the plural form unless the context clearly indicates otherwise.
[0021] As used herein, the terms "and / or" describe the relationship between related objects. For example, A and / or B includes three possibilities: A exists alone, A and B exist simultaneously, and B exists alone. The symbol " / " used herein generally indicates that the preceding and following related objects are in an "or" relationship.
[0022] Depending on the context, the term "if" as used herein may be interpreted as "when," "in the event of," "in response to confirmation," or "in response to detection." Similarly, depending on the context, "if confirmed" or "if detected (the described condition or event)" may be interpreted as "when confirmed," "in response to confirmation," "when detected (the described condition or event)," or "in response to detection."
[0023] The present invention provides a sleep quality monitoring method that integrates multiscale features, and as shown in Figures 1 and 2, the method includes the following steps. Step 1: The input signals are preprocessed to match the signal amplitudes, and then input into a multimodal sleep signal analysis network, where the input signals include electroencephalogram (EEG), electrooculogram (EOG), and electromyogram (EMG) signals.
[0024] In embodiments of the present invention, before inputting the input signal to the multimodal sleep signal analysis network, a series of preprocessing steps are required to adapt the data format to the model processing and improve model performance. The preprocessing in step 1 includes dimensionality adjustment, low-pass filtering, channel selection, and signal normalization. First, dimensional adjustment is performed to expand the original three-dimensional data of the input signal (number of samples, number of channels, time series length) into a four-dimensional format (batch size, 1, number of channels, time series length). This dimensional expansion provides a data structure suitable for subsequent two-dimensional convolution processing. Next, low-pass filtering is applied to remove high-frequency noise, and a Butterworth filter is used to achieve 40Hz low-pass filtering, preserving important frequency components related to sleep. Zero-phase filtering technique is employed during the filtering process to prevent the introduction of phase distortion and effectively preserve the temporal characteristics of the signal. Subsequently, channel selection is performed, selecting relevant signal channels according to research needs. Specific channels are selected for different datasets; for example, 9 channels are selected for the ISRUC dataset and 4 channels for the Sleep-EDF dataset, allowing the model to focus on the input signals most relevant to sleep analysis. Finally, the input signal is normalized through a learnable scaling layer, and adaptive adjustment of signal amplitude is achieved by applying independent scaling factors and offsets to each channel. This method allows adaptation to characteristic differences between different channel signals, improving the model's processing capability for various input signals.
[0025] In embodiments of the present invention, applying independent scaling factors and offsets to each channel includes the following: a. Axis swap operation: Swap the second and third axes of the input tensor so that the weights are correctly applied to each channel. b. Application of scaling factors: An independent scaling factor is applied to each channel by the multiplication operation x*self.weights. Due to PyTorch's broadcast mechanism, the shape of self.weights is [num_features] and is automatically expanded to match the dimension of the input tensor, thereby scaling each channel individually. c. Application of offsets: An independent offset is applied to each channel by the addition operation x + self.bias, and similarly, self.bias is extended to the appropriate dimension through the broadcast mechanism. d. Restoring the original axis order: Finally, swap the second and third axes again to return the tensor to its original dimensional order.
[0026] Step 2: Based on Step 1, capture features across multiple time scales using a multi-granularity feature learning module and perform feature fusion.
[0027] In the embodiment of the present invention, step 2 includes the following: The multi-granularity feature learning module includes two submodules: a multi-scale convolution module and a feature fusion module. The multiscale convolutional module extracts features from the input signal at different time resolutions through a parallel multiscale processing architecture, and the multiscale convolutional module first applies different scale factors to the input signal.
number
number
number
number
[0028] Examples of the present invention The feature fusion module employs a multimodal branching architecture to perform independent feature extraction and enhancement for different types of input signals. First, the feature fusion module divides the input features into three processing channels according to the type of input signal: EEG signal processing channels (channels 1-6), EOG signal processing channels (channels 7-8), and EMG signal processing channel (channel 9). Each processing channel employs a two-dimensional convolutional layer to extract patterns specific to each signal type. Next, the representation intensity of important feature channels is adaptively enhanced through a channel attention mechanism. Features processed by the three processing channels are concatenated on the feature dimension, and through batch normalization, nonlinear activation, and dropout regularization, a fused multimodal feature representation is formed. The entire processing process is represented by the following equation.
number
number
[0029] Step 3: Based on Step 2, integrate the spatial information using the spatiotemporal feature enhancement module and map the three-dimensional features to a two-dimensional time-series feature sequence.
[0030] In the embodiment of the present invention, step 3 includes the following: The spatiotemporal feature enhancement module integrates the spatial relationships of multi-channel input signals through cross-channel convolution. The module first applies a two-dimensional convolutional layer with a convolution kernel covering the spatial dimensions of all channels to perform cross-channel feature extraction. Next, it adaptively enhances the expressive strength of important feature channels using a channel attention mechanism. Then, it improves the stability and expressive power of the features through batch normalization and a nonlinear activation function. Finally, it removes the integrated spatial dimensions, transforming the features into a two-dimensional time-series feature sequence suitable for subsequent time-series modeling. The entire process is represented by the following equation:
number
number
number
[0031] Steps 4 and 3 are used to model long-range time dependencies with linear computational complexity using a Mamba-based time context module, to average and aggregate features along the time dimension via a classification module, and to output classification results using a fully connected layer and the Softmax activation function.
[0032] In the embodiments of the present invention, step 4 includes the following: The Mamba-based time-context module dynamically updates the signal state through a selective state-space model (SSM), capturing the time-dependency and complex change features of the EEG signal, and the time-context module outputs X from the spatiotemporal feature enhancement module. spatial Upon receiving the data, first, it is adapted to the input through dimensional transformation, and then the feature dimension is mapped to a predefined embedding space dimension, embed_dim, using a linear transformation, i.e.,
number
number
number
[0033] In an embodiment of the present invention, the processing steps of the Mamba-based time context module include the following state update, output calculation, and residual connection: (1) State update: Input vector X at the current time step tt Based on parameter A t , B t Dynamically generate the state equation h t =A t h t-1 +B t X t Using the hidden state h t By updating h, we capture long-range time dependencies, where h t represents the hidden state vector at time step t, and h t-1 represents the hidden state vector of the previous time step t-1, and A t This represents the state transition matrix, which changes dynamically in response to input and is used to update the hidden state, B t represents the dynamic input projection matrix, and the input vector X t Used to map to the hidden state space, (2) Output calculation: Dynamic projection C t Combine this with the skip weight D, y t =C t h t +DX t Outputs, and here, y t represents the output feature vector at time step t, and C t represents the dynamic output projection matrix, used to map the hidden state to the feature space, and D represents the learnable skip connection weights. (3) Residual connection: Output y t and the original input X t Add the output of the time context module.
number
[0034] The present invention was experimentally validated using the publicly available standard dataset ISRUC-S3, and the performance of the model on the experimental dataset is shown in Table 1. The ISRUC-S3 dataset contains all-night polysomnography (PSG) recordings of 10 healthy subjects, collected and provided by the Sleep Medicine Center (CHUC) at the University Hospital of Coimbra, Portugal. The dataset includes approximately 8 hours of continuous recording for each subject and is characterized by the inclusion of pre-processed physiological recordings and other auxiliary signals obtained from six electroencephalogram (EEG) channels, two electrooculography (EOG) channels, one electromyogram (EMG), and one electrocardiogram (ECG). Regarding data annotation, ISRUC-S3 follows the criteria of the American Academy of Sleep Medicine (AASM), with two specialist sleep physicians independently performing visual assessments for each 30-second time window (epoch) and classifying the data into five sleep stages: wakefulness (W), non-rapid eye movement (NREM: N1, N2, N3), and rapid eye movement (REM). In the data preprocessing stage, considering that the periodic characteristics of electrocardiogram (ECG) signals differ significantly from other physiological signals, the present invention excludes data from this channel.
[0035] To comprehensively evaluate the classification performance of the model, we used three evaluation metrics: accuracy, macro-F1 score (MF1), and Cohen's kappa coefficient (κ). The specific definitions and calculation methods for these metrics are as follows, and true positives (TP) for the i-th class are measured. i ), false positive (FP i ), true negative (TN i ) and false negatives (FN i Based on the above, Accuracy and MF1 are calculated using the following formula. The formula is as follows:
number
number
number
[0036] Table 1: Model performance on experimental datasets [Table 1]
[0037] As is clear from Table 1, the present invention was compared with four types of advanced sleep stage classification methods. Specifically, the four types of advanced sleep stage classification methods are a sleep neural network combining CNN and bidirectional long short-term memory (DeepSleepNet), an EEG classification network combining deep convolution and segregated convolution (EEGNet), a sleep network classifier based on multi-head attention (AttnSleep), and a fully connected spatiotemporal network graph (FCSTGNN). Specifically, on the ISRUC-S3 dataset, the method of the present invention showed superior performance to existing methods in all evaluation metrics. The model of the present invention achieved an accuracy rate of 81.2%, which was 2.7 points higher than DeepSleepNet, which had the next best performance. In addition, the macro average F1 score and Cohen's kappa coefficient reached 80.04% and 77.5%, respectively, showing similarly significant superiority. Of particular note is that in the N1 stage, which is difficult to distinguish, the present invention model achieved an F1 score of 62.7%, an improvement of 2.7 points over the next best model, demonstrating that the present invention method has a significant advantage in processing sleep stages with small interclass differences and unbalanced samples. Furthermore, the present invention model achieved the best performance in distinguishing between the wakefulness (W), N2, N3, and REM stages. The experimental results described above fully support the advanced nature of the present invention. Not only did it achieve overall performance improvement, it demonstrated a unique advantage even in processing the challenging N1 stage. Furthermore, its stable performance across datasets reflects the model's excellent generalization ability, providing new guidance for the further development and clinical application of automated sleep stage classification technology.
[0038] This invention significantly improves the spatiotemporal modeling capabilities of multivariate time series (MTS). Specifically, the model extracts features from multiple time scales through a multiscale convolutional module, enhances spatial correlation between signals through channel attention, and clearly separates the spatiotemporal feature extraction process by employing a spatial convolutional layer. Experimental results show that the model outperforms existing baseline models in multiple publicly available MTS sleep datasets, demonstrating a highly efficient solution for real-time biomedical signal processing.
[0039] Compared to the prior art, the present invention has the following beneficial effects. 1. This invention is the first to introduce a Mamba framework based on a state-space model (SSM) into MTS analysis, replacing the conventional Transformer architecture. It captures dynamic time dependencies with linear time complexity O(L), and the Transformer architecture is O(L 2 Compared to other methods, it significantly reduces computational overhead. In particular, with long-series MTS data (e.g., electroencephalogram (EEG) signals), the Mamba framework efficiently models dynamic correlations between time stamps and improves the model's adaptability to complex time patterns.
[0040] 2. By combining a multiscale convolution module, a channel attention mechanism, a spatiotemporal feature enhancement module, and a Mamba-based time context module, the spatiotemporal dependencies of MTS data are comprehensively captured. Multiscale convolution extracts features from different time spans, channel attention enhances the coordinated effects of multiple signals such as EEG, EOG, and EMG, the spatiotemporal feature enhancement module models static correlations between signals, and the Mamba-based time context module dynamically captures interactions in the time dimension. This provides a more comprehensive representational capability compared to single time modeling with conventional RNNs and CNNs, or the static graph structure of GNNs.
[0041] 3. While maintaining high performance, it significantly reduces computational complexity and the number of parameters, making it suitable for real-time biomedical signal processing, and maintaining high classification performance while meeting the requirements for low latency and high efficiency.
[0042] In the technical solution provided by the present invention, the method involves preprocessing the input signal to match its amplitude, then inputting it into a multimodal sleep signal analysis network, capturing features from multiple time scales through a multi-granularity feature learning module and performing feature fusion, integrating spatial information using a spatiotemporal feature enhancement module, mapping three-dimensional features to a two-dimensional time-series feature sequence, further modeling long-range time dependencies with linear computation complexity using a Mamba-based time-context module, averaging and aggregating features along the time dimension via a classification module, and outputting classification results using a fully connected layer and the Softmax activation function. This ensures high efficiency in sleep stage classification and improves the accuracy of sleep stage classification.
[0043] Each step in the embodiments of the present invention can be performed by an electronic device, which includes, but is not limited to, a tablet device, a portable PC, a desktop computer, and the like.
[0044] Embodiments of the present invention provide a computer-readable storage medium containing a stored program, and when the program is executed, the computer-readable storage medium controls an electronic device on which it is located to perform an embodiment of the sleep quality monitoring method that integrates the aforementioned multiscale features.
[0045] Figure 3 is a schematic diagram of an electronic device provided according to an embodiment of the present invention. As shown in Figure 3, the electronic device 21 includes a processor 211, a memory 212, and a computer program 213 stored in the memory 212 and executable on the processor 211. When the computer program 213 is executed by the processor 211, a sleep quality monitoring method integrating multiscale features according to the embodiment is realized. To avoid redundancy, a detailed explanation is omitted here.
[0046] The electronic device 21 includes, but is not limited to, a processor 211 and memory 212. As those skilled in the art will know, Figure 3 is merely an example of the electronic device 21 and is not limiting to it. It may include more or fewer components than those shown, some components may be combined, or different components may be provided. For example, the electronic device may further include input / output devices, network connection devices, buses, etc.
[0047] The processor 211 may be a Central Processing Unit (CPU), a general-purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc. The general-purpose processor may be a microprocessor, or any ordinary processor.
[0048] Memory 212 may be an internal storage device of the electronic device 21, such as a hard disk or memory of the electronic device 21. Memory 212 may also be an external storage device of the electronic device 21, such as a removable hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card equipped in the electronic device 21. Furthermore, memory 212 may include both the internal and external storage devices of the electronic device 21. Memory 212 is used to store computer programs and other programs and data necessary for network devices, and is also used to temporarily store data that has already been output or will be output.
[0049] Those skilled in the art can, for the convenience and brevity of this description, refer to the corresponding processes in the method embodiments described above for the specific operating processes of the aforementioned systems, apparatus, and units, and a detailed explanation is omitted here.
[0050] The above description is merely one example of preferred embodiments of the present invention and does not limit the invention. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are within the scope of protection of the present invention.
Claims
1. A sleep quality monitoring method that integrates multiscale features, including steps 1 to 4 below, Step 1: The input signal is preprocessed to equalize the signal amplitude, and then input into the multimodal sleep signal analysis network, where the input signal includes electroencephalogram (EEG) signals, electrooculogram (EOG) signals, and electromyogram (EMG) signals. Step 2: Based on Step 1, capture features across multiple time scales using a multi-granularity feature learning module and perform feature fusion. Step 3: Based on Step 2, spatial information is integrated using the spatiotemporal feature enhancement module, and three-dimensional features are mapped to a two-dimensional time-series feature sequence. Step 4: Based on Step 3, the time-context module based on Mamba models the long-range time dependency with linear computational complexity, the classification module averages and aggregates the features along the time dimension, and the fully connected layer and activation function Softmax output the classification result. In step 2, The multi-granularity feature learning module includes two submodules: a multi-scale convolution module and a feature fusion module. The multiscale convolutional module extracts features from the input signal at different time resolutions through a parallel multiscale processing architecture, and the multiscale convolutional module first applies different scale factors to the input signal. [Math 1] Based on this, an average pooling process is performed to reduce the time resolution, then independent two-dimensional convolution operations are applied to the signals at each scale to extract local time features, followed by enhancement of expressive power with a nonlinear activation function, and finally, the features at each scale are concatenated on the channel dimension to form a multiscale feature representation. The entire process is expressed by the following equation: [Math 2] During the ceremony, [Math 3] Here, represents the input features, B is the batch size, N is the feature dimension, T is the time series length, S = {1, 2, 4, 8} represents the scale factor set, f represents the nonlinear activation function, D represents the Dropout operation, Conv represents the convolution operation, Concat represents the feature concatenation, and Avgpool(X, s) represents performing an average pooling operation on X with scale s. [Math 4] This represents the output characteristics of the multiscale convolution module, C out represents the total number of output channels, and T' represents the time length after downsampling. The feature fusion module employs a multimodal branching architecture, performing independent feature extraction and enhancement for different types of input signals. The feature fusion module first divides the input features into three processing channels—EEG, EOG, and EMG—according to the type of input signal. Each processing channel employs a two-dimensional convolutional layer to extract specific patterns for each signal type. Subsequently, through a channel attention mechanism, the representation intensity of important feature channels is adaptively enhanced. The features processed by the three processing channels are then concatenated on the feature dimension, and after batch normalization, nonlinear activation, and Dropout regularization, a fused multimodal feature representation is formed. The entire process is represented by the following equation: [Math 5] In the formula, X EEG , X EOG , X EMG These are X out The three types of signals after splitting are represented as electroencephalogram (EEG) signals, electrooculogram (EOG) signals, and electromyogram (EMG) signals. Conv represents the convolution operation, SE represents the channel attention mechanism, Concat represents feature concatenation, BN represents batch normalization, and D represents the Dropout operation. [Math 6] This represents the output of the feature fusion module, where C out '' represents the total number of output channels, and T'' represents the time length after the second downsampling. In step 3, The spatiotemporal feature enhancement module integrates the spatial relationships of multi-channel input signals through cross-channel convolution. The module first applies a two-dimensional convolutional layer with a convolution kernel covering the spatial dimensions of all channels to perform cross-channel feature extraction. Next, it adaptively enhances the expressive strength of important feature channels using a channel attention mechanism. Then, it improves the stability and expressive power of the features through batch normalization and a nonlinear activation function. Finally, it removes the integrated spatial dimensions, transforming the features into a two-dimensional time-series feature sequence suitable for subsequent time-series modeling. The entire process is represented by the following equation: [Number 7] During the ceremony, [Number 8] represents the output features of the feature fusion module, Conv represents the convolution operation, SE represents the channel attention mechanism, BN represents batch normalization, f represents the nonlinear activation function, and squeeze(2) represents the operation to remove the third dimension. [Number 9] This represents the output of the spatiotemporal feature enhancement module, C spatial A method characterized by representing the number of output channels of a spatiotemporal feature enhancement module.
2. The preprocessing in step 1 includes dimensionality adjustment, low-pass filtering, channel selection, and signal normalization. First, dimensional adjustment is performed to expand the original three-dimensional data of the input signal into a four-dimensional format. Next, high-frequency noise is removed by low-pass filtering, and here, a Butterworth filter is used to achieve 40 Hz low-pass filtering, and zero-phase filtering technology is employed in the filtering process. Subsequently, channel selection is performed, relevant signal channels are selected according to research needs, and specific channels are selected for different datasets. The method according to claim 1, characterized in that, finally, the input signal is normalized through a learnable scaling layer, and an independent scaling factor and offset are applied to each channel to achieve adaptive adjustment of the signal amplitude.
3. In step 4, The Mamba-based time-context module dynamically updates the signal state through a selective state-space model (SSM), capturing the time-dependent and complex change features of the EEG signal, and the time-context module outputs X from the spatiotemporal feature enhancement module. spatial Upon receiving the data, first, it is adapted to the input through dimensional transformation, and then the feature dimensions are mapped to the predefined embedding space dimension embed_dim through linear transformation, i.e., [Number 10] Next, the Mamba-based time context module processes the sequence using a selective state-space model (SSM), learns global time context relationships between EEG signal features, and finally outputs a feature tensor with time-series recognition capabilities. First, the feature tensor output by the time context module is transposed. Next, mean pooling is applied on the time dimension to compress the time-series features into fixed-length feature vectors. Finally, the feature vectors are mapped to the sleep stage category space through a fully connected layer, and a probability distribution is generated using the Softmax activation function. The category with the highest probability is taken as the final classification result. The entire classification process is expressed by the following equation: [Math 11] During the ceremony, [Math 12] The method according to claim 1, characterized in that represents the output features of the time context module, TRANSPOSE represents the dimensional adjustment operation, AvgPool represents the mean pooling operation, W and b represent the weights and bias parameters of the fully connected layer, respectively, the Softmax function is used to convert the output to a probability distribution, and Y represents the final classification result.
4. The processing steps of the Mamba-based time context module include the following: state updates, output calculations, and residual connections. (1) State update: input vector X at current time step t t based on which parameter A t , B t are dynamically generated, and the state equation h t = A t h t-1 + B t X t is used to update the hidden state h t , thereby capturing long-distance temporal dependencies, where h t represents a hidden state vector at time step t, h t-1 represents a hidden state vector at previous time step t-1, A t represents a state transition matrix, which dynamically changes according to inputs and is used for updating the hidden state, B t represents a dynamic input projection matrix, which is used for mapping the input vector X t to a hidden state space, (2) Output calculation: Dynamic projection C t Combine this with the skip weight D, y t = C t h t +DX t Outputs, and here, y t represents the output feature vector at time step t, C t represents the dynamic output projection matrix, used to map the hidden state to the feature space, and D represents the learnable skip connection weights. (3) Residual connection: Output y t and the original input X t Add the output of the time context module. [Number 13] By constructing this, the flow of the gradient is strengthened, and this process is X temporal = y t +Residual Connection (X t ) is expressed as, where Residual Connection represents the identity residual connection, X temporal This represents the output of the time context module, The method according to claim 3, characterized in that the entire process efficiently processes the sequence with linear computational complexity and balances local and global features.
5. Applying independent scaling factors and offsets to each channel involves the following axis swapping operations, application of scaling factors, application of offsets, and restoration of the original axis order. a. Axis swapping operation: Swap the second and third axes of the input tensor. b. Application of scaling factors: An independent scaling factor is applied to each channel by the multiplication operation x * self.weights. Due to PyTorch's broadcast mechanism, the shape of self.weights is [num_features] and is automatically expanded to match the dimension of the input tensor, thereby scaling each channel individually. c. Application of offsets: An independent offset is applied to each channel by the addition operation x + self.bias, and similarly, self.bias is extended to the appropriate dimension through the broadcast mechanism. d. Restoration of the original axis order: The method according to claim 2, characterized in that the second and third axes are swapped again at the end to return the tensor to its original dimensional order.
6. A computer-readable storage medium containing stored programs, A computer-readable storage medium characterized in that, when the program is executed, it controls the device on which the computer-readable storage medium is located to perform the method according to any one of claims 1 to 5.
7. An electronic device comprising one or more processors, memory, and one or more computer programs, The electronic device is characterized in that the one or more computer programs are stored in the memory, and the one or more computer programs include instructions, and when the instructions are executed by the electronic device, the electronic device causes the electronic device to perform the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Sleep stage classification method and system based on multi-granularity feature fusion
CN118436317A
Sleep staging method and system based on self-supervised learning and Mama network
CN118490179A
Lightweight automatic sleep staging method capable of being used for on-chip migration
CN120345857A