WO2023077569A1 - 一种深度学习水果光谱分析模型更新方法 - Google Patents

一种深度学习水果光谱分析模型更新方法 Download PDF

Info

Publication number
WO2023077569A1
WO2023077569A1 PCT/CN2021/132651 CN2021132651W WO2023077569A1 WO 2023077569 A1 WO2023077569 A1 WO 2023077569A1 CN 2021132651 W CN2021132651 W CN 2021132651W WO 2023077569 A1 WO2023077569 A1 WO 2023077569A1
Authority
WO
WIPO (PCT)
Prior art keywords
fruit
model
weight
deep learning
spectral analysis
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.)
Ceased
Application number
PCT/CN2021/132651
Other languages
English (en)
French (fr)
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.)
Zhejiang University
Original Assignee
Zhejiang University
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 Zhejiang University filed Critical Zhejiang University
Publication of WO2023077569A1 publication Critical patent/WO2023077569A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • G—PHYSICS
    • G01—MEASURING; TESTING
    • G01N—INVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00—Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/17—Systems in which incident light is modified in accordance with the properties of the material investigated
    • G01N21/25—Colour; Spectral properties, i.e. comparison of effect of material on the light at two or more different wavelengths or wavelength bands
    • G01N21/27—Colour; Spectral properties, i.e. comparison of effect of material on the light at two or more different wavelengths or wavelength bands using photo-electric detection ; circuits for computing concentration
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00—Computing arrangements based on biological models
    • G06N3/02—Neural networks
    • G06N3/04—Architecture, e.g. interconnection topology
    • G06N3/045—Combinations of networks
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00—Computing arrangements based on biological models
    • G06N3/02—Neural networks
    • G06N3/08—Learning methods

