[go: up one dir, main page]

CN118919080A - Noninvasive blood glucose concentration prediction method - Google Patents

Noninvasive blood glucose concentration prediction method Download PDF

Info

Publication number
CN118919080A
CN118919080A CN202411411714.1A CN202411411714A CN118919080A CN 118919080 A CN118919080 A CN 118919080A CN 202411411714 A CN202411411714 A CN 202411411714A CN 118919080 A CN118919080 A CN 118919080A
Authority
CN
China
Prior art keywords
data
blood glucose
triplet
training
glucose concentration
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202411411714.1A
Other languages
Chinese (zh)
Other versions
CN118919080B (en
Inventor
周林华
唐晶晶
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xingtu Optoelectronics Technology (Jilin) Co.,Ltd.
Original Assignee
Changchun University of Science and Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Changchun University of Science and Technology filed Critical Changchun University of Science and Technology
Priority to CN202411411714.1A priority Critical patent/CN118919080B/en
Publication of CN118919080A publication Critical patent/CN118919080A/en
Application granted granted Critical
Publication of CN118919080B publication Critical patent/CN118919080B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16HHEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
    • G16H50/00ICT specially adapted for medical diagnosis, medical simulation or medical data mining; ICT specially adapted for detecting, monitoring or modelling epidemics or pandemics
    • G16H50/30ICT specially adapted for medical diagnosis, medical simulation or medical data mining; ICT specially adapted for detecting, monitoring or modelling epidemics or pandemics for calculating health indices; for individual health risk assessment
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/145Measuring characteristics of blood in vivo, e.g. gas concentration or pH-value ; Measuring characteristics of body fluids or tissues, e.g. interstitial fluid or cerebral tissue
    • A61B5/14532Measuring characteristics of blood in vivo, e.g. gas concentration or pH-value ; Measuring characteristics of body fluids or tissues, e.g. interstitial fluid or cerebral tissue for measuring glucose, e.g. by tissue impedance measurement
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/145Measuring characteristics of blood in vivo, e.g. gas concentration or pH-value ; Measuring characteristics of body fluids or tissues, e.g. interstitial fluid or cerebral tissue
    • A61B5/1455Measuring characteristics of blood in vivo, e.g. gas concentration or pH-value ; Measuring characteristics of body fluids or tissues, e.g. interstitial fluid or cerebral tissue using optical sensors, e.g. spectral photometrical oximeters
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/048Activation functions
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16HHEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
    • G16H50/00ICT specially adapted for medical diagnosis, medical simulation or medical data mining; ICT specially adapted for detecting, monitoring or modelling epidemics or pandemics
    • G16H50/70ICT specially adapted for medical diagnosis, medical simulation or medical data mining; ICT specially adapted for detecting, monitoring or modelling epidemics or pandemics for mining of medical data, e.g. analysing previous cases of other patients
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02ATECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
    • Y02A90/00Technologies having an indirect contribution to adaptation to climate change
    • Y02A90/10Information and communication technologies [ICT] supporting adaptation to climate change, e.g. for weather forecasting or climate simulation

Landscapes

  • Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • Medical Informatics (AREA)
  • Public Health (AREA)
  • Biophysics (AREA)
  • Molecular Biology (AREA)
  • Pathology (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • Evolutionary Computation (AREA)
  • Heart & Thoracic Surgery (AREA)
  • Animal Behavior & Ethology (AREA)
  • Optics & Photonics (AREA)
  • Veterinary Medicine (AREA)
  • Surgery (AREA)
  • Databases & Information Systems (AREA)
  • Epidemiology (AREA)
  • Primary Health Care (AREA)
  • Spectroscopy & Molecular Physics (AREA)
  • Emergency Medicine (AREA)
  • Measurement Of The Respiration, Hearing Ability, Form, And Blood Characteristics Of Living Organisms (AREA)

Abstract

本发明是一种无创血糖浓度预测方法。本发明涉及无创血糖检测技术领域,本发明进行光谱数据采集得到原始光谱数据,对采集到的数据进行预处理;对预处理后的数据划分训练集、验证集和测试集,并进行超参数设置;搭建无创血糖浓度回归预测模型,进行迭代计算得到最优的无创血糖浓度回归预测模型;根据最优的无创血糖浓度回归预测模型,对血糖浓度进行预测。本发明提高了无创血糖浓度回归预测的性能和稳定性,减少误差和波动,为血糖浓度的非侵入性测量提供了一种新的思路和技术手段,有助于推动临床诊断、药物治疗、毒物鉴定等领域的发展,提高人类的健康水平和生活质量。

The present invention is a non-invasive blood glucose concentration prediction method. The present invention relates to the technical field of non-invasive blood glucose detection. The present invention collects spectral data to obtain original spectral data, and pre-processes the collected data; divides the pre-processed data into a training set, a validation set, and a test set, and sets hyperparameters; builds a non-invasive blood glucose concentration regression prediction model, performs iterative calculations to obtain an optimal non-invasive blood glucose concentration regression prediction model; and predicts blood glucose concentration based on the optimal non-invasive blood glucose concentration regression prediction model. The present invention improves the performance and stability of non-invasive blood glucose concentration regression prediction, reduces errors and fluctuations, and provides a new idea and technical means for non-invasive measurement of blood glucose concentration, which helps to promote the development of clinical diagnosis, drug treatment, poison identification and other fields, and improve human health and quality of life.

Description

一种无创血糖浓度预测方法A non-invasive method for predicting blood glucose concentration

技术领域Technical Field

本发明涉及无创血糖检测技术领域,是一种无创血糖浓度预测方法。The invention relates to the technical field of non-invasive blood sugar detection, and is a non-invasive blood sugar concentration prediction method.

背景技术Background Art

深度学习是机器学习领域中一类模式分析方法的统称。区别于传统的浅层学习,深度学习明确了特征学习的重要性,它通过逐层特征变换,将原特征变换到一个新特征空间,从而使分类或预测更容易。2006年Hinton通过“预训练+精调”的方式有效地解决深度神经网络难以训练的问题,并且使深度网络的实用化成为可能,这标志着深度学习的崛起。由于贪婪逐层预训练的技术突破,以及计算机算力的提升,在2010年,Vinod Nair等人首次提出修正线性单元ReLU(Rectified Linear Unit)激活函数,用它取代Sigmoid或tanh函数,以解决深层网络训练时梯度消失问题。2012年Hinton使用深度神经网络进行语音识别并取得巨大成功,这标志着以神经网络为基础的深度学习得到迅速发展。此后,研究者尝试加深深度神经网络以得到更强的表征能力,从AlexNet的8层发展到了VGG的19层,到GoogLeNet的22层,再到后续更深的Inception网络。但由于梯度消失问题的存在,更深的网络其性能出现退化现象,为此,2015年He等人提出ResNet。ResNet的梯度可直接通过捷径回到更早层,极大缓解梯度消失问题,因而可构建更深且有效的网络结构。Deep learning is a general term for a class of pattern analysis methods in the field of machine learning. Different from traditional shallow learning, deep learning clarifies the importance of feature learning. It transforms the original features into a new feature space through layer-by-layer feature transformation, making classification or prediction easier. In 2006, Hinton effectively solved the problem of deep neural network training difficulties through the "pre-training + fine-tuning" method, and made the practical application of deep networks possible, which marked the rise of deep learning. Due to the technical breakthrough of greedy layer-by-layer pre-training and the improvement of computer computing power, in 2010, Vinod Nair and others first proposed the Rectified Linear Unit (ReLU) activation function, which replaced the Sigmoid or tanh function to solve the problem of gradient disappearance during deep network training. In 2012, Hinton used deep neural networks for speech recognition and achieved great success, which marked the rapid development of deep learning based on neural networks. Since then, researchers have tried to deepen the deep neural network to obtain stronger representation capabilities, from AlexNet's 8 layers to VGG's 19 layers, to GoogLeNet's 22 layers, and then to the subsequent deeper Inception network. However, due to the existence of the gradient vanishing problem, the performance of deeper networks has degraded. For this reason, He et al. proposed ResNet in 2015. The gradient of ResNet can directly return to the earlier layers through shortcuts, greatly alleviating the gradient vanishing problem, and thus a deeper and more effective network structure can be constructed.

深度孪生网络由两个结构相同、参数共享的子网络组成,能够同时处理两个不同输入,并计算两者间相似度或距离。三胞胎神经网络(TNN)是深度孪生网络的延展,2015年Schroff等人基于深度卷积网络通过三元组损失(T Loss)为每个图像学习一个欧几里得嵌入,并训练网络模型使得嵌入空间中的距离直接对应于人脸相似度。三胞胎神经网络在人脸识别领域的广泛应用激发更多研究思考,2018年Yang等人尝试将TNN应用于回归问题,提出了一种嵌入三重损失的深度回归网络,利用韵律特征预测急诊室患者在分诊前后血压的变化,但是正样本和负性样本是通过分诊后所定义,而未使用数据集的真实标签值(血压),如果没有关于分诊前后的明确信息,该方法将不起作用。2019年Song等人使用三胞胎神经网络嵌入草图和自然图像域到一个共同的特征空间中,通过端到端的训练过程,实现域间桥接、特征嵌入和距离度量学习,并引入形状回归模块,探索草图和自然图像之间的形状相似性,进一步细化特征的学习过程。针对三胞胎神经网络中三元组构造的问题,2020年Cheuk等人将TNN应用于音乐情感回归预测任务,并提出了在没有关于正样本和负样本的明确信息的情况下定义正样本和负样本的机制,使TNN能够为回归任务提供有意义的低维表示。The deep twin network consists of two sub-networks with the same structure and shared parameters. It can process two different inputs at the same time and calculate the similarity or distance between them. The triplet neural network (TNN) is an extension of the deep twin network. In 2015, Schroff et al. learned a Euclidean embedding for each image based on a deep convolutional network through triplet loss (T Loss), and trained the network model so that the distance in the embedding space directly corresponds to the face similarity. The wide application of triplet neural networks in the field of face recognition has inspired more research thinking. In 2018, Yang et al. tried to apply TNN to regression problems and proposed a deep regression network embedded with triple loss. The rhythmic features were used to predict the changes in blood pressure of emergency room patients before and after triage. However, the positive and negative samples were defined after triage, and the true label value (blood pressure) of the data set was not used. If there is no clear information about before and after triage, this method will not work. In 2019, Song et al. used triplet neural networks to embed sketch and natural image domains into a common feature space. Through an end-to-end training process, they achieved inter-domain bridging, feature embedding, and distance metric learning. They also introduced a shape regression module to explore the shape similarity between sketches and natural images and further refine the feature learning process. In response to the problem of triplet construction in triplet neural networks, Cheuk et al. applied TNN to the music emotion regression prediction task in 2020 and proposed a mechanism to define positive and negative samples without explicit information about them, enabling TNN to provide meaningful low-dimensional representations for regression tasks.

无创血糖浓度测量的研究具有重要的意义,它可以避免传统的侵入性检测方法,如组织活检、内镜检查等,带来的痛苦、风险和成本,提高了患者的便利性和舒适性。随着所收集的个人数据不断增加,借助于深度学习算法通过数据驱动来监测血糖浓度已经成为可能。其中,近红外光谱法NIRS是传统无创血糖检测研究的第一选择,它根据葡萄糖分子在近红外区域(波长750~2500 nm)具有的吸收和散射特征,利用现代计量学手段建立血糖浓度与近红外光谱之间的回归模型,实现对血糖浓度的无创检测。此外还有其他光谱技术,2009年Virkler课题组通过人,猫和狗的血痕种属鉴别结果初步证实了拉曼光谱法可以实现无损血液种属鉴别。随后,他们于2014年采用近红外激发拉曼光谱结合PLSDA进行人与动物血液的二分类研究。2017年Kavakiotis等人使用生理学模型、数据驱动模型和混合模型对1型糖尿病患者的血糖水平进行个性化预测。调了因个体差异而采用个性化管理血糖的重要性。研究还讨论了在模型中整合额外因素(如体力活动和情绪)的挑战,并指出了机器学习技术在临床验证中的必要性。The research on non-invasive blood glucose concentration measurement is of great significance. It can avoid the pain, risk and cost brought by traditional invasive detection methods such as tissue biopsy and endoscopy, and improve the convenience and comfort of patients. With the continuous increase of personal data collected, it has become possible to monitor blood glucose concentration through data-driven with the help of deep learning algorithms. Among them, near-infrared spectroscopy NIRS is the first choice for traditional non-invasive blood glucose detection research. It uses modern metrology methods to establish a regression model between blood glucose concentration and near-infrared spectrum based on the absorption and scattering characteristics of glucose molecules in the near-infrared region (wavelength 750~2500 nm), and realizes non-invasive detection of blood glucose concentration. In addition, there are other spectral technologies. In 2009, the Virkler research group preliminarily confirmed that Raman spectroscopy can achieve non-destructive blood species identification through the results of blood stain species identification of humans, cats and dogs. Subsequently, they used near-infrared excitation Raman spectroscopy combined with PLSDA to conduct a binary classification study of human and animal blood in 2014. In 2017, Kavakiotis et al. used physiological models, data-driven models and hybrid models to make personalized predictions of blood glucose levels in patients with type 1 diabetes. The study also discussed the challenges of incorporating additional factors (such as physical activity and mood) into the model and pointed out the need for machine learning technology in clinical validation.

将三胞胎神经网络与回归算法相结合应用于无创血液浓度检测,通过三胞胎神经网络强大的特征提取能力,从多种生理信号中自动学习与血糖浓度相关的特征,降低了人工特征工程的复杂度和成本,再通过回归算法的预测能力,根据提取的特征建立血糖浓度与生理信号的数学模型,实现对血糖浓度的准确估计。The triplet neural network is combined with the regression algorithm and applied to non-invasive blood concentration detection. Through the powerful feature extraction ability of the triplet neural network, the features related to blood glucose concentration are automatically learned from a variety of physiological signals, reducing the complexity and cost of manual feature engineering. Then, through the prediction ability of the regression algorithm, a mathematical model of blood glucose concentration and physiological signals is established according to the extracted features to achieve accurate estimation of blood glucose concentration.

发明内容Summary of the invention

本发明建立了深度三胞胎残差支持向量回归机模型,并对三胞胎网络的损失函数进行了改进,提出基于三元损失与对比损失的TC Loss损失函数。TC Loss约束下DTRSVR模型结合三胞胎神经网络与回归算法的优化能力,提高无创血糖浓度回归预测的性能和稳定性,减少误差和波动,为血糖浓度的非侵入性测量提供了一种新的思路和技术手段,有助于推动临床诊断、药物治疗、毒物鉴定等领域的发展,提高人类的健康水平和生活质量。The present invention establishes a deep triplet residual support vector regression machine model, improves the loss function of the triplet network, and proposes a TC Loss loss function based on ternary loss and contrast loss. The DTRSVR model under TC Loss constraint combines the optimization capabilities of the triplet neural network and the regression algorithm to improve the performance and stability of non-invasive blood glucose concentration regression prediction, reduce errors and fluctuations, and provide a new idea and technical means for non-invasive measurement of blood glucose concentration, which is helpful to promote the development of clinical diagnosis, drug treatment, poison identification and other fields, and improve human health and quality of life.

本发明提供了一种无创血糖浓度预测方法,本发明提供了以下技术方案:The present invention provides a non-invasive blood glucose concentration prediction method, and the present invention provides the following technical solutions:

一种无创血糖浓度预测方法,所述方法包括以下步骤:A non-invasive blood glucose concentration prediction method, the method comprising the following steps:

步骤1:进行光谱数据采集得到原始光谱数据,对采集到的数据进行预处理;Step 1: Collect spectral data to obtain original spectral data, and pre-process the collected data;

步骤2:对预处理后的数据划分训练集、验证集和测试集,并进行超参数设置;Step 2: Divide the preprocessed data into training set, validation set and test set, and set hyperparameters;

步骤3:搭建无创血糖浓度回归预测模型,进行迭代计算得到最优的无创血糖浓度回归预测模型;Step 3: Build a non-invasive blood glucose concentration regression prediction model, and perform iterative calculations to obtain the optimal non-invasive blood glucose concentration regression prediction model;

步骤4:根据最优的无创血糖浓度回归预测模型,对血糖浓度进行预测。Step 4: Predict the blood glucose concentration based on the optimal non-invasive blood glucose concentration regression prediction model.

优选地,所述步骤1具体为:Preferably, the step 1 is specifically:

步骤1.1:通过光源、光谱仪、光纤和计算机构建采集系统,通过采集系统进行光谱数据采集得到原始光谱数据;Step 1.1: Construct an acquisition system through a light source, a spectrometer, an optical fiber and a computer, and acquire spectral data through the acquisition system to obtain original spectral data;

步骤1.2:采用多元散射矫正进行预处理原始光谱数据,当原始光谱信号值为为浓度总数,为选定浓度下样本总数,为波长总数,对原始光谱信号值进行多元散射校正:Step 1.2: Use multivariate scattering correction to preprocess the original spectral data. When the original spectral signal value is , , , , is the total concentration, is the total number of samples at the selected concentration, is the total number of wavelengths, and the original spectral signal value is corrected for multivariate scattering:

其中,是经过多元散射处理后的光谱数据,是多元散射校正函数;in, is the spectral data after multivariate scattering processing, is the multivariate scatter correction function;

步骤1.3:通过Lamber_Beer定律求吸光度,通过测量穿过样品的光的吸光度,计算出分析物的浓度:Step 1.3: Use the Lamber-Beer law to calculate the absorbance of the light passing through the sample and calculate the concentration of the analyte:

其中,为分析物的光谱吸光度,LB是 Lambert-Beer 定律的简写,其中是吸光度,是摩尔吸光系数,是浓度,是光的路径长度;in, is the spectral absorbance of the analyte, and LB is the abbreviation of Lambert-Beer law, where is the absorbance, is the molar absorptivity, is the concentration, is the path length of the light;

对吸光度进行归一化处理:Normalize the absorbance:

其中,为处理后的吸光度数据。in, is the processed absorbance data.

优选地,所述步骤2数据集划分具体为:Preferably, the data set division in step 2 is specifically as follows:

根据预处理后得到27个浓度2430条数据,对预处理后的数据进行了训练集、验证集和测试集的划分,从所有浓度中随机选择5个浓度即450个样本作为测试集,每个浓度所对应的光谱数据值不参与模型的训练生成,从剩下的22个浓度中随机选择20%的数据作为验证集,剩下80%的数据作为训练集。According to the 27 concentrations and 2430 data obtained after preprocessing, the preprocessed data were divided into training set, validation set and test set. Five concentrations, namely 450 samples, were randomly selected from all concentrations as the test set. The spectral data values corresponding to each concentration did not participate in the training and generation of the model. 20% of the data were randomly selected from the remaining 22 concentrations as the validation set, and the remaining 80% of the data were used as the training set.

优选地,所述步骤2超参数设置具体为:Preferably, the hyperparameter setting in step 2 is specifically as follows:

在训练集、验证集和测试集上划分三元组,从真实血糖浓度值中随机选取一个浓度作为锚点样本对应的标签值,即第次抽取的锚点样本标签值,,在标签值为范围内抽取正样本,在范围内抽取负样本,构成三元组样本,通过数据分布和迭代结果进行阈值调整,经过交叉验证得到在=0.1和=0.5时网络模型训练效果最好:Divide the triplets into the training set, validation set, and test set, and randomly select a concentration from the true blood glucose concentration value as the label value corresponding to the anchor sample , that is, The label value of the anchor sample extracted. , when the label value is Extract positive samples within the range ,exist Extract negative samples within the range , forming a triple sample , the threshold is adjusted through data distribution and iteration results, and the cross-validation results are obtained. = 0.1 and =0.5 when the network model training effect is best:

Right now , .

优选地,所述步骤3具体为:Preferably, the step 3 is specifically:

步骤3.1:根据阈值间隙划分三元组后,根据随机梯度下降更新权重反复训练,直至损失值足够小或已达到最大训练批次结束训练,输出血糖光谱数据的特征;将输出的特征数据转入支持向量回归机中,进行回归算法的训练和测试;Step 3.1: After dividing the triplets according to the threshold gap, use stochastic gradient descent Update the weights and train repeatedly until the loss value is small enough or the maximum training batch is reached, then the training is terminated and the features of the blood glucose spectrum data are output; the output feature data is transferred to the support vector regression machine to train and test the regression algorithm;

在三胞胎神经网络的训练过程中,需要三条相对应的样本数据作为输入,在划分样本时不使用固定分组,而是依据锚点信息固定阈值间隔,定义锚点标签值为为两个数值不同的阈值,正样本对应标签所属范围为,负样本对应标签所属范围为之间的距离形成一个间隙,以指导网络学习区分性的样本;In the training process of the triplet neural network, three corresponding sample data are required as input. When dividing the samples, fixed grouping is not used, but the threshold interval is fixed according to the anchor information, and the anchor label value is defined as , and are two thresholds with different values, and the positive samples correspond to labels The scope is , the negative sample corresponds to the label The scope is , and The distance between them forms a gap to guide the network to learn discriminative samples;

将构建的三元组记为,其中是原始锚点特征数据;是原始正例特征数据;是原始负例特征数据,The constructed triple is recorded as ,in , is the original anchor feature data; , is the original positive feature data; , is the original negative feature data, ;

对于给定的数据集,其中是原始锚点特征数据,是对应标签数据,其余两个同理,原始特征通过三胞胎残差神经网络映射至高维特征空间中,得到深度特征For a given data set and ,in , is the original anchor feature data, is the corresponding label data, and the other two are the same, the original features Through triplet residual neural network Mapping to high-dimensional feature space In the deep feature ;

步骤3.2:通过深度三胞胎残差神经网络预训练更新网络参数得到具有三胞胎特征性质的深度特征,在三胞胎残差神经网络后增加一层全连接层,模型基于损失函数计算训练数据的损失值,并反向传播梯度更新网络参数,以完成特征提取过程;Step 3.2: Update network parameters through deep triplet residual neural network pre-training Get deep features with triplet characteristics , add a fully connected layer after the triplet residual neural network ,Model Calculate the loss value of the training data based on the loss function, and back-propagate the gradient to update the network parameters to complete the feature extraction process;

并根据随机梯度下降更新权重反复训练,直至损失值足够小或已达到最大训练批次结束训练,输出血糖光谱数据的特征;将输出的特征数据转入支持向量回归机中,进行回归算法的训练和测试;And according to stochastic gradient descent Update the weights and train repeatedly until the loss value is small enough or the maximum training batch is reached, then the training is terminated and the features of the blood glucose spectrum data are output; the output feature data is transferred to the support vector regression machine to train and test the regression algorithm;

步骤3.3:构建的三胞胎残差神经网络作为深度三胞胎残差支持向量机的特征提取模块,在孪生网络中,输入是两组数据构成的数据对,在三胞胎神经网络中输入是三组数据构成的三元组,即锚点(Anchor,)、正例(Positive,)和负例(Negative,);将三元组输入具有三胞胎结构的残差神经网络ResNet-18中,三元组数据经过阈值间隙的划分后输入至共享网络Net(x)进行特征提取得到,通过损失函数计算变量梯度,更新网络权重,增强数据特征在高维空间中的表征,三胞胎神经网络的训练目标是使锚点与正例间的高维度表征距离最小化,同时使锚点与负例间的高维度表征距离最大化;Step 3.3: The constructed triplet residual neural network is used as the feature extraction module of the deep triplet residual support vector machine. In the twin network, the input is a data pair consisting of two sets of data, and in the triplet neural network, the input is a triple consisting of three sets of data. , that is, the anchor point (Anchor, ), Positive ) and negative examples (Negative, ); The triplet is input into the residual neural network ResNet-18 with a triplet structure. After the triplet data is divided by the threshold gap, it is input into the shared network Net(x) for feature extraction. , and , the variable gradient is calculated through the loss function, the network weight is updated, and the representation of data features in high-dimensional space is enhanced. The training goal of the triplet neural network is to make the high-dimensional representation distance between the anchor point and the positive example Minimize while making the high-dimensional representation distance between the anchor point and the negative example maximize;

结合三元组损失函数和对比损失函数建立三元对比损失TC Loss,通过来度量锚点、正例和负例间距,并引入含有的自适应超参数增强模型的泛化能力,通过下式表示TC Loss函数:Combine the triplet loss function and the contrast loss function to establish the ternary contrast loss TC Loss, through , and to measure the distance between anchor points, positive examples and negative examples, and introduce The adaptive hyperparameters enhance the generalization ability of the model. The TC Loss function is expressed as follows:

其中,是锚点与正例标签值之差的绝对值,是锚点与负例标签值之差的绝对值,分别是锚点、正例和负例通过共享网络结构处理后得到的特征数据,是锚点与正例特征数据间的余弦值,是锚点与负例特征数据间的余弦值,是边际参数;in, is the absolute value of the difference between the anchor point and the positive example label value, is the absolute value of the difference between the anchor point and the negative example label value, , and They are the feature data obtained after the anchor point, positive example and negative example are processed through the shared network structure. is the cosine value between the anchor point and the positive feature data, is the cosine value between the anchor point and the negative feature data, is the marginal parameter;

将TC Loss函数与三胞胎残差神经网络结构结合,将特征提取部分通过如下优化问题:Combine the TC Loss function with the triplet residual neural network structure, and optimize the feature extraction part through the following problem:

;

步骤3.4:使用三胞胎残差神经网络进行特征提取,使用随机梯度下降法计算三元对比损失函数TC Loss关于网络变量的梯度来优化网络,使网络输出的锚点与正例特征数据相近,锚点与负例特征数据相远,根据TC Loss损失函数:Step 3.4: Use triplet residual neural network for feature extraction using stochastic gradient descent Calculate the gradient of the ternary contrast loss function TC Loss with respect to the network variables to optimize the network so that the anchor point output by the network is close to the positive feature data and the anchor point is far from the negative feature data. According to the TC Loss loss function:

,则梯度when , then the gradient ;

,则梯度为:when , then the gradient is:

由于包含包含,因此分别对求偏导,更新梯度:because Include and , Include and , so respectively , and Find partial derivatives and update gradients:

步骤3.5:令表示第第迭代的参数,,则表示第第迭代的损失值,表示第第迭代的学习率。Step 3.5: Order Indicates The parameters of the iteration, ,but Indicates The loss value of the iteration, Indicates The learning rate for iteration .

优选地,当学习率,则当最大迭代次数时,深度三胞胎残差网络的损失值收敛至最优解,得到最优模型。Preferably, when the learning rate , then when the maximum number of iterations When , the loss value of the deep triplet residual network Converge to the optimal solution , and obtain the optimal model.

优选地,深度残差神经网络ResNet-18的各残差块依次为,模型最终的输出维度通过全连接层的numclass确定,且,对于损失函数中的参数设置,函数中参数指定为函数中参数初始值指定为Preferably, the residual blocks of the deep residual neural network ResNet-18 are , , , , the final output dimension of the model is determined by the numclass of the fully connected layer, and , for the parameter settings in the loss function, The function parameters are specified as , The initial values of the parameters in the function are specified as .

一种无创血糖浓度预测系统,所述系统包括:A non-invasive blood glucose concentration prediction system, the system comprising:

数据采集模块,所述数据采集模块进行光谱数据采集得到原始光谱数据,对采集到的数据进行预处理;A data acquisition module, wherein the data acquisition module acquires spectral data to obtain raw spectral data and pre-processes the acquired data;

超参数设置模块,所述超参数设置模块对预处理后的数据划分训练集、验证集和测试集,并进行超参数设置;A hyperparameter setting module, wherein the hyperparameter setting module divides the preprocessed data into a training set, a validation set, and a test set, and performs hyperparameter setting;

模型搭建模块,所述模型搭建模块搭建无创血糖浓度回归预测模型,进行迭代计算得到最优的无创血糖浓度回归预测模型;A model building module, wherein the model building module builds a non-invasive blood glucose concentration regression prediction model and performs iterative calculations to obtain an optimal non-invasive blood glucose concentration regression prediction model;

预测模块,所述预测模块根据最优的无创血糖浓度回归预测模型,对血糖浓度进行预测。A prediction module predicts blood glucose concentration based on an optimal non-invasive blood glucose concentration regression prediction model.

一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行,以用于实现一种无创血糖浓度预测方法。A computer-readable storage medium stores a computer program, which is executed by a processor to implement a non-invasive blood glucose concentration prediction method.

一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现一种无创血糖浓度预测方法。A computer device comprises a memory and a processor, wherein the memory stores a computer program and the processor implements a non-invasive blood glucose concentration prediction method when executing the computer program.

本发明具有以下有益效果:The present invention has the following beneficial effects:

本发明与现有技术相比:Compared with the prior art, the present invention has the following advantages:

本发明对三胞胎网络的损失函数进行了改进,提出基于三元损失与对比损失的TCLoss损失函数。将预训练完成的深度三胞胎残差嵌入支持向量回归机中,构建TC Loss约束下DTRSVR模型,并采用SGD算法进行损失反向传播以调整参数完成模型训练。实验结果表明,当最佳输出维度为16且超参数=0.8时,基于TC Loss函数的DTRSVR模型预测性能最佳。改进的损失函数不仅提高模型的预测精度,且显著提高了模型的训练速度,其训练速度比三元组损失快40倍左右。对比于SVR、DBN-SVR、T Loss约束下的DTRSVR,基于TC Loss函数的DTRSVR模型的均方误差平均降低58.43%、79.28%和39.32%,决定系数平均提高0.3603、0.1945和0.1575。显示了模型的泛化能力与运算优势,为亟待跨越的难题提供了深度学习解决策略。The present invention improves the loss function of the triplet network and proposes a TCLoss loss function based on ternary loss and contrast loss. The pre-trained deep triplet residual is embedded in the support vector regression machine to construct the DTRSVR model under the TC Loss constraint, and the SGD algorithm is used for loss back propagation to adjust the parameters to complete the model training. Experimental results show that when the optimal output dimension is 16 and the hyperparameters are =0.8, the prediction performance of the DTRSVR model based on the TC Loss function is the best. The improved loss function not only improves the prediction accuracy of the model, but also significantly improves the training speed of the model, which is about 40 times faster than the triple loss. Compared with SVR, DBN-SVR, and DTRSVR under T Loss constraints, the mean square error of the DTRSVR model based on the TC Loss function is reduced by 58.43%, 79.28%, and 39.32% on average, and the determination coefficient is increased by 0.3603, 0.1945, and 0.1575 on average. This shows the generalization ability and computational advantages of the model, and provides a deep learning solution strategy for the problems that need to be overcome.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为本发明的三胞胎神经网络结合支持向量回归机流程图;FIG1 is a flow chart of a triplet neural network combined with a support vector regression machine according to the present invention;

图2为定义锚点和正负样本示意图;Figure 2 is a schematic diagram of defining anchor points and positive and negative samples;

图3为深度三胞胎残差网络TRSGD训练算法伪代码Figure 3 is the pseudo code of the TRSGD training algorithm for the deep triplet residual network

图4为本发明三胞胎残差神经网络结构示意图;FIG4 is a schematic diagram of the structure of a triplet residual neural network according to the present invention;

图5为第一位志愿者的不同模型的克拉克分析对比图;Figure 5 is a comparison of Clarke analysis of different models for the first volunteer;

图6为第二位志愿者的不同模型的克拉克分析对比图。Figure 6 is a comparison of the Clarke analysis of different models for the second volunteer.

具体实施方式DETAILED DESCRIPTION

以下结合具体实施例,对本发明进行了详细说明。The present invention is described in detail below in conjunction with specific embodiments.

具体实施例一:Specific embodiment one:

根据图1至图6所示,本发明为解决上述技术问题采取的具体优化技术方案是:本发明涉及一种无创血糖浓度预测方法。As shown in FIG. 1 to FIG. 6 , the specific optimization technical solution adopted by the present invention to solve the above-mentioned technical problems is: the present invention relates to a non-invasive blood glucose concentration prediction method.

本发明提供一种无创血糖浓度预测方法,所述方法包括以下步骤:The present invention provides a non-invasive blood glucose concentration prediction method, the method comprising the following steps:

步骤1:进行光谱数据采集得到原始光谱数据,对采集到的数据进行预处理;Step 1: Collect spectral data to obtain original spectral data, and pre-process the collected data;

步骤2:对预处理后的数据划分训练集、验证集和测试集,并进行超参数设置;Step 2: Divide the preprocessed data into training set, validation set and test set, and set hyperparameters;

步骤3:搭建无创血糖浓度回归预测模型,进行迭代计算得到最优的无创血糖浓度回归预测模型;Step 3: Build a non-invasive blood glucose concentration regression prediction model, and perform iterative calculations to obtain the optimal non-invasive blood glucose concentration regression prediction model;

步骤4:根据最优的无创血糖浓度回归预测模型,对血糖浓度进行预测。Step 4: Predict the blood glucose concentration based on the optimal non-invasive blood glucose concentration regression prediction model.

具体实施例二:Specific embodiment 2:

本申请实施例二与实施例一的区别仅在于:The difference between the second embodiment of the present application and the first embodiment is that:

所述步骤1具体为:The step 1 is specifically as follows:

步骤1.1:通过光源、光谱仪、光纤和计算机构建采集系统,通过采集系统进行光谱数据采集得到原始光谱数据;Step 1.1: Construct an acquisition system through a light source, a spectrometer, an optical fiber and a computer, and acquire spectral data through the acquisition system to obtain original spectral data;

步骤1.2:采用多元散射矫正进行预处理原始光谱数据,当原始光谱信号值为为浓度总数,为选定浓度下样本总数,为波长总数,对原始光谱信号值进行多元散射校正:Step 1.2: Use multivariate scattering correction to preprocess the original spectral data. When the original spectral signal value is , , , , is the total concentration, is the total number of samples at the selected concentration, is the total number of wavelengths, and the original spectral signal value is corrected for multivariate scattering:

其中,是经过多元散射处理后的光谱数据,是多元散射校正函数;in, is the spectral data after multivariate scattering processing, is the multivariate scatter correction function;

步骤1.3:通过Lamber_Beer定律求吸光度,通过测量穿过样品的光的吸光度,计算出分析物的浓度:Step 1.3: Use the Lamber-Beer law to calculate the absorbance of the light passing through the sample and calculate the concentration of the analyte:

其中,为分析物的光谱吸光度,LB是 Lambert-Beer 定律的简写,其中是吸光度,是摩尔吸光系数,是浓度,是光的路径长度;in, is the spectral absorbance of the analyte, and LB is the abbreviation of Lambert-Beer law, where is the absorbance, is the molar absorptivity, is the concentration, is the path length of the light;

对吸光度进行归一化处理:Normalize the absorbance:

其中,为处理后的吸光度数据。in, is the processed absorbance data.

具体实施例三:Specific embodiment three:

本申请实施例三与实施例二的区别仅在于:The difference between the third embodiment of the present application and the second embodiment is that:

所述步骤2数据集划分具体为:The data set division in step 2 is specifically as follows:

根据预处理后得到27个浓度2430条数据,对预处理后的数据进行了训练集、验证集和测试集的划分,从所有浓度中随机选择5个浓度即450个样本作为测试集,每个浓度所对应的光谱数据值不参与模型的训练生成,从剩下的22个浓度中随机选择20%的数据作为验证集,剩下80%的数据作为训练集。According to the 27 concentrations and 2430 data obtained after preprocessing, the preprocessed data were divided into training set, validation set and test set. Five concentrations, namely 450 samples, were randomly selected from all concentrations as the test set. The spectral data values corresponding to each concentration did not participate in the training and generation of the model. 20% of the data were randomly selected from the remaining 22 concentrations as the validation set, and the remaining 80% of the data were used as the training set.

具体实施例四:Specific embodiment four:

本申请实施例四与实施例三的区别仅在于:The difference between the fourth embodiment of the present application and the third embodiment is that:

所述步骤2超参数设置具体为:The hyperparameter settings in step 2 are specifically as follows:

在训练集、验证集和测试集上划分三元组,从真实血糖浓度值中随机选取一个浓度作为锚点样本对应的标签值,即第次抽取的锚点样本标签值,,在标签值为范围内抽取正样本,在范围内抽取负样本,构成三元组样本,通过数据分布和迭代结果进行阈值调整,经过交叉验证得到在=0.1和=0.5时网络模型训练效果最好:Divide the triplets into the training set, validation set, and test set, and randomly select a concentration from the true blood glucose concentration value as the label value corresponding to the anchor sample , that is, The label value of the anchor sample extracted. , when the label value is Extract positive samples within the range ,exist Extract negative samples within the range , forming a triple sample , the threshold is adjusted through data distribution and iteration results, and the cross-validation results are obtained. = 0.1 and =0.5 when the network model training effect is best:

Right now , .

具体实施例五:Specific embodiment five:

本申请实施例五与实施例四的区别仅在于:The difference between the fifth embodiment of the present application and the fourth embodiment is that:

所述步骤3具体为:The step 3 is specifically as follows:

步骤3.1:根据阈值间隙划分三元组后,根据随机梯度下降更新权重反复训练,直至损失值足够小或已达到最大训练批次结束训练,输出血糖光谱数据的特征;将输出的特征数据转入支持向量回归机中,进行回归算法的训练和测试;Step 3.1: After dividing the triplets according to the threshold gap, use stochastic gradient descent Update the weights and train repeatedly until the loss value is small enough or the maximum training batch is reached, then the training is terminated and the features of the blood glucose spectrum data are output; the output feature data is transferred to the support vector regression machine to train and test the regression algorithm;

在三胞胎神经网络的训练过程中,需要三条相对应的样本数据作为输入,在划分样本时不使用固定分组,而是依据锚点信息固定阈值间隔,定义锚点标签值为为两个数值不同的阈值,正样本对应标签所属范围为,负样本对应标签所属范围为之间的距离形成一个间隙,以指导网络学习区分性的样本;In the training process of the triplet neural network, three corresponding sample data are required as input. When dividing the samples, fixed grouping is not used, but the threshold interval is fixed according to the anchor information, and the anchor label value is defined as , and are two thresholds with different values, and the positive samples correspond to labels The scope is , the negative sample corresponds to the label The scope is , and The distance between them forms a gap to guide the network to learn discriminative samples;

将构建的三元组记为,其中是原始锚点特征数据;是原始正例特征数据;是原始负例特征数据;The constructed triple is recorded as ,in , is the original anchor feature data; , is the original positive feature data; , is the original negative feature data;

对于给定的数据集,其中是原始锚点特征数据,是对应标签数据,其余两个同理,原始特征通过三胞胎残差神经网络映射至高维特征空间中,得到深度特征For a given data set and ,in , is the original anchor feature data, is the corresponding label data, and the other two are the same, the original features Through triplet residual neural network Mapping to high-dimensional feature space In the deep feature ;

步骤3.2:通过深度三胞胎残差神经网络预训练更新网络参数得到具有三胞胎特征性质的深度特征,在三胞胎残差神经网络后增加一层全连接层,模型基于损失函数计算训练数据的损失值,并反向传播梯度更新网络参数,以完成特征提取过程;Step 3.2: Update network parameters through deep triplet residual neural network pre-training Get deep features with triplet characteristics , add a fully connected layer after the triplet residual neural network ,Model Calculate the loss value of the training data based on the loss function, and back-propagate the gradient to update the network parameters to complete the feature extraction process;

并根据随机梯度下降更新权重反复训练,直至损失值足够小或已达到最大训练批次结束训练,输出血糖光谱数据的特征;将输出的特征数据转入支持向量回归机中,进行回归算法的训练和测试;And according to stochastic gradient descent Update the weights and train repeatedly until the loss value is small enough or the maximum training batch is reached, then the training is terminated and the features of the blood glucose spectrum data are output; the output feature data is transferred to the support vector regression machine to train and test the regression algorithm;

步骤3.3:构建的三胞胎残差神经网络作为深度三胞胎残差支持向量机的特征提取模块,在孪生网络中,输入是两组数据构成的数据对,在三胞胎神经网络中输入是三组数据构成的三元组,即锚点(Anchor,)、正例(Positive,)和负例(Negative,);将三元组输入具有三胞胎结构的残差神经网络ResNet-18中,三元组数据经过阈值间隙的划分后输入至共享网络Net(x)进行特征提取得到,通过损失函数计算变量梯度,更新网络权重,增强数据特征在高维空间中的表征,三胞胎神经网络的训练目标是使锚点与正例间的高维度表征距离最小化,同时使锚点与负例间的高维度表征距离最大化;Step 3.3: The constructed triplet residual neural network is used as the feature extraction module of the deep triplet residual support vector machine. In the twin network, the input is a data pair consisting of two sets of data, and in the triplet neural network, the input is a triple consisting of three sets of data. , that is, the anchor point (Anchor, ), Positive ) and negative examples (Negative, ); The triplet is input into the residual neural network ResNet-18 with a triplet structure. After the triplet data is divided by the threshold gap, it is input into the shared network Net(x) for feature extraction. , and , the variable gradient is calculated through the loss function, the network weight is updated, and the representation of data features in high-dimensional space is enhanced. The training goal of the triplet neural network is to make the high-dimensional representation distance between the anchor point and the positive example Minimize while making the high-dimensional representation distance between the anchor point and the negative example maximize;

