A blood glucose prediction method of multi-scale data processing
By employing a multi-scale data processing method and setting small, medium, and large sliding windows, blood glucose sequence features are extracted and fused, solving the prediction bias problem caused by single-scale features in existing technologies and improving the accuracy and stability of blood glucose prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-29
- Publication Date
- 2026-03-24
AI Technical Summary
Existing blood glucose prediction technologies typically rely on blood glucose sequence features at a single time scale, making it difficult to simultaneously characterize the rapid fluctuations in blood glucose over a short period and the changing trends over a longer time range, resulting in insufficient stability and reliability of the prediction results.
A multi-scale data processing method is adopted, setting up three sliding windows of small, medium and large to extract blood glucose sequence features at each scale. Attention is calculated through small-medium and small-large attention sequences. Feature fusion and prediction are performed by combining scale feature fusion units and dual-channel feature blood glucose prediction networks.
It effectively captures the characteristics of rapid short-term fluctuations, stable medium-term transitions, and long-term changes in blood glucose, improving the accuracy and reliability of prediction results and enhancing adaptability to complex blood glucose change patterns.
Smart Images

Figure CN121435154B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of blood glucose prediction, and in particular to a blood glucose prediction method based on multi-scale data processing. BACKGROUND
[0002] The popularity of continuous glucose monitoring (CGM) technology enables blood glucose data to be collected continuously at a high frequency and for a long time, providing a data basis for blood glucose trend analysis and prediction. Existing blood glucose prediction techniques usually construct a prediction model based on historical blood glucose time series. The core idea is to use blood glucose data within a fixed time window to extract statistical features or time series features, and then use a regression model or neural network to predict future blood glucose values.
[0003] In the prior art, the historical blood glucose sequence is first preprocessed, then segmented using a single time scale sliding window, and features such as mean, variance, and rate of change are extracted based on the blood glucose data within each window. Finally, the features at this scale are used as model inputs to predict blood glucose values. This type of method has a relatively simple structure and low computational complexity, so it is widely used in practical applications.
[0004] However, one of the major problems with the above prior art is that it usually only relies on a single time scale of blood glucose sequence features for modeling, making it difficult to capture both the rapid fluctuation characteristics of blood glucose in a short period of time and the long-term trend. When the blood glucose sequence has abnormal fluctuations in a local time period, but the overall trend remains relatively stable, single-scale features often cannot effectively distinguish between short-term disturbances and long-term changes, affecting the stability and reliability of blood glucose prediction results, and resulting in low blood glucose prediction accuracy. SUMMARY
[0005] To address the above deficiencies in the prior art, the present application provides a blood glucose prediction method based on multi-scale data processing, which solves the problem of low blood glucose prediction accuracy in the prior art.
[0006] To achieve the above-mentioned application purposes, the technical solution adopted by the present application is as follows: a blood glucose prediction method based on multi-scale data processing, comprising the following steps:
[0007] Three sliding windows are set to slide and process the normalized historical blood glucose sequence, obtaining small, medium, and large scale blood glucose sub-sequence sets, and extracting features from the blood glucose sub-sequences to obtain small, medium, and large scale sequence feature vectors;
[0008] According to the differences between the small-scale sequence feature vectors and the medium-scale sequence feature vectors and the large-scale sequence feature vectors in the same time period, small-medium scale attention degree sequences and small-large scale attention degree sequences are obtained;
[0009] The small, medium and large scale sequence feature vectors are arranged in time sequence to obtain small, medium and large scale sequence feature samples;
[0010] The small, medium and large scale sequence feature samples are processed by a scale feature fusion unit, and small-medium scale weighted features and small-large scale weighted features are obtained based on the attention degrees imposed by the small-medium scale attention degree sequence and the small-large scale attention degree sequence;
[0011] The small-medium scale weighted features and the small-large scale weighted features are processed by a dual-channel feature blood glucose prediction network to obtain predicted blood glucose values.
[0012] Further, the process of obtaining the small, medium and large scale sequence feature vectors comprises:
[0013] Blood glucose sub-sequences are extracted from the small, medium and large scale blood glucose sub-sequence sets respectively;
[0014] The mean value, maximum value, head-tail fluctuation difference value and fluctuation value of each blood glucose sub-sequence are extracted, wherein the head-tail fluctuation difference value is the difference between the element at the latest time and the element at the starting time of the blood glucose sub-sequence, and the fluctuation value is the standard deviation of the elements of the blood glucose sub-sequence;
[0015] The mean value, maximum value, head-tail fluctuation difference value and fluctuation value of the same blood glucose sub-sequence belonging to the small scale blood glucose sub-sequence set are combined to form a small scale sequence feature vector;
[0016] The mean value, maximum value, head-tail fluctuation difference value and fluctuation value of the same blood glucose sub-sequence belonging to the medium scale blood glucose sub-sequence set are combined to form a medium scale sequence feature vector;
[0017] The mean value, maximum value, head-tail fluctuation difference value and fluctuation value of the same blood glucose sub-sequence belonging to the large scale blood glucose sub-sequence set are combined to form a large scale sequence feature vector.
[0018] Further, the process of obtaining the small-medium scale attention degree sequence comprises:
[0019] According to the time period in which the small scale sequence feature vector is located, the medium scale sequence feature vectors in the same time period are found;
[0020] The small-medium direction consistency factor and the small-medium amplitude deviation factor of the small scale sequence feature vector and the medium scale sequence feature vector in the same time period are calculated;
[0021] According to the small-medium direction consistency factor and the small-medium amplitude deviation factor, the attention degree corresponding to each medium scale sequence feature vector is calculated to obtain the small-medium scale attention degree sequence.
[0022] Furthermore, the calculation process of the small-to-medium directional consistency factor includes: multiplying the feature vector of the small-scale sequence with the feature vector of the mesoscale sequence to obtain the small-to-medium inner product result; multiplying the L2 norm of the feature vector of the small-scale sequence with the L2 norm of the feature vector of the mesoscale sequence to obtain the small-to-medium scale norm product; using the ratio of the small-to-medium inner product result to the small-to-medium scale norm product as the small-to-medium directional consistency factor; reducing the small-to-medium directional consistency factor by 1 and normalizing it to obtain the small-to-medium enhancement coefficient.
[0023] The calculation process of the small-to-medium amplitude deviation factor includes: subtracting the feature vector of the small-scale sequence from the feature vector of the medium-scale sequence to obtain the small-to-medium difference vector; taking the L2 norm of the small-to-medium difference vector to obtain the small-to-medium amplitude deviation; using the ratio of the small-to-medium amplitude deviation to the maximum amplitude deviation as the small-to-medium amplitude deviation factor; and multiplying the small-to-medium amplitude deviation factor by the small-to-medium enhancement coefficient to obtain the small-to-medium initial attention level.
[0024] The average of all small-to-medium initial attention values corresponding to the time period in which the mesoscale sequence feature vector is located is taken to obtain the attention value corresponding to the mesoscale sequence feature vector.
[0025] Furthermore, the process of obtaining the small-to-large scale attention sequence includes:
[0026] Based on the time period in which the feature vector of the small-scale sequence is located, find the feature vector of the large-scale sequence in the same time period.
[0027] Calculate the small-to-large direction consistency factor and the small-to-large magnitude deviation factor of the eigenvectors of small-scale sequences and large-scale sequences within the same time period;
[0028] Based on the small-to-large direction consistency factor and the small-to-large magnitude deviation factor, the attention corresponding to each large-scale sequence feature vector is calculated to obtain the small-to-large scale attention sequence.
[0029] Furthermore, the calculation process of the small-to-large directional consistency factor includes: multiplying the feature vector of the small-scale sequence with the feature vector of the large-scale sequence to obtain the small-to-large inner product result; multiplying the L2 norm of the feature vector of the small-scale sequence with the L2 norm of the feature vector of the large-scale sequence to obtain the small-to-large scale norm product; using the ratio of the small-to-large inner product result to the small-to-large scale norm product as the small-to-large directional consistency factor; reducing the small-to-large directional consistency factor by 1 and normalizing it to obtain the small-to-large enhancement coefficient.
[0030] The calculation process of the small-to-large deviation factor includes: subtracting the feature vector of the small-scale sequence from the feature vector of the large-scale sequence to obtain the small-to-large difference vector; taking the L2 norm of the small-to-large difference vector to obtain the small-to-large deviation; using the ratio of the small-to-large deviation to the maximum deviation as the small-to-large deviation factor; and multiplying the small-to-large deviation factor by the small-to-large enhancement coefficient to obtain the small-to-large initial attention.
[0031] The average of all small-to-large initial attention values corresponding to the time period where the large-scale sequence feature vector is located is taken to obtain the attention value corresponding to the large-scale sequence feature vector.
[0032] Furthermore, the scale feature fusion unit includes: three pointwise convolutional layers, a first feature compression layer, a second feature compression layer, a small-to-medium scale feature fusion layer, and a small-to-large scale feature fusion layer;
[0033] Pointwise convolutional layers are used to extract features from small-scale, medium-scale, and large-scale sequence feature samples respectively, to obtain small-scale original features, medium-scale original features, and large-scale original features;
[0034] The first feature compression layer is used to compress the original small-scale features to obtain the first small-scale compressed features;
[0035] Based on the small-to-medium scale attention sequence, a small-to-medium scale feature fusion layer is used to fuse the first small-scale compressed features with the original mesoscale features to obtain small-to-medium scale weighted features;
[0036] A second feature compression layer is used to compress the original small-scale features to obtain the second small-scale compressed features.
[0037] Based on the small-to-large scale attention sequence, a small-to-large scale feature fusion layer is used to fuse the second small-scale compressed features with the original large-scale features to obtain small-to-large scale weighted features.
[0038] Furthermore, the expression for the small-to-medium scale feature fusion layer is: ,
[0039] in, For the small-to-medium scale weighted features, the features at time t are... This is the feature at time t in the first small-scale compressed feature set. This represents the feature at time t in the original mesoscale features, where t is the time index. The attention level at time t in the small-to-medium scale attention sequence;
[0040] The expression for the small-to-large scale feature fusion layer is: ,
[0041] in, For the features at time t in the small-to-large scale weighted features, This represents the feature at time t in the second small-scale compression feature. This represents the feature at time t in the large-scale original features. Let t represent the attention level at time t in the small-to-large scale attention sequence.
[0042] Furthermore, the dual-channel feature blood glucose prediction network includes: a third feature compression layer, a first stacked convolutional unit, a second stacked convolutional unit, a first multi-level feature extraction unit, a second multi-level feature extraction unit, an adder, and a fully connected layer.
[0043] Furthermore, the process of obtaining the predicted blood glucose value includes:
[0044] A third feature compression layer is used to compress the small-to-medium-scale weighted features to obtain small-to-medium-scale compressed features.
[0045] The first stacked convolutional unit is used to extract depth features from the small-to-medium scale compressed features to obtain the small-to-medium scale depth features;
[0046] The second stacked convolutional unit is used to extract depth features from the small-to-large scale weighted features to obtain the small-to-large scale depth features;
[0047] The first multi-level feature extraction unit is used to extract multi-level features from small-to-medium-scale depth features to obtain small-to-medium multi-level features.
[0048] A second multi-level feature extraction unit is used to extract multi-level features from small-to-large scale depth features, resulting in small-to-large multi-level features.
[0049] An adder is used to add the small-medium multi-level features and the small-large multi-level features element by element to obtain the small-medium-large fused features;
[0050] Based on the small-medium-large fusion characteristics, a fully connected layer is used for mapping to obtain the blood glucose prediction value.
[0051] The beneficial effects of this invention are as follows:
[0052] 1. This invention constructs sliding sequences with three time scales: small, medium, and large, which can simultaneously capture the rapid fluctuations of blood glucose in the short term, the stable transitions in the medium term, and the overall changes in the long term. Through the synergistic analysis of multi-scale features, it effectively solves the prediction bias problem caused by the limitation of single-scale features in existing technologies, which cannot distinguish between short-term disturbances and long-term trends. This significantly improves the fit between predicted and actual blood glucose values, ensuring the accuracy and reliability of the prediction results.
[0053] 2. This invention constructs small-to-medium-scale attention sequences and small-to-large-scale attention sequences by calculating the difference between small-scale feature vectors and medium- and large-scale feature vectors within the same time period. This adaptively identifies the correlation and importance of features at different time scales. During the feature fusion stage, dynamic weights are assigned to features at different scales based on the attention sequences, allowing the model to focus more on feature information that significantly impacts the prediction results, while weakening the effects of ineffective or interfering features, thus achieving more accurate and efficient feature representation.
[0054] 3. This invention introduces a scale feature fusion unit and combines it with an attention adjustment mechanism between different scales, enabling small-scale blood glucose change features to be adaptively distinguished and emphasized when fused with mesoscale and large-scale features, thereby forming a weighted feature representation with scale differences. Then, a dual-channel feature blood glucose prediction network is used to model and predict the weighted features at different scales respectively, so that the model can simultaneously take into account short-term blood glucose fluctuation information and medium- and long-term change trends, improving the adaptability and prediction accuracy of blood glucose prediction results to complex blood glucose change patterns. Attached Figure Description
[0055] Figure 1 A flowchart of a blood glucose prediction method based on multi-scale data processing;
[0056] Figure 2 This is a schematic diagram of the scale feature fusion unit.
[0057] Figure 3 This is a schematic diagram of the structure of a dual-channel feature blood glucose prediction network.
[0058] Figure 4 This is a schematic diagram of the structure of the first stacked convolutional unit and the second stacked convolutional unit;
[0059] Figure 5 This is a schematic diagram of the structure of the first multi-level feature extraction unit and the second multi-level feature extraction unit. Detailed Implementation
[0060] The specific embodiments of the present invention are described below to enable those skilled in the art to understand the present invention. However, it should be understood that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the present invention as defined and determined by the appended claims. All inventions utilizing the concept of the present invention are protected.
[0061] like Figure 1 As shown, a blood glucose prediction method based on multi-scale data processing includes the following steps:
[0062] Three sliding windows are set up to slide across the normalized historical blood glucose sequence to obtain small, medium and large scale blood glucose subsequence sets. Features are extracted from the blood glucose subsequences to obtain small, medium and large scale sequence feature vectors.
[0063] Based on the differences between the feature vectors of small-scale sequences and the feature vectors of medium-scale and large-scale sequences within the same time period, we obtain small-to-medium-scale attention sequences and small-to-large-scale attention sequences.
[0064] Arrange the feature vectors of small, medium, and large scale sequences in chronological order to obtain feature samples of small, medium, and large scale sequences;
[0065] A scale feature fusion unit is used to process small, medium and large scale sequence feature samples, and small-to-medium scale weighted features and small-to-large scale weighted features are obtained based on the attention applied to the small-to-medium scale attention sequence and the small-to-large scale attention sequence.
[0066] A dual-channel feature blood glucose prediction network was used to process small-to-medium-scale weighted features and small-to-large-scale weighted features to obtain predicted blood glucose values.
[0067] In this embodiment, the sampling frequency of the CGM device is set to 1 minute / time, and the historical blood glucose sequence is 5 hours of blood glucose values, containing 300 blood glucose values; the length of the small-scale sliding window is set to 5, the length of the medium-scale sliding window is set to 10, and the length of the large-scale sliding window is set to 30; the small-scale sliding window, medium-scale sliding window, and large-scale sliding window are used to slide on the normalized historical blood glucose sequence, and the sliding length is equal to the window length. That is, the small-scale sliding window divides the historical blood glucose sequence into 60 small-scale blood glucose subsequences of the same length, the medium-scale sliding window divides the historical blood glucose sequence into 30 medium-scale blood glucose subsequences of the same length, and the large-scale sliding window divides the historical blood glucose sequence into 10 large-scale blood glucose subsequences of the same length.
[0068] The set of small-scale blood glucose subsequences consists of 60 small-scale blood glucose subsequences, the set of medium-scale blood glucose subsequences consists of 30 medium-scale blood glucose subsequences, and the set of large-scale blood glucose subsequences consists of 10 large-scale blood glucose subsequences.
[0069] In this embodiment, the process of obtaining small, medium, and large-scale sequence feature vectors includes:
[0070] Blood glucose subsequences were extracted from small, medium, and large-scale blood glucose subsequence sets, respectively.
[0071] For each blood glucose subsequence, extract the mean, maximum value, first-to-last fluctuation difference, and fluctuation value. The first-to-last fluctuation difference is the difference between the element at the latest time and the element at the beginning time of the blood glucose subsequence, and the fluctuation value is the standard deviation of each element in the blood glucose subsequence.
[0072] The mean, maximum value, first-to-last fluctuation difference, and fluctuation value of the same blood glucose subsequence belonging to the small-scale blood glucose subsequence set are used to construct the small-scale sequence feature vector;
[0073] The mean, maximum value, first-to-last fluctuation difference, and fluctuation value of the same blood glucose subsequence belonging to the mesoscale blood glucose subsequence set are used to construct the mesoscale sequence feature vector;
[0074] The mean, maximum value, first-to-last fluctuation difference, and fluctuation value of the same blood glucose subsequence belonging to the large-scale blood glucose subsequence set are used to construct the large-scale sequence feature vector.
[0075] This invention uses the mean to reflect the overall blood glucose level within a subsequence, the maximum value to capture the peak blood glucose level within a subsequence, the difference between the first and last fluctuations to quantify the blood glucose rise and fall trend within the time range of the subsequence, and the fluctuation value to characterize the dispersion and intensity of blood glucose within the subsequence, thus comprehensively depicting the dynamic change pattern of blood glucose at different time scales.
[0076] In this embodiment, the number of feature vectors for small-scale sequences is 60, the number of feature vectors for medium-scale sequences is 30, and the number of feature vectors for large-scale sequences is 10.
[0077] In this embodiment, the process of obtaining the small-to-medium scale attention sequence includes:
[0078] Based on the time period of the small-scale sequence feature vector, find the mesoscale sequence feature vector that is in the same time period. Here, "in the same time period" means that the time interval corresponding to the small-scale feature vector completely falls within the time interval corresponding to a certain mesoscale feature vector.
[0079] Calculate the small-to-medium directional consistency factor and the small-to-medium amplitude deviation factor of the eigenvectors of small-scale sequences and mesoscale sequences within the same time period;
[0080] Based on the small-to-medium directional consistency factor and the small-to-medium amplitude deviation factor, the attention level corresponding to each mesoscale sequence feature vector is calculated to obtain the small-to-medium scale attention level sequence.
[0081] In this embodiment, the calculation process of the small-to-medium directional consistency factor includes: multiplying the feature vector of the small-scale sequence with the feature vector of the mesoscale sequence to obtain the small-to-medium inner product result; multiplying the L2 norm of the feature vector of the small-scale sequence with the L2 norm of the feature vector of the mesoscale sequence to obtain the small-to-medium scale norm product; using the ratio of the small-to-medium inner product result to the small-to-medium scale norm product as the small-to-medium directional consistency factor; reducing the small-to-medium directional consistency factor by 1 and normalizing it to obtain the small-to-medium enhancement coefficient.
[0082] The calculation process of the small-to-medium amplitude deviation factor includes: subtracting the feature vector of the small-scale sequence from the feature vector of the medium-scale sequence to obtain the small-to-medium difference vector; taking the L2 norm of the small-to-medium difference vector to obtain the small-to-medium amplitude deviation; using the ratio of the small-to-medium amplitude deviation to the maximum amplitude deviation as the small-to-medium amplitude deviation factor; and multiplying the small-to-medium amplitude deviation factor by the small-to-medium enhancement coefficient to obtain the small-to-medium initial attention level.
[0083] The average of all small-to-medium initial attention values corresponding to the time period in which the mesoscale sequence feature vector is located is taken to obtain the attention value corresponding to the mesoscale sequence feature vector.
[0084] In this embodiment, the initial attention count for small-to-medium scale is 60, and the attention count corresponding to the mesoscale sequence feature vector is 30.
[0085] The formula for calculating the consistency factor in the small-to-medium direction is: ,
[0086] in, For small-to-medium direction consistency factor, For small-scale sequence feature vectors, This is a feature vector of a mesoscale sequence. For the denominator parameter, It is a 2-norm;
[0087] ,
[0088] in, Small to medium enhancement coefficient;
[0089] The formula for the small-to-medium amplitude deviation factor is: ,
[0090] ,
[0091] in, For small to medium amplitude deviation factors, The deviation is small to medium. This represents the maximum deviation.
[0092] In this embodiment, the historical blood glucose sequence has a duration of 300 minutes. The first small-scale sequence feature vector corresponds to 0-5 minutes, the second small-scale sequence feature vector corresponds to 5-10 minutes, and so on, with the last small-scale sequence feature vector corresponding to 295-300 minutes. The first mesoscale sequence feature vector corresponds to 0-10 minutes, the second mesoscale sequence feature vector corresponds to 10-20 minutes, and so on, with the last mesoscale sequence feature vector corresponding to 290-300 minutes. Each mesoscale feature vector corresponds to a time period that includes the time periods corresponding to two consecutive small-scale feature vectors. The first large-scale sequence feature vector corresponds to 0-30 minutes, the second large-scale sequence feature vector corresponds to 30-60 minutes, and so on, with the last large-scale sequence feature vector corresponding to 270-300 minutes. Therefore, the initial attention count for small-to-medium-scale sequence feature vectors is 60. The average of the initial attention counts for small-to-medium-scale sequence feature vectors belonging to the same mesoscale time period is taken to obtain the attention count corresponding to the mesoscale sequence feature vector.
[0093] This invention utilizes a small-to-medium directional consistency factor constructed based on vector inner product and L2 norm. This factor can accurately measure the directional similarity between small-scale and medium-scale feature vectors from the perspective of feature space, reflecting the trend consistency between short-term blood glucose fluctuations and medium-term stable transitions. Simultaneously, by defining a small-to-medium amplitude deviation factor through the L2 norm of vector differences, the difference between the two types of feature vectors in the numerical dimension can be quantified, reflecting the amplitude deviation between short-term fluctuations and medium-term trends. By using an enhancement coefficient that is 1 minus the directional consistency factor and normalized, higher enhancement weights can be assigned to feature combinations with large directional differences, strengthening the feature identification when short-term disturbances and medium-term trends do not match.
[0094] In this embodiment, the process of obtaining the small-to-large scale attention sequence includes:
[0095] Based on the time period of the small-scale sequence feature vector, find the large-scale sequence feature vector that is in the same time period. Here, "in the same time period" means that the time interval corresponding to the small-scale feature vector completely falls within the time interval corresponding to a certain large-scale feature vector.
[0096] Calculate the small-to-large direction consistency factor and the small-to-large magnitude deviation factor of the eigenvectors of small-scale sequences and large-scale sequences within the same time period;
[0097] Based on the small-to-large direction consistency factor and the small-to-large magnitude deviation factor, the attention corresponding to each large-scale sequence feature vector is calculated to obtain the small-to-large scale attention sequence.
[0098] In this embodiment, the calculation process of the small-to-large directional consistency factor includes: multiplying the feature vector of the small-scale sequence with the feature vector of the large-scale sequence to obtain the small-to-large inner product result; multiplying the L2 norm of the feature vector of the small-scale sequence with the L2 norm of the feature vector of the large-scale sequence to obtain the small-to-large scale norm product; using the ratio of the small-to-large inner product result to the small-to-large scale norm product as the small-to-large directional consistency factor; reducing the small-to-large directional consistency factor by 1 and normalizing it to obtain the small-to-large enhancement coefficient.
[0099] The calculation process of the small-to-large deviation factor includes: subtracting the feature vector of the small-scale sequence from the feature vector of the large-scale sequence to obtain the small-to-large difference vector; taking the L2 norm of the small-to-large difference vector to obtain the small-to-large deviation; using the ratio of the small-to-large deviation to the maximum deviation as the small-to-large deviation factor; and multiplying the small-to-large deviation factor by the small-to-large enhancement coefficient to obtain the small-to-large initial attention.
[0100] The average of all small-to-large initial attention values corresponding to the time period where the large-scale sequence feature vector is located is taken to obtain the attention value corresponding to the large-scale sequence feature vector.
[0101] The formula for calculating the small-to-large direction consistency factor is: ,
[0102] Its size As a small-to-large direction consistency factor, For small-scale sequence feature vectors, For large-scale sequence feature vectors, For the denominator parameter, It is a 2-norm;
[0103] ,
[0104] Its size Small-to-large enhancement coefficient;
[0105] The formula for the small-to-large deviation factor is: ,
[0106] ,
[0107] Its size For small to large deviation factors, For small to large deviations, This represents the maximum deviation.
[0108] This invention uses a small-to-large directional consistency factor to measure the directional similarity between short-term blood glucose fluctuations and long-term blood glucose trends from a feature space perspective, objectively reflecting their trend synergy. It also uses a small-to-large amplitude deviation factor to quantify the difference in numerical dimensions between the two types of feature vectors, intuitively reflecting the amplitude deviation between short-term disturbances and long-term trends. By employing an enhancement coefficient that is "1 minus the directional consistency factor and normalized," higher enhancement weights can be assigned to short-term and long-term feature combinations with significant trend differences, strengthening the feature identification when short-term abnormal fluctuations do not match long-term stable trends. Furthermore, by multiplying the enhancement coefficient with the amplitude deviation factor to generate an initial focus, it is possible to prioritize feature combinations with "inconsistent trends and large amplitude deviations."
[0109] like Figure 2 As shown, the scale feature fusion unit includes: three pointwise convolutional layers, a first feature compression layer, a second feature compression layer, a small-to-medium scale feature fusion layer, and a small-to-large scale feature fusion layer;
[0110] Pointwise convolutional layers are used to extract features from small-scale, medium-scale, and large-scale sequence feature samples respectively, to obtain small-scale original features, medium-scale original features, and large-scale original features;
[0111] The first feature compression layer is used to compress the original small-scale features to obtain the first small-scale compressed features;
[0112] Based on the small-to-medium scale attention sequence, a small-to-medium scale feature fusion layer is used to fuse the first small-scale compressed features with the original mesoscale features to obtain small-to-medium scale weighted features;
[0113] A second feature compression layer is used to compress the original small-scale features to obtain the second small-scale compressed features.
[0114] Based on the small-to-large scale attention sequence, a small-to-large scale feature fusion layer is used to fuse the second small-scale compressed features with the original large-scale features to obtain small-to-large scale weighted features.
[0115] In this embodiment, the expression for the small-to-medium scale feature fusion layer is: ,
[0116] in, For the small-to-medium scale weighted features, the features at time t are... This is the feature at time t in the first small-scale compressed feature set. This represents the feature at time t in the original mesoscale features, where t is the time index. For the attention at time t in the small-to-medium-scale attention sequence, the size of the first small-scale compressed feature is 30×4, the size of the mesoscale original feature is 30×4, and the length of the small-to-medium-scale attention sequence is 30. Therefore, the features in the time dimension can be weighted.
[0117] The expression for the small-to-large scale feature fusion layer is: ,
[0118] in, For the features at time t in the small-to-large scale weighted features, This represents the feature at time t in the second small-scale compression feature. This represents the feature at time t in the large-scale original features. Let t be the attention at time t in the small-to-large scale attention sequence. The size of the second small-scale compressed feature is 10×4, the size of the large-scale original feature is 10×4, and the length of the small-to-large scale attention sequence is 10. Therefore, the features in the time dimension can be weighted.
[0119] This invention extracts features through each pointwise convolutional layer. The first feature compression layer compresses the small-scale original features in the time dimension, keeping them consistent with the size of the medium-scale original features. The second feature compression layer compresses the small-scale original features in the time dimension, keeping them consistent with the size of the large-scale original features. For time periods where short-term fluctuations differ significantly from medium / long-term trends, the attention weight will be tilted towards the small-scale compressed features, strengthening the capture of abnormal fluctuation signals. For time periods with smaller feature differences, more weight will be allocated to the medium / large-scale original features.
[0120] In this embodiment, the size of the small-scale sequence feature sample is 60×4, the size of the medium-scale sequence feature sample is 30×4, and the size of the large-scale sequence feature sample is 10×4. After pointwise convolution operation, the original small-scale features are 60×4, the original medium-scale features are 30×4, and the original large-scale features are 10×4.
[0121] The first feature compression layer is used to weight the two feature vectors of the small-scale original features corresponding to the same time period in the mesoscale original features into one feature vector. That is, the small-scale original features are divided into groups of two row feature vectors, and the groups are weighted into one row feature vector. The size of the first small-scale compressed feature is 30×4.
[0122] The second feature compression layer is used to weight the six feature vectors of the small-scale original features corresponding to the same time period in the large-scale original features into one feature vector. That is, the small-scale original features are divided into groups of six row feature vectors, and the groups are weighted into one row feature vector. The size of the second small-scale compressed feature is 10×4.
[0123] like Figure 3 As shown, the dual-channel feature blood glucose prediction network includes: a third feature compression layer, a first stacked convolutional unit, a second stacked convolutional unit, a first multi-level feature extraction unit, a second multi-level feature extraction unit, an adder, and a fully connected layer.
[0124] The process of obtaining a predicted blood glucose value includes:
[0125] A third feature compression layer is used to compress the small-to-medium-scale weighted features to obtain small-to-medium-scale compressed features.
[0126] The first stacked convolutional unit is used to extract depth features from the small-to-medium scale compressed features to obtain the small-to-medium scale depth features;
[0127] The second stacked convolutional unit is used to extract depth features from the small-to-large scale weighted features to obtain the small-to-large scale depth features;
[0128] The first multi-level feature extraction unit is used to extract multi-level features from small-to-medium-scale depth features to obtain small-to-medium multi-level features.
[0129] A second multi-level feature extraction unit is used to extract multi-level features from small-to-large scale depth features, resulting in small-to-large multi-level features.
[0130] An adder is used to add the small-medium multi-level features and the small-large multi-level features element by element to obtain the small-medium-large fused features;
[0131] Based on the small-medium-large fusion characteristics, a fully connected layer is used for mapping to obtain the blood glucose prediction value.
[0132] In this embodiment, the third feature compression layer is used to weight the three row feature vectors in the small-to-medium scale weighted features corresponding to the same time period in the small-to-large scale weighted features into one feature vector. That is, the small-to-medium scale weighted features of size 30×4 are divided into a group of three row feature vectors, and the group is weighted into one feature vector. The resulting small-to-medium scale compressed feature has a size of 10×4.
[0133] Feature compression methods include: taking the mean of a feature from multiple rows of feature vectors; a better approach is to compress based on the proportion of each feature element, expressed as: ,in, The first eigenvector in the weighted eigenvector One element, For the weighted middle In the feature vector of row , the th One element, The number of row feature vectors to be weighted.
[0134] This invention compresses the time dimension of small-to-medium-scale weighted features through a third feature compression layer, making the compressed small-to-medium-scale features the same size as the small-to-large-scale weighted features. Then, it extracts depth features through a first stacked convolutional unit and a second stacked convolutional unit. Finally, it extracts multi-level features through two multi-level feature extraction units, and uses an adder to fuse the elements of the two types of features. Finally, it completes the mapping through a fully connected layer, realizing the synergistic effect of multi-scale features. This effectively avoids the one-sided capture of feature information by a single channel and improves the accuracy and stability of blood glucose prediction.
[0135] This invention establishes a dual-channel feature-based blood glucose prediction network, enabling parallel structural modeling and deep feature extraction of small-to-medium-scale weighted features and small-to-large-scale weighted features based on different scale relationships. Firstly, after feature compression and stacked convolution, the weighted features within different channels are gradually mapped to more discriminative deep representations, and multi-level feature extraction units fully exploit the features of blood glucose changes at different levels. Secondly, an adder fuses the multi-level features output from the two channels, allowing short-term blood glucose fluctuations and medium-to-long-term trends to be co-expressed at the feature level, avoiding information bias caused by single-scale or single-path modeling. Finally, a fully connected layer completes the mapping from features to blood glucose values, improving the prediction model's comprehensive representation of complex blood glucose change patterns, thereby enhancing the stability and reliability of blood glucose prediction results.
[0136] like Figure 4 As shown, the first stacked convolutional unit and the second stacked convolutional unit have the same structure, both including: a first convolutional block and a second convolutional block.
[0137] In this embodiment, the kernel size of both the first and second convolutional blocks is set to 1×3.
[0138] like Figure 5 As shown, the first and second multi-level feature extraction units have the same structure, both including: a third convolutional block, a fourth convolutional block, a max pooling layer, an average pooling layer, and a concat layer. The kernel size of the third and fourth convolutional blocks is set to 3×3.
[0139] This invention constructs sliding sequences with small, medium, and large time scales, enabling simultaneous capture of rapid short-term fluctuations, stable medium-term transitions, and overall long-term changes in blood glucose levels. Through synergistic analysis of multi-scale features, it effectively solves the prediction bias problem caused by the limitation of single-scale features in existing technologies, which cannot distinguish between short-term disturbances and long-term trends. This significantly improves the fit between predicted and actual blood glucose values, ensuring the accuracy and reliability of the prediction results.
[0140] This invention constructs small-to-medium-scale attention sequences and small-to-large-scale attention sequences by calculating the difference between small-scale feature vectors and medium- and large-scale feature vectors within the same time period. This adaptively identifies the correlation and importance of features at different time scales. During the feature fusion stage, dynamic weights are assigned to features at different scales based on the attention sequences, allowing the model to focus more on features that significantly impact prediction results, while mitigating the effects of ineffective or interfering features, thus achieving more accurate and efficient feature representation.
[0141] This invention introduces a scale feature fusion unit and combines it with an attention adjustment mechanism between different scales, enabling small-scale blood glucose change features to be adaptively distinguished and emphasized when fused with mesoscale and large-scale features, thus forming a weighted feature representation with scale differences. Then, a dual-channel feature blood glucose prediction network is used to model and predict the weighted features at different scales respectively, so that the model can simultaneously take into account short-term blood glucose fluctuation information and medium- and long-term change trends, improving the adaptability and prediction accuracy of blood glucose prediction results to complex blood glucose change patterns.
[0142] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A blood glucose prediction method using multi-scale data processing, characterized in that, Includes the following steps: Three sliding windows are set up to slide across the normalized historical blood glucose sequence to obtain small, medium and large scale blood glucose subsequence sets. Features are extracted from the blood glucose subsequences to obtain small, medium and large scale sequence feature vectors. Based on the differences between the feature vectors of small-scale sequences and the feature vectors of medium-scale and large-scale sequences within the same time period, we obtain small-to-medium-scale attention sequences and small-to-large-scale attention sequences. Arrange the feature vectors of small, medium, and large scale sequences in chronological order to obtain feature samples of small, medium, and large scale sequences; A scale feature fusion unit is used to process small, medium, and large-scale sequence feature samples. Based on the attention applied to the small-to-medium-scale attention sequences and the small-to-large-scale attention sequences, small-to-medium-scale weighted features and small-to-large-scale weighted features are obtained. Feature extraction is performed through each pointwise convolutional layer. The first feature compression layer compresses the original small-scale features in the time dimension, keeping them consistent with the original medium-scale features in size. The second feature compression layer compresses the original small-scale features in the time dimension, keeping them consistent with the original large-scale features in size. For time periods where short-term fluctuations differ significantly from medium / long-term trends, the attention weights will tilt towards the small-scale compressed features, strengthening the capture of abnormal fluctuation signals. For time periods with smaller feature differences, more weights will be allocated to the original medium / large-scale features. A dual-channel feature blood glucose prediction network was used to process small-to-medium-scale weighted features and small-to-large-scale weighted features to obtain predicted blood glucose values.
2. The blood glucose prediction method for multi-scale data processing according to claim 1, characterized in that, The process of obtaining feature vectors for small, medium, and large-scale sequences includes: Blood glucose subsequences were extracted from small, medium, and large-scale blood glucose subsequence sets, respectively. For each blood glucose subsequence, extract the mean, maximum value, first-to-last fluctuation difference, and fluctuation value. The first-to-last fluctuation difference is the difference between the element at the latest time and the element at the beginning time of the blood glucose subsequence, and the fluctuation value is the standard deviation of each element in the blood glucose subsequence. The mean, maximum value, first-to-last fluctuation difference, and fluctuation value of the same blood glucose subsequence belonging to the small-scale blood glucose subsequence set are used to construct the small-scale sequence feature vector; The mean, maximum value, first-to-last fluctuation difference, and fluctuation value of the same blood glucose subsequence belonging to the mesoscale blood glucose subsequence set are used to construct the mesoscale sequence feature vector; The mean, maximum value, first-to-last fluctuation difference, and fluctuation value of the same blood glucose subsequence belonging to the large-scale blood glucose subsequence set are used to construct the large-scale sequence feature vector.
3. The blood glucose prediction method for multi-scale data processing according to claim 1, characterized in that, The process of obtaining the small-to-medium-scale attention sequence includes: Based on the time period in which the feature vector of the small-scale sequence is located, find the feature vector of the medium-scale sequence in the same time period; Calculate the small-to-medium directional consistency factor and the small-to-medium amplitude deviation factor of the eigenvectors of small-scale sequences and mesoscale sequences within the same time period; Based on the small-to-medium directional consistency factor and the small-to-medium amplitude deviation factor, the attention level corresponding to each mesoscale sequence feature vector is calculated to obtain the small-to-medium scale attention level sequence.
4. The blood glucose prediction method for multi-scale data processing according to claim 3, characterized in that, The calculation process of the small-to-medium directional consistency factor includes: multiplying the feature vector of the small-scale sequence with the feature vector of the mesoscale sequence to obtain the small-to-medium inner product; multiplying the L2 norm of the feature vector of the small-scale sequence with the L2 norm of the feature vector of the mesoscale sequence to obtain the small-to-medium scale norm product; using the ratio of the small-to-medium inner product to the small-to-medium scale norm product as the small-to-medium directional consistency factor; reducing the small-to-medium directional consistency factor by 1 and normalizing it to obtain the small-to-medium enhancement coefficient. The calculation process of the small-to-medium amplitude deviation factor includes: subtracting the feature vector of the small-scale sequence from the feature vector of the medium-scale sequence to obtain the small-to-medium difference vector; taking the L2 norm of the small-to-medium difference vector to obtain the small-to-medium amplitude deviation; using the ratio of the small-to-medium amplitude deviation to the maximum amplitude deviation as the small-to-medium amplitude deviation factor; and multiplying the small-to-medium amplitude deviation factor by the small-to-medium enhancement coefficient to obtain the small-to-medium initial attention level. The average of all small-to-medium initial attention values corresponding to the time period in which the mesoscale sequence feature vector is located is taken to obtain the attention value corresponding to the mesoscale sequence feature vector.
5. The blood glucose prediction method for multi-scale data processing according to claim 1, characterized in that, The process of obtaining the small-to-large scale attention sequence includes: Based on the time period in which the feature vector of the small-scale sequence is located, find the feature vector of the large-scale sequence in the same time period. Calculate the small-to-large direction consistency factor and the small-to-large magnitude deviation factor of the eigenvectors of small-scale sequences and large-scale sequences within the same time period; Based on the small-to-large direction consistency factor and the small-to-large magnitude deviation factor, the attention corresponding to each large-scale sequence feature vector is calculated to obtain the small-to-large scale attention sequence.
6. The blood glucose prediction method for multi-scale data processing according to claim 5, characterized in that, The calculation process of the small-to-large directional consistency factor includes: multiplying the feature vector of the small-scale sequence with the feature vector of the large-scale sequence to obtain the small-to-large inner product result; multiplying the L2 norm of the feature vector of the small-scale sequence with the L2 norm of the feature vector of the large-scale sequence to obtain the small-to-large scale norm product; using the ratio of the small-to-large inner product result to the small-to-large scale norm product as the small-to-large directional consistency factor; reducing the small-to-large directional consistency factor by 1 and normalizing it to obtain the small-to-large enhancement coefficient. The calculation process of the small-to-large deviation factor includes: subtracting the feature vector of the small-scale sequence from the feature vector of the large-scale sequence to obtain the small-to-large difference vector; taking the L2 norm of the small-to-large difference vector to obtain the small-to-large deviation; using the ratio of the small-to-large deviation to the maximum deviation as the small-to-large deviation factor; and multiplying the small-to-large deviation factor by the small-to-large enhancement coefficient to obtain the small-to-large initial attention. The average of all small-to-large initial attention values corresponding to the time period where the large-scale sequence feature vector is located is taken to obtain the attention value corresponding to the large-scale sequence feature vector.
7. The blood glucose prediction method for multi-scale data processing according to claim 1, characterized in that, The scale feature fusion unit includes: three pointwise convolutional layers, a first feature compression layer, a second feature compression layer, a small-to-medium scale feature fusion layer, and a small-to-large scale feature fusion layer; Pointwise convolutional layers are used to extract features from small-scale, medium-scale, and large-scale sequence feature samples respectively, to obtain small-scale original features, medium-scale original features, and large-scale original features; The first feature compression layer is used to compress the original small-scale features to obtain the first small-scale compressed features; Based on the small-to-medium scale attention sequence, a small-to-medium scale feature fusion layer is used to fuse the first small-scale compressed features with the original mesoscale features to obtain small-to-medium scale weighted features; A second feature compression layer is used to compress the original small-scale features to obtain the second small-scale compressed features. Based on the small-to-large scale attention sequence, a small-to-large scale feature fusion layer is used to fuse the second small-scale compressed features with the original large-scale features to obtain small-to-large scale weighted features.
8. The blood glucose prediction method for multi-scale data processing according to claim 7, characterized in that, The expression for the small-to-medium scale feature fusion layer is: , in, For the small-to-medium scale weighted features, the features at time t are... This is the feature at time t in the first small-scale compressed feature set. This represents the feature at time t in the original mesoscale features, where t is the time index. The attention level at time t in the small-to-medium scale attention sequence; The expression for the small-to-large scale feature fusion layer is: , in, For the features at time t in the small-to-large scale weighted features, This represents the feature at time t in the second small-scale compression feature. This represents the feature at time t in the large-scale original features. Let t represent the attention level at time t in the small-to-large scale attention sequence.
9. The blood glucose prediction method for multi-scale data processing according to claim 1, characterized in that, The dual-channel feature blood glucose prediction network includes: a third feature compression layer, a first stacked convolutional unit, a second stacked convolutional unit, a first multi-level feature extraction unit, a second multi-level feature extraction unit, an adder, and a fully connected layer.
10. The blood glucose prediction method for multi-scale data processing according to claim 9, characterized in that, The process of obtaining a predicted blood glucose value includes: A third feature compression layer is used to compress the small-to-medium-scale weighted features to obtain small-to-medium-scale compressed features. The first stacked convolutional unit is used to extract depth features from the small-to-medium scale compressed features to obtain the small-to-medium scale depth features; The second stacked convolutional unit is used to extract depth features from the small-to-large scale weighted features to obtain the small-to-large scale depth features; The first multi-level feature extraction unit is used to extract multi-level features from small-to-medium-scale depth features to obtain small-to-medium multi-level features. A second multi-level feature extraction unit is used to extract multi-level features from small-to-large scale depth features, resulting in small-to-large multi-level features. An adder is used to add the small-medium multi-level features and the small-large multi-level features element by element to obtain the small-medium-large fused features; Based on the small-medium-large fusion characteristics, a fully connected layer is used for mapping to obtain the blood glucose prediction value.
Citation Information
Patent Citations
Blood glucose concentration prediction method combined with neural network
CN119361171A
Multi-mode diabetes dynamic curative effect evaluation method
CN120319469A