Definitions

  • the invention belongs to the field of spectral analysis and chemometrics, and specifically relates to a method for updating a deep learning fruit spectral analysis model.
  • this research aims to propose a model update method suitable for nonlinear deep learning models, which makes good use of historical batch data and provides good performance when the new batch has a small number of labeled samples. model reliability.
  • the present invention proposes a deep learning method for updating the fruit spectral analysis model, which solves the problem of biological
  • the technology that cannot achieve accurate detection caused by the difference has brought about an improvement effect on the accuracy of the model method.
  • the invention uses a small number of samples to update the spectral model constructed by historical data, and provides higher prediction accuracy than multiple traditional model updating methods. This method can effectively preserve the common characteristics of historical batch data and new batch data, and provide better prediction accuracy and robustness for new batches of fruit samples.
  • Step 1) Use historical batches of fruit spectral data as the sample set, and the fruit quality variable values corresponding to the sample set as the label set; construct a deep learning fruit spectral analysis model, use the sample set as input, and the label set as output, and use the deep learning fruit
  • the spectral analysis model is trained, and the initial deep learning fruit spectral analysis model and its model weight are obtained through the gradient descent algorithm and the hyperparameter optimization method;
  • Step 2) Predict the quality variable value of the new batch of fruit:
  • step 1) Select a small number of representative samples from the new batch of total fruit samples, collect the spectral data of representative fruit samples and their corresponding fruit quality variable values as a training set, and input it into the initial deep learning fruit spectral analysis model obtained in step 1) Among them, the weight of the weight freezing layer in the model is fixed, and the model is retrained to complete the weight fine-tuning of the weight variable layer, so as to obtain an updated deep learning fruit spectral analysis model suitable for the prediction of the new batch of fruit quality variables;
  • step 2.2) Collect the fruit spectral data of the remaining unknown quality variable values in the new batch, and input the updated deep learning fruit spectral analysis model in step 2.1) to predict the quality variable values, and complete the detection of the new batch of fruit quality variables.
  • the deep neural network spectral analysis model adopts a convolutional neural network model, an autoencoder model, a recurrent neural network model or a Transformer model; the embodiment of the present invention adopts a convolutional neural network model, which usually consists of multiple convolutional layers, a
  • the stretching layer is composed of multiple fully connected layers, where the front end of the convolutional layer is the input of the original spectrum, and the predicted value of the quality variable is input after the last fully connected layer.
  • the weight training of the deep neural network spectral analysis model guides the gradient descent algorithm to learn the model weights according to the loss function.
  • the loss function is composed of the mean square error between the estimated predicted value and the real value and a regularization term.
  • the final weight is determined through several rounds of iterations. .
  • the structural hyperparameter search of the deep neural network spectral analysis model is used to optimize the model structure of the neural network, such as the size of the convolution kernel, etc., and generate several hyperparameter combinations in the pre-set hyperparameter search space. According to the training set samples in the network training performance to determine the optimal model hyperparameters.
  • the training of the deep learning model adopts one or more combinations of the following four strategies: L2 norm regularization, learning rate decay strategy Learning rate decay, loss method Dropout and early stopping strategy Early stopping.
  • the fruit samples of the historical batches in the step 1) are the fruit samples obtained before the new batch, which come from different harvest years, different harvest seasons and different origins; the new batch of fruits in the step 2) are quality Variable fruit to be tested.
  • the fruit quality variable value in described step 1) and step 2.1) is a kind of quality parameter value in the sugar content of fruit, acidity, hardness;
  • the sugar content and acidity of the fruit are detected; the hardness of the fruit is measured by a hardness meter.
  • representative samples are selected from the total samples of the new batch of fruits by the Kennard-Stone method for model update, and the representative samples account for 5% to 20% of the total samples of the new batch of fruits.
  • the weight freezing layer and the weight variable layer in the step 2.1) are optimized by the following method:
  • the last 1 layer, the last 2 layers, ... the last N-1, and N layers in the model are respectively used as variable weight layers in the model, and the rest of the layers in the model are used as weight freezing layers, so that Obtain N models with different weight variable layers and weight frozen layers;
  • the parameters of the convolutional layer are generally fixed, and the parameters of the fully connected layer are fine-tuned.
  • the gradient descent algorithm is used to fine-tune the weight of the variable weight layer.
  • the present invention can realize the generalization of the model by fine-tuning the weight of the model. Due to the good nonlinear fitting ability of the deep neural network model, a new batch of data is used to fine-tune the model, so that the model can extract the general and differential features of different batches of data and improve the prediction accuracy of the model.
  • the present invention can fine-tune the historical model based on a small number of samples in a new batch, avoiding the manpower and material resources spent on collecting a large number of samples required for remodeling, and Effective use of historical data.
  • the present invention is applicable to the weight adjustment of the nonlinear neural network model, and has better reliability in the case of different data volumes.
  • the present invention is applicable to the application of the convolutional neural network model in the spectral analysis of different batches of fruit, and can effectively utilize the model constructed by the historical batch, and through the spectral data and quality variables of a small number of new batch samples, the model Fine-tune some parameters of the model to increase the generalization ability of the model, making it suitable for good prediction of a new batch of fruit samples.
  • Fig. 1 is the architecture diagram of the deep learning model used for spectral analysis in the present invention, taking the convolutional neural network as an example;
  • Fig. 2 is the flowchart of implementing model update
  • Fig. 3 is the schematic diagram of deep neural network fine-tuning method
  • Fig. 4 is a comparison chart of prediction performance of different model update methods in the embodiment.
  • Step 1) Build a deep learning fruit spectral analysis model (this paper takes convolutional neural network as an example): use the fruit spectral data collected in historical batches and the quality variable data obtained through destructive tests as labels, and input them into the convolutional neural network respectively.
  • the initial deep neural network spectral analysis model structure and its model weight are obtained through the gradient descent algorithm and the random grid hyperparameter search method. This model is suitable for the quality variable prediction of historical batches of fruits;
  • model weight refers to the connection weight of the neurons between the layers of the deep neural network spectral analysis model
  • structural hyperparameter refers to the parameters that determine the model structure and the number of weights.
  • step 1) specifically:
  • Deep neural network spectral analysis models include convolutional neural network models, autoencoder models, recurrent neural network models, and Transformer models used in spectral analysis.
  • the structural hyperparameters of the model are optimized and determined through manual search, network search, and random network search methods.
  • This paper mainly takes the convolutional neural network model as an example.
  • the model usually consists of multiple convolutional layers, a stretching layer, and multiple fully connected layers.
  • the front end of the convolutional layer is the input of the original spectrum, and the last fully connected Output the predicted value of the quality variable after the layer;
  • the weight training of the deep neural network spectral analysis model guides the gradient descent algorithm to learn the weight of the model according to the loss function.
  • the loss function is composed of the mean square error and the regularization item between the estimated predicted value and the real value. Through several rounds of iterations Determine the final weight parameter.
  • the hyperparameter search of the model is used to optimize the model structure, such as the size of the convolution kernel, etc., generate several hyperparameter combinations in the pre-set hyperparameter search space, and determine the optimal model hyperparameter according to the performance of the training set samples in network training. parameter;
  • Structural hyperparameters include the number of neurons in different layers of the neural network, learning rate of network training, learning rate decay, activation function, random deactivation rate, batch size, etc.
  • the training process of the deep learning model uses four strategies to reduce model overfitting and improve model accuracy, including 1) adding an L2 norm regularization term to the loss function and optimizing the strength of the regularization term; 2) in the model Add a dropout layer (Dropout) to the structure, optimize its strength, and randomly deactivate some neurons to avoid excessive dependence of the model on specific parameter configurations; 3) Use the Learning rate decay strategy to learn the weight of the model Gradually reduce the learning rate in the middle to avoid the model from falling into local optimum; 4) Use the early stopping strategy (Early stopping) to avoid over-fitting caused by over-training of the model.
  • these four strategies may not all be used, and one or a combination of some of them may be used.
  • step 2) specifically:
  • the number of weight-freezing layers with fixed weights in the process of parameter fine-tuning is determined after optimization. By comparing the impact of fixing different layers on the model update prediction results, the number of layers with fixed weights in model fine-tuning is determined.
  • the parameters of the convolutional layer are generally fixed, and the parameters of the fully connected layer are fine-tuned;
  • Step 3) Collect spectral data for a large number of fruit samples with unknown quality variable values in the new batch, and predict them through the updated model in step 2), so as to obtain the quality variable prediction results of the new batch of fruit samples .
  • This method updates the model by fine-tuning some of the weights of the historical model.
  • This method uses the neural network data-driven weight learning method to automatically retain the common features between different batches of data in the two trainings, and is suitable for the new generation. The samples collected in batches can improve the accuracy of predicting the quality variables of new batches of fruits.
  • the method proposed by the invention aims to update the model developed in the historical batch and apply it to the new batch of fruit samples, and the scope of application includes: different harvest years, different harvest seasons, different origins and so on. Aiming at the problem of model performance degradation caused by differences in the growth environment of different batches of fruits, a small amount of new batch data is used to update the model to be suitable for the prediction of the new batch of fruit quality.
  • the selected data set is the Cuiguan pear data collected in two batches (harvest year) in Tonglu County, Zhejiang City in 2017 and 2018 by the pear sugar detection system developed by the Intelligent Bio-Industrial Equipment Innovation (IBE) team of Zhejiang University.
  • IBE Intelligent Bio-Industrial Equipment Innovation
  • Kennard-Stone sampling algorithm 80% of the samples in 2017 (historical batch) are selected as the training set, and 20% are used as the prediction set for the development of the convolutional neural network model; the sample selection for 2018 (new batch) 5%, 10%, 15%, 20% are used for model update, and 80% are used for testing model update performance.
  • this model comprises three convolutional layers, a stretching layer, two fully connected layers and an output layer connected successively .
  • the convolution kernel sizes in the three convolution layers are 5, 7, and 3 respectively, and the step size is 5, respectively. 3, 1, the number of neurons in both fully connected layers is 16, the random deactivation rate is 0.2, the batch size is 32, the learning rate is 0.001, and the regularization coefficient is 0.05, etc.
  • the obtained prediction sets RMSEP are 0.481, 0.477, 0.476, and 0.407 respectively; using the global Model method, the obtained prediction set RMSEP is 0.516, 0.499, 0.501, 0.448 respectively; using the slope/bias correction method, the obtained prediction set RMSEP is 0.621, 0.554, 0.566, 0.549 respectively; using the remodeling method, the obtained The RMSEP of the prediction set are 0.843, 0.538, 0.737, 0.530 respectively.
  • the method of the present invention is superior to the three methods in updating the fruit spectral model between different batches, and can improve the accuracy of fruit sugar content prediction.
  • This method has good reliability under different sample sizes and has wider application prospects.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Mathematical Physics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Molecular Biology (AREA)
  • Computational Linguistics (AREA)
  • General Engineering & Computer Science (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Software Systems (AREA)
  • Evolutionary Computation (AREA)
  • Spectroscopy & Molecular Physics (AREA)
  • Chemical & Material Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Biochemistry (AREA)
  • Immunology (AREA)
  • Pathology (AREA)
  • Investigating Or Analysing Materials By Optical Means (AREA)

Abstract

一种深度学习水果光谱分析模型更新方法。将历史批次采集的水果光谱数据和品质变量输入到深度神经网络中,通过随机网格超参数搜索和梯度下降算法优化模型参数,得到最优的模型结构和权重;保持该模型权重冻结层的权重固定,使用新批次少量水果样本得到的光谱数据和品质变量,微调该模型权重可变层的权重,得到更新后的模型;将新批次未知预测值的水果光谱输入到更新后的模型,输出对新批次水果的品质变量预测结果。该方法使用少量的样本,更新历史数据构建的光谱模型,提供比多种传统模型更新方法更高的预测精度;能够有效保留历史批次数据与新一批次数据的共有特征,并且对新一批次的水果样本提供更好的预测精度和鲁棒性。

Description

一种深度学习水果光谱分析模型更新方法 技术领域
本发明属于光谱分析与化学计量学领域,具体涉及了一种深度学习水果光谱分析模型更新方法。
背景技术
光谱技术与化学计量学的发展促进了食品、制药、石油化工等行业的现场化无损检测应用。近年来,水果高通量分级系统快速发展,处理速度达到每秒多个,能够进行水果内部品质安全的快速分选。由于水果等生物对象在生长发育过程中收到环境等因素的影响,不同批次、年份、来源的水果通常存在生物学差异性,影响光在水果组织内部的作用和光谱数据的采集,导致已经开发的水果光谱分析模型失效,难以提供良好的品质预测决策支持。因此,开发可靠的光谱模型更新方法,对不同批次的待测水果是重要的。
传统的模型更新方法主要有三大类:1)全局模型:通过将多批次的数据构建全局训练集来提升模型的适用范围,但是由于增大的数据变异性和非线性程度,该方法通常会导致预测精度下降;2)重新建模:通过采集新一批次大量水果样本的光谱和品质变量数据,重新开发模型,但是该方法耗费较多的人力物力,且不能良好地利用历史批次的数据;3)斜率/偏差校正:通过部分新一批次的样本对已有模型的斜率和偏差进行校正,但是该方法仅适用于线性预测模型,且该方法可靠性较差,样本选择不当会造成杠杆效应显著降低模型预测精度。
针对现有方法的限制,该研究旨在提出一种适用于非线性深度学习模型的模型更新方法,良好地利用历史批次的数据,并且新一批次有少量带标签样本的情况下提供良好的模型可靠性。
发明内容
为了解决已开发的水果光谱分析模型对不同批次水果样本预测精度显著降低的问题,本发明提出了一种深度学习水果光谱分析模型更新方法,解决了由于不同批次采集的水果样本存在生物学差异性而引起的无法实现准确检测的技术,对模型方法精度带来了提升效果。
本发明使用少量的样本,更新历史数据所构建的光谱模型,提供比多种传统模型更新方法更高的预测精度。该方法能够有效保留历史批次数据与新一批次数据的共有特征,并且对新一批次的水果样本提供更好的预测精度和鲁棒性。
本发明采用的技术方案如下,包含如下步骤:
步骤1)采用历史批次的水果光谱数据作为样本集,样本集对应的水果品质变量值作为标签集;构建深度学习水果光谱分析模型,将样本集作为输入,标签集作为输出,对深度学习水果光谱分析模型进行训练,通过梯度下降算法和超参数优化方法,得到初始深度学习水果光谱分析模型及其模型权重;
步骤2)预测新批次水果的品质变量值:
2.1)从新批次水果总样本中选取少量代表性样本,采集代表性水果样本的光谱数据及其对应的水果品质变量值作为训练集,将其输入步骤1)得到的初始深度学习水果光谱分析模型中,固定模型中权重冻结层的权重,对模型进行重新训练完成权重可变层的权重微调,从而得到适用于新批次水果品质变量预测的更新后的深度学习水果光谱分析模型;
2.2)采集新批次中其余的未知品质变量值的水果光谱数据,并输入步骤2.1)更新后的深度学习水果光谱分析模型中进行品质变量值预测,完成新批次的水果品质变量检测。
所述深度神经网络光谱分析模型采用卷积神经网络模型、自编码器模型、循环神经网络模型或Transformer模型;本发明实施例采用卷积神经网络模型,该模型通常由多个卷积层、一个拉伸层和多个全连接层组成,其中卷积层的前端为原始光谱的输入,最后一个全连接层后输入品质变量预测值。
深度神经网络光谱分析模型的权重训练根据损失函数指导梯度下降算法以学习模型权重,损失函数由评估预测值和真实值之间的均方误差和正则化项组成,通过若干轮迭代确定最后的权重。
深度神经网络光谱分析模型的结构超参数搜索用于优化神经网络的模型结构,如卷积核大小等,在预先设定的超参数搜索空间生成若干项超参数组合,根据网络训练中训练集样本的表现,确定最优的模型超参数。
深度学习模型的训练采用下述四种策略中的一种或多种组合:L2范数正则化、学习率衰减策略Learning rate decay、丢失法Dropout和提前停止策略Early stopping。
所述步骤1)中历史批次的水果样本为在新批次之前获得的水果样本,分别来源于不同收获年份、不同收获季节和不同产地;所述步骤2)中新批次的水果为品质变量待检测的水果。
所述步骤1)和步骤2.1)中的水果品质变量值为水果的糖度、酸度、硬度中的一种品质参数值;通过破坏性试验获取水果果汁后,分别采用糖度计和pH计对果汁进行检测得到水果的糖度和酸度;水果的硬度通过硬度计测量得到。
所述步骤2.1)中,通过Kennard-Stone方法从新批次水果总样本中选择代表性样本用于模型更新,代表性样本占新批次水果总样本的5%~20%。
所述步骤2.1)中的权重冻结层和权重可变层通过下述方法优化得到:
对于N层的深度神经网络模型,将模型中的最后1层、最后2层、…最后N-1、N层分别作为模型中的权重可变层,模型中的其余层作为权重冻结层,从而得到N个权重可变层和权重冻结层不同的模型;
将训练集分别输入N个模型中,比较N个模型输出的预测值与真实值的误差,将误差最小的模型对应的权重冻结层和权重可变层作为优化后得到的权重冻结层和权重可变层。
以卷积神经网络为例,一般将卷积层参数固定,微调全连接层的参数。
所述步骤2.1)中采用梯度下降算法对权重可变层的权重进行微调。
本发明的有益效果是:
1)本发明相比与全局建模方法而言,能够通过微调模型模型权重来实现模型的泛化。由于深度神经网络模型具有良好的非线性拟合能力,使用新一批次数据进行模型微调,使模型提取到不同批次数据的通用和差异特征,提升模型预测精度。
2)本发明相比与重新建模方法而言,能够通过新一批次的少量样本对在历史模型的基础上进行微调,避免了重新建模所需要采集大量样本所耗费的人力物力,并能有效利用好历史数据。
3)本发明相比与斜率/偏差校正方法而言,能够适用于非线性神经网络模型的权重调整,并且在不同数据量的情况下具有较好的可靠性。
4)本发明适用于卷积神经网络模型在不同批次水果光谱分析中的应用,能够有效的利用历史批次所构建的模型,通过少量新一批次样本的光谱数据和品质变量,对模型的部分参数进行微调,增加模型的可泛化能力,使其适用于对新一批次水果样本的良好预测。
附图说明
图1为本发明用于光谱分析的深度学习模型架构图,以卷积神经网络为例;
图2为实现模型更新的流程图;
图3为深度神经网络微调方法的示意图;
图4为实施例不同模型更新方法预测性能比较图。
具体实施方式
下面结合实施例对本发明做进一步详细说明,但本发明要求保护的范围并不局限于实施例表示的范围。以下进行的实施例,在Python软件上运行。
如图2所示,本发明采用的技术方案如下:
步骤1):构建深度学习水果光谱分析模型(本文以卷积神经网络为例):采用历史批次采集的水果光谱数据和通过破坏性试验获取的品质变量数据作为标签,分别输入到该卷积神经网络模型中,通过梯度下降算法和随机网格超参数搜索方法,得到初始深度神经网络光谱分析模型结构及其模型权重,该模型适用于历史批次水果的品质变量预测;
其中,模型权重是指深度神经网络光谱分析模型层与层之间神经元的连接权重,结构超参数是指决定模型结构和权重数量的参数。
所述的步骤1)中,具体为:
1.1)深度神经网络光谱分析模型包括光谱分析中使用的卷积神经网络模型、自编码器模型、循环神经网络模型、Transformer模型等。模型的结构超参数是通过人工搜索、网络搜索、随机网络搜索方法优化决定。本文中主要以卷积神经网络模型为例,该模型通常由多个卷积层、一个拉伸层、多个全连接层组成,其中卷积层的前端为原始光谱的输入,最后一个全连接层后输出品质变量预测值;
1.2)深度神经网络光谱分析模型的权重训练根据损失函数来指导梯度下降算法以学习模型权重,损失函数由评估预测值和真实值之间的均方误差和正则化项所组成,通过若干轮迭代确定最后的权重参数。模型的超参数搜索用于优化模型结构,如卷积核大小等,在预先设定的超参数搜索空间生成若干项超参数组合,根据网络训练中训练集样本的表现,确定最优的模型超参数;
结构超参数包括神经网络不同层中神经元个数等,网络训练的学习率、学习率衰减、激活函数、随机失活率、批大小等。
步骤2):对训练好的深度神经网络光谱分析模型进行参数微调:对新一批次收获的少量水果样本,采集光谱数据和品质变量标签,将其输入步骤1)中训练好的深度神经网络光谱分析模型中,在模型结构和部分层权重固定不变的基础下,对模型其他层的权重进行微调,实现模型权重的更新,以适用于新一批次的品质变量预测;
1.3)深度学习模型的训练过程使用四种策略来减少模型过度拟合从而提升模型精度,包括1)损失函数中加入L2范数正则化项,并优化该正则化项的强度;2)在模型结构中添加丢失层(Dropout),并优化其强度,随机使一部分神经元失活,避免模型过度依赖于特定的参数配置;3)使用学习率衰减(Learning rate decay)策略,在模型权重学习过程中逐步降低学习率,避免模型陷入局部最优;4)使用提前停止策略(Early stopping),在模型避免模型过度训练导致 过拟合。
具体实施中,这四种策略不一定全部使用,可采用其中的某种或某几种的组合。
所述的步骤2)中,具体为:
2.1)对训练好的深度学习模型进行参数微调时,模型的结构参数保持固定,部分层的权重固定,仅对其他层的权重进行更新,以调整所提取特征的权重组合,使模型适用于新一批次所采集的数据,如图3示意图。对于多层网络结构的深度学习模型,所选择用于权重的固定层的层数通过优化所确定的;
2.2)参数微调过程中权重固定的权重冻结层的数量是优化后决定的,通过比较固定不同层对模型更新预测结果的影响,确定模型微调中权重固定的层数。以卷积神经网络为例,一般将卷积层参数固定,微调全连接层的参数;
2.3)参数微调过程选择新一批次具有代表性的样本,有利于提升模型的预测精度,如可通过Kennard-Stone方法来选择代表性样本用于模型更新。
步骤3):对新一批次中未知品质变量值的大量水果样本采集光谱数据,通过步骤2)中更新后的模型对其进行预测,以得到对新一批次水果样本的品质变量预测结果。该方法通过微调历史模型的部分权重实现模型的更新,该方法利用神经网络数据驱动的权重学习方式,在两次训练中自动地保留了不同批次数据之间的通用特征,并适用于新一批次采集的样本,从而提高了对新一批次水果品质变量预测的精度。
本发明提出的方法旨在对历史批次开发的模型更新应用于新一批次的水果样本,适用范围包括:不同收获年份、不同收获季节、不同产地来源等。针对不同批次水果生长环境等差异所导致的模型性能下降的问题,采用少量新一批次数据对模型更新,以适用于新一批次的水果品质预测。
由于不同收获年份、不同收获季节、不同产地来源水果的生长环境和种植管理不同,水果收获后通常存在大小尺寸、外观颜色、品质变量分布等生物学差异性,使用历史批次构建好的模型不能提供良好的预测精度、通常导致检测结果不准确。本发明解决了上述技术问题。
实施例:
本实例应用于可见/近红外光谱的定量分析,预测翠冠梨的糖度含量。所选取的数据集是浙江大学智能生物产业装备创新(IBE)团队开发的梨糖度检测系统于2017和2018年两个批次(收获年份)在浙江省桐庐县采集的翠冠梨数据。
2017年采集样本477个,糖度含量范围是8.95%~16.25%,2018年采集样本256个,糖度含量范围是9.00%~13.50%。糖度数据是通过对梨可食用部分榨 汁后在糖度计上采集的。在海洋光学QE65pro光谱仪上测试每个梨的光谱数据,去除噪声部分后,使用的光谱波段范围是576.66到939.29nm,共有475个变量构建模型。
通过Kennard-Stone采样算法对2017年(历史批次)的样本选择80%作为训练集,20%作为预测集,用于开发卷积神经网络模型;对2018年(新一批次)的样本选择5%,10%,15%,20%用于模型更新,80%用于测试模型更新性能。
如图2所示步骤,上述实施例过程具体如下:
1)构建深度学习模型,该实施例中使用卷积神经网络模型,如图1所示,该模型包括依次连接的三个卷积层、一个拉伸层、两个全连接层和一个输出层。
2)将2017年的训练集数据和已知的糖度含量输入到模型中。
3)使用Adam优化器结合随机梯度下降算法训练模型的权重,并且优化神经网络模型的超参数,三个卷积层中的卷积核大小分别为5,7,3,步长分别为5,3,1,两个全连接层的神经元个数均为16,随机失活率为0.2,批大小为32,学习率为0.001,正则化系数为0.05等。
4)将该2017年数据所训练的卷积神经网络模型的最优权重保存,并固定网络结构的超参数和卷积层的权重;
5)将2018年少量样本输入到该模型中,使用随机梯度下降算法微调全连接层的中的权重参数。使用5%,10%,15%,20%样本量进行更新后分别得到四个更新后的模型,并保存各更新后模型的最优权重。
6)将2018年80%的测试样本的光谱数据分别输入以上四个更新后的模型中,输出糖度含量的预测值。
7)使用5%,10%,15%,20%样本量进行测试:如图4所示,采用本发明模型微调的方法,得到的预测集RMSEP分别为0.481,0.477,0.476,0.407;使用全局模型方法,所得到的预测集RMSEP分别为0.516,0.499,0.501,0.448;使用斜率/偏差校正方法,所得到的预测集RMSEP分别为0.621,0.554,0.566,0.549;使用重新建模方法,所得到的预测集RMSEP分别为0.843,0.538,0.737,0.530。
通过比较看出,本发明方法在不同批次间的水果光谱模型更新中优于三种方法,可以提高水果糖度预测的精度。该方法在不同的样本量下具有较好的可靠性,有更加广泛的应用前景。