结合三元组损失函数和对比损失函数建立三元对比损失TC Loss,通过来度量锚点、正例和负例间距,并引入含有的自适应超参数增强模型的泛化能力,通过下式表示TC Loss函数:Combine the triplet loss function and the contrast loss function to establish the ternary contrast loss TC Loss, through , and to measure the distance between anchor points, positive examples and negative examples, and introduce The adaptive hyperparameters enhance the generalization ability of the model. The TC Loss function is expressed as follows:

其中,是锚点与正例标签值之差的绝对值,是锚点与负例标签值之差的绝对值,分别是锚点、正例和负例通过共享网络结构处理后得到的特征数据,是锚点与正例特征数据间的余弦值,是锚点与负例特征数据间的余弦值,是边际参数;in, is the absolute value of the difference between the anchor point and the positive example label value, is the absolute value of the difference between the anchor point and the negative example label value, , and They are the feature data obtained after the anchor point, positive example and negative example are processed through the shared network structure. is the cosine value between the anchor point and the positive feature data, is the cosine value between the anchor point and the negative feature data, is the marginal parameter;

将TC Loss函数与三胞胎残差神经网络结构结合,将特征提取部分通过如下优化问题:Combine the TC Loss function with the triplet residual neural network structure, and optimize the feature extraction part through the following problem:

