High-precision sleeping posture data feature extraction method based on pressure sensor
Through the improved Kolmogorov-Arnold network combined with mixed Gaussian cores and residual connections, the shortcomings of traditional machine learning and deep learning in sleeping posture classification are solved, and feature extraction of high-precision sleeping posture data is realized, which is suitable for devices with limited resources.
Patent Information
- Application Number
- CN202510453623.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-10
- Publication Date
- 2025-08-01
AI Technical Summary
Traditional machine learning algorithms perform poorly in high-complexity, fine-grained sleeping posture classification tasks. Deep learning algorithms such as multi-layer perceptrons and convolutional neural networks are difficult to deploy on devices with limited resources, making it difficult to achieve effective extraction of high-precision sleeping posture data.
The improved Kolmogorov-Arnold network is adopted, combining a mixed Gaussian kernel function and residual connection for feature extraction of pressure sensor data, and the improved Kolmogorov-Arnold network is used for feature extraction through pressure image input. The network layer is configured as [72, 64, 32, 28] or [72, 64, 48, 32, 28], and a Tanh-Matérn hybrid Gaussian kernel is used to replace the B-spline function, and the residual connection is introduced to improve model performance.
The number of model parameters decreased by about 9%, and the speed of backpropagation and forward reasoning increased by 42.3% and 53.9%. The classification accuracy was stable, which significantly improved the model's expression ability and training stability. It was suitable for equipment with limited resources.
Smart Images