Claims (7)

  1. 一种深度学习水果光谱分析模型更新方法,其特征在于,包含如下步骤:
    步骤1)采用历史批次的水果光谱数据作为样本集,样本集对应的水果品质变量值作为标签集;构建深度学习水果光谱分析模型,将样本集作为输入,标签集作为输出,对深度学习水果光谱分析模型进行训练,通过梯度下降算法和超参数优化方法,得到初始深度学习水果光谱分析模型及其模型权重;
    步骤2)预测新批次水果的品质变量值:
    2.1)从新批次水果总样本中选取少量代表性样本,采集代表性水果样本的光谱数据及其对应的水果品质变量值作为训练集,将其输入步骤1)得到的初始深度学习水果光谱分析模型中,固定模型中权重冻结层的权重,对模型进行重新训练完成权重可变层的权重微调,从而得到适用于新批次水果品质变量预测的更新后的深度学习水果光谱分析模型;
    2.2)采集新批次中其余的未知品质变量值的水果光谱数据,并输入步骤2.1)更新后的深度学习水果光谱分析模型中进行品质变量值预测,完成新批次的水果品质变量检测。
  2. 根据权利要求1所述的一种深度学习水果光谱分析模型更新方法,其特征在于,所述深度神经网络光谱分析模型采用卷积神经网络模型、自编码器模型、循环神经网络模型或Transformer模型;
    深度学习模型的训练采用下述四种策略中的一种或多种组合:L2范数正则化、学习率衰减策略、丢失法和提前停止策略。
  3. 根据权利要求1所述的一种深度学习水果光谱分析模型更新方法,其特征在于,所述步骤1)中历史批次的水果样本为在新批次之前获得的水果样本,分别来源于不同收获年份、不同收获季节和不同产地;所述步骤2)中新批次的水果为品质变量待检测的水果。
  4. 根据权利要求1所述的一种深度学习水果光谱分析模型更新方法,其特征在于,所述步骤1)和步骤2.1)中的水果品质变量值为水果的糖度、酸度、硬度中的一种品质参数值;
    通过破坏性试验获取水果果汁后,分别采用糖度计和pH计对果汁进行检测得到水果的糖度和酸度;水果的硬度通过硬度计测量得到。
  5. 根据权利要求1所述的一种深度学习水果光谱分析模型更新方法,其特征在于,所述步骤2.1)中,通过Kennard-Stone方法从新批次水果总样本中选择代表性样本用于模型更新,代表性样本占新批次水果总样本的5%~20%。
  6. 根据权利要求1所述的一种深度学习水果光谱分析模型更新方法,其特征在于,所述步骤2.1)中的权重冻结层和权重可变层通过下述方法优化得到:
    对于N层的深度神经网络模型,将模型中的最后1层、最后2层、…最后N-1层、N层分别作为模型中的权重可变层,模型中的其余层作为权重冻结层,从而得到N个权重可变层和权重冻结层不同的模型;
    将训练集分别输入N个模型中,比较N个模型输出的预测值与真实值的误差,将误差最小的模型对应的权重冻结层和权重可变层作为优化后得到的权重冻结层和权重可变层。
  7. 根据权利要求1所述的一种深度学习水果光谱分析模型更新方法,其特征在于,所述步骤2.1)中采用梯度下降算法对权重可变层的权重进行微调。