;

步骤3.4:使用三胞胎残差神经网络进行特征提取,使用随机梯度下降法计算三元对比损失函数TC Loss关于网络变量的梯度来优化网络,使网络输出的锚点与正例特征数据相近,锚点与负例特征数据相远,根据TC Loss损失函数:Step 3.4: Use triplet residual neural network for feature extraction using stochastic gradient descent Calculate the gradient of the ternary contrast loss function TC Loss with respect to the network variables to optimize the network so that the anchor point output by the network is close to the positive feature data and the anchor point is far from the negative feature data. According to the TC Loss loss function:

,则梯度when , then the gradient ;

,则梯度为:when , then the gradient is:

由于包含包含,因此分别对求偏导,更新梯度:because Include and , Include and , so respectively , and Find partial derivatives and update gradients:

步骤3.5:令表示第第迭代的参数,,则表示第第迭代的损失值,表示第第迭代的学习率。Step 3.5: Order Indicates The parameters of the iteration, ,but Indicates The loss value of the iteration, Indicates The learning rate for iteration .

具体实施例六:Specific embodiment six:

本申请实施例六与实施例五的区别仅在于:The difference between the sixth embodiment of the present application and the fifth embodiment is that:

当学习率,则当最大迭代次数时,深度三胞胎残差网络的损失值收敛至最优解,得到最优模型。When the learning rate , then when the maximum number of iterations When , the loss value of the deep triplet residual network Converge to the optimal solution , and obtain the optimal model.

