Sleep posture recognition model training and sleep posture recognition method and related device
Patent Information
- Application Number
- CN202310816949.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-04
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2043-07-04
AI Technical Summary
[0015]综上所述,本申请所述的睡姿识别模型训练与睡姿识别方法及相关设备,能够利用历史心冲击信号(Ballistocardiogram,BCG)训练基于空时特征融合和残差网络结构的深度学习睡姿识别模型,利用训练得到的睡姿识别模型根据用户的实时BCG信号进行睡姿判别,能够降低睡姿识别的成本的同时提高睡姿识别的准确率。
Smart Images

Figure CN116894226B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of deep learning technology, specifically to a sleeping posture recognition model training and sleeping posture recognition method and related equipment. Background Technology
[0002] Sleep quality is closely related to sleeping posture, and poor sleeping posture can even exacerbate the potential risks of various diseases. Therefore, sleeping posture can be used to diagnose postural sleep disorders, cardiovascular diseases, and other conditions. However, traditional methods of sleep posture recognition rely on professional medical equipment and healthcare personnel, making the cost of sleep posture recognition too high and limiting its widespread adoption in daily family life due to the need for professional operation by healthcare personnel. Summary of the Invention
[0003] In view of the above, it is necessary to propose a sleeping posture recognition model training and sleeping posture recognition method and related equipment, which can improve the accuracy of the model in recognizing sleeping postures while saving the training cost of the model.
[0004] Embodiment 1 of this application provides a method for training a sleeping posture recognition model. The method includes: acquiring training samples, the training samples including historical cardiac impact signals; preprocessing the training samples to obtain preprocessed training samples, including: calculating standardized historical cardiac impact signals using standardized parameters; and training a deep learning network model using the preprocessed training samples to obtain the sleeping posture recognition model. The structure of the deep learning network model includes: a convolutional neural network, a gated recurrent unit, and a deep residual network.
[0005] Optionally, the training samples may also include historical sleeping posture category labels corresponding to the historical cardiac impact signals.
[0006] Optionally, the standardization parameters include: the mean μ and standard deviation σ of all historical cardiac impact signals; the standardization process includes: calculating the relationship between the historical cardiac impact signal x and the standardization parameters based on a preset formula. i The corresponding zero-mean normalized historical cardiac impact signal x k The preset formula is
[0007]
[0008] Optionally, the convolutional neural network is used to extract time-frequency domain features of the preprocessed historical cardiac impact signal.
[0009] Optionally, the gated recurrent unit is used in conjunction with the convolutional neural network to extract the time-frequency domain features with a preset period.
[0010] Optionally, the deep residual network is used to connect different layers of the neural network of the deep learning network model.
[0011] Embodiment 2 of this application provides a sleeping posture recognition method, the method comprising: acquiring real-time cardiac impact signals and preprocessing the real-time cardiac impact signals; inputting the preprocessed real-time cardiac impact signals into a sleeping posture recognition model, wherein the sleeping posture recognition model is obtained using the sleeping posture recognition model training method described in Embodiment 1; extracting real-time features of the preprocessed real-time cardiac impact signals using the sleeping posture recognition model, and outputting a sleeping posture category corresponding to the real-time features, wherein the real-time features include real-time time-frequency domain features.
[0012] Embodiment 3 of this application provides a sleeping posture recognition model training device, the device comprising: a preprocessing module and a training module; the preprocessing module is used to acquire training samples, preprocess the training samples to obtain preprocessed training samples; the training module is used to train a deep learning network model using the preprocessed training samples to obtain the sleeping posture recognition model, wherein the structure of the deep learning network model includes: a convolutional neural network, a gated recurrent unit, and a deep residual network.
[0013] Embodiment 4 of this application provides an electronic device, which includes a processor and a memory. The processor is used to execute a computer program stored in the memory to implement the sleeping posture recognition model training and sleeping posture recognition method.
[0014] Embodiment 5 of this application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the sleeping posture recognition model training and sleeping posture recognition method.
[0015] In summary, the sleeping posture recognition model training, sleeping posture recognition method, and related equipment described in this application can train a deep learning sleeping posture recognition model based on spatiotemporal feature fusion and residual network structure using historical ballistocardiogram (BCG) signals. The trained sleeping posture recognition model can then be used to determine the sleeping posture based on the user's real-time BCG signal, thereby reducing the cost of sleeping posture recognition while improving its accuracy. Attached Figure Description
[0016] Figure 1 This is a flowchart of the sleeping posture recognition model training method provided in Embodiment 1 of this application.
[0017] Figure 2 This is a structural example diagram of the attention mechanism provided in the embodiments of this application.
[0018] Figure 3This is a schematic diagram of the network structure of the sleeping posture recognition model provided in the embodiments of this application.
[0019] Figure 4 This is a flowchart of the sleeping posture recognition method provided in Embodiment 2 of this application.
[0020] Figure 5 This is an example flowchart of the overall process of training the sleeping posture recognition model and the sleeping posture recognition method provided in the embodiments of this application.
[0021] Figure 6 This is a structural diagram of the sleeping posture recognition model training device provided in Embodiment 3 of this application.
[0022] Figure 7 This is a schematic diagram of the structure of the electronic device provided in Embodiment 5 of this application. Detailed Implementation
[0023] To better understand the above-mentioned objectives, features, and advantages of this application, the application will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.
[0024] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the specification of this application is for the purpose of describing an embodiment in one instance only and is not intended to be limiting of the application.
[0025] In one embodiment, sleep quality is closely related to sleeping posture, and poor sleeping posture can even exacerbate the potential risks of various diseases. Therefore, sleeping posture can be used to diagnose postural sleep disorders, cardiovascular diseases, and other conditions. However, traditional sleeping posture recognition methods rely on professional medical equipment and healthcare personnel, making the cost of sleeping posture recognition too high and requiring highly specialized operation by healthcare personnel, thus hindering its widespread adoption in daily home use.
[0026] Therefore, this application provides a sleeping posture recognition model training and sleeping posture recognition method, which can use historical ballistocardiogram (BCG) signals to train a deep learning sleeping posture recognition model based on spatiotemporal feature fusion and residual network structure. The trained sleeping posture recognition model is used to determine the sleeping posture based on the user's real-time BCG signal, which can reduce the cost of sleeping posture recognition while improving the accuracy of sleeping posture recognition.
[0027] The sleeping posture recognition model training method provided in this application embodiment is executed by an electronic device, and correspondingly, the sleeping posture recognition model training device runs in the electronic device.
[0028] Example 1
[0029] Figure 1 This is a flowchart of the sleeping posture recognition model training method provided in Embodiment 1 of this application. The sleeping posture recognition model training method specifically includes the following steps. Depending on different needs, the order of the steps in this flowchart can be changed, and some steps can be omitted.
[0030] S11, Obtain training samples, the training samples including historical cardiac impact signals.
[0031] In one embodiment, the cardiac impact signal is the change in external pressure caused by the heartbeat and blood circulation in the aorta. A PVDF (Polyvinylidene Fluoride) piezoelectric film can be used for non-contact detection of the human body to obtain the cardiac impact signal. PVDF piezoelectric films have advantages such as light weight, good impact resistance, and the ability to be cut to any size. Pressure applied to the surface of the PVDF piezoelectric film can cause deformation, thereby causing a change in the output charge. Therefore, PVDF piezoelectric films are suitable for BCG signal acquisition based on monitoring pressure changes.
[0032] For example, a piezoelectric film can be installed in a mattress to detect cardiac impact signals through clothing and sheets. Alternatively, a belt-type piezoelectric film can be strapped to the left or right arm to detect cardiac impact signals.
[0033] In one embodiment, the training samples include a preset number (e.g., 5000) of historical cardiac impact signals, and the training samples also include historical sleeping position category labels corresponding to the historical cardiac impact signals, wherein each historical cardiac impact signal corresponds to a historical sleeping position category label, and each historical cardiac impact signal has the same duration.
[0034] For example, the historical sleeping position category labels include, but are not limited to: supine, prone, left lateral, and right lateral; the duration of each historical cardiac impact signal can be set to 2 seconds, or it can be set to a multiple of the average human heartbeat cycle.
[0035] In one embodiment, historical cardiac impact signals represent historically acquired cardiac impact signals. The category of the human sleeping position corresponding to each historical cardiac impact signal is known; therefore, each historical cardiac impact signal corresponds to a historical sleeping position category label. For example, professional medical personnel can identify each historical cardiac impact signal to determine the corresponding human sleeping position category.
[0036] S12, preprocess the training samples to obtain preprocessed training samples, including: using standardized parameters to calculate standardized historical cardiac impact signals.
[0037] In one embodiment, the differences between multiple historical cardiac impact signals may be significant. For example, the difference in amplitude of the J-peak (the maximum forward peak of the BCG signal) in different historical cardiac impact signals may exceed a preset difference threshold. If multiple historical cardiac impact signals with large differences are directly used for model training, the role of historical cardiac impact signals with higher numerical values will be emphasized in the comprehensive analysis, while the role of historical cardiac impact signals with lower numerical values will be relatively weakened. Therefore, in order to improve the prediction accuracy of the trained model, it is necessary to standardize the historical cardiac impact signals.
[0038] In one embodiment, the normalization parameters include: the mean μ and standard deviation σ of all historical cardiac impact signals; the normalization process includes: calculating the relationship between the historical cardiac impact signal x and the normalization parameters based on a preset formula. i The corresponding zero-mean normalized historical cardiac impact signal x k The preset formula is The method also includes saving the standardized parameters for later use.
[0039] In other embodiments, historical BCG signals may contain interference from respiratory signals. Therefore, before performing the standardization process described above, the preprocessing may further include noise reduction of the historical cardiac impact signals. The noise reduction process includes using Discrete Wavelet Transform (DWT) technology to eliminate respiratory signals from the historical cardiac impact signals.
[0040] Specifically, a low-pass filter (e.g., a zero-phase-shift low-pass filter with a cutoff frequency of 30 Hz) is used to eliminate high-frequency noise in the historical cardiac impact signal; the respiratory signal in the historical cardiac impact signal after high-frequency noise elimination is separated and eliminated, for example, using DWT (dB 4, Level 9) to separate the respiratory signal, where the 9th level profile (0.2 to 0.5 Hz) contains the respiratory signal, and this level of signal is eliminated.
[0041] In other embodiments, the preprocessing may also include amplification processing, enhancement processing, etc.
[0042] S13, the sleeping posture recognition model is obtained by training a deep learning network model using the preprocessed training samples, wherein the structure of the deep learning network model includes: a convolutional neural network, a gated recurrent unit, and a deep residual network.
[0043] In one embodiment, because deep learning networks possess the capability of automatic feature engineering, they can automatically extract discriminative features from BCG signals through training. Therefore, deep learning networks are well-suited for continuous sleep posture monitoring using BCG signals. Deep learning methods for continuous sleep posture monitoring using BCG signals mainly include: Convolutional Neural Networks (CNN) classification models and Recurrent Neural Networks (RNN) regression models, etc.
[0044] In one embodiment, the BCG signal is a one-dimensional signal that can be viewed as a time series, possessing characteristics not only in the time domain (reflecting changes in amplitude over time) but also in the frequency domain (independent of time, reflecting the distribution of frequency).
[0045] When using convolutional neural networks (CNNs) to extract features from one-dimensional signals, there are two common methods: one is to convert the one-dimensional signal into an image and use a two-dimensional CNN as the feature extraction layer to extract features from the image, but this method is relatively computationally intensive; the other is to directly use a one-dimensional CNN to extract features from the BCG signal, using the one-dimensional CNN to extract the translation-invariant features of the BCG signal in the time direction. Specifically, a CNN is a feedforward network in which the inputs of each convolutional layer are independent of each other, the signal of each neuron can only propagate to the next layer, and the extraction of information from different channels within the same convolutional layer is independent.
[0046] In one embodiment, this application directly uses a one-dimensional convolutional neural network to extract features from the preprocessed historical cardiac impact signal. The convolutional neural network is used to extract the time-frequency domain features of the preprocessed historical cardiac impact signal, and the time-frequency domain features represent the fusion of time-domain features and frequency-domain features.
[0047] In one embodiment, Recurrent Neural Networks (RNNs) are suitable for processing time-series data (e.g., BCG signals). Long Short-Term Memory (LSTM) networks are a variant of RNNs, primarily designed to address the vanishing and exploding gradient problems during training on long-range sequence data (e.g., BCG signals). Compared to RNNs, LSTMs perform better on longer sequences. Gated Recurrent Units (GRUs) are an improvement on LSTMs, merging the forget gate and input gate into a single update gate. They also combine data unit states and hidden states, maintaining performance similar to LSTMs while reducing model complexity. Therefore, GRUs are a more efficient deep learning model than CNNs for processing time-series data, and also a more efficient method for extracting temporal feature information, capable of handling locally correlated time-series data.
[0048] In one embodiment, a gated recurrent unit (GRU) can be added to the structure of the sleeping posture recognition model based on the convolutional neural network (CNN). The GRU is used to combine with the CNN to extract the time-frequency domain features with a preset period. The prediction and classification model combining the CNN and the GRU can effectively address the shortcomings of a single model.
[0049] In one embodiment, while the gated recurrent unit possesses a certain ability to extract information from long sequence data, it lacks the ability to abstract features from short sequences, and its generalization ability gradually decreases as the input sequence becomes longer. To improve the model's generalization ability, a residual network structure incorporating an attention mechanism can be introduced into the sleeping posture recognition model.
[0050] The residual network structure with attention mechanism can fully extract feature information from BCG signal. It can filter out important and discriminative information in time and frequency domains while fully extracting feature information from BCG signal. It can reduce the problem of poor generalization performance caused by overfitting due to redundant features. It can improve the accuracy of the classification results of sleeping posture recognition model while ensuring the generalization performance of sleeping posture recognition model.
[0051] In one embodiment, the deep residual network is used to connect different layers of the neural network in the deep learning network model. Specifically, the deep residual network uses direct mappings to connect the different layers of the network.
[0052] Specifically, the attention mechanism allows the model to focus on the parts of the input data that are relevant to the current task, while ignoring other irrelevant information. It can determine the importance of different input elements by calculating the relationships between them, and then weight the inputs according to these importance.
[0053] For example, when the attention layer corresponding to the attention mechanism is connected to the one-dimensional convolutional neural network mentioned above, the attention layer can enable the deep learning network model to focus on extracting the time-frequency domain features of the preprocessed BCG signal according to the weights corresponding to the attention layer. As another example, when the attention layer corresponding to the attention mechanism is connected to the GRU mentioned above, the attention layer can enable the deep learning network model to focus on processing locally correlated BCG signals according to the weights corresponding to the attention layer.
[0054] For example Figure 2 The diagram shown is a structural example of the attention mechanism provided in this application embodiment. Here, input represents the output of the network layer connected to the attention layer (e.g., the time-frequency domain features of the BCG signal output by a one-dimensional convolutional neural network); exp represents the exponential function, used to calculate attention weights or scores, thereby measuring the correlation or importance between different elements. By using the exponential function, smaller values can receive greater weights after exponential operation, thus enhancing the influence of important elements; ∑ represents the summation symbol, used to calculate the sum of the weights of each input element and to generate a weighted average for the final output; ÷ represents the normalization operation, which divides each weight by the sum of all weights, making their sum equal to 1.
[0055] In one embodiment, the residual network structure containing the attention mechanism can take many forms. For example, the residual network structure containing the attention mechanism can be: (1) Residual Attention Network (ResAttNet): ResAttNet is a residual network structure based on the attention mechanism. Its core idea is to introduce an attention module into the residual block. In each residual block, after the input passes through a normal convolutional layer, it is divided into two branches: one branch is weighted by an attention module, and the other branch is directly connected to the attention module. Finally, the outputs of the two branches are added together to obtain the result of the residual connection. The attention module is usually composed of multiple attention heads, each of which is used to learn different attention patterns to capture different relationships in the input features. (2) DenseNet with Self-Attention (DenseSA): DenseNet is a densely connected residual network structure, while DenseSA introduces a self-attention mechanism on the basis of DenseNet. In each dense block, in addition to the normal skip connections, a self-attention module is added. The self-attention module can dynamically adjust the weights of the features by calculating the similarity of the input features, so that the network can better focus on the important features. Self-attention modules typically consist of multiple attention heads to learn different feature attention patterns.
[0056] The above are just two examples of residual network structures that incorporate attention mechanisms, and do not represent all of them. In other embodiments, other structural designs and improvements can be made according to task requirements and specific circumstances.
[0057] For example Figure 3 The diagram shows the network structure of the sleeping posture recognition model provided in this application embodiment. 1D-CNN represents a one-dimensional convolutional neural network, GRU represents a gated recurrent unit, and the residual network structure is shown in the figure. The attention layer is used to perform a weighted summation of the outputs of 1D-CNN and GRU. In addition, the sleeping posture recognition model uses a fully connected layer to classify the features identified by the convolutional layers of the previous convolutional neural network to obtain sleeping posture classification labels.
[0058] In one embodiment, the method further includes: obtaining a test set, using the test set to test the prediction accuracy of the deep learning network model, and using the model whose prediction accuracy is greater than a preset accuracy threshold (e.g., 0.9) as the sleeping posture recognition model.
[0059] Specifically, the test set includes multiple test cardiac impact signals, and the sleeping posture category label for each test cardiac impact signal is known; the test set is input into the deep learning network model to obtain the sleeping posture category recognition result for each test cardiac impact signal in the test set; the sleeping posture category recognition result of the test set is compared with the known sleeping posture category label of the test set to obtain the prediction accuracy.
[0060] In one embodiment, when the prediction accuracy of the deep learning network model is less than or equal to the accuracy threshold, the deep learning network model can be optimized by adjusting model parameters (e.g., kernel size, stride) and / or loss function until the sleeping posture recognition model is obtained.
[0061] In one embodiment, the sleeping posture recognition model training method provided in this application includes at least the following beneficial effects: preprocessing historical cardiac impact signals, including standardization, to eliminate differences between training samples and thus improve the accuracy of the trained model; extracting locally correlated temporal features by combining GRU with convolutional neural networks can reduce model complexity while solving the gradient vanishing and gradient exploding problems during training; and using deep residual networks can solve the shortcomings of single models in extracting time-frequency domain features and the problem of weak generalization performance caused by model overfitting due to redundant features, thereby improving the generalization ability of the model.
[0062] Once a sleeping posture recognition model is trained, it can be used for sleeping posture recognition. The sleeping posture recognition method provided in this application is executed by an electronic device. Accordingly, in one embodiment, the electronic device may include a sleeping posture recognition device running therein.
[0063] Example 2
[0064] Figure 4 This is a flowchart of the sleeping posture recognition method provided in Embodiment 2 of this application. The sleeping posture recognition method specifically includes the following steps. Depending on different needs, the order of the steps in this flowchart can be changed, and some steps can be omitted.
[0065] S21, Acquire real-time cardiac impact signals and preprocess the real-time cardiac impact signals.
[0066] In one embodiment, the real-time cardiac impact signal includes the electrocardiogram (ECG) signal of the user to be identified in sleep position, obtained through real-time monitoring. The method for acquiring the real-time cardiac impact signal is the same as the method for acquiring the historical cardiac impact signal in Embodiment 1 above; specifically, refer to the description in step S11 of Embodiment 1.
[0067] In one embodiment, the duration of the real-time cardiac impact signal is the same as the duration of the historical cardiac impact signal. Specifically, a cardiac impact signal of the same duration can be extracted from the real-time acquired cardiac impact signal of the user as the real-time cardiac impact signal.
[0068] S22, the preprocessed real-time cardiac impact signal is input into the sleeping posture recognition model, which is obtained using the sleeping posture recognition model training method described in Example 1.
[0069] In one embodiment, the preprocessing method is the same as the preprocessing method in step S12 of embodiment one. Specifically, the real-time cardiac impact signal is standardized using the standardized parameters in step S12.
[0070] S23, using the sleeping posture recognition model to extract the real-time features of the preprocessed real-time cardiac impact signal, and outputting the sleeping posture category corresponding to the real-time features, wherein the real-time features include real-time time-frequency domain features.
[0071] In one embodiment, the method of extracting the real-time features using the sleeping posture recognition model and determining the real-time time-frequency domain features based on the real-time features is similar to the process in the sleeping posture recognition model training method in Embodiment 1. It is only necessary to correspond the real-time cardiac impact signal with the historical cardiac impact signal in Embodiment 1. The specific process will not be described further.
[0072] In one embodiment, such as Figure 5 The diagram shown is an example of the overall flowchart of the sleeping posture recognition model training and sleeping posture recognition method provided in this application embodiment. The sleeping posture recognition model training and sleeping posture recognition method are executed in the direction indicated by the arrows, thereby achieving sleeping posture category recognition based on BCG signal identification and classification.
[0073] Example 3
[0074] Figure 6 This is a structural diagram of the sleeping posture recognition model training device provided in Embodiment 3 of this application.
[0075] In some embodiments, the sleeping posture recognition model training device 20 may include multiple functional modules composed of computer program segments. The computer programs for each program segment in the sleeping posture recognition model training device 20 may be stored in the memory of an electronic device and executed by at least one processor to perform (see details). Figure 1 (Description) Function of training the sleeping posture recognition model.
[0076] In this embodiment, the sleeping posture recognition model training device 20 can be divided into multiple functional modules according to its functions. The functional modules may include: a preprocessing module 201 and a training module 202. As used in this application, a module refers to a series of computer program segments that can be executed by at least one processor and perform a fixed function, and which are stored in memory. In this embodiment, the limitations of the sleeping posture recognition model training device 20 can be found in the above-described limitations of the sleeping posture recognition model training method, and will not be elaborated upon here.
[0077] The preprocessing module 201 is used to acquire training samples, preprocess the training samples, and obtain preprocessed training samples.
[0078] The training module 202 is used to train a deep learning network model using preprocessed training samples to obtain the sleeping posture recognition model. The structure of the deep learning network model includes: a convolutional neural network, a gated recurrent unit, and a deep residual network.
[0079] Example 4
[0080] This embodiment provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the steps described in the above-described sleeping posture recognition model training embodiment. Figure 1 S11-S13 as shown:
[0081] S11, Obtain training samples, the training samples including historical cardiac impact signals;
[0082] S12, preprocess the training samples to obtain preprocessed training samples, including: using standardized parameters to calculate standardized historical cardiac impact signals;
[0083] S13, using the preprocessed training samples to train a deep learning network model to obtain the sleeping posture recognition model, wherein the structure of the deep learning network model includes: a convolutional neural network, a gated recurrent unit, and a deep residual network.
[0084] Alternatively, when the computer program is executed by the processor, it can also implement the steps in the above-described sleeping posture recognition embodiments, for example... Figure 4 S21-S23 as shown:
[0085] S21, Acquire real-time cardiac impact signals and preprocess the real-time cardiac impact signals;
[0086] S22, the preprocessed real-time cardiac impact signal is input into the sleep posture recognition model, which is obtained by using the sleep posture recognition model training method described in Example 1;
[0087] S23, using the sleeping posture recognition model to extract the real-time features of the preprocessed real-time cardiac impact signal, and outputting the sleeping posture category corresponding to the real-time features, wherein the real-time features include real-time time-frequency domain features.
[0088] Alternatively, when the computer program is executed by the processor, it implements the functions of each module / unit in the above-described device embodiments, for example... Figure 6 Modules 201-202 in the middle:
[0089] The acquisition module 201 is used to acquire the source domain dataset and the target domain dataset.
[0090] The preprocessing module 201 is used to acquire training samples, preprocess the training samples, and obtain preprocessed training samples.
[0091] The training module 202 is used to train a deep learning network model using preprocessed training samples to obtain the sleeping posture recognition model. The structure of the deep learning network model includes: a convolutional neural network, a gated recurrent unit, and a deep residual network.
[0092] Example 5
[0093] See Figure 7 The diagram shown is a structural schematic of an electronic device provided in Embodiment 5 of this application. In a preferred embodiment of this application, the electronic device 3 includes a memory 31, at least one processor 32, at least one communication bus 33, and a transceiver 34.
[0094] Those skilled in the art should understand that Figure 7 The structure of the electronic device shown does not constitute a limitation of the embodiments of this application. It can be a bus structure or a star structure. The electronic device 3 may also include more or fewer other hardware or software than shown, or different component arrangements.
[0095] In some embodiments, the electronic device 3 is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions. Its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), programmable gate arrays (FPGAs), digital processors, and embedded devices. The electronic device 3 may also include client devices, including, but not limited to, any electronic product capable of human-computer interaction with a client via a keyboard, mouse, remote control, touchpad, or voice control device, such as personal computers, tablets, smartphones, and digital cameras.
[0096] It should be noted that the electronic device 3 is merely an example. Other existing or future electronic products that are suitable for this application should also be included within the scope of protection of this application and are incorporated herein by reference.
[0097] In some embodiments, the memory 31 stores a computer program that, when executed by the at least one processor 32, implements all or part of the steps in the sleep posture recognition model training and sleep posture recognition method as described above. The memory 31 includes read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, disk storage, magnetic tape storage, or any other computer-readable medium capable of carrying or storing data.
[0098] Furthermore, the computer-readable storage medium may primarily include a program storage area and a data storage area, wherein the program storage area may store the operating system, at least one application required for a function, etc.; and the data storage area may store data created based on the use of blockchain nodes, etc.
[0099] The blockchain referred to in this application is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include an underlying blockchain platform, a platform product service layer, and an application service layer.
[0100] In some embodiments, the at least one processor 32 is the control unit of the electronic device 3, connecting various components of the electronic device 3 via various interfaces and lines. It executes programs or modules stored in the memory 31 and calls data stored in the memory 31 to perform various functions and process data. For example, when the at least one processor 32 executes a computer program stored in the memory, it implements all or part of the steps of the sleep posture recognition model training and sleep posture recognition method described in the embodiments of this application; or it implements all or part of the functions of the sleep posture recognition model training device and the sleep posture recognition device. The at least one processor 32 may be composed of integrated circuits, such as a single-packaged integrated circuit or multiple integrated circuits with the same or different functions, including combinations of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips.
[0101] In some embodiments, the at least one communication bus 33 is configured to enable communication between the memory 31 and the at least one processor 32, etc.
[0102] Although not shown, the electronic device 3 may also include a power supply (such as a battery) to power the various components. Preferably, the power supply can be logically connected to the at least one processor 32 through a power management device, thereby enabling functions such as charging, discharging, and power consumption management. The power supply may also include one or more DC or AC power supplies, recharging devices, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device 3 may also include various sensors, Bluetooth modules, Wi-Fi modules, camera devices, etc., which will not be described in detail here.
[0103] The integrated unit implemented as a software functional module described above can be stored in a computer-readable storage medium. This software functional module, stored in a storage medium, includes several instructions to cause a computer device (which may be a personal computer, electronic device, or network device, etc.) or processor to execute portions of the methods described in the various embodiments of this application.
[0104] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and other division methods may be used in actual implementation.
[0105] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0106] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional modules.
[0107] It will be apparent to those skilled in the art that this application is not limited to the details of the exemplary embodiments described above, and that this application can be implemented in other specific forms without departing from the spirit or essential characteristics of this application. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of this application is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be embraced within this application. No reference numerals in the claims should be construed as limiting the scope of the claims. Furthermore, it is clear that the word "comprising" does not exclude other elements or, and the singular does not exclude the plural. Multiple elements or devices recited in the specification may also be implemented by a single element or device in software or hardware. The terms "first," "second," etc., are used to indicate names and do not indicate any particular order.
[0108] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application and are not intended to limit it. Although this application has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of this application without departing from the spirit and scope of the technical solutions of this application.
Claims
1. A method for training a sleeping posture recognition model, characterized in that, The method includes: Acquire training samples, which include historical cardiac impact signals; The training samples are preprocessed to obtain preprocessed training samples, including: using standardized parameters to calculate standardized historical cardiac impact signals; The sleeping posture recognition model is obtained by training a deep learning network model using preprocessed training samples, wherein the structure of the deep learning network model includes: A convolutional neural network is used to extract time-frequency domain features from preprocessed historical cardiac impact signals; A gated recurrent unit is used to combine with the convolutional neural network to extract the time-frequency domain features with a preset period; A deep residual network incorporating an attention mechanism, wherein the attention layer of the attention mechanism is used to calculate the correlation between the time-frequency domain features extracted by the convolutional neural network layer and the temporal features extracted by the gated recurrent unit layer, generate attention weights based on the correlation, and use the attention weights to perform a weighted summation of the time-frequency domain features and the temporal features to obtain a weighted fused feature. The attention layer uses an exponential function to calculate the correlation score between each element in the time-frequency domain features and each element in the temporal features, sums and normalizes the correlation scores to obtain the attention weights, and uses the attention weights to perform a weighted summation of the time-frequency domain features and the temporal features. The deep residual network includes at least one residual block, and the residual block uses direct mapping to connect different layers of the deep learning network model to fuse features from different layers. A fully connected layer is used to output a sleeping posture category label based on the weighted and fused features from the attention layer.
2. The method for training a sleeping posture recognition model according to claim 1, characterized in that, The training samples also include historical sleeping posture category labels corresponding to the historical cardiac impact signals.
3. The method for training a sleeping posture recognition model according to claim 1, characterized in that: The standardized parameters include: the average value of all historical cardiac impact signals. with standard deviation ; The standardization process includes: calculating the correlation between the historical cardiac impact signal and the preset formula and the standardization parameters. The corresponding zero-mean normalized historical cardiac impact signal The preset formula is .
4. A method for recognizing sleeping posture, characterized in that, The method includes: Real-time cardiac impact signals are acquired and preprocessed. The preprocessed real-time cardiac impact signal is input into the sleep posture recognition model, which is obtained by using the sleep posture recognition model training method as described in any one of claims 1 to 3. The sleep posture recognition model is used to extract real-time features from the preprocessed real-time cardiac impact signal, and the sleep posture category corresponding to the real-time features is output. The real-time features include real-time time-frequency domain features.
5. A sleeping posture recognition model training device for implementing the method as described in claim 1, characterized in that, The device includes a preprocessing module and a training module. The preprocessing module is used to acquire training samples, preprocess the training samples, and obtain preprocessed training samples. The training module is used to train a deep learning network model using preprocessed training samples to obtain the sleeping posture recognition model. The structure of the deep learning network model includes: a convolutional neural network, a gated recurrent unit, and a deep residual network.
6. An electronic device, characterized in that, The electronic device includes a processor and a memory, wherein the processor is used to execute a computer program stored in the memory to implement the sleeping posture recognition model training method as described in any one of claims 1 to 3, or to implement the sleeping posture recognition method as described in claim 4.
7. A computer-readable storage medium storing a computer program thereon, characterized in that, When the computer program is executed by the processor, it implements the sleeping posture recognition model training method as described in any one of claims 1 to 3, or the sleeping posture recognition method as described in claim 4.
Citation Information
Patent Citations
Electrocardiosignal classification training method, classification method, device and storage medium
CN114224355A
Body movement artifact signal detection method and device
CN114680879A