PCT/CN2021/132651 2021-11-02 2021-11-24 一种深度学习水果光谱分析模型更新方法 Ceased WO2023077569A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111288042.6 2021-11-02
CN202111288042.6A CN114002167A (zh) 2021-11-02 2021-11-02 一种深度学习水果光谱分析模型更新方法

Publications (1)

Publication Number Publication Date
WO2023077569A1 true WO2023077569A1 (zh) 2023-05-11

Family

ID=79926429

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/132651 Ceased WO2023077569A1 (zh) 2021-11-02 2021-11-24 一种深度学习水果光谱分析模型更新方法

Country Status (2)

Country Link
CN (1) CN114002167A (zh)
WO (1) WO2023077569A1 (zh)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113077450A (zh) * 2021-04-12 2021-07-06 大连大学 基于深度卷积神经网络的樱桃分级检测方法及系统
CN119361008A (zh) * 2024-12-27 2025-01-24 双胞胎(集团)股份有限公司 基于成分预测的饲料生产过程监测方法
CN119474843A (zh) * 2025-01-15 2025-02-18 南昌工程学院 一种基于透射光谱分析的水质检测方法及电子设备
CN119810671A (zh) * 2025-01-22 2025-04-11 合肥工业大学 一种基于高光谱技术和神经网络的中药材产地快速识别方法
CN119901706A (zh) * 2025-01-16 2025-04-29 安徽农业大学 一种水稻籽粒垩白无损检测方法、装置、设备及介质
CN120030900A (zh) * 2025-02-07 2025-05-23 中国人民解放军国防科技大学 基于光谱感知改进的共振超表面设计方法和装置
CN120385642A (zh) * 2025-04-16 2025-07-29 广东省农业科学院蔬菜研究所 增强多任务深度注意力网络协同近红外光谱的南瓜糖度高效检测方法及系统
CN120522105A (zh) * 2025-07-25 2025-08-22 中国科学院东北地理与农业生态研究所 一种基于高光谱养分稀疏特征的稻米品质检测方法
CN120636612A (zh) * 2025-05-29 2025-09-12 江苏康缘药业股份有限公司 制药数据处理方法、装置及设备
CN120847014A (zh) * 2025-09-19 2025-10-28 西安山川石油科技有限责任公司 一种用于套气回收的智能监测方法
CN120893631A (zh) * 2025-09-25 2025-11-04 西安理工大学 一种基于机器学习的智能活性包装优化方法及系统
CN121190426A (zh) * 2025-09-18 2025-12-23 中国热带农业科学院农产品加工研究所 基于图像分割技术的干燥龙眼褐变程度的评价方法、系统及存储介质

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPWO2023204029A1 (zh) * 2022-04-21 2023-10-26
CN115238789A (zh) * 2022-07-22 2022-10-25 新华融合媒体科技发展(北京)有限公司 基于改进gru的金融行业另类数据预测方法和系统
CN115855860A (zh) * 2022-11-04 2023-03-28 华南农业大学 一种茶叶干燥过程中的水分含量预测方法及处理终端
CN119104505B (zh) * 2024-11-08 2025-04-25 浙江大学 一种自适应校正的制药过程质量检测方法及机器人
CN120827752A (zh) * 2025-09-19 2025-10-24 山东大学 中药醇沉调控系统及基于成分实时检测的动态调控方法

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106841103A (zh) * 2017-03-01 2017-06-13 沈阳农业大学 近红外光谱检测水果内部品质方法及专用检测系统
CN110320162A (zh) * 2019-05-20 2019-10-11 广东省智能制造研究所 一种基于生成对抗网络的半监督高光谱数据定量分析方法
CN110736707A (zh) * 2019-09-16 2020-01-31 浙江大学 一种主仪器向从仪器光谱模型传递的光谱检测优化方法
CN111968080A (zh) * 2020-07-21 2020-11-20 山东农业大学 一种基于高光谱和深度学习的肥城桃内外品质检测方法
WO2021033033A1 (en) * 2019-08-22 2021-02-25 Foss Analytical A/S Determining physicochemical properties of a sample
CN113030001A (zh) * 2021-03-19 2021-06-25 北京农业智能装备技术研究中心 一种水果糖度检测方法及系统

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108596123A (zh) * 2018-04-28 2018-09-28 山东师范大学 一种基于高光谱分析的水果硬度检测方法及装置
CN108760668B (zh) * 2018-06-01 2019-10-29 南京林业大学 基于加权自动编码器的马尾松苗木根部水分快速测量方法
CN109493287B (zh) * 2018-10-10 2022-03-15 浙江大学 一种基于深度学习的定量光谱数据分析处理方法
CN110705372B (zh) * 2019-09-10 2023-05-05 中国科学院上海技术物理研究所 基于深度学习卷积神经网络的libs多成分定量反演方法

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106841103A (zh) * 2017-03-01 2017-06-13 沈阳农业大学 近红外光谱检测水果内部品质方法及专用检测系统
CN110320162A (zh) * 2019-05-20 2019-10-11 广东省智能制造研究所 一种基于生成对抗网络的半监督高光谱数据定量分析方法
WO2021033033A1 (en) * 2019-08-22 2021-02-25 Foss Analytical A/S Determining physicochemical properties of a sample
CN110736707A (zh) * 2019-09-16 2020-01-31 浙江大学 一种主仪器向从仪器光谱模型传递的光谱检测优化方法
CN111968080A (zh) * 2020-07-21 2020-11-20 山东农业大学 一种基于高光谱和深度学习的肥城桃内外品质检测方法
CN113030001A (zh) * 2021-03-19 2021-06-25 北京农业智能装备技术研究中心 一种水果糖度检测方法及系统

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113077450A (zh) * 2021-04-12 2021-07-06 大连大学 基于深度卷积神经网络的樱桃分级检测方法及系统
CN119361008A (zh) * 2024-12-27 2025-01-24 双胞胎(集团)股份有限公司 基于成分预测的饲料生产过程监测方法
CN119474843A (zh) * 2025-01-15 2025-02-18 南昌工程学院 一种基于透射光谱分析的水质检测方法及电子设备
CN119901706A (zh) * 2025-01-16 2025-04-29 安徽农业大学 一种水稻籽粒垩白无损检测方法、装置、设备及介质
CN119810671A (zh) * 2025-01-22 2025-04-11 合肥工业大学 一种基于高光谱技术和神经网络的中药材产地快速识别方法
CN120030900A (zh) * 2025-02-07 2025-05-23 中国人民解放军国防科技大学 基于光谱感知改进的共振超表面设计方法和装置
CN120385642A (zh) * 2025-04-16 2025-07-29 广东省农业科学院蔬菜研究所 增强多任务深度注意力网络协同近红外光谱的南瓜糖度高效检测方法及系统
CN120636612A (zh) * 2025-05-29 2025-09-12 江苏康缘药业股份有限公司 制药数据处理方法、装置及设备
CN120522105A (zh) * 2025-07-25 2025-08-22 中国科学院东北地理与农业生态研究所 一种基于高光谱养分稀疏特征的稻米品质检测方法
CN121190426A (zh) * 2025-09-18 2025-12-23 中国热带农业科学院农产品加工研究所 基于图像分割技术的干燥龙眼褐变程度的评价方法、系统及存储介质
CN120847014A (zh) * 2025-09-19 2025-10-28 西安山川石油科技有限责任公司 一种用于套气回收的智能监测方法
CN120893631A (zh) * 2025-09-25 2025-11-04 西安理工大学 一种基于机器学习的智能活性包装优化方法及系统