具体实施例七:Specific embodiment seven:

本申请实施例七与实施例六的区别仅在于:The difference between the seventh embodiment of the present application and the sixth embodiment is that:

深度残差神经网络ResNet-18的各残差块依次为,模型最终的输出维度通过全连接层的numclass确定,且,对于损失函数中的参数设置,函数中参数指定为函数中参数初始值指定为The residual blocks of the deep residual neural network ResNet-18 are , , , , the final output dimension of the model is determined by the numclass of the fully connected layer, and , for the parameter settings in the loss function, The function parameters are specified as , The initial values of the parameters in the function are specified as .

具体实施例八:Specific embodiment eight:

本申请实施例八与实施例七的区别仅在于:The difference between the eighth embodiment of the present application and the seventh embodiment is only that:

本发明提供一种无创血糖浓度预测系统,所述系统包括:The present invention provides a non-invasive blood glucose concentration prediction system, the system comprising:

数据采集模块,所述数据采集模块进行光谱数据采集得到原始光谱数据,对采集到的数据进行预处理;A data acquisition module, wherein the data acquisition module acquires spectral data to obtain raw spectral data and pre-processes the acquired data;

超参数设置模块,所述超参数设置模块对预处理后的数据划分训练集、验证集和测试集,并进行超参数设置;A hyperparameter setting module, wherein the hyperparameter setting module divides the preprocessed data into a training set, a validation set, and a test set, and performs hyperparameter setting;

模型搭建模块,所述模型搭建模块搭建无创血糖浓度回归预测模型,进行迭代计算得到最优的无创血糖浓度回归预测模型;A model building module, wherein the model building module builds a non-invasive blood glucose concentration regression prediction model and performs iterative calculations to obtain an optimal non-invasive blood glucose concentration regression prediction model;

预测模块,所述预测模块根据最优的无创血糖浓度回归预测模型,对血糖浓度进行预测。A prediction module predicts blood glucose concentration based on an optimal non-invasive blood glucose concentration regression prediction model.

具体实施例九:Specific embodiment nine:

本发明实施例九与实施例八的区别仅在于:The difference between the ninth embodiment of the present invention and the eighth embodiment is that:

本发明提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行,以用于实现一种无创血糖浓度预测方法。The present invention provides a computer-readable storage medium on which a computer program is stored. The program is executed by a processor to implement a non-invasive blood glucose concentration prediction method.

具体实施例十:Specific embodiment ten:

本发明实施例十与实施例九的区别仅在于:The difference between the tenth embodiment of the present invention and the ninth embodiment is that:

本发明提供一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现一种无创血糖浓度预测方法。The present invention provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements a non-invasive blood glucose concentration prediction method when executing the computer program.

具体实施例十一:Specific embodiment eleven:

本发明实施例十一与实施例十的区别仅在于:The difference between the eleventh embodiment of the present invention and the tenth embodiment is that:

本发明构建了一套实验采集系统,主要由光源、光谱仪、光纤和计算机组成。使用该系统进行在体实验,以采集志愿者的光谱数据和离体血液数据。为确保数据质量,采用了口服葡萄糖耐量测试(OGTT)来收集实验数据,并使用近红外光谱成像仪测量反射光谱数据。实验前,所有志愿者需空腹超过10小时以保证体内状态的稳定。实验中,志愿者在5分钟内摄入由75克无水葡萄糖粉末配制的200毫升葡萄糖水溶液。随后2.5小时内,志愿者的血糖浓度会经历一个从低点升至高点再回落的过程,整个测量过程持续3小时。The present invention constructs a set of experimental acquisition system, which is mainly composed of a light source, a spectrometer, an optical fiber and a computer. The system is used to conduct in vivo experiments to collect spectral data and ex vivo blood data of volunteers. To ensure data quality, an oral glucose tolerance test (OGTT) is used to collect experimental data, and a near-infrared spectral imager is used to measure reflectance spectral data. Before the experiment, all volunteers need to fast for more than 10 hours to ensure the stability of the body state. In the experiment, the volunteers ingested 200 ml of glucose aqueous solution prepared by 75 grams of anhydrous glucose powder within 5 minutes. In the following 2.5 hours, the blood glucose concentration of the volunteers will experience a process of rising from a low point to a high point and then falling back, and the entire measurement process lasts for 3 hours.

技术细节方面,近红外光谱成像仪采用固定扫描模式,波长范围设定在925nm至1701nm,光谱分辨率为5nm,采样帧频为90Hz。实验中选取了志愿者左手食指作为测量部位。为控制光源温度变化引起的光源不稳定性,每次数据采集前进行白板矫正,并研究了接触压力如何影响光谱信号,确保手指与仪器端面之间保持轻微而稳定的接触。实验共计收集了10名志愿者各27个时刻的血糖浓度,每个时间点记录90条与血糖浓度相应的光谱带信息,由于受试者体质及其他因素的变动影响,总计获得234个不同的血糖浓度值,相应地产生了21060条光谱数据,每条数据包含164个波长点。In terms of technical details, the near-infrared spectroscopic imager adopts a fixed scanning mode, with a wavelength range set at 925nm to 1701nm, a spectral resolution of 5nm, and a sampling frame rate of 90Hz. The index finger of the volunteer's left hand was selected as the measurement site in the experiment. In order to control the instability of the light source caused by changes in the light source temperature, a whiteboard correction was performed before each data collection, and how the contact pressure affects the spectral signal was studied to ensure a slight and stable contact between the finger and the end face of the instrument. The experiment collected blood glucose concentrations of 10 volunteers at 27 moments in total, and recorded 90 spectral band information corresponding to the blood glucose concentration at each time point. Due to the changes in the subjects' physique and other factors, a total of 234 different blood glucose concentration values were obtained, and 21,060 spectral data were generated accordingly, each containing 164 wavelength points.

本发明进行数据的预处理。为了减轻数据中噪声的影响,采用了多元散射矫正和归一化的预处理方法。由于血液的散射效应会导致不同波长的光程长度不一致,从而影响脉动血液光程变化量。因此,通过引入多元散射校正方法,可以有效地分离散射信息与化学光吸收信息。此外,该方法进一步消除了由物理散射引起的数据差异,进行MSC预处理后,可以获得更高质量的原始反射数据。随后,使用Lambert-Beer定律处理这些数据,可以得到经过初步预处理后的吸光度数据。The present invention performs data preprocessing. In order to reduce the influence of noise in the data, a preprocessing method of multivariate scattering correction and normalization is adopted. The scattering effect of blood will cause the optical path lengths of different wavelengths to be inconsistent, thereby affecting the change in the optical path of pulsating blood. Therefore, by introducing the multivariate scattering correction method, the scattering information and the chemical light absorption information can be effectively separated. In addition, the method further eliminates the data differences caused by physical scattering, and after MSC preprocessing, higher quality original reflection data can be obtained. Subsequently, the Lambert-Beer law is used to process these data to obtain absorbance data after preliminary preprocessing.

通过多元散射校正方法,分离散射信息与化学光吸收信息,消除了由物理散射引起的数据差异,进获得原始反射数据;使用Lambert-Beer定律处理数据,得到经过初步预处理后的吸光度数据;The scattering information and chemical light absorption information are separated by the multivariate scattering correction method, the data difference caused by physical scattering is eliminated, and the original reflection data is obtained; the data is processed using the Lambert-Beer law to obtain the absorbance data after preliminary preprocessing;

假定原始光谱信号值为为浓度总数,为选定浓度下样本总数,为波长总数。对原始光谱信号值进行多元散射校正,处理公式如下:Assume that the original spectral signal value is , , , , is the total concentration, is the total number of samples at the selected concentration, is the total number of wavelengths. The original spectral signal value is corrected for multivariate scattering, and the processing formula is as follows:

其中是经过多元散射处理后的光谱数据,是多元散射校正函数。in is the spectral data after multivariate scattering processing, is the multivariate scatter correction function.

使用Lamber_Beer定律求吸光度,该定理提供了一种直接测量样品中分析物浓度的方法,通过测量穿过样品的光的吸光度,可以简便地计算出分析物的浓度。其公式如下:The Lamber_Beer law is used to calculate the absorbance. This theorem provides a method to directly measure the concentration of the analyte in the sample. By measuring the absorbance of the light passing through the sample, the concentration of the analyte can be easily calculated. The formula is as follows:

其中,LB是 Lambert-Beer 定律的简写。它通常形式为,其中是吸光度,是摩尔吸光系数,是浓度,是光的路径长度。Here, LB is the abbreviation of Lambert-Beer law. It is usually expressed as ,in is the absorbance, is the molar absorptivity, is the concentration, is the path length of light.

对吸光度进行归一化处理:Normalize the absorbance:

对于2名志愿者的光谱数据,925nm~1000nm区间内的155个波长数据噪声较大,参考动态光谱数据质量评价截取1000nm~1700nm 区间的数据进行分析。在对上述原始反射数据多元散射矫正后,使用Lambert-Beer 定律求吸光度并绘制相应光谱图如图4所示。由图4可知,对于每名志愿者的27个浓度2430条数据,在使用多元散射校正后,数据更集中且数据质量有明显提升。For the spectral data of the two volunteers, the 155 wavelength data in the range of 925nm~1000nm have large noise. The data in the range of 1000nm~1700nm are intercepted for analysis with reference to the dynamic spectral data quality evaluation. After multivariate scattering correction of the above raw reflection data, the absorbance is calculated using the Lambert-Beer law and the corresponding spectrum is plotted as shown in Figure 4. As can be seen from Figure 4, for each volunteer's 27 concentrations and 2430 data, after using multivariate scattering correction, the data is more concentrated and the data quality is significantly improved.

