Non-invasive blood glucose dynamic detection system
By designing a non-invasive blood glucose dynamic detection system, using a personalized blood glucose detection model with multi-channel input and self-attention mechanism, the shortcomings of convenience, continuity and personalized detection in the existing technology are solved, and accurate estimation of dynamic changes in blood glucose levels and personalized health management are achieved.
Patent Information
- Application Number
- CN202510221065.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-03-28
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing blood sugar detection technology has shortcomings in terms of convenience, continuity and the discomfort that may be caused to patients, and it is difficult to achieve personalized real-time blood sugar detection.
A non-invasive blood sugar dynamic detection system is designed, using a combination of a terminal subsystem and a superior computer subsystem to achieve accurate estimation of dynamic changes in blood sugar levels through a personalized blood sugar detection model of multi-channel input and self-attention mechanism.
The system can more accurately estimate the dynamic changes in blood sugar levels, improve the accuracy and interpretability of the test results, provide diabetic patients with personalized health management plans, and enhance the convenience and reliability of the test.
Smart Images

Figure CN119700102A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of medical equipment and medical signal processing, and relates to a non-invasive blood sugar dynamic detection system, in particular to a non-invasive blood sugar dynamic detection system composed of a terminal subsystem and a host computer subsystem. Background Art
[0002] With the improvement of living standards, the incidence of diabetes has risen sharply. This disease can cause irreversible damage to many important organs of the human body, such as the eyes, kidneys, and blood vessels, due to abnormal fluctuations in long-term blood sugar levels. At present, diabetes cannot be cured and needs to be managed by blood sugar testing, drugs, insulin or diet therapy. Against this background, the research direction of organically combining blood sugar testing with drug treatment has become a hot topic of common concern in academia and the medical field. For the diabetic patient group, it is of great significance to achieve timely detection of blood sugar and carry out corresponding treatment measures in advance. This is not only related to the patient's quality of life, but also closely related to the effective control of the disease and long-term health prognosis.
[0003] At present, the mainstream blood glucose testing methods include invasive and minimally invasive. Invasive testing requires the collection of blood samples, but it is easy to cause discomfort to users and it is difficult to achieve the goal of real-time testing. Minimally invasive testing methods, such as dynamic blood glucose monitoring systems, although they can provide continuous blood glucose information, require regular replacement of sensors and have the potential risk of causing infection. Both do not achieve ideal dynamic real-time blood glucose measurement and may cause discomfort. Non-invasive blood glucose testing, with its non-invasive and painless characteristics, brings hope to blood glucose management.
[0004] However, due to the limitations of non-invasive blood glucose testing in terms of accuracy, technical maturity, and adaptability to human body differences, it cannot completely replace traditional blood glucose testing methods. With the development of artificial intelligence, especially end-to-end deep learning technology, it has become possible to use low-cost sensors to detect changes in blood glucose levels. However, due to the instability of physiological signals and the differences between human tissues, improving detection accuracy has become the key to improving the reliability of non-invasive blood glucose testing.
[0005] At present, many scientific research teams and enterprises are actively exploring innovation in the field of non-invasive blood glucose detection patents. For example, a non-invasive blood glucose detection method and device based on the RNN model (patent number: CN115067938A) constructs a blood glucose detection system based on a neural network model by extracting comprehensive feature parameters related to blood glucose. A non-invasive human blood glucose detector and detection method (patent number: CN117838114A) proposes a nonlinear operator integral multi-model decision fusion regression algorithm to complete the output of blood glucose values by optimizing the contribution weights through features. However, there are some shortcomings in the existing schemes that cannot be ignored. First, it is difficult to accurately depict this complex nonlinear relationship by relying only on a single signal to establish a mapping relationship with the blood glucose level, resulting in insufficient accuracy of the blood glucose model. Secondly, most of the existing algorithm models related to non-invasive blood glucose detection lack an attention mechanism, which may make it impossible for the model to effectively screen and fully utilize the most valuable information when processing complex signals. The above problems make it difficult for the model to capture the dynamic trend of blood glucose, thereby failing to meet the user's needs for personalized real-time detection of blood glucose. Therefore, it is urgent to establish a personalized, safe and stable non-invasive blood glucose dynamic detection system. Summary of the invention
[0006] In order to solve the problems of existing blood sugar detection technology in terms of convenience, continuity and possible discomfort to patients, the present invention proposes a non-invasive blood sugar dynamic detection system.
[0007] To achieve the above object, the present invention provides the following solutions:
[0008] A non-invasive blood sugar dynamic detection system is mainly composed of a terminal subsystem and a host computer subsystem.
[0009] The terminal subsystem includes a system control and information processing module, a signal acquisition module, a data transmission module and a power management module; the system control and information processing module is connected to the signal acquisition module and the data transmission module, and sends a signal acquisition instruction to the signal acquisition module; the signal acquisition module sends the collected signal data to the system control and information processing module; the system control and information processing module processes the signal data and transmits it to the data transmission module; the data transmission module transmits the signal data to the host computer subsystem; the power management module supplies power to the system control and information processing module, the signal acquisition module and the data transmission module.
[0010] The signal acquisition module includes external fingertip probes, wristband probes and finger sleeves, as well as built-in sensors and EDA acquisition circuits, which are used to collect photoplethysmography (PPG) signals, human skin temperature (ST) signals and electrodermal activity (EDA) signals. The sensors include PPG sensors and ST sensors.
[0011] The PPG sensor is embedded in the fingertip probe and the wristband probe to collect PPG signals at the user's fingertips and wrists; the ST sensor is embedded in the wristband probe to collect ST signals on the user's skin surface; the EDA acquisition circuit collects the user's EDA signal through the acquisition electrodes embedded in the finger cuff, and amplifies and preliminarily processes it.
[0012] The data transmission module includes serial port and Bluetooth communication modes, and is responsible for establishing a connection with the upper subsystem to achieve two-way data interaction, ensuring that the upper subsystem can receive signal data from the terminal subsystem in real time and issue corresponding instructions.
[0013] The host computer subsystem includes a data packet receiving and parsing module, a data storage and management module, a data processing module, a deep learning training module and an inference estimation module.
[0014] The data packet receiving and parsing module receives data packets from the system control and information processing module through a serial port or Bluetooth communication method, and converts them into corresponding signal content; at the same time, the received data packets are checked for integrity to ensure the accuracy of the data; after completing the data conversion, the received signal waveform is drawn in real time to facilitate debugging and monitoring.
[0015] The data storage and management module stores the signal data converted by the data packet receiving and parsing module in the local storage space, and provides functions such as data query, backup, and recovery; at the same time, the data is exported to file formats such as CSV, TXT, and HDF5, so that the host computer subsystem can analyze and manage the stored signal data.
[0016] The data processing module reads the signal data file stored in the data storage and management module and performs preprocessing operations on the signal data file, including but not limited to data alignment, noise removal and outlier processing.
[0017] The deep learning training module trains the blood glucose detection model using the data processed by the data processing module to obtain a personalized blood glucose detection model. In this process, the user can customize the hyperparameters of the model training, including the training batch size, learning rate, and maximum number of iterations.
[0018] The inference estimation module estimates the current blood sugar value in real time based on the personalized blood sugar detection model trained by the deep learning training module; and records the blood sugar level value and the detection time, draws a curve chart of the blood sugar level value changing over time, and generates various forms of charts from the recorded blood sugar data.
[0019] Based on the above functional module description, the host computer subsystem integrates core components such as user interaction device, computer readable storage medium, processing unit and display device. During the operation of the blood glucose detection system, these components work together to support the realization of core functions such as data processing, inference estimation and visualization, thereby ensuring that the entire system can operate stably and show good detection performance.
[0020] In order to overcome the shortcomings and deficiencies of the existing blood sugar model, the present invention proposes a personalized blood sugar detection model based on multi-channel input and self-attention mechanism. The blood sugar detection model is composed of a temporal convolutional network (TCN) module, a position encoding module, a Transformer module and a regression detection module. The TCN module receives the original signal and is used to model the time dependency in each signal; the position encoding module receives the output of the TCN and integrates the sequence information into the feature representation; the Transformer module receives the output of the position encoding and uses the multi-head self-attention mechanism to mine the global correlation of the features; finally, the regression detection module integrates the features extracted by the Transformer module and outputs the blood sugar level detection result in milligrams per deciliter (mg / dL).
[0021] The training process of the personalized blood sugar detection model includes:
[0022] 1) Read signal data from local storage space and divide it into training set and test set;
[0023] 2) Initialize the blood glucose detection model in preparation for training based on the user-selected custom hyperparameters;
[0024] 3) Initialize the whale optimization algorithm and construct the hyperparameter search space required for blood glucose model training;
[0025] 4) Using the training set data, the blood glucose model is trained under specific hyperparameter combination settings, and the early stopping strategy is used to optimize the training process;
[0026] 5) According to the fitness value, the hyperparameter combination is continuously updated iteratively until the stopping condition is met.
[0027] After completing the training of the personalized blood sugar detection model, the user's blood sugar level can be inferred and estimated. The process of inference and estimation of the personalized model includes:
[0028] 1) After the terminal subsystem transmits the required signal, the host computer subsystem pre-processes the signal;
[0029] 2) Inputting the signal into the trained blood glucose detection model to obtain the corresponding blood glucose level detection value.
[0030] 3) The host computer subsystem displays the blood sugar level value and performs management and storage operations of the blood sugar data according to the corresponding current time point.
[0031] Compared with the prior art, the present invention has the following beneficial effects:
[0032] The system of the present invention makes full use of the correlation between multiple physiological signals and their internal sequence information to achieve accurate estimation of the dynamic changes in blood glucose levels. In the multi-source acquisition stage of the signal, the terminal subsystem efficiently manages multiple tasks, thereby ensuring the reliability of the terminal subsystem. In order to deeply explore the information hidden in physiological signals such as photoelectric volume pulse wave, skin temperature and skin electrical activity, the detection model in the host computer subsystem incorporates the attention mechanism in the feature extraction stage. In addition, during the model training process, an optimization algorithm is used to dynamically adjust the hyperparameters of the model to ensure that the personalized blood glucose model finally constructed can better meet the user's daily blood glucose management needs. The present invention not only provides patients with a personalized health management plan, but also improves the accuracy and interpretability of the test results, bringing a more convenient and efficient health management solution to diabetic patients. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 A schematic diagram of the overall structure of a non-invasive dynamic blood glucose detection system provided by an embodiment of the present invention.
[0034] Figure 2 A schematic diagram of a PPG sensor circuit provided in an embodiment of the present invention and built into a fingertip probe and a wristband probe.
[0035] Figure 3 A flowchart of an EDA signal acquisition program provided by an embodiment of the present invention.
[0036] Figure 4 A main program flow chart of a system control and information processing module provided in an embodiment of the present invention.
[0037] Figure 5 A schematic diagram of a 3.7V lithium battery charging and discharging circuit with integrated power management function provided by an embodiment of the present invention.
[0038] Figure 6 The invention provides an interface design of a data packet receiving and parsing module in a host computer subsystem according to an embodiment of the present invention.
[0039] Figure 7 An interface design of a deep learning training module in a host computer subsystem provided in an embodiment of the present invention.
[0040] Figure 8 The invention provides an interface design of an inference estimation module in a host computer subsystem according to an embodiment of the present invention.
[0041] Fig. 9 A structural diagram of a blood sugar detection model provided in an embodiment of the present invention.
[0042] Fig.10 A waveform comparison diagram of the output result obtained by a personalized blood glucose detection model provided in an embodiment of the present invention and the actual blood glucose result. DETAILED DESCRIPTION
[0043] The specific implementation of the present invention is further described below in conjunction with the accompanying drawings and technical solutions.
[0044] Figure 1 The overall structural diagram of a non-invasive blood glucose dynamic detection system provided by the present invention is divided into a terminal subsystem and a host computer subsystem.
[0045] The terminal subsystem described in this embodiment specifically includes the following components:
[0046] Signal acquisition module, system control and information processing module, data transmission module and power management module, etc.
[0047] The signal acquisition module is used to collect the photoplethysmography (PPG) signal, the electrodermal activity (EDA) signal and the human skin temperature (ST) signal of the measured part.
[0048] The PPG signal is a physiological signal of arterial blood pulsation caused by changes in light absorption due to changes in blood vessel volume, and is collected by a heart rate and blood oxygen sensor (PPG sensor). Figure 2 The figure is a schematic diagram of the PPG sensor circuit built into the fingertip probe and the wristband probe.
[0049] like Figure 2As shown, in order to improve the bidirectional level conversion efficiency of the I2C communication circuit and reduce power consumption, the NMOS tube is used in the embodiment of the present invention to optimize its communication performance. Specifically, the gate (G) of the NMOS tube is connected to a 1.8V power supply, the source (S) is connected to the corresponding pin of the PPG sensor, and the drain (D) is connected to the STM32 series microcontroller (MCU).
[0050] The EDA signal is a physiological signal that reflects the activity state of the sympathetic nervous system. The signal is first amplified by the amplifier circuit, and then the MCU analog-to-digital conversion (ADC) function completes the conversion of the digital signal. The skin electricity acquisition circuit is mainly composed of electrodes, constant current sources and other parts, which together realize the conversion of tiny changes in the conductivity of the skin into measurable electrical signals. At the same time, in order to increase the dynamic range of the measurement, the bias of the first-stage operational amplifier is determined by the output feedback of the second-stage integrator.
[0051] Among them, since it is necessary to convert the continuously changing EDA electrical signal into a digital signal at a certain sampling frequency, the built-in ADC function of the MCU is used to realize the collection of the EDA signal. Figure 3 The flowchart of the acquisition procedure of the EDA signal is shown. Specifically, the EDA acquisition circuit is set to trigger a timer interrupt every fixed time interval, thereby starting the ADC conversion. Once the conversion is completed, the ADC interrupt function is immediately turned off to ensure that the converted data can be sent smoothly before the next timer interrupt arrives. Subsequently, when a new timer interrupt occurs again, the terminal subsystem will re-enable the ADC interrupt to start the next round of conversion. This process is repeated, thereby achieving stable acquisition and efficient transmission of EDA signals.
[0052] The ST signal reflects physiological states such as blood circulation and metabolic rate. The ST sensor has a built-in temperature-sensitive element that responds to changes in ambient temperature and adjusts its electrical parameters accordingly. The built-in analog-to-digital converter converts the changes in electrical parameters into digital signals and transmits them to the MCU via the I2C communication circuit.
[0053] The system control and information processing module is implemented based on the STM32F103C8T6 main control chip, and its peripheral circuits include a crystal oscillator circuit, a reset circuit, a serial port line debugging interface circuit and a power supply circuit.
[0054] like Figure 4 As shown in the figure, the main program flow chart in the system control and information processing module is shown. The system control and information processing module is responsible for coordinating the operation of the entire terminal subsystem, and its core functions cover a wide range of aspects such as task scheduling, device management, and information processing:
[0055] (1) In terms of task scheduling mechanism, it is implemented based on the FreeRTOS real-time operating system, and effectively supports the multi-tasking requirements in the terminal subsystem through functions such as task creation, task switching and memory allocation.
[0056] (2) In terms of device management, it involves functions such as initialization of the terminal subsystem, detection of the status of each sensor, and abnormal response.
[0057] (3) At the information processing level, the terminal subsystem is responsible for combining the signals transmitted by each sensor with the corresponding frame header and frame footer to construct various types of data packets. These constructed data packets are then transmitted to the upper subsystem via the serial port / Bluetooth communication circuit.
[0058] The data transmission module is built with the serial port / Bluetooth communication circuit as the core. It transmits various data packets generated after being processed by the system control and information processing module to the upper subsystem by building a connection link with the upper subsystem. In the design of the serial port communication circuit, a serial port to USB conversion chip is used, combined with a TYPE-C interface circuit, to realize the conversion and transmission of the serial port of the terminal subsystem to the USB communication protocol. In the Bluetooth communication circuit, a slave Bluetooth transparent transmission module, VG6328A, whose operating voltage is set to 3.3V, is selected.
[0059] The power management module includes a USB power supply circuit based on a TYPE-C interface, a level conversion circuit, a power selection circuit, a lithium battery charging and discharging circuit, and a battery remaining detection circuit.
[0060] In the USB power supply circuit constructed based on the TYPE-C interface, a linear regulator (LDO) chip is used to design a level conversion circuit to achieve efficient conversion from 5V voltage to 3.3V voltage.
[0061] In view of the fact that there are two power supply circuit designs in the terminal subsystem, in order to realize the automatic switching of the single power supply mode, a power selection circuit is designed based on the PMOS tube, which can automatically select and switch to the USB power supply or lithium battery power supply mode.
[0062] Figure 5 This is a 3.7V lithium battery charging and discharging circuit with integrated power management functions (specifically including lithium battery charging and boost conversion two-in-one functions). The circuit is designed using a dedicated power management chip. The 3.7V lithium battery is electrically connected to the terminal subsystem through a curved plug-in Pin wiring interface. This design is intended to facilitate the rapid replacement and connection of lithium batteries.
[0063] exist Figure 5In addition to the above-mentioned lithium battery charging and discharging circuit, a battery power detection circuit based on an RC network is also designed. This circuit uses the analog-to-digital conversion function of the MCU to detect the power status of the lithium battery. To ensure that the level output by the BAT-ADC pin is within a safe range, the battery power detection circuit uses a voltage divider circuit composed of resistors R30 and R31 to adjust the voltage to a safe range. At the same time, in order to effectively filter out noise interference in the power supply voltage, a capacitor C28 is connected in parallel.
[0064] The host computer subsystem described in this embodiment specifically includes the following modules: data packet receiving and parsing module, data storage and management module, data processing module and deep learning training and inference estimation module. Among them:
[0065] Figure 6 The interface design of the data packet receiving and parsing module in the host computer subsystem. The data packet receiving and parsing module relies on the QComboBox plug-in and PushButton plug-in in Pyqt to scan and control the serial port occupied by the terminal subsystem. The user detects the serial port of the terminal subsystem through the serial port scanning function. After selecting a valid port, click the "Open Serial Port" button to establish a connection between the host computer and the terminal device, and then the button changes to the "Close Serial Port" button.
[0066] After successfully establishing a communication connection with the terminal subsystem, the host computer subsystem executes the operation of transferring the data packet to the main window. Among them, each data packet received by the host computer subsystem is presented in hexadecimal format. To this end, the data packet receiving and parsing module embedded in the host computer subsystem automatically performs the conversion operation to convert these hexadecimal data into decimal form. In addition, the data packet receiving and parsing module uses the current time information to generate a corresponding index (i.e., timestamp) for each data point. At the same time, the module completes the waveform drawing of each received signal based on the PlotWidget plug-in in Pyqt.
[0067] The data storage and management module relies on the pandas, h5py and numpy libraries in the Python programming language to achieve efficient storage of signal data and its corresponding timestamps. Specifically, the module classifies and saves signals according to their types, and records the storage path of each data file in detail, aiming to provide convenience and accuracy for subsequent operations such as adding, deleting and reading data.
[0068] The data processing module is responsible for reading the stored signal data and the blood glucose level values recorded by the user. Subsequently, the module performs preprocessing steps, including data alignment, noise removal, and outlier processing, to ensure that each blood glucose value can be accurately matched with the corresponding multiple physiological signals. After the preprocessing is completed, the module further performs Z-Score standardization on each physiological signal to eliminate the differences between different signal segments.
[0069] The deep learning training module executes the training process of the blood glucose detection model according to the user's operating instructions on the blood glucose model training interface and the parameter configuration specified by the user. Figure 7 The interface design of the deep learning training module is presented in detail. Specifically, users can manually select data files for model training on this interface. At the same time, users can customize model training parameters, including setting key parameters such as batch size, learning rate, and maximum number of iterations. During model training, the interface will update and display relevant information in the training process in real time, covering core indicators such as training progress, loss function value, and root mean square error. After the training, Clarke monitoring grid error analysis will be used to conduct a comprehensive and systematic evaluation of the trained blood glucose model on the test set.
[0070] The inference estimation module uses the trained blood glucose prediction model based on the physiological signals such as PPG, EDA and ST collected by the terminal subsystem to achieve non-invasive estimation of the user's blood glucose level. Figure 8 The interface design of the inference estimation module is specifically described. In this interface, the host computer subsystem continuously displays and records the user's blood sugar level value at preset time intervals. At the same time, the system intuitively presents the blood sugar measurement value in the form of a waveform graph to facilitate the observation of blood sugar change trends. To further enhance the user experience, the interface also provides flexible data visualization options. Users can choose to display the recorded blood sugar level values in the form of tables, pie charts, or bar charts according to their personal preferences. Figure 8 The interface shown embodies this functionality.
[0071] Specifically, the blood glucose detection model is built based on the Pytorch framework, including four parts: TCN module, position encoding, Transformer module and regression detection module. Fig. 9 The specific situation is as follows:
[0072] The TCN module receives three-channel one-dimensional signals processed by the relevant modules of the host computer subsystem, which correspond to PPG, EDA and ST signals respectively, and outputs feature information. The TCN module is based on causal convolution, dilated convolution and residual connection mechanisms, and is used to model the long-distance time dependency in the signal sequence data to obtain deep feature information. Among them, the PPG signal is obtained after phase matching and approximation processing of the two-channel PPG signals collected from the fingertip and wristband probes.
[0073] The position encoding module performs position encoding on the feature information output by the TCN module to incorporate the order information of the sequence. The process mainly includes the following two steps:
[0074] 1) Calculate the position encoding matrix PE corresponding to the feature information through sine and cosine functions:
[0075]
[0076] in, and Respectively represent the position coding information corresponding to the elements in the posth row, 2ith column, and 2i+1th column in the feature information, and d model Represents the dimension of feature information.
[0077] 2) Project the obtained position encoding matrix PE to the space where the feature information X extracted by the TCN module is located, and add the two together:
[0078]
[0079] Among them, APE represents the features after the addition operation, and W represents the trainable projection matrix.
[0080] The Transformer module uses four Transformer encoders as the main architecture and mines the deep association of feature information APE based on the multi-head self-attention mechanism (MultiHead). The specific structure and components of each encoder are as follows:
[0081] 1) Multi-head self-attention mechanism
[0082] MultiHead is constructed by combining multiple self-attention modules, which can operate in parallel in multiple independent representation subspaces. For the input matrix, it will undergo three independent linear transformations to map it into the query matrix Q, the key matrix K, and the value matrix V. The specific calculation formula of the multi-head self-attention mechanism is as follows.
[0083]
[0084]
[0085] Where h is the number of heads in the MultiHead mechanism, , and are all trainable parameter matrices, and head i is the score matrix calculated for the i-th head attention module.
[0086] exist In the mechanism, The matrix will be calculated based on the scaled dot product attention formula:
[0087]
[0088] 2) Residual Connection and Layer Normalization
[0089] After the multi-head attention mechanism, the feature information X is not directly passed into the fully connected neural network, but is passed through residual connection and layer normalization ( ) This part:
[0090]
[0091] Among them, O represents the output of this link, and Represents the transformation that has been undergone, such as the multi-head attention mechanism.
[0092] 3) Feedforward Neural Network
[0093] The feedforward neural network (FNN) accepts the output X from the multi-head self-attention mechanism as input and maps it into a new representation matrix through two linear transformations and a nonlinear activation function:
[0094]
[0095] in, , , and Both are trainable weight matrices, and ReLu represents a nonlinear activation function.
[0096] The regression detection module is constructed based on the linear layer, and maps the feature information output by the Transformer module to the blood glucose detection value. The detection module includes the following three parts:
[0097] 1) Downsampling
[0098] Downsampling adopts a downsampling strategy that combines the maximum pooling layer and the one-dimensional convolution layer. Specifically, when the maximum pooling layer window size is set to k (k is a positive integer) and the step size is s (s≤k), the maximum pooling layer will filter out the maximum value of the feature in each pooling window as the output. In addition, the one-dimensional convolution layer performs convolution operations on the input data through the set convolution kernel size n and step size m (m≤n). During the training process of the blood glucose detection model, the parameters of the downsampling part are deeply studied and continuously optimized based on the training set data and blood glucose value labels.
[0099] 2) Flatten operation
[0100] For the three-dimensional tensor with a shape of (m, n, p) obtained after downsampling, the Flatten operation converts it into a one-dimensional feature vector of m×n×p.
[0101] 3) Linear layer
[0102] The linear layer is used to map the one-dimensional feature vector after the Flatten operation to the final blood sugar level value. The linear layer consists of multiple neurons, with the input feature vector x, the weight matrix W, the bias vector b, and the output blood sugar result y as:
[0103]
[0104] During the training process of the blood glucose detection model, the signal data processed by the data processing module is first read and divided into a training set and a test set; then, the model is initialized according to the user-defined hyperparameters, and the model is trained using the whale optimization algorithm and the early stopping strategy, and the hyperparameter combination is iteratively updated to optimize the model performance until the stopping condition is met.
[0105] After completing the optimization training of the blood glucose model based on the WOA algorithm, the blood glucose model with the best current hyperparameters is determined to be the personalized blood glucose detection model. The host computer subsystem inputs the relevant signal as the signal to be detected, performs inference estimation through the personalized blood glucose detection model to obtain the blood glucose level value, and visualizes the blood glucose level value at the current time, while recording the blood glucose level value and its corresponding timestamp information.
[0106] Furthermore, the blood sugar detection model training process is performed in the following steps:
[0107] 1) Data preparation stage
[0108] The host computer subsystem reads the saved multi-signal data from the storage device according to the file data imported by the user to ensure the integrity and accuracy of the data. Subsequently, a partitioning strategy based on five-fold cross-validation is adopted to partition the read signal data to form a training set and a test set. The specific operation process is as follows: First, all the data is evenly divided into five subsets; then, four of the subsets are selected as training sets in turn, and the remaining subset is used as a test set.
[0109] 2) Model initialization
[0110] Initialize the blood glucose monitoring model based on the user's custom hyperparameters selected in a specific application scenario or based on individual prior knowledge. The range of custom parameters selected is wide, including but not limited to batch size, learning rate, and maximum number of iterations.
[0111] 3) Initialization of whale optimization algorithm and construction of search space
[0112] When the whale optimization algorithm (WOA) performs hyperparameter optimization of the blood glucose model, a series of key parameters need to be set in its initialization phase. These parameters include but are not limited to population size, maximum number of iterations, and construction of search space. Given the individual differences in blood glucose detection models, it is particularly important to construct a multi-dimensional hyperparameter search space. Specifically, for the convolution kernel size in the TCN module, its search range is set to a closed interval of [3, 15]. Similarly, for the feature information dimension in the Transformer module, its search space can be set to an integer range of [12, 64]. Through this setting method, the search space required by the WOA algorithm is constructed.
[0113] 4) Model training and early stopping strategy application
[0114] The blood glucose detection model is trained using the divided training set under a specific hyperparameter combination setting. The training process follows the standard process of deep learning, that is, the training set data is input into the model batch by batch with the batch size set by the user, the user's blood glucose value is estimated through the forward propagation calculation of the model, and then the loss function value is calculated based on the difference between the estimated value and the true blood glucose value. In order to match the blood glucose detection task, a loss function matching the blood glucose detection task is used in the embodiment of the present invention to measure the difference between the model estimated value x and the true value y, and to guide the training process of the model. The loss function is defined as follows:
[0115]
[0116] Among them, β is set to 14.94, and the ultimate goal of using this loss function is to minimize the loss between x and y.
[0117] In order to effectively prevent the model from overfitting during the training process, the early stopping strategy is used to optimize the training process. The specific process is: after each training cycle, the performance of the model is evaluated on the test set, and key performance indicators (such as MSE, MAE, etc.) are recorded. When the performance indicators of the model on the validation set no longer improve or show a downward trend for several consecutive iterations (such as 5-10 times), it is determined that the model may be overfitting. At this time, the training process is stopped and the current model parameters are saved.
[0118] 5) WOA algorithm optimization hyperparameter selection
[0119] In the WOA algorithm, hyperparameter combinations are encoded as individual whales. Its operation includes three core stages: surrounding prey, spiral updating position, and random search, and is optimized in an iterative manner. In each iteration, the blood glucose detection model is first trained in the training set according to the hyperparameter combination determined by WOA, and then the performance is evaluated in the validation set and the fitness value of the individual whale is calculated. Through continuous search, update, and evaluation, the hyperparameter configuration is driven to evolve towards the optimal solution. When the preset stopping conditions are met, such as reaching the maximum number of iterations, the WOA algorithm terminates the search and outputs the optimal whale individual in the current population, that is, the optimal hyperparameter combination.
[0120] After the WOA algorithm completes the optimization training of the blood glucose model, the blood glucose model with the best hyperparameters is determined as the user's personalized blood glucose detection model. The terminal subsystem collects the signal and transmits it to the host computer subsystem through the serial port / Bluetooth communication method. After receiving the signal, the host computer subsystem performs operations such as signal preprocessing, and then inputs the processed signal into the trained personalized blood glucose detection model to perform inference estimation. The specific steps are as follows:
[0121] 1) The host computer subsystem inputs relevant signals and uses them as signals to be detected;
[0122] 2) Using the personalized blood glucose detection model, the imported signal to be detected is inferred and estimated to obtain the corresponding test result, i.e., the blood glucose level value;
[0123] 3) The host computer subsystem visualizes the blood sugar level value corresponding to the current time and simultaneously records the blood sugar level value and its associated timestamp information.
[0124] After the inference estimation is completed, the non-invasive estimation result of the blood glucose level of the user by the blood glucose model will be Figure 8 It is displayed in the interface shown.
[0125] Fig.10 This is a comparison chart of the estimated blood sugar value and the actual blood sugar value output by the trained personalized blood sugar detection model. This chart shows that the blood sugar model in the embodiment of the present invention is feasible and effective in the non-invasive estimation solution of user blood sugar.
Claims
1. A non-invasive blood sugar dynamic detection system, characterized in that: The non-invasive blood glucose dynamic detection system is mainly composed of a terminal subsystem and a host computer subsystem; The terminal subsystem includes a system control and information processing module, a signal acquisition module, a data transmission module and a power management module; the system control and information processing module is connected to the signal acquisition module and the data transmission module, and sends a signal acquisition instruction to the signal acquisition module; the signal acquisition module sends the collected signal data to the system control and information processing module; the system control and information processing module processes the signal data and transmits it to the data transmission module; the data transmission module transmits the signal data to the host computer subsystem; the power management module supplies power to the system control and information processing module, the signal acquisition module and the data transmission module; The signal acquisition module includes an external fingertip probe, a wristband probe and a finger sleeve, as well as a built-in sensor and an EDA acquisition circuit, which are used to collect a photoelectric volumetric pulse wave signal PPG, a human skin temperature signal ST and a skin electrical activity signal EDA; wherein the sensor includes a PPG sensor and an ST sensor; The PPG sensor is embedded in the fingertip probe and the wristband probe to collect PPG signals at the fingertips and wrists of the user; the ST sensor is embedded in the wristband probe to collect ST signals on the surface of the user's skin; the EDA acquisition circuit collects the user's EDA signal through the acquisition electrodes embedded in the finger cuff, and performs amplification and preliminary processing; The data transmission module includes serial port and Bluetooth communication modes, and is responsible for establishing a connection with the upper subsystem to achieve two-way data interaction, ensuring that the upper subsystem can receive signal data from the terminal subsystem in real time and issue corresponding instructions; The host computer subsystem includes a data packet receiving and parsing module, a data storage and management module, a data processing module, a deep learning training module and an inference estimation module; The data packet receiving and parsing module receives data packets from the system control and information processing module through a serial port or Bluetooth communication mode, and converts them into corresponding signal contents; at the same time, the integrity check is performed on the received data packets to ensure the accuracy of the data; after completing the data conversion, the received signal waveform is drawn in real time to facilitate debugging and monitoring work; The data storage and management module stores the signal data converted by the data packet receiving and parsing module into the local storage space, and provides functions such as data query, backup, and recovery; at the same time, the data is exported into file formats such as CSV, TXT, and HDF5, so that the host computer subsystem can analyze and manage the stored signal data; The data processing module reads the signal data file stored in the data storage and management module and performs preprocessing operations on it, including but not limited to data alignment, noise removal and outlier processing; The deep learning training module uses the data processed by the data processing module to train the blood glucose detection model to obtain a personalized blood glucose detection model; in this process, the user can customize the hyperparameters of the model training, including the training batch size, the learning rate, and the maximum number of iterations; The inference estimation module estimates the current blood sugar value in real time according to the personalized blood sugar detection model trained by the deep learning training module; and records the blood sugar level value and the detection time, draws a curve chart of the blood sugar level value changing over time, and generates various forms of charts from the recorded blood sugar data; The blood glucose detection model is composed of a TCN module, a position encoding module, a Transformer module and a regression detection module; the TCN module receives the original signal and is used to model the time dependency in each signal; the position encoding module receives the output of the TCN and incorporates the sequential information into the feature representation; the Transformer module receives the output of the position encoding and uses the multi-head self-attention mechanism to mine the global correlation of the features; finally, the regression detection module integrates the features extracted by the Transformer module and outputs the blood glucose level detection results in milligrams per deciliter.
2. A non-invasive blood sugar dynamic detection system according to claim 1, characterized in that: The blood glucose detection model is as follows: The TCN module receives three-channel one-dimensional signals processed by the data processing module in the host computer subsystem, which correspond to PPG, EDA and ST signals respectively, and outputs feature information; The position encoding module performs position encoding on the feature information output by the TCN module to incorporate the order information of the sequence, and the process includes: 1) Calculate the position encoding matrix PE corresponding to the feature information through sine and cosine functions: in, and Respectively represent the position coding information corresponding to the elements in the posth row, 2ith column, and 2i+1th column in the feature information, and d model Dimensions representing feature information; 2) Project the obtained position encoding matrix PE to the space where the feature information X extracted by the TCN module is located, and add the two together: Among them, APE represents the features after the addition operation, and W represents the trainable projection matrix; The Transformer module uses four Transformer encoders as the main architecture and mines the deep association of feature information APE based on the multi-head self-attention mechanism MultiHead; The regression detection module is built based on the linear layer, mapping the feature information output by the Transformer module to the blood glucose detection value, and includes the following three parts: 1) Downsampling The downsampling adopts a downsampling strategy that combines the maximum pooling layer and the one-dimensional convolution layer. Specifically, when the maximum pooling layer window size is set to k and the step size is s, the maximum pooling layer will filter out the maximum value of the feature in each pooling window as the output. In addition, the one-dimensional convolution layer performs convolution operations on the input data through the set convolution kernel size n and step size m. During the training process of the blood glucose detection model, the parameters of the downsampling part are deeply learned and continuously optimized based on the training set data and the blood glucose value labels. Among them, k is a positive integer, s≤k, m≤n; 2) Flatten operation For the three-dimensional tensor with a shape of (m, n, p) obtained after downsampling, the Flatten operation converts it into a one-dimensional feature vector of m×n×p; 3) Linear layer The linear layer is used to map the one-dimensional feature vector after the Flatten operation to the final blood glucose level value; the linear layer consists of multiple neurons, with the input feature vector x, the weight matrix W, the bias vector b, and the output blood glucose result y as: 。 3. A non-invasive blood sugar dynamic detection system according to claim 1, characterized in that: The process of the inference estimation module includes: 1) After the terminal subsystem transmits the required signal, the host computer subsystem pre-processes the signal; 2) inputting the signal into a trained blood glucose detection model to obtain a corresponding blood glucose level detection value; 3) The host computer subsystem displays the blood sugar level value and performs management and storage operations of the blood sugar data according to the corresponding current time point.
Citation Information
Patent Citations
Noninvasive blood glucose detection method and device based on RNN (Recurrent Neural Network) model
CN115067938A
Human body blood sugar noninvasive detector and detection method
CN117838114A
Device and equipment capable of realizing noninvasive blood glucose detection
CN115768348A
Noninvasive blood glucose dynamic monitoring equipment, determination method and system
CN118319298A
Electricity price prediction method and system based on multiple attention mechanisms and convolutional network
CN119338488A
Cited By
Child development dynamic evaluation method and system based on multi-source data fusion
CN120108711A
Child development dynamic evaluation method and system based on multi-source data fusion
CN120108711B
Diabetes and early-stage patient self-management system based on AI and CGM
CN121641459A