Figure CN120408142A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and particularly relates to a high-precision sleeping posture data feature extraction method based on a pressure sensor. Background Art
[0002] The data for sleeping posture classification mainly comes from a variety of sensors, including pressure sensors, infrared cameras, and accelerometers, etc. Infrared cameras identify sleeping postures by capturing the thermal imaging data of the human body, but they are more sensitive to environmental changes and involve privacy issues; accelerometers are usually embedded in wearable devices and identify sleeping postures by capturing the motion data of the human body. Although they are portable, they may interfere with the user's sleep quality; pressure sensors identify sleeping postures by capturing the pressure distribution on the mattress, and can provide relatively accurate pressure distribution information, which is suitable for sleeping posture classification.
[0003] The feature extraction algorithms based on pressure sensor data mainly include traditional machine learning methods and deep learning methods. Traditional machine learning algorithms include k-nearest neighbor (k-NN), support vector machine (SVM), decision tree (Decision Tree), etc. Deep learning methods include multi-layer perceptron (MLP), convolutional neural network (CNN), and quantized fully convolutional neural network (QFCN), etc.
[0004] Traditional machine learning algorithms have limited performance in fine-grained sleeping posture classification tasks. Traditional machine learning algorithms perform well when dealing with low-complexity data, but perform poorly when dealing with high-complexity and fine-grained sleeping posture classification tasks. Especially on the PoPu dataset (28 classifications), the classification accuracy of traditional machine learning algorithms is significantly lower than that of deep learning algorithms. For example, the accuracy of k-NN on the PoPu dataset is only 48.80%, and the accuracies of support vector machine (SVM) and decision tree are 58.24% and 35.78% respectively. When dealing with high-dimensional and non-linear sleeping posture data, these algorithms are difficult to capture the subtle changes in the data, resulting in poor classification effects. Traditional machine learning algorithms are difficult to effectively extract the complex features in the data when dealing with high-complexity and fine-grained sleeping posture classification tasks, resulting in low classification accuracy. In addition, when dealing with high-dimensional data, these algorithms are prone to overfitting problems, further limiting their performance in practical applications.
[0005] The multi-layer perceptron (MLP) has a large number of parameters and low computational efficiency. As a classic deep learning algorithm, the multi-layer perceptron (MLP) can process high-dimensional data, but it has a large number of parameters and low computational efficiency. For example, on the PoPu dataset, the number of parameters of the MLP is 50,240, but its classification accuracy is only 59.10%, far lower than the performance of KAN. In addition, when processing high-dimensional data, the MLP is prone to overfitting problems, resulting in poor performance of the model on the test data. The large number of parameters of the MLP leads to a high computational complexity of the model, making it difficult to deploy on devices with limited resources. In addition, when processing high-dimensional data, the MLP is prone to overfitting problems, further limiting its performance in practical applications.
[0006] Convolutional neural networks (CNNs) are suitable for high-pixel images and have a high model complexity. Convolutional neural networks (CNNs) perform well in processing two-dimensional image data, but they are usually suitable for image data with relatively high pixels and have a high model complexity, making it difficult to deploy on devices with limited resources. For example, on the PoPu dataset, the CNN has a high classification accuracy, but its model complexity is high, making it difficult to deploy on devices with limited resources. The CNN performs well in processing high-pixel image data, but its model complexity is high, making it difficult to deploy on devices with limited resources. In addition, when processing low-pixel image data, the CNN performs poorly, further limiting its performance in practical applications. Summary of the Invention
[0007] In order to solve the deficiencies in the prior art, the present invention proposes a high-precision sleeping posture data feature extraction method based on a pressure sensor, which solves at least one aspect of the problems existing in the traditional machine learning methods and deep learning methods in the prior art.
[0008] The present invention is specifically implemented through the following technical solutions:
[0009] A high-precision sleeping posture data feature extraction method based on a pressure sensor, the method is based on an improved Kolmogorov - Arnold network, and the method includes the following steps:
[0010] Obtain the pressure distribution data on the surface of the mattress through a pressure sensor to generate a pressure image;
[0011] Input the pressure image into the improved Kolmogorov - Arnold network for feature extraction, and the network uses a mixture of Gaussian kernel functions to replace the B-spline function in the traditional Kolmogorov - Arnold network; among them, the mixture of Gaussian kernel function K tanh (x, x′) can be expressed as follows:
[0012] K tanh (x, x′) = β × Ktanh *(x,x′)×K matérn (x,x′)
[0013]
[0014] Wherein, x is the input of the network, x' is a preset grid point, e is the scale parameter of the Tanh kernel function, and K matérn (x, x′) is the Matérn kernel function, and d(x, x′) is the Euler distance between x and x′.
[0015] As a further improvement of the present invention, wherein the improved Kolmogorov - Arnold network has a hierarchical network architecture with residual connections, and feature mapping is realized between layers through LayerNorm normalization and SiLU activation function. The implementation method of the residual connection architecture includes:
[0016] The input tensor is flattened into a [batch size, 72] - dimensionality;
[0017] Kernel function similarity calculation and basic linear mapping are executed in parallel to generate features of [batch size, 64] - dimensionality respectively;
[0018] Through residual connection, the input layer after linear transformation is added to the processed features, satisfying the relationship: output = residual linear transformation(input)+SplineLinear(Flatten((GP calculation features))+BaseLinear(SiLU(input))), where SplineLinear is the fully - connected layer function in the Kolmogorov - Arnold network for cooperating with spline transformation, Flatten is used to flatten the dimensions of the tensor into a one - dimensional or multi - dimensional vector, and BaseLinear is the fully - connected layer function in deep learning.
[0019] As a further improvement of the present invention, wherein the output of the improved Kolmogorov - Arnold network is:
[0020] ψ tanh (x) = W base ·σ(x)+W tanh ·K tanh (x,x′)
[0021] Wherein, W tanh is a trainable weight matrix.
[0022] As a further improvement of the present invention, wherein the pressure image is a low - resolution pressure image.
[0023] As a further improvement of the present invention, the improved Kolmogorov - Arnold network is a neural network model composed of multi - layer residual - connected Kolmogorov - Arnold layers. The network layer configuration is [72, 64, 32, 28], where [72, 64, 32, 28] represents that the input layer has 72 neurons, 2 hidden layers, the first hidden layer has 64 neurons, the second hidden layer has 32 neurons, and the output layer has 28 neurons.
[0024] As a further improvement of the present invention, the improved Kolmogorov - Arnold network is a neural network model composed of multi - layer residual - connected Kolmogorov - Arnold layers. The network layer configuration [72, 64, 48, 32, 28] represents that the input layer has 72 neurons, 3 hidden layers, the first hidden layer has 64 neurons, the second hidden layer has 48 neurons, the third hidden layer has 32 neurons, and the output layer has 28 neurons.
[0025] The beneficial effects of the present invention are as follows: The advantages of the present invention are:
[0026] 1. The present invention uses the Tanh - Matérn mixed Gaussian kernel to better approximate the B - spline. Compared with the B - spline, after using the Tanh - Matérn mixed Gaussian kernel, the number of model parameters is reduced by about 9%, and the back - propagation and forward - inference speeds are increased by 42.3% and 53.9% respectively, while the classification accuracy remains stable. In the finer - grained sleeping - posture classification task, the model still shows excellent classification performance.
[0027] 2. By introducing residual connections in the Kolmogorov - Arnold network, the expression ability and training stability of the model are significantly improved. It effectively solves the problems of gradient disappearance and feature degradation in the deep Kolmogorov - Arnold network, lays a foundation for increasing the depth of the model subsequently, and optimizes the training efficiency and performance of the model. Brief Description of the Drawings
[0028] Figure 1(a) is a comparison schematic diagram of the DotProduct kernel function and the B - spline function;
[0029] Figure 1(b) is a comparison schematic diagram of the Exp - Sine - Squared kernel function and the B - spline function;
[0030] Figure 1(c) is a comparison schematic diagram of the RationalBase kernel function and the B - spline function;
[0031] Figure 1(d) is a comparison schematic diagram of the Matérn kernel function and the B - spline function;
[0032] Figure 1(e) is a comparison schematic diagram of the Tanh kernel function and the B-spline function;
[0033] Figure 1(f) is a comparison schematic diagram of the Gaussian mixture kernel function and the B-spline function of the present invention;
[0034] Figure 2 is a schematic diagram of the single-layer Kolmogorov-Arnold network architecture with residual connection of the present invention;
[0035] Figure 3 is a schematic diagram of the multi-layer Kolmogorov-Arnold network architecture with residual connection of the present invention. Detailed implementation manners
[0036] The present invention will be further described below in conjunction with the accompanying drawings and detailed implementation manners.
[0037] The Kolmogorov-Arnold network is abbreviated as KAN. The definition of the original Kolmogorov-Arnold network is KAN(x)=(Φ3°Φ2°Φ1)(x).
[0038] The forward inference of the original Kolmogorov-Arnold network can be expressed as:
[0039] ψ(x)=W base ·σ(x)+W spline ·B(x)
[0040] where W base and W spline are weight matrices, σ(x) is the SiLU activation function, and B(x) is the B-spline function, that is, B(x = spline(x).
[0041] The present invention integrates the Tanh and Matérn Gaussian kernel functions, replaces the B-spline function with a Gaussian mixture kernel function, and the Gaussian mixture kernel function K tanh (x,x′) can be expressed as follows:
[0042]
[0043] K tanh (x,x′)=β×K tanh *(x,x′)×K matérn (x,x′)
[0044] where x is the input of the model, x′ is the preset grid point, l is the scale parameter of the Tanh kernel function, and K matérn(x, x′) is the Matérn kernel function, and d(x, x′) is the Euclidean distance between x and x′. α, β, and l are constants. α is the scaling coefficient of the tanh kernel, β is the scaling coefficient of the Tanh-Matérn mixture Gaussian kernel, and l is the length scale parameter of the Matérn kernel. In an embodiment of the present invention, α = 0.5, β = 1.3, and l = 1.0 can be set.
[0045] The tanh kernel function of the present invention combines the tanh kernel function that only retains positive values with the Matérn kernel function, generating a new Tanh-KAN output:
[0046] ψ tanh (x) = W base ·σ(x) + W tanh ·K tanh (x, x′)
[0047] where W tanh is a trainable weight matrix.
[0048] The present invention simplifies Φ from a B-spline function to a tanh kernel function commonly used in Gaussian processes. The benefits are that the number of model parameters is reduced by about 9%, and the backpropagation and forward inference speeds are increased by 42.3% and 53.9% respectively, while the classification accuracy remains stable.
[0049] Figure 1(a) - Figure 1(f) is a comparison schematic diagram of each Gaussian kernel function and the B-spline function. According to the experimental details, the present invention evenly distributes 8 control points in the interval [-2, 2]. These control points serve as both the nodes of the B-spline basis function and the center points of other kernel functions. Figure 1(a) - Figure 1(f) Simulates the input and output situations of 72 points evenly distributed in the interval [-2, 2] for the kernel function and the B-spline function.
[0050] ResNet (Residual Network) solves the problems of gradient disappearance and degradation in deep neural networks by introducing "residual connections" (skip connections), enabling the network to be trained deeper and more efficiently, and significantly improving the performance of tasks such as image recognition. Its core idea is to learn the residual mapping rather than the direct mapping, simplifying the optimization process.
[0051] Based on the above idea, the present invention proposes an improved Gaussian process kernel network layer (GPKANLayer) based on the residual idea. By introducing residual connections, the expression ability and training stability of the model are significantly improved. It effectively solves the problems of gradient disappearance and feature degradation in deep Kolmogorov-Arnold networks, and significantly improves the training efficiency and performance of the model.
[0052] Figure 2The figure shows the architecture of a single-layer Kolmogorov-Arnold network with residual connections. In the figure, B is the sample batch size, C is the number of image channels, H is the image height, W is the image width, G is the number of grid points, and K is the number of output features.
[0053] For easy understanding, taking the PoPu dataset as an example (the low-resolution images of PoPu sleeping posture data are 12 * 6), assuming the input is a tensor with a batch size of 8, single channel, height 12, and width 6 (i.e., shape [8, 1, 12, 6]), the ResGPKANLayer is directly flattened into [8, 72] (1×12×6 = 72). Since Figure 2 it is a single-layer Kolmogorov-Arnold network architecture, the number of neurons in the input layer is 72, the number of neurons in the hidden layer is set to 64, and the number of neurons in the output layer is 28, that is, the network architecture is [72, 64, 28]. K is the number of neurons in the hidden layer, which is 64. Specifically, the process is as follows:
[0054] a) The input tensor (8, 1, 12, 6) can be first flattened to a tensor with dimension (8, 72) before entering the network.
[0055] b) Perform LayerNorm on the tensor with dimension (8, 72) and keep the shape (8, 72).
[0056] c) Feed it into the GaussianProcess to calculate the kernel similarity with the grid (num_grids = 16), and output a tensor with dimension (8, 72, 16).
[0057] d) Unfold the tensor with dimension (8, 72, 16) via the Flaten module into a tensor with dimension (8, 1152), and then feed it into the SplineLinear to get a tensor with dimension (8, 64).
[0058] e) The parallel branch performs a SiLU activation (base_activation) and a linear mapping (base_linear) on the input tensor (8, 72), first activating and then mapping the input tensor into a tensor with dimension (8, 64).
[0059] f) Add the results of the two branches to get a tensor with dimension (8, 64).
[0060] g) The residual connection transforms the initially input tensor with dimension (8, 72) to a tensor with dimension (8, 64) through the residual_linear operator, and then adds it to the result of the previous step to get a feature tensor with dimension (8, 64).
[0061] Among them, SplineLinear is a custom fully connected layer in the Kolmogorov-Arnold network, which is used to cooperate with the spline transformation. Since it performs well in the original KAN, the present invention continues to use this initialization strategy as part of the basic module. The characteristics of this fully connected layer are as follows:
[0062] 1. Do not use the bias term (bias = False);
[0063] 2. Custom weight initialization method: Different from the uniform distribution or Kaiming / Xavier initialization used by default in PyTorch, SplineLinear uses the truncated normal distribution to initialize the weights. This initialization is more controllable: by setting the standard deviation σ, the distribution of the initial output can be effectively controlled to make it more stable, thereby improving the stability of model training.
[0064] Weight W ij is initialized following the truncated normal distribution (Truncated Normal Distribution), which is defined as:
[0065]
[0066] where, represents the normal distribution with a mean of 0 and a standard deviation of σ; the truncation range is usually limited to ±2σ or similar values to avoid extreme initializations. In the present invention, σ = 0.1.
[0067] BaseLinear is the most commonly used fully connected layer in deep learning, that is, nn.Linear(in_features, out_features, bias = True) in the pytorch code, which uses the bias term by default and uses Kaiming or Xavier initialization by default. Its basic mathematical form is:
[0068] y = Wx + b
[0069] where, is the input vector, is the weight matrix, is the bias vector (optional), is the output vector.
[0070] Flatten is used to flatten the dimensions of a tensor into a one-dimensional or multi-dimensional vector, and is often used for the conversion between the convolutional layer and the fully connected layer. Suppose a three-channel color image is represented as a three-dimensional tensor:
[0071]
[0072] Among them, C = 3 indicates that the image has 3 channels (such as R, G, B), H is the height of the image (number of pixels), and W is the width of the image (number of pixels).
[0073] For example: an image of 3×32×32 (commonly found in the CIFAR-10 dataset) After flattening, it is:
[0074] Figure 3 It is a neural network model composed of multiple residual connection Kolmogorov - Arnold layers. In the figure, B is the sample batch size, C is the number of image channels, H is the image height, W is the image width, G is the number of grid points, and K is the number of output features. The number of layers of ResKAN and the number of neurons can be configured through array variables.
[0075] [72, 36, 28] represents that the input layer has 72 neurons, 1 hidden layer, and this hidden layer has 36 neurons, and the output layer has 28 neurons.
[0076] [72, 64, 32, 28] represents that the input layer has 72 neurons, 2 hidden layers, hidden layer 1 has 64 neurons, hidden layer 2 has 32 neurons, and the output layer has 28 neurons.
[0077] [72, 64, 48, 32, 28] represents that the input layer has 72 neurons, 3 hidden layers, hidden layer 1 has 64 neurons, hidden layer 2 has 48 neurons, hidden layer 3 has 32 neurons, and the output layer has 28 neurons.
[0078] The above are only the preferred embodiments of the present invention, and do not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present invention. For those of ordinary skill in the art, without departing from the concept of the present invention, several simple deductions or substitutions can also be made, which should all be regarded as belonging to the protection scope of the present invention.
Claims
1. A high-precision sleep posture data feature extraction method based on a pressure sensor, characterized in that The method is based on an improved Kolmogorov - Arnold network, and the method comprises the following steps: Obtain the pressure distribution data on the mattress surface through a pressure sensor to generate a pressure image; Input the pressure image into an improved Kolmogorov - Arnold network for feature extraction. The network uses a mixture of Gaussian kernel functions to replace the B - spline function in the traditional Kolmogorov - Arnold network. Among them, the mixture of Gaussian kernel function K tanh (x, x′) can be expressed as follows: K tanh (x,x′) = β × K tanh *(x,x′) × K ma t érn (x,x′) where \(x\) is the input of the network, and \(x'\) is a preset grid point. is the scale parameter of the Tanh kernel function, \(K\) matérn (\(x, x'\)) is the Matérn kernel function, and \(d(x, x')\) is the Euler distance between \(x\) and \(x'\).
2. The method according to claim 1, wherein The improved Kolmogorov - Arnold network has a hierarchical network architecture with residual connections. Feature mapping is achieved between layers through LayerNorm normalization and the SiLU activation function. The implementation method of the residual connection architecture includes: The input tensor is flattened into a [batch size, 72] - dimensionality; The kernel function similarity calculation and the basic linear mapping are executed in parallel to generate features with a [batch size, 64] - dimensionality respectively; The input layer after linear transformation is added to the processed features through a residual connection, satisfying the relation: output = residual linear transformation(input)+SplineLinear(Flatten(GP calculation features))+BaseLinear((SiLU(input))), where SplineLinear is a fully - connected layer function in the Kolmogorov - Arnold network for cooperating with spline transformation, Flatten is used to flatten the dimensionality of the tensor into a one - dimensional or multi - dimensional vector, and BaseLinear is a fully - connected layer function in deep learning.
3. The method according to claim 1, wherein The output of the improved Kolmogorov - Arnold network is: ψ tanh (x) = W base ·σ(x) + W tanh ·K tanh (x, x′) where W tanh is a trainable weight matrix.
4. The method according to claim 1, wherein The pressure image is a low - resolution pressure image.
5. The method according to claim 2, wherein The improved Kolmogorov - Arnold network is a neural network model composed of multi - layer residual connection Kolmogorov - Arnold layers. The network layer configuration is [72, 64, 32, 28], where [72, 64, 32, 28] represents that the input layer has 72 neurons, 2 hidden layers, the first hidden layer has 64 neurons, the second hidden layer has 32 neurons, and the output layer has 28 neurons.
6. The method according to claim 2, wherein The improved Kolmogorov - Arnold network is a neural network model composed of multi - layer residual connection Kolmogorov - Arnold layers. The network layer configuration [72, 64, 48, 32, 28] represents that the input layer has 72 neurons, 3 hidden layers, the first hidden layer has 64 neurons, the second hidden layer has 48 neurons, the third hidden layer has 32 neurons, and the output layer has 28 neurons.