本发明对2名志愿者的预处理数据进行了训练集、验证集和测试集的划分。从所有浓度中随机选择5个浓度即450个样本作为测试集,为验证回归算法的广泛性,这些浓度所对应的光谱数据值不参与模型的训练生成。再从剩下的22个浓度中随机选择20%的数据作为验证集,剩下80%的数据作为训练集。The present invention divides the preprocessed data of two volunteers into a training set, a validation set and a test set. Five concentrations, i.e., 450 samples, are randomly selected from all concentrations as a test set. To verify the universality of the regression algorithm, the spectral data values corresponding to these concentrations do not participate in the training generation of the model. Then, 20% of the data are randomly selected from the remaining 22 concentrations as a validation set, and the remaining 80% of the data are used as a training set.

本发明进行无创血糖浓度回归预测算法框架的搭建,具体为融合深度三胞胎残差网络及SVR的回归预测算法框架。通过“三胞胎残差网络预学习”及“支持向量回归机”构建深度三胞胎残差支持向量回归机(Triplet Residual SVR Network,DTRSVR)模型。算法构建流程如图1所示。首先,根据阈值间隙划分三元组。随后,使用三胞胎残差神经网络进行数据的特征提取,并根据随机梯度下降()更新权重反复训练,直至损失值足够小或已达到最大训练批次结束训练,输出血糖光谱数据的特征。最后,将输出的特征数据转入支持向量回归机中,进行回归算法的训练和测试。The present invention constructs a non-invasive blood glucose concentration regression prediction algorithm framework, specifically a regression prediction algorithm framework integrating a deep triplet residual network and SVR. A deep triplet residual support vector regression machine (Triplet Residual SVR Network, DTRSVR) model is constructed through "triplet residual network pre-learning" and "support vector regression machine". The algorithm construction process is shown in Figure 1. First, the triplets are divided according to the threshold gap. Subsequently, the triplet residual neural network is used to extract the features of the data, and the random gradient descent ( ) Update the weights and train repeatedly until the loss value is small enough or the maximum training batch is reached, and the training is terminated, and the features of the blood glucose spectrum data are output. Finally, the output feature data is transferred to the support vector regression machine for training and testing of the regression algorithm.

本发明构建三元组数据模块。三胞胎神经网络的训练需要输入锚点、正样本和负样本,即三元组数据。三元组的构造对于训练效果至关重要。在处理分类任务时,正样本的定义很明确,即属于同一类的样本。然而,对于回归任务,需要采用新的策略,因为数据是在连续空间中操作,回归任务中标签数据具有无限数量的可能值。对于回归来说,设置绝对、离散的区间并不奏效。The present invention constructs a triplet data module. The training of the triplet neural network requires the input of anchor points, positive samples and negative samples, i.e., triplet data. The construction of the triplet is crucial to the training effect. When dealing with classification tasks, the definition of positive samples is clear, i.e., samples belonging to the same class. However, for regression tasks, new strategies need to be adopted because the data is operated in a continuous space and the label data in the regression task has an infinite number of possible values. For regression, setting absolute, discrete intervals does not work.

在三胞胎神经网络的训练过程中,需要三条相对应的样本数据作为输入,构造合适的样本集合有助于网络学习到有效的特征。因此,本节提出了一种更有效的方法来定义回归中的正样本和负样本,描述了在没有明确正负样本信息的情况下确定正负样本的机制。具体来说,在划分样本时不使用固定分组,而是依据锚点信息固定阈值间隔,定义锚点标签值为为两个数值不同的阈值,正样本对应标签所属范围为,负样本对应标签所属范围为之间的距离形成一个“间隙”,以指导网络学习更具区分性的样本。图2显示了正负样本定义示意图。In the training process of the triplet neural network, three corresponding sample data are required as input. Constructing a suitable sample set helps the network learn effective features. Therefore, this section proposes a more effective method to define positive and negative samples in regression, and describes the mechanism of determining positive and negative samples without clear positive and negative sample information. Specifically, when dividing samples, fixed grouping is not used, but the threshold interval is fixed according to the anchor point information, and the anchor point label value is defined as , and are two thresholds with different values, and the positive samples correspond to labels The scope is , the negative sample corresponds to the label The scope is . and The distance between them forms a “gap” to guide the network to learn more discriminative samples. Figure 2 shows a schematic diagram of the definition of positive and negative samples.

将构建的三元组记为,其中是原始锚点特征数据;是原始正例特征数据;是原始负例特征数据。The constructed triple is recorded as ,in , is the original anchor feature data; , is the original positive feature data; , is the original negative feature data.

对于给定的数据集,其中是原始锚点特征数据,是对应标签数据,其余两个同理。原始特征通过三胞胎残差神经网络映射至高维特征空间中,得到深度特征。进一步通过“深度三胞胎残差神经网络预训练”更新网络参数得到具有三胞胎特征性质的深度特征。最后,在三胞胎残差神经网络后增加一层全连接层,模型基于损失函数计算训练数据的损失值,并反向传播梯度更新网络参数,以完成特征提取过程。For a given data set and ,in , is the original anchor feature data, is the corresponding label data, and the other two are similar. Through triplet residual neural network Mapping to high-dimensional feature space , we get the deep features . Further update the network parameters through "deep triplet residual neural network pre-training" Get deep features with triplet characteristics Finally, add a fully connected layer after the triplet residual neural network ,Model The loss value of the training data is calculated based on the loss function, and the gradient is back-propagated to update the network parameters to complete the feature extraction process.

进行无创血糖浓度特征提取模型的构建。三胞胎神经网络(TNN)受孪生网络的启发所诞生,在孪生网络中,输入是两组数据构成的数据对,在三胞胎神经网络中输入是三组数据构成的三元组,即锚点(Anchor,)、正例(Positive,)和负例(Negative,)。其中,正例与锚点属于相近的类别,而负例与锚点属于不同的类别。将三元组输入具有三胞胎结构的残差神经网络ResNet-18中(见图4)。The non-invasive blood glucose concentration feature extraction model was constructed. The triplet neural network (TNN) was inspired by the twin network. In the twin network, the input is a data pair consisting of two sets of data, while in the triplet neural network, the input is a triple consisting of three sets of data. , that is, the anchor point (Anchor, ), Positive ) and negative examples (Negative, ). Among them, the positive example belongs to a similar category to the anchor point, while the negative example belongs to a different category from the anchor point. The triplet is input into the residual neural network ResNet-18 with a triplet structure (see Figure 4).

三元组数据经过阈值间隙的划分后输入至共享网络Net(x)进行特征提取得到。通过损失函数计算变量梯度,更新网络权重,增强数据特征在高维空间中的表征。三胞胎神经网络的训练目标是使锚点与正例间的高维度表征距离尽可能小,同时使锚点与负例间的高维度表征距离尽可能大。The triplet data is divided by the threshold gap and then input into the shared network Net(x) for feature extraction. , and . The variable gradient is calculated through the loss function, the network weight is updated, and the representation of data features in high-dimensional space is enhanced. The training goal of the triplet neural network is to make the high-dimensional representation distance between the anchor point and the positive example As small as possible, while making the high-dimensional representation distance between the anchor point and the negative example As big as possible.

在三胞胎残差神经网络的训练学习中,损失函数的设计直接关系到模型稳定性及其性能,它对网络学习的效果有着决定性的作用。In the training and learning of triplet residual neural networks, the design of the loss function is directly related to the model stability and its performance, and it plays a decisive role in the effect of network learning.

TC Loss函数TC Loss Function

对比损失函数(Contrastive Loss)适用于处理相似性度量问题,其目标是鼓励相同样本之间的距离尽量小,不同样本之间的距离尽量大。具体公式如下:The contrast loss function is suitable for dealing with similarity measurement problems. Its goal is to encourage the distance between the same samples to be as small as possible and the distance between different samples to be as large as possible. The specific formula is as follows:

其中,代表两个样本特征的欧氏距离,用于判断两个样本是否匹配,意味着两个样本相似或匹配;意味着两个样本不相似或不匹配;是一个预先设定的阈值,通常表示相似度的界限。in, Represents the Euclidean distance between two sample features, Used to determine whether two samples match. It means that the two samples are similar or matched; It means that the two samples are not similar or match; It is a pre-set threshold, usually indicating the boundary of similarity.

在原始三元组损失函数中,仅使用了锚点特征数据、正例特征数据和负例特征数据,并未使用标签信息,因此,存在有效信息浪费问题。针对该问题,结合三元组损失函数和对比损失函数提出三元对比损失(TC Loss)。In the original triplet loss function, only the anchor feature data, positive feature data and negative feature data are used, and the label information is not used. Therefore, there is a problem of effective information waste. To address this problem, a triplet contrast loss (TC Loss) is proposed by combining the triplet loss function and the contrast loss function.

在TC Loss函数中,锚点和正例的距离越近,值越小,数据间角度越小,越大,则第一部分越小;锚点和负例的距离越远,越大,数据间角度越大,越小,则第二部分越小;我们希望模型计算出的第一个距离小于第二个距离,且要小到一定程度,公式中的第三部分偏置值则控制模型要小多少时,loss才能为零或者小于零。此外,根据三元组划分机制,锚点和正例的距离小于锚点和负例的距离,第二部分权重系数最大,其对损失函数整体影响最大,而模型训练的直接目标是最小化损失函数来调整模型参数,从而达到优化特征嵌入的效果。在第二部分在大于第一部分的前提下,第二部分越小,越利于模型的训练,同时在TC Loss函数中第三部分使用自适应函数以加速模型训练的收敛速度。In the TC Loss function, the closer the distance between the anchor point and the positive example, The smaller the value, the smaller the angle between the data. The larger the first part The smaller it is, the farther the distance between the anchor point and the negative example is. The larger it is, the larger the angle between the data. The smaller the second part The smaller it is; we hope that the first distance calculated by the model is smaller than the second distance, and to a certain extent, the third part of the formula The bias value controls how small the model must be for the loss to be zero or less than zero. In addition, according to the triple partitioning mechanism, the distance between the anchor point and the positive example is smaller than the distance between the anchor point and the negative example. The weight coefficient of the second part is the largest, and it has the greatest overall impact on the loss function. The direct goal of model training is to minimize the loss function to adjust the model parameters, thereby achieving the effect of optimizing feature embedding. On the premise that the second part is larger than the first part, the smaller the second part is, the more conducive it is to model training. At the same time, the third part of the TC Loss function uses an adaptive function to accelerate the convergence speed of model training.

TC Loss函数在训练时促使模型学习到区分锚点与负例的能力,通过调整距离和角度的相似性,使得锚点与正例更加紧密,锚点与负例间的距离更大,将TC Loss与三胞胎残差神经网络结构结合,可将特征提取部分写作如下优化问题:The TC Loss function enables the model to learn the ability to distinguish anchor points from negative examples during training. By adjusting the similarity of distance and angle, the anchor points are closer to the positive examples and the distance between the anchor points and the negative examples is larger. Combining TC Loss with the triplet residual neural network structure, the feature extraction part can be written as the following optimization problem:

进行无创血糖浓度回归预测模型的构建。将SVR用于回归可得到:The non-invasive blood glucose concentration regression prediction model was constructed. Using SVR for regression, we can get:

为处理非线性问题引入松弛变量将上式改写为:Introducing slack variables to handle nonlinear problems and Rewrite the above formula as:

为对该优化问题进行求解,使用拉格朗日乘子法将其转化其对偶问题。具体来说,通过引入拉格朗日乘子,得到该式的拉格朗日函数:To solve the optimization problem, the Lagrange multiplier method is used to transform it into its dual problem. Specifically, by introducing the Lagrange multiplier , and we get the Lagrangian function of this formula:

的偏导数为零,即可得到SVR的对偶问题:make right and The partial derivative of is zero, and we can get the dual problem of SVR:

选择非线性核函数,该优化问题有解如下:Selecting a nonlinear kernel function, the optimization problem has the following solution:

其中是核函数,是样本映射到特征空间中的内积。通过监督学习,计算梯度并反向转播,优化神经网络。in is the kernel function, It is a sample Mapped to the inner product in the feature space. Through supervised learning, the gradient is calculated and back-propagated to optimize the neural network.

本发明使用三胞胎残差神经网络进行特征提取,在该阶段使用随机梯度下降法()计算三元对比损失函数(TC Loss)关于网络变量的梯度来优化网络,使网络输出的锚点与正例特征数据相近,锚点与负例特征数据相远。根据TC Loss损失函数:The present invention uses a triplet residual neural network for feature extraction, and uses a stochastic gradient descent method ( ) Calculate the gradient of the ternary contrast loss function (TC Loss) with respect to the network variables to optimize the network so that the anchor point output by the network is close to the positive feature data and the anchor point is far from the negative feature data. According to the TC Loss loss function:

,则梯度like , then the gradient .

,则梯度为:like , then the gradient is:

由于包含包含,因此分别对求偏导,更新梯度:because Include and , Include and , so respectively , and Find partial derivatives and update gradients:

综上所述,可构成深度三胞胎残差网络特征提取模型的参数训练算法(记为TRSGD算法),详细伪代码见图3。In summary, a parameter training algorithm for the deep triplet residual network feature extraction model (denoted as TRSGD algorithm) can be constructed. The detailed pseudo code is shown in Figure 3.

本发明探讨深度三胞胎残差网络TRSGD算法的收敛性。令表示第第迭代的参数,,则表示第第迭代的损失值,表示第第迭代的学习率。关于训练算法收敛性证明可根据如下定理展开。This paper discusses the convergence of the deep triplet residual network TRSGD algorithm. Indicates The parameters of the iteration, ,but Indicates The loss value of the iteration, Indicates The learning rate of the iteration. The proof of the convergence of the training algorithm can be expanded according to the following theorem.