Also Published As

Publication number Publication date
CN114002167A (zh) 2022-02-01

Similar Documents

Publication Publication Date Title
CN114002167A (zh) 一种深度学习水果光谱分析模型更新方法
Yang et al. A deep learning approach to improving spectral analysis of fruit quality under interseason variation
Zhang et al. Determination of bagged ‘Fuji’apple maturity by visible and near-infrared spectroscopy combined with a machine learning algorithm
Cruz et al. Nondestructive simultaneous prediction of internal browning disorder and quality attributes in ‘Rocha’pear (Pyrus communis L.) using VIS-NIR spectroscopy
Sun et al. Rapid and nondestructive watermelon (Citrullus lanatus) seed viability detection based on visible near‐infrared hyperspectral imaging technology and machine learning algorithms
Shi et al. Whale optimization algorithm-based multi-task convolutional neural network for predicting quality traits of multi-variety pears using near-infrared spectroscopy
CN105527244A (zh) 一种基于近红外光谱的寒富苹果品质无损检测方法
Fan et al. Non-destructive detection of single-seed viability in maize using hyperspectral imaging technology and multi-scale 3D convolutional neural network
Wang et al. Determination of watermelon soluble solids content based on visible/near infrared spectroscopy with convolutional neural network
CN105675539A (zh) 一种农产品品质综合评价方法
Zou et al. Fluorescence hyperspectral imaging technology combined with chemometrics for kiwifruit quality attribute assessment and non-destructive judgment of maturity
Mogollón et al. NIR spectral models for early detection of bitter pit in asymptomatic ‘Fuji’apples
CN118779829A (zh) 一种蔬菜农药残留的智能检测方法
Pan et al. Updating apple Vis-NIR spectral ripeness classification model based on deep learning and multi-seasonal database
CN107247033A (zh) 基于快速衰减式淘汰算法和plsda鉴别黄花梨成熟度的方法
WO2024174616A1 (zh) 一种孵前种蛋受精信息无损分拣方法及装置
CN104198397A (zh) 氮磷钾交互作用下温室作物营养含量检测的方法
CN121185942B (zh) 基于高光谱反透融合的柑橘黄龙病无损检测方法及系统
CN111597878A (zh) 基于bsa-ia-bp的菌落总数预测方法
Su et al. Identification of damage in pear using hyperspectral imaging technology
Lin et al. Nondestructive detection of mango soluble solid content in hyperspectral imaging based on multi-combinatorial feature wavelength selection
Bu et al. Dual-channel self-supervised multi-task learning for spectral detection of soluble solids content and firmness in Korla fragrant pears
Jiang et al. Deep learning method of visible and near-infrared spectroscopy considering small sample learning and prediction uncertainty assessment to detect soluble solids content of mandarin
CN119125039A (zh) 一种红美人柑橘维生素c含量无损检测方法
Hong et al. Nondestructive prediction of rice seed viability using spectral and spatial information modeling of visible–near infrared hyperspectral images

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21963077

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21963077

Country of ref document: EP

Kind code of ref document: A1