若TRSGD算法的学习率,则当最大迭代次数时,深度三胞胎残差网络的损失值收敛至最优解If the learning rate of the TRSGD algorithm , then when the maximum number of iterations When , the loss value of the deep triplet residual network Converge to the optimal solution .

证明:考虑网络结构的优化问题,显然,存在常数,使得Proof: Consider the optimization problem of network structure Obviously, there is a constant and , so that

其中关于的梯度值。最优化问题的遗憾是:in for about The gradient value of . Optimization problem The regret is:

表示优化问题的交叉熵损失函数取理论最小值时对应的参数。由于交叉熵损失函数是凸函数,于是: The parameters corresponding to the cross entropy loss function of the optimization problem when it takes the theoretical minimum value. Since the cross entropy loss function is a convex function, then:

可得:We can get:

由于通过算法更新且,则根据定理可知:because pass Algorithm updates and , then according to the theorem:

,而。当时,。因此,存在最优解but ,and .when hour, .therefore, There is an optimal solution .

本发明为验证基于TC Loss函数的DTRSVR模型有效性,在2位志愿者的血糖光谱数据集上进行模型预测结果分析,其中主要使用作为评价指标。随后,将该模型与SVR、DBN-SVR和基于T Loss函数的DTRSVR进行了比较实验。并探究输出维度和超参数对DTRSVR回归预测结果的影响,证实了三胞胎神经网络的预训练有助于算法的监督调整。In order to verify the effectiveness of the DTRSVR model based on the TC Loss function, the model prediction results were analyzed on the blood glucose spectrum dataset of two volunteers, mainly using and As an evaluation indicator. Subsequently, the model was compared with SVR, DBN-SVR and DTRSVR based on T Loss function. And the output dimension and hyperparameters were explored. The impact on the DTRSVR regression prediction results confirms that pre-training of the triplet neural network helps the supervised adjustment of the algorithm.

针对模型的训练过程。三胞胎残差网络包括两层迭代关系,第一层外迭代30次,当外迭代发生更新时,算法会重新选取锚点构造三元组。第二层内迭代(epochs)嵌入于外迭代中,一次外迭代包含10次内迭代(epochs=10),通过多次的实验比较分析,每epochs选择128个三元组进行训练,并由此决定训练的批次数(batch)使得所有训练数据都有参与模型训练的可能性。因此,划分了30次三元组,共训练300次模型,以确保网络在尽可能多的样本上训练以达到收敛目标。经过多次反复实验并依次对比实验结果,确定适当锚点标签实现实验结果最优化。The training process of the model. The triplet residual network includes two layers of iterative relationships. The first layer has 30 outer iterations. When the outer iteration is updated, the algorithm will reselect the anchor point to construct the triple. The second layer of inner iteration (epochs) is embedded in the outer iteration. One outer iteration contains 10 inner iterations (epochs=10). Through multiple experimental comparisons and analyses, 128 triplets are selected for training per epoch, and the number of training batches is determined so that all training data has the possibility of participating in model training. Therefore, 30 triplets were divided and the model was trained 300 times in total to ensure that the network is trained on as many samples as possible to achieve the convergence goal. After repeated experiments and comparing the experimental results in turn, the appropriate anchor point labels were determined to optimize the experimental results.

对DTRSVR算法而言,输出特征矩阵的维数对预测结果有显著影响,因此确定最佳输出维度非常有必要。本文使用控制变量法,将输出维度分别设定为16、32、64、128、256、和512这六类进行研究,这种设定即包含低维空间的映射也包含向更高维度的映射,考虑较为全面。并且,使用余弦边际损失函数及三元组损失函数进行对比分析。For the DTRSVR algorithm, the dimension of the output feature matrix has a significant impact on the prediction results, so it is very necessary to determine the optimal output dimension. This paper uses the control variable method to set the output dimensions to 16, 32, 64, 128, 256, and 512 for research. This setting includes both the mapping of low-dimensional space and the mapping to higher dimensions, which is more comprehensive. In addition, the cosine marginal loss function and the triplet loss function are used for comparative analysis.

针对选取的第一位志愿者,实验结果如表1所示,对于TC Loss函数而言,当输出维度为16和512时模型效果较佳,但是当输出维度为512时,模型训练时长显著增加,因此初步确定输出维度为16。综合分析三个损失函数在输出维度为16时的值和每次迭代耗费的平均时长(),可知TC Loss回归预测效果最佳。For the first volunteer selected, the experimental results are shown in Table 1. For the TC Loss function, the model effect is better when the output dimension is 16 and 512, but when the output dimension is 512, the model training time increases significantly, so the output dimension is initially determined to be 16. Comprehensive analysis of the three loss functions when the output dimension is 16 , , Value and the average time spent on each iteration ( ), it can be seen that TC Loss regression prediction has the best effect.

表1 不同损失函数下DTRSVR预测结果(第一志愿者)Table 1 DTRSVR prediction results under different loss functions (first volunteer)

针对选取的第二位志愿者,实验结果如表2所示,对于T Loss函数而言当输出维度为16和32时模型效果较佳;对于TC Loss函数而言当输出维度为16和64时模型效果较佳。且模型训练时间随输出维度的增加而增加,因此初步确定输出维度为16。综合分析三个损失函数在输出维度为16时的值和每次迭代耗费的平均时长(),可知TC Loss回归预测效果最佳。For the second volunteer, the experimental results are shown in Table 2. For the T Loss function, the model effect is better when the output dimension is 16 and 32; for the TC Loss function, the model effect is better when the output dimension is 16 and 64. The model training time increases with the increase of the output dimension, so the output dimension is initially determined to be 16. Comprehensive analysis of the three loss functions when the output dimension is 16 , , Value and the average time spent on each iteration ( ), it can be seen that TC Loss regression prediction has the best effect.

表2 不同损失函数下DTRSVR预测结果(第二志愿者)Table 2 DTRSVR prediction results under different loss functions (second volunteer)

为了较为直观地展示回归预测结果,对表1中结果数据进行可视化处理,绘制TLoss和TC Loss函数在不同维度下的值的直方图,以及基于T Loss和TCLoss函数的模型在300次训练过程中训练损失与验证损失趋势变化图。In order to more intuitively display the regression prediction results, the result data in Table 1 are visualized and the TLoss and TC Loss functions in different dimensions are plotted. , , The histogram of the values, as well as the trend change graph of training loss and validation loss of the model based on T Loss and TCLoss functions during 300 training cycles.

分析可知,当输出维度为16、32、64、256和512时,TC Loss函数的明显大于TLoss函数的。分析可知,当输出维度为16、32、128、256和512时,TC Loss函数的明显小于T Loss函数的值。Analysis shows that when the output dimensions are 16, 32, 64, 256, and 512, the TC Loss function Obviously larger than the TLoss function . Analysis shows that when the output dimensions are 16, 32, 128, 256, and 512, the TC Loss function and Obviously smaller than the T Loss function and value.

分析图5可知,随着训练次数的增加,基于T Loss函数的模型训练损失值快速收敛,但验证损失值在0.5至2.0范围内不断波动,几乎无收敛趋势。基于TC Loss函数的模型训练损失值从0.35快速降至0.05,训练损失值与验证损失值保持一致的变化趋势,且收敛迅速,可见模型训练效果较好。From the analysis of Figure 5, we can see that with the increase in the number of training times, the training loss value of the model based on the T Loss function converges quickly, but the verification loss value fluctuates continuously in the range of 0.5 to 2.0, with almost no convergence trend. The training loss value of the model based on the TC Loss function drops rapidly from 0.35 to 0.05, and the training loss value and the verification loss value maintain the same trend of change, and converge quickly, which shows that the model training effect is good.

进一步探讨在TC Loss函数中,间隔超参数取值对DTRSVR预测结果的影响。选择合适的值是一个需要精细调节的过程,用于调整正例与负例之间的“安全区域”,较大的促使模型拉大正负例之间的距离,有助于改善模型的区分能力。但是过大的值会使得TC Loss对小的特征变化过于敏感,从而影响模型的稳定性和收敛速度。因此,适当的值需要既能拉开正l例和负例之间的距离,亦能在一定程度上提供了更平滑的梯度,有助于模型更稳定地学习。本节选定的实验范围是(0.7,7)来找寻最佳值。在对取值进行多种尝试后,本节给出7类代表设置=0.7、0.8、0.9、1.0、1.1和1.2的详细分析。Further exploration of the interval hyperparameter in the TC Loss function The impact of the value on the DTRSVR prediction results. Choose the appropriate The value is a process that requires fine-tuning. Used to adjust the "safety zone" between positive and negative examples, the larger Encouraging the model to increase the distance between positive and negative examples helps improve the model’s ability to distinguish. The value will make TC Loss too sensitive to small feature changes, thus affecting the stability and convergence speed of the model. The value needs to be able to both increase the distance between positive and negative examples and provide a smoother gradient to a certain extent, which helps the model learn more stably. The experimental range selected in this section is (0.7, 7) to find the best Value. After trying many different values, this section provides 7 representative settings. Detailed analysis of =0.7, 0.8, 0.9, 1.0, 1.1 and 1.2.

针对选取的第一位志愿者,实验结果如表3所示,对比=1,当=0.8时决定系数提升了25.00%,已经达到0.8311。并且在=1.1时,预测结果的决定系数显著降低,在=1.2时,预测结果的决定系数有所提高,但仍明显低于0.8311。For the first volunteer selected, the experimental results are shown in Table 3. =1, when =0.8, the coefficient of determination increased by 25.00%, reaching 0.8311. =1.1, the determination coefficient of the prediction results is significantly reduced. =1.2, the determination coefficient of the prediction results increased, but was still significantly lower than 0.8311.

表3不同阈值下DTRSVR实验结果(第一志愿者)Table 3 DTRSVR experimental results under different thresholds (first volunteer)

针对选取的第二位志愿者,实验结果如表4所示,对比于=1,当=0.8时决定系数提升了15.80%,已经达到0.8053。For the second volunteer selected, the experimental results are shown in Table 4. =1, when =0.8, the determination coefficient increased by 15.80% and reached 0.8053.

表4不同阈值下DTRSVR实验结果(第二志愿者)Table 4 DTRSVR experimental results under different thresholds (second volunteer)

针对选取的第一位志愿者,回归结果分析如表5所示。对比于其他模型,本文提出的TC Loss (=0.8)约束下DTRSVR模型的值较大,但其值与值显著优于其他模型,相比于只使用SVR进行回归预测的结果,其均方误差降低了0.5390,决定系数提升了0.4996,有极大的性能提升。进一步分析相同网络结构设置下,不同损失函数表现情况,可见TC Loss约束下的DTRSVR模型决定系数显著高于T Loss约束下DTRSVR模型。For the first selected volunteer, the regression results are shown in Table 5. Compared with other models, the TC Loss ( =0.8) constraint The value is large, but its Value and The value is significantly better than other models. Compared with the results of regression prediction using only SVR, its mean square error is reduced by 0.5390 and the determination coefficient is increased by 0.4996, which is a great performance improvement. Further analysis of the performance of different loss functions under the same network structure setting shows that the determination coefficient of the DTRSVR model under TC Loss constraint is significantly higher than that of the DTRSVR model under T Loss constraint.

表5 不同模型回归结果分析表(第一志愿者)Table 5 Regression results analysis of different models (first volunteer)

为直观分析结果,给出表5中四组模型计算结果的克拉克网格分析图(见图5),其中DBN-SVR模型和基于T Loss损失DTRSVR模型有近一半的结果点落入B区,基于TC Loss损失DTRSVR模型的结果点几乎都落入A区。同时,基于TC Loss损失DTRSVR模型的结果点有明显间隔,说明不同浓度的血糖光谱数据被良好划分开,并且所有结果点都与直线相交说明其预测效果较好。In order to analyze the results intuitively, the Clarke grid analysis diagram of the calculation results of the four groups of models in Table 5 is given (see Figure 5). Among them, nearly half of the result points of the DBN-SVR model and the DTRSVR model based on T Loss fall into area B, and the result points of the DTRSVR model based on TC Loss almost all fall into area A. At the same time, the result points of the DTRSVR model based on TC Loss have obvious intervals, indicating that the blood glucose spectrum data of different concentrations are well divided, and all the result points are consistent with the straight line. The intersection shows that its prediction effect is better.

针对选取的第二位志愿者,回归结果分析如表6所示。对比于其他模型,本文提出的TC Loss (=0.8) 约束下DTRSVR模型的值和值均小于其他模型,并且在做到误差较小的同时模型的值也显著高于其他模型。相比于只使用SVR进行回归预测的结果,TC Loss (=0.8)约束下DTRSVR模型的均方误差降低了0.5392,决定系数提升了0.5598,有极大的性能提升。For the second selected volunteer, the regression results are shown in Table 6. Compared with other models, the TC Loss ( =0.8) constraint of DTRSVR model Value and The values are smaller than those of other models, and the model has the same The value is also significantly higher than other models. Compared with the results of regression prediction using only SVR, TC Loss ( =0.8), the mean square error of the DTRSVR model is reduced by 0.5392, and the determination coefficient is increased by 0.5598, which greatly improves the performance.

表6 不同模型回归结果分析表(第二志愿者)Table 6 Analysis of regression results of different models (second volunteer)

为直观分析结果,给出表6中四组模型计算结果的克拉克网格分析图(见图6)。DBN-SVR模型有部分结果点落入B区。T Loss约束下DTRSVR模型的结果点虽然几乎都落入A区,但是在直线周分布不均。相比之下,TC Loss约束下DTRSVR模型的结果点不仅100%落入A区,同时紧密分布在直线边并皆与其相交。To analyze the results intuitively, the Clarke grid analysis diagram of the calculation results of the four groups of models in Table 6 is given (see Figure 6). Some of the result points of the DBN-SVR model fall into area B. Although the result points of the DTRSVR model under the T Loss constraint almost all fall into area A, In contrast, the result points of the DTRSVR model under the TC Loss constraint not only fall 100% into area A, but are also closely distributed on the straight line. All edges intersect with it.

综上所述,实验结果强有力地支持TC Loss约束下DTRSVR模型作为一种有效的回归预测模型,其性能显著优于SVR、DBN-SVR、T Loss约束下DTRSVR。In summary, the experimental results strongly support that the DTRSVR model under TC Loss constraint is an effective regression prediction model, and its performance is significantly better than SVR, DBN-SVR, and DTRSVR under T Loss constraint.

本发明提出基于TC Loss损失的DTRSVR模型,通过对2位志愿的无创血糖光谱数据进行实验,发现TC Loss约束下DTRSVR模型在支持向量机回归预测任务中表现出最高的决定系数。与传统SVR相比,DTRSVR模型的特征映射能力得到显著提升。研究结果表示,三胞胎残差神经网络对支持向量回归机的预测性能影响显著,同时,通过引入标签信息和自适应阈值,所构建的TC Loss函数不仅显著提高深度三胞胎残差网络的训练及收敛速度,还通过监督学习提高数据的表征能力。The present invention proposes a DTRSVR model based on TC Loss loss. Through experiments on non-invasive blood glucose spectrum data of 2 volunteers, it is found that the DTRSVR model under TC Loss constraint shows the highest determination coefficient in the support vector machine regression prediction task. Compared with the traditional SVR, the feature mapping ability of the DTRSVR model is significantly improved. The research results show that the triplet residual neural network has a significant impact on the prediction performance of the support vector regression machine. At the same time, by introducing label information and adaptive thresholds, the constructed TC Loss function not only significantly improves the training and convergence speed of the deep triplet residual network, but also improves the data representation ability through supervised learning.

对比于T Loss约束下DTRSVR,基于TC Loss损失的DTRSVR模型在相同网络结构的基础上改进了损失函数。首先,将锚点与正例之间距离由欧式距离的平方改成标签差值与余弦值的乘积,不仅考虑特征之间的空间距离还提供了角度信息,其中余弦值能较好地捕捉特征之间的方向相似性,以更全面地反映特征之间的关系。其次,在锚点与负例间距离也引入余弦值来增强模型区分不同样本的能力。最后,将阈值从固定值改成关于锚点与负例的自适应函数,该自适应函数用以调整锚点与正负例间距离的差距,能够根据不同特征相似性动态调整,更好地适应样本间的差异,并处理数据不均衡问题,进而提高模型的区分能力,加快模型训练收敛速度。实验证明,TC Loss约束下DTRSVR模型相较于T Loss损失取得了明显的精度提升,且运行速度得到显著提高。详细分析,TC Loss约束下DTRSVR模型相较于T Loss损失决定系数平均提高0.1575即提高23.83%。Compared with DTRSVR under T Loss constraint, the DTRSVR model based on TC Loss loss improves the loss function on the basis of the same network structure. First, the distance between the anchor point and the positive example is changed from the square of the Euclidean distance to the product of the label difference and the cosine value, which not only considers the spatial distance between the features but also provides angle information. The cosine value can better capture the directional similarity between the features to more comprehensively reflect the relationship between the features. Secondly, the cosine value is also introduced in the distance between the anchor point and the negative example to enhance the model's ability to distinguish different samples. Finally, the threshold is changed from a fixed value to an adaptive function about the anchor point and the negative example. The adaptive function is used to adjust the distance between the anchor point and the positive and negative examples. It can be dynamically adjusted according to the similarity of different features, better adapt to the differences between samples, and deal with data imbalance problems, thereby improving the model's ability to distinguish and accelerating the convergence of model training. Experiments show that the DTRSVR model under TC Loss constraint has achieved significant accuracy improvement compared with T Loss loss, and the running speed has been significantly improved. A detailed analysis shows that the loss determination coefficient of the DTRSVR model under TC Loss constraint is increased by an average of 0.1575, or 23.83%, compared with that of T Loss.

总体而言,本发明的实验结果强调了TC Loss约束下DTRSVR在支持向量机回归预测任务的卓越性能,尤其是对三胞胎神经网络预训练的引入及其损失函数的改进,为深度学习与支持向量机的结合提供了有力的实证支持。这些发现不仅对相关领域的学术研究具有重要意义,也为实际应用中的模型选择和性能优化提供了有益的指导。In general, the experimental results of this paper highlight the excellent performance of DTRSVR in support vector machine regression prediction tasks under TC Loss constraints, especially the introduction of triplet neural network pre-training and the improvement of its loss function, which provides strong empirical support for the combination of deep learning and support vector machines. These findings are not only of great significance to academic research in related fields, but also provide useful guidance for model selection and performance optimization in practical applications.

以上所述仅是一种无创血糖浓度预测方法的优选实施方式,一种无创血糖浓度预测方法的保护范围并不仅局限于上述实施例,凡属于该思路下的技术方案均属于本发明的保护范围。应当指出,对于本领域的技术人员来说,在不脱离本发明原理前提下的若干改进和变化,这些改进和变化也应视为本发明的保护范围。The above is only a preferred implementation of a non-invasive blood glucose concentration prediction method. The protection scope of a non-invasive blood glucose concentration prediction method is not limited to the above embodiment. All technical solutions under this idea belong to the protection scope of the present invention. It should be pointed out that for those skilled in the art, several improvements and changes without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.

Claims (9)

1.一种无创血糖浓度预测方法,其特征是:所述方法包括以下步骤:1. A non-invasive blood glucose concentration prediction method, characterized in that: the method comprises the following steps: 步骤1:进行光谱数据采集得到原始光谱数据,对采集到的数据进行预处理;Step 1: Collect spectral data to obtain original spectral data, and pre-process the collected data; 步骤2:对预处理后的数据划分训练集、验证集和测试集,并进行超参数设置;Step 2: Divide the preprocessed data into training set, validation set and test set, and set hyperparameters; 步骤3:搭建无创血糖浓度回归预测模型,进行迭代计算得到最优的无创血糖浓度回归预测模型;Step 3: Build a non-invasive blood glucose concentration regression prediction model, and perform iterative calculations to obtain the optimal non-invasive blood glucose concentration regression prediction model; 所述步骤3具体为:The step 3 is specifically as follows: 步骤3.1:根据阈值间隙划分三元组后,根据随机梯度下降更新权重反复训练,直至损失值足够小或已达到最大训练批次结束训练,输出血糖光谱数据的特征;将输出的特征数据转入支持向量回归机中,进行回归算法的训练和测试;Step 3.1: After dividing the triplets according to the threshold gap, use stochastic gradient descent Update the weights and train repeatedly until the loss value is small enough or the maximum training batch is reached, then the training is terminated and the features of the blood glucose spectrum data are output; the output feature data is transferred to the support vector regression machine to train and test the regression algorithm; 在三胞胎神经网络的训练过程中,需要三条相对应的样本数据作为输入,在划分样本时不使用固定分组,而是依据锚点信息固定阈值间隔,定义锚点标签值为为两个数值不同的阈值,正样本对应标签所属范围为,负样本对应标签所属范围为之间的距离形成一个间隙,以指导网络学习区分性的样本;In the training process of the triplet neural network, three corresponding sample data are required as input. When dividing the samples, fixed grouping is not used, but the threshold interval is fixed according to the anchor information, and the anchor label value is defined as , and are two thresholds with different values, and the positive samples correspond to labels The scope is , the negative sample corresponds to the label The scope is , and The distance between them forms a gap to guide the network to learn discriminative samples; 将构建的三元组记为,其中是原始锚点特征数据;是原始正例特征数据;是原始负例特征数据;The constructed triple is recorded as ,in , is the original anchor feature data; , is the original positive feature data; , is the original negative feature data; 对于给定的数据集,其中分别是相应的锚点、正例和负例标签数据,原始特征通过三胞胎残差神经网络映射至高维特征空间中,得到深度特征For a given data set and ,in , and They are the corresponding anchor points, positive and negative label data, and the original features Through triplet residual neural network Mapping to high-dimensional feature space In the deep feature ; 步骤3.2:通过深度三胞胎残差神经网络预训练更新网络参数得到具有三胞胎特征性质的深度特征,在三胞胎残差神经网络后增加一层全连接层,模型基于损失函数计算训练数据的损失值,并反向传播梯度更新网络参数,以完成特征提取过程;Step 3.2: Update network parameters through deep triplet residual neural network pre-training Get deep features with triplet characteristics , add a fully connected layer after the triplet residual neural network ,Model Calculate the loss value of the training data based on the loss function, and back-propagate the gradient to update the network parameters to complete the feature extraction process; 并根据随机梯度下降更新权重反复训练,直至损失值足够小或已达到最大训练批次结束训练,输出血糖光谱数据的特征;将输出的特征数据转入支持向量回归机中,进行回归算法的训练和测试;And according to stochastic gradient descent Update the weights and train repeatedly until the loss value is small enough or the maximum training batch is reached, then the training is terminated and the features of the blood glucose spectrum data are output; the output feature data is transferred to the support vector regression machine to train and test the regression algorithm; 步骤3.3:构建的三胞胎残差神经网络作为深度三胞胎残差支持向量机的特征提取模块,在孪生网络中,输入是两组数据构成的数据对,在三胞胎神经网络中输入是三组数据构成的三元组,即锚点(Anchor,)、正例(Positive,)和负例(Negative,);将三元组输入具有三胞胎结构的残差神经网络ResNet-18中,三元组数据经过阈值间隙的划分后输入至共享网络Net(x)进行特征提取得到,通过损失函数计算变量梯度,更新网络权重,增强数据特征在高维空间中的表征,三胞胎神经网络的训练目标是使锚点与正例间的高维度表征距离最小化,同时使锚点与负例间的高维度表征距离最大化;Step 3.3: The constructed triplet residual neural network is used as the feature extraction module of the deep triplet residual support vector machine. In the twin network, the input is a data pair consisting of two sets of data, and in the triplet neural network, the input is a triple consisting of three sets of data. , that is, the anchor point (Anchor, ), Positive ) and negative examples (Negative, ); The triplet is input into the residual neural network ResNet-18 with a triplet structure. After the triplet data is divided by the threshold gap, it is input into the shared network Net(x) for feature extraction. , and , the variable gradient is calculated through the loss function, the network weight is updated, and the representation of data features in high-dimensional space is enhanced. The training goal of the triplet neural network is to make the high-dimensional representation distance between the anchor point and the positive example Minimize while making the high-dimensional representation distance between the anchor point and the negative example maximize; 结合三元组损失函数和对比损失函数建立三元对比损失TC Loss,通过来度量锚点、正例和负例间距,并引入含有的自适应超参数增强模型的泛化能力,通过下式表示TC Loss函数:Combine the triplet loss function and the contrast loss function to establish the ternary contrast loss TC Loss, through , and to measure the distance between anchor points, positive examples and negative examples, and introduce The adaptive hyperparameters enhance the generalization ability of the model. The TC Loss function is expressed as follows: 其中,是锚点与正例标签值之差的绝对值,是锚点与负例标签值之差的绝对值,分别是锚点、正例和负例通过共享网络结构处理后得到的特征数据,是锚点与正例特征数据间的余弦值,是锚点与负例特征数据间的余弦值,是边际参数;in, is the absolute value of the difference between the anchor point and the positive example label value, is the absolute value of the difference between the anchor point and the negative example label value, , and They are the feature data obtained after the anchor point, positive example and negative example are processed through the shared network structure. is the cosine value between the anchor point and the positive feature data, is the cosine value between the anchor point and the negative feature data, is the marginal parameter; 将TC Loss函数与三胞胎残差神经网络结构结合,将特征提取部分通过如下优化问题:Combine the TC Loss function with the triplet residual neural network structure, and optimize the feature extraction part through the following problem: ; 步骤3.4:使用三胞胎残差神经网络进行特征提取,使用随机梯度下降法计算三元对比损失函数TC Loss关于网络变量的梯度来优化网络,使网络输出的锚点与正例特征数据相近,锚点与负例特征数据相远,根据TC Loss损失函数:Step 3.4: Use triplet residual neural network for feature extraction using stochastic gradient descent Calculate the gradient of the ternary contrast loss function TC Loss with respect to the network variables to optimize the network so that the anchor point output by the network is close to the positive feature data and the anchor point is far from the negative feature data. According to the TC Loss loss function: ,则梯度when , then the gradient ; ,则梯度为:when , then the gradient is: 由于包含包含,因此分别对求偏导,更新梯度:because Include and , Include and , so respectively , and Find partial derivatives and update gradients: 步骤3.5:令表示第第迭代的参数,,则表示第第迭代的损失值,表示第第迭代的学习率;Step 3.5: Order Indicates The parameters of the iteration, ,but Indicates The loss value of the iteration, Indicates The learning rate for the iteration; 步骤4:根据最优的无创血糖浓度回归预测模型,对血糖浓度进行预测。Step 4: Predict the blood glucose concentration based on the optimal non-invasive blood glucose concentration regression prediction model. 2.根据权利要求1所述的方法,其特征是:所述步骤1具体为:2. The method according to claim 1, characterized in that: the step 1 specifically comprises: 步骤1.1:通过光源、光谱仪、光纤和计算机构建采集系统,通过采集系统进行光谱数据采集得到原始光谱数据;Step 1.1: Construct an acquisition system through a light source, a spectrometer, an optical fiber and a computer, and acquire spectral data through the acquisition system to obtain raw spectral data; 步骤1.2:采用多元散射矫正进行预处理原始光谱数据,当原始光谱信号值为为浓度总数,为选定浓度下样本总数,为波长总数,对原始光谱信号值进行多元散射校正:Step 1.2: Use multivariate scattering correction to preprocess the original spectral data. When the original spectral signal value is , , , , is the total concentration, is the total number of samples at the selected concentration, is the total number of wavelengths, and the original spectral signal value is corrected for multivariate scattering: 其中,是经过多元散射处理后的光谱数据,是多元散射校正函数;in, is the spectral data after multivariate scattering processing, is the multivariate scatter correction function; 步骤1.3:通过Lamber_Beer定律求吸光度,通过测量穿过样品的光的吸光度,计算出分析物的浓度:Step 1.3: Use the Lamber-Beer law to calculate the absorbance of the light passing through the sample and calculate the concentration of the analyte: 其中,为分析物的光谱吸光度,LB是 Lambert-Beer 定律的简写,其中是吸光度,是摩尔吸光系数,是浓度,是光的路径长度;in, is the spectral absorbance of the analyte, and LB is the abbreviation of Lambert-Beer law, where is the absorbance, is the molar absorptivity, is the concentration, is the path length of the light; 对吸光度进行归一化处理:Normalize the absorbance: 其中,为处理后的吸光度数据。in, is the processed absorbance data. 3.根据权利要求2所述的方法,其特征是:所述步骤2数据集划分具体为:3. The method according to claim 2 is characterized in that: the data set division in step 2 is specifically as follows: 根据预处理后得到浓度数据,对预处理后的数据进行了训练集、验证集和测试集的划分,从所有浓度中随机选择样本作为测试集,每个浓度所对应的光谱数据值不参与模型的训练生成,从剩下的浓度中随机选择20%的数据作为验证集,剩下80%的数据作为训练集。According to the concentration data obtained after preprocessing, the preprocessed data were divided into training set, validation set and test set. Samples were randomly selected from all concentrations as the test set. The spectral data values corresponding to each concentration did not participate in the training and generation of the model. 20% of the data were randomly selected from the remaining concentrations as the validation set, and the remaining 80% of the data were used as the training set. 4.根据权利要求3所述的方法,其特征是:所述步骤2超参数设置具体为:4. The method according to claim 3 is characterized in that: the hyperparameter setting in step 2 is specifically: 在训练集、验证集和测试集上划分三元组,从真实血糖浓度值中随机选取一个浓度作为锚点样本对应的标签值,即第次抽取的锚点样本标签值,,在标签值为范围内抽取正样本,在范围内抽取负样本,构成三元组样本,通过数据分布和迭代结果进行阈值调整,经过交叉验证得到在=0.1和=0.5时网络模型训练效果最好:Divide the triplets into the training set, validation set, and test set, and randomly select a concentration from the true blood glucose concentration value as the label value corresponding to the anchor sample , that is, The label value of the anchor sample extracted. , when the label value is Extract positive samples within the range ,exist Extract negative samples within the range , forming a triple sample , the threshold is adjusted through data distribution and iteration results, and the cross-validation results are obtained. = 0.1 and =0.5 when the network model training effect is best: Right now , . 5.根据权利要求1所述的方法,其特征是:5. The method according to claim 1, characterized in that: 当学习率,则当最大迭代次数时,深度三胞胎残差网络的损失值收敛至最优解,得到最优模型。When the learning rate , then when the maximum number of iterations When , the loss value of the deep triplet residual network Converge to the optimal solution , and obtain the optimal model. 6.根据权利要求1所述的方法,其特征是:6. The method according to claim 1, characterized in that: 深度残差神经网络ResNet-18的各残差块依次为,模型最终的输出维度通过全连接层的numclass确定,且,对于损失函数中的参数设置,函数中参数指定为函数中参数初始值指定为The residual blocks of the deep residual neural network ResNet-18 are , , , , the final output dimension of the model is determined by the numclass of the fully connected layer, and , for the parameter settings in the loss function, The function parameters are specified as , The initial values of the parameters in the function are specified as . 7.一种无创血糖浓预测系统,其特征是:所述系统包括:7. A non-invasive blood glucose concentration prediction system, characterized in that: the system comprises: 数据采集模块,所述数据采集模块进行光谱数据采集得到原始光谱数据,对采集到的数据进行预处理;A data acquisition module, wherein the data acquisition module acquires spectral data to obtain raw spectral data and pre-processes the acquired data; 超参数设置模块,所述超参数设置模块对预处理后的数据划分训练集、验证集和测试集,并进行超参数设置;A hyperparameter setting module, wherein the hyperparameter setting module divides the preprocessed data into a training set, a validation set, and a test set, and performs hyperparameter setting; 模型搭建模块,所述模型搭建模块搭建无创血糖浓度回归预测模型,进行迭代计算得到最优的无创血糖浓度回归预测模型;A model building module, wherein the model building module builds a non-invasive blood glucose concentration regression prediction model and performs iterative calculations to obtain an optimal non-invasive blood glucose concentration regression prediction model; 预测模块,所述预测模块根据最优的无创血糖浓度回归预测模型,对血糖浓度进行预测。A prediction module predicts blood glucose concentration based on an optimal non-invasive blood glucose concentration regression prediction model. 8.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行,以用于实现如权利要求1-6任意一项权利要求所述的方法。8. A computer-readable storage medium having a computer program stored thereon, wherein the program is executed by a processor to implement the method according to any one of claims 1 to 6. 9.一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,其特征是:所述处理器执行所述计算机程序时实现权利要求1-6任意一项权利要求所述的方法。9. A computer device, comprising a memory and a processor, wherein the memory stores a computer program, wherein the processor implements the method according to any one of claims 1 to 6 when executing the computer program.
CN202411411714.1A 2024-10-11 2024-10-11 A non-invasive method for predicting blood glucose concentration Active CN118919080B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411411714.1A CN118919080B (en) 2024-10-11 2024-10-11 A non-invasive method for predicting blood glucose concentration

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411411714.1A CN118919080B (en) 2024-10-11 2024-10-11 A non-invasive method for predicting blood glucose concentration

Publications (2)

Publication Number Publication Date
CN118919080A true CN118919080A (en) 2024-11-08
CN118919080B CN118919080B (en) 2025-01-28

Family

ID=93301859

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411411714.1A Active CN118919080B (en) 2024-10-11 2024-10-11 A non-invasive method for predicting blood glucose concentration

Country Status (1)

Country Link
CN (1) CN118919080B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119380993A (en) * 2024-12-27 2025-01-28 长春理工大学 Non-invasive blood glucose concentration prediction system and method based on deep triplet network
CN119969975A (en) * 2025-01-17 2025-05-13 长沙理工大学 Flexible pulse data detection method and system based on three-cellular neural network

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111292853A (en) * 2020-01-15 2020-06-16 长春理工大学 A multi-parameter-based cardiovascular disease risk prediction network model and its construction method
WO2021007812A1 (en) * 2019-07-17 2021-01-21 深圳大学 Deep neural network hyperparameter optimization method, electronic device and storage medium
CN114444506A (en) * 2022-01-11 2022-05-06 四川大学 A Relational Triple Extraction Method Based on Fusion Entity Types
CN114863226A (en) * 2022-04-26 2022-08-05 江西理工大学 Network physical system intrusion detection method
WO2023056614A1 (en) * 2021-10-09 2023-04-13 大连理工大学 Method for predicting rotating stall of axial flow compressor on the basis of stacked long short-term memory network
CN118173264A (en) * 2024-03-12 2024-06-11 长春理工大学 Noninvasive blood glucose concentration prediction method
CN118196566A (en) * 2024-03-29 2024-06-14 重庆赛力斯新能源汽车设计院有限公司 Intelligent driving system classification optimization method, device and medium based on metric learning
CN118314986A (en) * 2024-06-05 2024-07-09 昆明理工大学 A hyperspectral soil nickel concentration prediction method based on improved convolutional neural network
CN118609814A (en) * 2024-06-12 2024-09-06 中北大学 A blood glucose concentration prediction method, prediction system, terminal device, and storage medium based on machine learning

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021007812A1 (en) * 2019-07-17 2021-01-21 深圳大学 Deep neural network hyperparameter optimization method, electronic device and storage medium
CN111292853A (en) * 2020-01-15 2020-06-16 长春理工大学 A multi-parameter-based cardiovascular disease risk prediction network model and its construction method
WO2023056614A1 (en) * 2021-10-09 2023-04-13 大连理工大学 Method for predicting rotating stall of axial flow compressor on the basis of stacked long short-term memory network
CN114444506A (en) * 2022-01-11 2022-05-06 四川大学 A Relational Triple Extraction Method Based on Fusion Entity Types
CN114863226A (en) * 2022-04-26 2022-08-05 江西理工大学 Network physical system intrusion detection method
CN118173264A (en) * 2024-03-12 2024-06-11 长春理工大学 Noninvasive blood glucose concentration prediction method
CN118196566A (en) * 2024-03-29 2024-06-14 重庆赛力斯新能源汽车设计院有限公司 Intelligent driving system classification optimization method, device and medium based on metric learning
CN118314986A (en) * 2024-06-05 2024-07-09 昆明理工大学 A hyperspectral soil nickel concentration prediction method based on improved convolutional neural network
CN118609814A (en) * 2024-06-12 2024-09-06 中北大学 A blood glucose concentration prediction method, prediction system, terminal device, and storage medium based on machine learning

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
王灵珍;赖惠成;王睿;: "基于多任务级联CNN与三元组损失的人脸识别", 激光杂志, no. 05, 25 May 2019 (2019-05-25) *
董元菲;王康;: "基于频域卷积和三元组损失的端到端声纹识别", 电子设计工程, no. 13, 5 July 2020 (2020-07-05) *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119380993A (en) * 2024-12-27 2025-01-28 长春理工大学 Non-invasive blood glucose concentration prediction system and method based on deep triplet network
CN119380993B (en) * 2024-12-27 2025-03-21 长春理工大学 Non-invasive blood glucose concentration prediction system and method based on deep triplet network
CN119969975A (en) * 2025-01-17 2025-05-13 长沙理工大学 Flexible pulse data detection method and system based on three-cellular neural network

Also Published As

Publication number Publication date
CN118919080B (en) 2025-01-28

Similar Documents

Publication Publication Date Title
CN118919080A (en) Noninvasive blood glucose concentration prediction method
US10695005B2 (en) Non-invasive blood sugar measuring method and fingertip measuring probe
Zeynali et al. Non-invasive blood glucose monitoring using PPG signals with various deep learning models and implementation using TinyML
CN119498778B (en) Sleep quality monitoring and evaluating method and system
CN119557840B (en) Feature fusion method based on multi-mode medical data
Li et al. Identifying autism spectrum disorder in resting-state fNIRS signals based on multiscale entropy and a two-branch deep learning network
Ma et al. A prediction method for transport stress in meat sheep based on GA-BPNN
Shan et al. Compact seizure detection based on spiking neural network and support vector machine for efficient neuromorphic implementation
CN115089123A (en) OSA detection method based on attention and Transformer
Mortazavi et al. Deep learning approaches for assessing pediatric sleep apnea severity through SpO2 signals
Burrello et al. Optimization and deployment of deep neural networks for PPG-based blood pressure estimation targeting low-power wearables
Othmane et al. Comparative Study of Machine Learning and Deep Learning Approaches
Almanza-Conejo et al. REGEEG: A regression-based EEG signal processing in emotion recognition
Lian et al. Enhanced human lower-limb motion recognition using flexible sensor array and relative position image
Nogay et al. Detection of hyperglycemia and hypoglycemia using deep learning from facial images obtained with an AI image generator
CN119380993B (en) Non-invasive blood glucose concentration prediction system and method based on deep triplet network
CN120823995A (en) Gynecological facial diagnosis multimodal feature fusion analysis system and method
Kumar et al. Non-invasive blood glucose estimation using a novel white-box model: An interpretable machine learning approach
CN118173264A (en) Noninvasive blood glucose concentration prediction method
Yang et al. FCS-TPNet: Fusion of fNIRS chromophore signals to construct temporal-spatial graph representation for topological networks
TW202531254A (en) Signal quality assessement system and blood glucose level prediction system based on photoplethysmography
Koçak et al. The diagnosis of diabetes mellitus with boosting methods
WO2023031355A1 (en) Health state estimation using machine learning
Cvetkovic et al. BioEdgeNet: A compact deep residual network for stress recognition on edge devices
Nakagawa et al. A comparative study of linear and nonlinear regression models for blood glucose estimation based on near-infrared facial images from 760 to 1650 nm wavelength

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20250804

Address after: 130100 Jilin Province, Changchun City, Jingyue Development Zone, east of Shengtai East Street, west of Dingqi Street, south of Jinju Road, north of Fuzhi Avenue, Jingyue High-tech Industrial Park Digital Technology Incubation Base Construction Project A6 Building 101.NO

Patentee after: Xingtu Optoelectronics Technology (Jilin) Co.,Ltd.

Country or region after: China

Address before: 130022 Changchun City, Jilin province Satellite Road, No. 7089

Patentee before: CHANGCHUN University OF SCIENCE AND TECHNOLOGY

Country or region before: China