WO2023231204A1 - 一种基于 ics-bp 神经网络的传感器物理量回归方法 - Google Patents
一种基于 ics-bp 神经网络的传感器物理量回归方法 Download PDFInfo
- Publication number
- WO2023231204A1 WO2023231204A1 PCT/CN2022/116052 CN2022116052W WO2023231204A1 WO 2023231204 A1 WO2023231204 A1 WO 2023231204A1 CN 2022116052 W CN2022116052 W CN 2022116052W WO 2023231204 A1 WO2023231204 A1 WO 2023231204A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- neural network
- ics
- regression
- training
- physical quantity
- Prior art date
Links
- 238000013528 artificial neural network Methods 0.000 title claims abstract description 78
- 238000000034 method Methods 0.000 title claims abstract description 42
- 238000012549 training Methods 0.000 claims abstract description 51
- 230000006870 function Effects 0.000 claims abstract description 34
- 238000004422 calculation algorithm Methods 0.000 claims abstract description 16
- 230000004913 activation Effects 0.000 claims abstract description 11
- 210000002569 neuron Anatomy 0.000 claims abstract description 10
- 238000005286 illumination Methods 0.000 claims description 21
- 238000005070 sampling Methods 0.000 claims description 10
- 238000003062 neural network model Methods 0.000 claims description 5
- 238000004836 empirical method Methods 0.000 claims description 2
- 230000032683 aging Effects 0.000 abstract description 8
- 238000012937 correction Methods 0.000 abstract description 7
- 230000003044 adaptive effect Effects 0.000 description 9
- 238000002474 experimental method Methods 0.000 description 9
- 238000004364 calculation method Methods 0.000 description 8
- 238000012886 linear function Methods 0.000 description 7
- 230000008569 process Effects 0.000 description 7
- 241000544061 Cuculus canorus Species 0.000 description 6
- 238000004458 analytical method Methods 0.000 description 6
- 230000007423 decrease Effects 0.000 description 6
- 244000000626 Daucus carota Species 0.000 description 5
- 235000005770 birds nest Nutrition 0.000 description 5
- 235000005765 wild carrot Nutrition 0.000 description 5
- 235000013601 eggs Nutrition 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 4
- 238000013459 approach Methods 0.000 description 3
- 238000006243 chemical reaction Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 238000013508 migration Methods 0.000 description 3
- 230000005012 migration Effects 0.000 description 3
- 238000012360 testing method Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 2
- 230000008571 general function Effects 0.000 description 2
- 238000012417 linear regression Methods 0.000 description 2
- 230000001537 neural effect Effects 0.000 description 2
- 238000005457 optimization Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000000717 retained effect Effects 0.000 description 2
- 230000003679 aging effect Effects 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000000052 comparative effect Effects 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 230000007613 environmental effect Effects 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 230000014509 gene expression Effects 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 238000010606 normalization Methods 0.000 description 1
- 238000005295 random walk Methods 0.000 description 1
- 238000012892 rational function Methods 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000010845 search algorithm Methods 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/004—Artificial life, i.e. computing arrangements simulating life
- G06N3/006—Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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
- G06N3/084—Backpropagation, e.g. using gradient descent
Definitions
- This application relates to the field of sensor data processing technology, and in particular to a sensor physical quantity regression method based on ICS-BP neural network.
- this application is to propose a sensor physical quantity regression method based on ICS-BP neural network. This application can solve the existing problems in a targeted manner.
- this application proposes a sensor physical quantity regression method based on ICS-BP neural network, including:
- Figure 1 shows a schematic diagram of physical quantity regression based on BP neural network in this application.
- Figure 2 shows a flow chart of a sensor physical quantity regression method based on ICS-BP neural network according to an embodiment of the present application.
- Figure 3 shows a schematic diagram of the process of fitting a straight line using the ICS-BP neural network.
- Figure 4 shows a schematic diagram of the process of fitting a straight line using the ICS-BP neural network.
- Figure 5 shows the light intensity regression curve graph based on ICS-BP.
- Common physical quantity regression methods include least squares method, formula method, look-up table method, and cubic spline interpolation method.
- the least squares regression obtains the estimator of the simple linear regression model parameters by minimizing the sum of squares of errors, but the least squares method is difficult to fit nonlinear data;
- the formula method calculates the physical quantity corresponding to the AD value through a known formula Value, this method is simple and fast, and can quickly calculate the value of physical quantities.
- the look-up table method is Query the corresponding physical quantity value according to the AD value.
- This method does not require calculation, but it is difficult to enumerate the physical quantity values corresponding to the AD value of all sensors; the cubic spline difference method finds the function of the curve by solving the three-bend matrix equation.
- the calculation method is simple and has good stability, but it is difficult to estimate the error.
- neural networks for physical quantity regression does not determine the coefficients in mathematical formulas through neural networks, but determines a neural network structure F through training and learning of existing sample data.
- the network structure here represents the sampling values and physical quantities. The relationship between them, through this network structure, every time an AD sample value is input, there is a predicted physical quantity value output.
- BP neural network is one of the most widely used models in the field of artificial neural networks. This application will use BP neural network to achieve physical regression, perform aging correction on sensors, and improve the accuracy of regression. .
- Theoretical research shows that in the BP neural network, if the activation function used is a continuous function (such as the sigmoid function), the network output can approximate a continuous function with arbitrary accuracy, that is, let ⁇ be a bounded, non-constant monotonically increasing continuous function. , I d represents the d -dimensional unit hypercube.
- the network output can approximate f arbitrarily, that is . It can be seen that the BP neural with only one hidden layer is sufficient as a general function approximator.
- the three-layer BP neural network structure F is shown in Figure 1, which mainly includes the number of network layers (three layers), the number of units in each layer, the connection weights between each layer, and the thresholds of the hidden layer and output layer, etc., after training The resulting neural network model can become an "expert" in solving this regression problem.
- the traditional BP neural network adjusts the weights and thresholds through the gradient descent algorithm and is easily limited to local extreme values. Therefore, the improved cuckoo search algorithm is introduced to optimize the BP neural network.
- the CS algorithm was proposed by Xin-She Yang and Sansh Deb in 2009. This algorithm simulates the cuckoo's brooding behavior, combined with Flying searches for the global optimal solution.
- the CS algorithm requires few parameters, has strong optimization capabilities, and is easy to implement.
- the algorithm is based on the following three ideal premises.
- Each cuckoo only lays one egg at a time and randomly selects a nest for storage.
- the position of the bird's nest represents a solution
- the weights and thresholds of each layer of the neural network can be encoded as the position of the bird's nest, using The bird's nest position is continuously updated through flight and random migration until the iteration conditions are met and the global optimal solution is obtained.
- Flight is a random walk with a heavy-tailed distribution.
- the direction and length of each step are random.
- Position updating of the flight path facilitates global search to jump out of the local optimal solution. Assume that the position of the i -th bird's nest in generation t is , then the position of the t + 1th generation bird's nest is shown in equation (2).
- ⁇ represents the step size control amount, which is generally 0.01. Since the local search ability of the CS algorithm is poor, if the adaptive step size is adopted to optimize the CS algorithm, the improved algorithm will take a larger value in the early stage of iteration. , which is convenient for global search, and the value in the later stage of iteration is smaller, which is convenient for local search.
- the host bird After flying and conducting a global search, the host bird will find a cuckoo egg with a certain probability P.
- the calculation formula of probability P is as shown in Equation (6). If it is discovered, the nest location will be updated through local random migration to ensure the diversity of the group. property, local random migration updates the nest position according to Equation (7).
- P min 0.1
- P max 0.5
- the activation function Since the analog quantity changes continuously, it can be seen from Section 1.1 that when the activation function is a continuous function, the three-layer BP neural output can approximate a continuous function with arbitrary accuracy. Therefore, the activation function needs to select a continuous function, and due to the physical quantity The range of values is large, and the data needs to be normalized before training. Some activation functions are not suitable for training the normalized data. Therefore, this application selects the most commonly used Sigmoid function as the activation function. .
- the selected training samples need to be extensive and representative. Through these samples, the possible relationship between the input volume and the output volume can be found.
- the sample size needs to be appropriate. If the sample size is insufficient, the trained model will not be representative, and overfitting may occur. If too many samples are selected, the amount of calculation will increase, the training time will be too long, and even This results in the data being too specific and losing its characteristics.
- the sample distribution needs to be uniform, that is, in any interval, the density of the sample is roughly the same. For example, for temperature physical quantity regression, 1 to 2 temperatures should be selected as the sample size in every 10°C interval between 0 and 100°C, and approximately 10-20 Article data. Sample selection can use 10
- the EPV empirical method is based on the sample size being more than 10 times the number of independent variables, and then selecting an appropriate number of training samples based on the value range of the sample.
- the collected sample data needs to be normalized, and then the ICS algorithm introduced in Section 1.2 is used to obtain the global optimal weights and thresholds, and the BP neural network is initialized. After determining the ICS-BP neural network After learning parameters, including learning rate, number of hidden layer neurons, and iteration cutoff conditions (accuracy error), the model can be trained.
- the generated model can be stored in the terminal in the form of a structure as shown in Figure 2.
- the ICS-BP neural network structure and prediction function are encapsulated into software components to be called when the AD sample value is returned, and the regression prediction of physical quantities is completed at the terminal.
- This application selects the correlation coefficient (usually represented by R), residual standard deviation, and mean absolute error to evaluate the quality of the model, and uses represents the predicted value, represents the true value, represents the mean of the true value, and m represents the number of samples.
- Correlation coefficient is also called goodness of fit, coefficient of determination, coefficient of determination, etc. This index represents the fitting degree of the regression line to the observed value. The larger R is, the better the fitting effect is. The optimal value of R is 1.
- the calculation formula is shown in Formula (8).
- the residual standard deviation also known as the root mean square error
- the calculation formula is shown in Equation (9).
- the average absolute error refers to the average value of the absolute value of the error between the observed value and the true value. This indicator can better reflect the actual situation of the predicted value error.
- Equation (10) The calculation formula is shown in Equation (10).
- the ICS-BP network structure is selected as 1-8-1, and the learning rate is set to 0.1. Experiments are conducted under different error precisions. Each group conducts 100 experiments and averages the results. The specific training results are shown in Table 2.
- Figure 3 shows the process of using ICS-BP neural network to fit a linear function. Combining Figure 3 and Table 2, it can be seen that the smaller the accuracy error, the longer the training time required, and the better the model performance index, that is, the fitting The curve continues to approach the original straight line, and the fitting degree becomes higher and higher. The residual standard deviation and mean absolute error also continue to decrease. However, as the overall error continues to become smaller, the model performance improves more and more slowly.
- the nonlinear function is obtained after conversion , use this function to perform fitting nonlinear function experiments, set x ⁇ [0,100], and the training set is shown in Table 3.
- the ICS-BP network structure is selected as 1-8-1, the learning rate is set to 0.1, each group conducts 100 experiments and averages the results.
- the fitting process is shown in Figure 4.
- Table 4 shows the curve fitting results under different precision errors. Combining Figure 4 and Table 4, it can be seen that as the training time increases, the overall error continues to decrease, and the fitting curve continues to approach the nonlinear function. The correlation coefficient It also continues to increase, gradually approaching 1, and the remaining standard deviation and mean error continue to decrease.
- BP neural networks often set the learning rate to a constant. If the learning rate is set too high, it may cause problems such as parameters oscillating near the optimal solution and the model failing to converge. If the learning rate is too small, the number of training times will increase and the model will fail. The convergence speed is very slow or even impossible to train. Since this system may involve multiple types of sensor regression problems, designing an appropriate learning rate for each type of sensor would be a huge workload and difficult to implement, so an adaptive learning rate method is adopted. Adaptive learning rate does not use a fixed learning rate, but dynamically adjusts the learning rate within a certain range. During the training process, when the error continues to decrease, it means that the correction direction at this time is correct, and the learning rate can be appropriately increased.
- the setting of the number of hidden layer nodes will also have a direct impact on the training effect. If the number is too small, not much information will be obtained, resulting in an underfitting state; if the number is too large, it will not only increase the training time, but also make it easier to Overfitting occurs, resulting in poor generalization ability of the model.
- the number of hidden layer neurons is related to the requirements of the problem and the number of input and output layer neurons.
- the training data adopts the illumination regression data set in Section 4.1, uses the adaptive learning rate, sets the number of hidden layer units to 10, and sets the overall error accuracy less than 0.0001 as the iteration termination condition.
- the regression curve is shown in Figure 5.
- the network model obtained after training the ICS-BP neural network on the illumination data set was verified on the test set and compared with the physical quantity regression results based on the BP neural network. The results are shown in Table 10.
- This application starts from theory and practice respectively, and verifies the feasibility and superiority of the three-layer ICS-BP neural network in physical quantity regression.
- the use of ICS-BP neural network for regression does not obtain a specific mathematical formula between the sampled value and the actual physical quantity, but the structure of the network model is determined, and it can become the solution to the regression problem. expert” and can establish unified mathematical expressions.
- the ICS-BP neural network is used for regression. It only needs to collect training sample data to independently perform dynamic physical quantity regression and realize sensor aging correction.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Evolutionary Computation (AREA)
- Artificial Intelligence (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- Testing Or Calibration Of Command Recording Devices (AREA)
Abstract
本申请提供一种基于ICS-BP神经网络的传感器物理量回归方法,包括:确定ICS-BP神经网络的激活函数和层数;采集训练数据,对所述ICS-BP神经网络进行训练;使用训练后的ICS-BP神经网络对传感器物理量进行回归预测。对采集的样本数据进行归一化处理;使用ICS算法获得全局最优的权值和阈值,并初始化BP神经网络;确定ICS-BP神经网络的学习参数,包括学习率、隐藏层神经元数、迭代截止条件。对于很难寻找明确的数学公式甚至根本找不到数学公式的回归问题,使用ICS-BP神经网络进行回归,只需采集训练样本数据,即可自主进行动态物理量回归并实现传感器老化矫正。
Description
本申请涉及传感器数据处理技术领域,尤其涉及一种基于ICS-BP神经网络的传感器物理量回归方法。
在使用AD类传感器进行环境数据采样时,MCU的模数转换与实际物理量之间为非线性关系,因此需要对采样值进行非线性回归处理,而常见的回归方法存在回归公式不统一、非线性校正能力差等问题。
有鉴于此,本申请的目的在于提出一种基于ICS-BP神经网络的传感器物理量回归方法,本申请能够针对性的解决现有的问题。
基于上述目的,本申请提出了一种基于ICS-BP神经网络的传感器物理量回归方法,包括:
确定ICS-BP神经网络的激活函数和层数;
采集训练数据,对所述ICS-BP神经网络进行训练;
使用训练后的ICS-BP神经网络对传感器物理量进行回归预测。
本申请的优势及给用户带来的体验在于:对于很难寻找明确的数学公式甚至根本找不到数学公式的回归问题,使用ICS-BP神经网络进行回归,只需采集训练样本数据,即可自主进行动态物理量回归并实现传感器老化矫正。
在附图中,除非另外规定,否则贯穿多个附图相同的附图标记表示相同或相似的部件或元素。这些附图不一定是按照比例绘制的。应该理解,这些附图仅描绘了根据本申请公开的一些实施方式,而不应将其视为是对本申请范围的限制。
图1示出本申请基于BP神经网络的物理量回归的示意图。
图2示出根据本申请实施例的基于ICS-BP神经网络的传感器物理量回归方法的流程图。
图3示出使用ICS-BP神经网络拟合直线的过程示意图。
图4示出使用ICS-BP神经网络拟合直线的过程示意图。
图5示出了基于ICS-BP的光照强度回归曲线图。
下面结合附图和实施例对本申请作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅用于解释相关发明,而非对该发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与有关发明相关的部分。
需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本申请。
1基于BP神经网络的物理量回归理论基础
本申请将从理论出发分析使用BP神经网络进行物理量回归的必要性,并阐述三层BP神经网络应用于物理量回归的可行性,同时针对BP神经网络易陷于局部最小的缺陷,采用改进的布谷鸟算法对其进行优化。
1.1基于BP神经网络的物理量回归的必要性与可行性分析
常见的物理量回归方法有最小二乘法、公式法、查表法、以及三次样条插值法等。其中最小二乘法回归通过最小化误差的平方和来获得简单线性回归模型参数的估计量,但最小二乘法很难拟合非线性数据;公式法是通过已知的公式计算出AD值对应的物理量值,该方式简单快捷,能够迅速计算出物理量的值,但是在实际生活中,很难找到AD类传感器的回归公式,甚至有的传感器不存这样的公式,例如照度传感器;查表法顾名思义即根据AD值查询到对应的物理量值,此方法无需计算,但很难穷举出所有传感器的AD值对应的物理量的值;三次样条差值法通过求解三弯矩阵方程寻找曲线的函数,该方法计算方法简单,稳定性好,但它难以对误差进行估计。
以上的回归方法都是为了找到一个简明的数学公式表示AD采样值(
x)与物理量(
y)之间的关系,即
y=
f(
x),但在实际的应用中,物理量需要经过放大器、运算器、比较器等等多层的转换后才能得到AD采样值,这就导致AD采样值与物理量之间很难保持线性关系,加之传感器的种类繁多,传统的方法明显缺乏普适性,并且随着时间的推移,电路老化的问题是不可避免的,而这个问题直接影响了数据的准确度,目前有的技术通过门替换技术对电路老化进行检测预防,或者通过检测与补偿的技术来减缓甚至恢复老化效应,由此可以看出,电路的老化只能缓解与预防,而不能彻底阻止老化的发生。由此在实际生活中很难找到一个实际的数学公式准确表达出AD采样值与物理量之间的关系,而人工神经网络在线性回归分析、实验数据的补漏、非线性校正等方面表现优异,是实现物理量非线性回归的一个选择。
使用神经网络进行物理量回归,并不是通过神经网络确定数学公式中的各项系数,而是通过对现有样本数据的训练学习后确定一个神经网络结构
F,这里的网络结构代表了采样值与物理量之间的关系,通过这个网络结构,每输入一个AD采样值,都有一个预测的物理量值输出。在人工神经网络的发展中,BP神经网络是目前人工神经网络领域中应用最为广泛的模型之一,本申请将使用BP神经网络实现物理的回归,对传感器进行老化矫正,并提高回归的准确性。
理论研究表明,在BP神经网络中,若采用的激活函数是一个连续函数(如sigmoid函数),其网络输出能够以任意精度逼近一个连续函数,即令
φ为有界、非常量的单调增连续函数,
I
d
代表
d维单位超立方体。C(
I
d
)表示定义在
I
d
上的连续函数构成的集合,则给定任何函数
f∈C(
I
d
)和ε>0,存在整数
M和一组实常数α
i ,θ
i 和
w
ij
,其中
i=1,2,…,
M,
j=1,2,…,
d,其网络输出如式(1)所示。
该网络输出可任意逼近
f,即
。由此可以看出只含一个隐层的BP神经已足够作为一个通用的函数逼近器。
在数字信号处理的系统中,实际的物理量要通过传感器、比较器、放大器、AD转换器等,将电压信号转化为数字量,由于电压信号量是连续的,从而得出的模拟量也会是连续的,而三层的BP神经网络已经被证明能够逼近任何有理函数,因此理论上三层BP神经网络足以应用于物理量回归。三层BP神经网络结构
F如图1所示,主要包括了网络层数(三层),每层的单元数,各层之间连接权值,以及隐藏层和输出层的阈值等,经过训练后的神经网络模型便可以成为解决这个回归问题的“专家”。
1.2 BP神经网络优化
传统的BP神经网络通过梯度下降算法来调整权值和阈值,易限于局部极值,因此引入改进后的布谷鸟搜索算法对BP神经网络进行优化。CS算法是Xin-She Yang 和Sansh Deb于2009年提出的,该算法模拟了布谷鸟的育雏行为,结合
飞行搜索全局最优解。CS算法所需参数少,寻优能力强,容易实现,该算法基于以下三条理想化前提。
(1)每只布谷鸟每次只产一个鸟蛋,并随机选择一个鸟巢存放。
(2)具有最高质量鸟蛋的鸟巢位置会被保留到下一代。
(3)鸟巢群的数量固定,布谷鸟的鸟蛋被宿主鸟发现的概率为
P∈[0,1)。
实际上鸟巢的位置就代表了一个解,因此可以将神经网络各层的权值和阈值进行编码作为鸟巢的位置,利用
飞行和随机迁移的方式不断对鸟巢位置进行更新,直至满足迭代条件,得出全局最优的解。
式(2)中α表示步长控制量,一般取0.01,由于CS算法的局部搜索能力较差,如果采取自适应步长来优化CS算法,使得改进后的算法在迭代的前期取值较大,便于全局搜索,迭代后期取值较小,便于局部搜索,α的更新公式见式(3),其中
a
min=0.5
,
a
max=1.5
,
m
1=3
,
T表示迭代的总次数,
t表示当前迭代次数;levy(λ)飞行的轨迹可以通过式(4)获得。
式(4)中,
X
best表示适应度最高的鸟巢位置,
v~N(0,1)
,
u~N(0,
δ
2
)
,δ
2 的计算公式见式(5),其中λ=1.5,Γ(x)表示伽马函数。
其中,
P
min=0.1
,P
max=0.5,m
2=3,δ
1
,δ
2是[0,1]上的随机数,
是
t代中三个随机不重复的鸟窝位置。
ICS算法的具体实现见算法1。
2基于ICS-BP神经网络的物理量回归过程
使用ICS-BP神经网络进行物理量回归,首先需确定神经网络的激活函数和层数,其次进行训练,最后对训练出的模型进行评价。
2.1 ICS-BP算法中的激活函数与层数选择
由于模拟量是连续变化的,由1.1节可知激活函数是一个连续的函数时,三层的BP神经输出能够以任意精度逼近一个连续函数,因此激活函数需要选取连续型的函数,又由于物理量的取值范围跨度较大,需在训练前需对数据进行归一化处理,有的激活函数不适用于对归一化后的数据进行训练,因此本申请选取了最常用的Sigmoid函数作为激活函数。
经证明三层的BP神经网络经已足够被用来作为一个通用的函数逼近器,因此本申请选用一层隐藏层,并在此结构上进行后续的测试和应用。
2.2 ICS-BP神经网络模型训练
1. 采集训练数据
选取的训练样本需具有广泛性、代表性,通过这些样本能够找到输入量与输出量之间可能存在的关系。首先样本量需适当,若样本量不足,训练出的模型不具备代表性,可能还会出现过拟合的情况,如果选取的样本过多,会导致运算量增大,训练时间过长,甚至导致数据过于具体而失去了其特征。其次样本分布需要均匀,即在任意一个区间内,样本的密度大致相同,例如温度物理量回归,在0~100℃间的每10℃区间选取1~2个温度作为样本量,大概选取10-20条数据。样本的选取可以使用10
EPV经验法,即样本量是自变量个数10倍以上的基础上,再根据样本的取值范围,选取适量的训练样本数。
2. 确定网络结构与训练
在进行模型训练之前需要对采集的样本数据进行归一化处理,接着使用1.2节中介绍的ICS算法获得全局最优的权值和阈值,并初始化BP神经网络,在确定ICS-BP神经网络的学习参数,包括学习率、隐藏层神经元数、迭代截止条件(精度误差)后便可以对模型进行训练。
3. 回归预测
上位机完成模型训练任务后,可以将生成的模型按图2所示的结构体形式存入终端。同时将ICS-BP神经网络结构体和预测函数封装成软件构件,以便在AD采样值回归时调用,在终端完成了物理量的回归预测。
2.3模型性能评价指标
在完成数据集的训练后,需有多个指标来评定模型训练的好坏。本申请选取了相关系数(通常用R表示)、剩余标准差、以及平均绝对误差来评价模型好坏,并用
表示预测值,
表示真实值,
表示真实值的均值,m表示样本数量。
相关系数又称拟合优度、决定系数、测定系数等,该指标代表了回归线对观测值的拟合度,
R越大,拟合效果越好,
R的最优值为1,计算公式见式(8)。
剩余标准差又称均方根误差,用于计算真实值与测量值之间的偏差,均方根误差越小,表明模型的结果越好,计算公式见式(9)。
平均绝对误差指观测值与真实值的误差的绝对值的平均值,该指标能更好地反映出预测值误差的实际情况,计算公式见式(10)。
由于数据归一化后只会对数据进行缩放,并不会改变数据的好坏,因此为了便于计算和比较,计算剩余标准差和均方差的数据均采用归一化后的数据。
3基于ICS-BP神经网络的物理量回归实践分析
为了更好地验证ICS-BP神经网络能够应用于物理量回归,分别选取了线性函数和非线性函数对ICS-BP神经网络用于回归预测进行实践验证。
3.1拟合线性函数
利用随机数的方式产生一元一次函数,以
y=-0.25x+16.74为例,设定
x∈[0,100],训练集见表1。
ICS-BP网络结构选取1-8-1,学习率设为0.1,在不同误差精度下进行实验,每组进行100次实验并将结果取平均值,具体的训练结果见表2所示。
图3中展示了使用ICS-BP神经网络拟合线性函数的过程,结合图3和表2可以看出精度误差越小,所需训练的时间越长,模型性能指标也更好,即拟合曲线不断的逼近原直线,且拟合度越来越高,剩余标准差和平均绝对误差也不断减少,但随着总体误差不断变小,模型性能提高的愈加缓慢。
3.2拟合非线性函数
根据热敏电阻阻值与温度的公式,经转换得到非线性函数
,使用该函数进行拟合非线性函数实验,设定x∈[0,100],训练集见表3。
与拟合线性函数的过程类似,ICS-BP网络结构选取1-8-1,学习率设为0.1,每组进行100次实验并将结果取平均值,拟合过程如图4所示。
表4是在不同精度误差下的曲线拟合结果,结合图4和表4可以看出,随着训练时间的增加,总体误差在不断的下降,拟合曲线也不断逼近非线性函数,相关系数也不断提升,逐渐接近于1,剩余标准差和均值误差则不断减少。
结合线性函数和非线性函数的拟合结果分析,随着训练时间越长,相关系数会不断提高,全局误差和剩余标准差也不断减小,回归曲线也随着训练时间的增加不断逼近原函数图像,由此说明ICS-BP神经网络能够拟合线性函数和非线性函数。
4 基于ICS-BP神经网络的物理量回归实例应用
前文从理论和实践两个方面阐明了ICS-BP神经网络可以应用于物理量回归,本小节将以照度传感器和温度传感器为例,将ICS-BP神经网络用于处理实际问题。
4.1训练样本与学习参数设置
在神经网络学习中,训练样本以及学习参数的设置直接影响了模型训练的结果,在很多BP神经网络的应用中,很少谈及如何选取样本数据以及设置参数。但在实际生活中如需使用BP网络进行预测回归,用户首先需要学习神经网络以及了解学习率、隐藏层节点等一系列知识,因此本小节将通过实验来设定适合本系统中的温度和照度回归的一系列学习参数,减少用户对学习参数的设定从而降低使用门槛。
1. 样本采集
将选取的温度传感器和照度传感器接入MCU,利用UART串口将AD采样值滤波后输出,待AD值稳定后,再使用专业工具测得当前环境的实际值,从而获得样本数据,温度回归的训练集见表5,照度回归的训练集见表6。
2. 自适应学习率
传统的BP神经网络常常将学习率设置为常数,如果学习率设置的偏大,可能导致参数在最优解附近振荡、模型无法收敛等问题;如果学习率偏小则会导致训练次数增加、模型收敛的速度很缓慢甚至无法训练。由于本系统可能会涉及多个种类的传感器回归问题,为每一类型的传感器都设计一个合适的学习率,其工作量巨大且不易实现,因此采用一种自适应学习率的方式。自适应学习率不使用固定的学习率,而是在一定范围内对学习率进行动态调节。在训练的过程中,当误差不断减少,说明此时的修正方向正确,可以适当地增大学习率,若误差增加超过一定的比例,则立即降低学习率,从而提高训练模型的稳定性,本申请按照公式(11)来动态调节学习率,其中η
(t)表示第
t次的学习率,且η
(0)=0.1;E
(t)表示
t次的总体误差。
将迭代截止条件设置为总体误差小于0.001,分别使用温度和照度的回归数据集,对采用与不采用自适应学习率进行对比实验,每组实验进行100次,网络结构选取1-10-1,实验结果见表7所示。从表中可以看出,采用自适应学习率进行训练并没有降低神经网络模型的性能,并且有助于提高训练速度。
3. 隐藏层节点数
隐藏层节点数量的设置也会对训练效果产生直接的影响,如果数目太少,会导致所获取的信息不多,出现欠拟合的状态;若数目太多,不仅会增加训练时间,还容易出现过拟合的状况,导致模型的泛化能力差。隐藏层神经元的数目与问题的要求、输入和输出层神经元的数量都有关系。本申请依据经验公式
(
h:隐藏层神经元数;
m:输入层单元数;
n:输出层单元数;
l:1-10之间的常数)得出2≤
h≤12,再此基础,利用试错法确定隐藏层节点数,选取本系统中的两种物理量(温度、照度)的训练集,在采取自适应学习率的条件下,对2≤
h≤12进行测试,每组实验进行100次,结果取平均值,如表8所示。
经实验发现,在自适应学习率条件下,隐藏层单元数设置为2、3时出现了欠拟合的状况,当隐藏层数设置为4、5、6时,训练模型的稳定性较差,经常出现刚开始训练时的总体误差下降缓慢的情况。对温度回归数据集训练时,当隐藏层的神经元数量超过9个时,模型的相关系数提升低于0.00001;使用照度回归数据集训练时,隐藏层的神经元个数大于10时,模型的相关系数提升低于0.00001,且RMSE和MAE减少缓慢,基于以上分析,设定隐藏层的神经元数为10个。
4.2实例及结果分析
以照度回归为例,若采用最小二乘法对照度进行回归,将无法确定采样值与照度之间的指数关系,而使用ICS-BP神经网络进行回归只需要对样本进行学习,无需考虑AD值与物理量之间的指数关系。训练数据采用4.1节中的照度回归数据集,使用自适应学率,隐藏层单元数设置为10,将总体误差精度小于0.0001作为迭代终止条件,回归曲线如图5所示。
经过实际拟合发现,照度回归曲线可以使用式(12)进行统一表达,式中的指数部分求和为10,表明ICS-BP网络的隐层单元个数均为10。
其中ICS-BP神经网络模型的各层参数如表9所示(结果保留五位小数)。
经ICS-BP神经网络对照度数据集进行训练后得到的网络模型在测试集上进行验证,并与基于BP神经网络的物理量回归结果进行对比,结果见表10。
从表10中可知,使用ICS算法优化的BP神经网络并不会影响物理量回归结果的准确性,并且相较于照度的测量范围而言,其误差在可接受的范围内。
本申请分别从理论和实践出发,验证了三层ICS-BP神经网络在物理量回归方面的可行性和优越性。与其他回归方法不同的是,利用ICS-BP神经网络进行回归没有得到采样值与实际物理量之间的一个具体的数学公式,但网络模型的结构是确定的,它能够成为解决该回归问题的“专家”,并且可以建立统一数学表达。对于很难寻找明确的数学公式甚至根本找不到数学公式的回归问题,使用ICS-BP神经网络进行回归,只需采集训练样本数据,即可自主进行动态物理量回归并实现传感器老化矫正。
Claims (10)
- 一种基于ICS-BP神经网络的传感器物理量回归方法,其特征在于,包括:确定ICS-BP神经网络的激活函数和层数;采集训练数据,对所述ICS-BP神经网络进行训练;使用训练后的ICS-BP神经网络对传感器物理量进行回归预测。
- 根据权利要求1所述的方法,其特征在于,所述激活函数为Sigmoid函数,所述神经网络的层数为三层,包括一层隐藏层。
- 根据权利要求1所述的方法,其特征在于,所述采集训练数据时,样本的选取使用10 EPV经验法,即样本量是自变量个数10倍以上的基础上,再根据样本的取值范围,选取一定量的训练样本数。
- 根据权利要求3所述的方法,其特征在于,在对所述ICS-BP神经网络进行训练之前,包括:对采集的样本数据进行归一化处理;使用ICS算法获得全局最优的权值和阈值,并初始化BP神经网络;确定ICS-BP神经网络的学习参数,包括学习率、隐藏层神经元数、迭代截止条件。
- 根据权利要求3所述的方法,其特征在于,在对所述ICS-BP神经网络进行训练之后,包括:选取相关系数、剩余标准差、以及平均绝对误差中的至少一种评价所述ICS-BP神经网络的质量。
- 根据权利要求1-5任一项所述的方法,其特征在于,所述传感器为照度传感器或温度传感器。
- 根据权利要求6所述的方法,其特征在于,将所述温度传感器和照度传感器接入MCU,利用UART串口将AD采样值滤波后输出,待AD值稳定后,再测得当前环境的实际值,从而获得样本数据。
- 根据权利要求7所述的方法,其特征在于,在对所述ICS-BP神经网络进行训练时,按照以下公式(11)来动态调节学习率:其中η (t)表示第 t次的学习率,且η (0)=0.1;E (t)表示 t次的总体误差 。
- 根据权利要求8所述的方法,其特征在于,所述ICS-BP神经网络的隐藏层的神经元数为10个。
- 根据权利要求8或9所述的方法,其特征在于,所述回归预测得到照度回归曲线,使用式(12)进行统一表达:其中ICS-BP神经网络模型的各层参数如下:w j表示输入层到隐藏层权值,o j为输入层到隐藏层阈值,v j为隐藏层到输出层权值,r 1为隐藏层到输出层阈值,y为照度值,x为照度的AD采样值。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210625753.6 | 2022-06-02 | ||
CN202210625753.6A CN115034361A (zh) | 2022-06-02 | 2022-06-02 | 一种基于ics-bp神经网络的传感器物理量回归方法 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2023231204A1 true WO2023231204A1 (zh) | 2023-12-07 |
Family
ID=83123589
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2022/116052 WO2023231204A1 (zh) | 2022-06-02 | 2022-08-31 | 一种基于 ics-bp 神经网络的传感器物理量回归方法 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN115034361A (zh) |
WO (1) | WO2023231204A1 (zh) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117686555A (zh) * | 2024-02-04 | 2024-03-12 | 南京邮电大学 | 一种基于机器学习的lc湿度传感器漂移补偿方法 |
CN117708707A (zh) * | 2024-02-06 | 2024-03-15 | 国网安徽省电力有限公司营销服务中心 | 大数据下台区线损率异常智能预警方法和系统 |
CN118016218A (zh) * | 2024-04-09 | 2024-05-10 | 山东新旋工业装备科技有限公司 | 用于耐高温旋转接头材料性能数据智能分析方法 |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111291898A (zh) * | 2020-02-17 | 2020-06-16 | 哈尔滨工业大学 | 一种多任务稀疏贝叶斯极限学习机回归方法 |
CN111507499A (zh) * | 2019-12-05 | 2020-08-07 | 阿里巴巴集团控股有限公司 | 预测用模型的构建方法、测试方法、装置及系统 |
US20210133567A1 (en) * | 2019-10-30 | 2021-05-06 | Robert Bosch Gmbh | Determining an output signal by aggregating parent instances |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109925992B (zh) * | 2019-04-23 | 2021-05-25 | 辽宁工业大学 | 一种基于多模块分阶段的连续搅拌在线监测方法 |
-
2022
- 2022-06-02 CN CN202210625753.6A patent/CN115034361A/zh active Pending
- 2022-08-31 WO PCT/CN2022/116052 patent/WO2023231204A1/zh unknown
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20210133567A1 (en) * | 2019-10-30 | 2021-05-06 | Robert Bosch Gmbh | Determining an output signal by aggregating parent instances |
CN111507499A (zh) * | 2019-12-05 | 2020-08-07 | 阿里巴巴集团控股有限公司 | 预测用模型的构建方法、测试方法、装置及系统 |
CN111291898A (zh) * | 2020-02-17 | 2020-06-16 | 哈尔滨工业大学 | 一种多任务稀疏贝叶斯极限学习机回归方法 |
Non-Patent Citations (2)
Title |
---|
PAN JUN-HONG; WANG YI-HUAI;WU WEI: "Physical Quantity Regression Method Based on Optimized BP Neural Network", COMPUTER SCIENCE, KEXUE JISHU WENXIAN CHUBANSHE CHONGQING FENSHE, CN, vol. 45, no. 12, 31 December 2018 (2018-12-31), CN , pages 170 - 176, XP009550988, ISSN: 1002-137X * |
YIHUAI WANG ; YONG SUN ; CHUNPING LIU ; YUN GUO: "An Algorithm for Learning Principal Curves with Explicit Formulation Based on Neural Network", IMAGE AND SIGNAL PROCESSING, 2008. CISP '08. CONGRESS ON, IEEE, PISCATAWAY, NJ, USA, 27 May 2008 (2008-05-27), Piscataway, NJ, USA , pages 399 - 404, XP031286586, ISBN: 978-0-7695-3119-9 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117686555A (zh) * | 2024-02-04 | 2024-03-12 | 南京邮电大学 | 一种基于机器学习的lc湿度传感器漂移补偿方法 |
CN117686555B (zh) * | 2024-02-04 | 2024-05-14 | 南京邮电大学 | 一种基于机器学习的lc湿度传感器漂移补偿方法 |
CN117708707A (zh) * | 2024-02-06 | 2024-03-15 | 国网安徽省电力有限公司营销服务中心 | 大数据下台区线损率异常智能预警方法和系统 |
CN117708707B (zh) * | 2024-02-06 | 2024-05-17 | 国网安徽省电力有限公司营销服务中心 | 大数据下台区线损率异常智能预警方法和系统 |
CN118016218A (zh) * | 2024-04-09 | 2024-05-10 | 山东新旋工业装备科技有限公司 | 用于耐高温旋转接头材料性能数据智能分析方法 |
Also Published As
Publication number | Publication date |
---|---|
CN115034361A (zh) | 2022-09-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2023231204A1 (zh) | 一种基于 ics-bp 神经网络的传感器物理量回归方法 | |
CN110659722B (zh) | 基于AdaBoost-CBP神经网络的电动汽车锂离子电池健康状态估算方法 | |
CN106022521B (zh) | 基于Hadoop架构的分布式BP神经网络的短期负荷预测方法 | |
WO2021089013A1 (zh) | 空间图卷积网络的训练方法、电子设备及存储介质 | |
CN111795761B (zh) | 一种基于强化学习模型的预测机柜进风温度的方法 | |
CN110990784A (zh) | 一种基于梯度提升回归树的烟支通风率预测方法 | |
CN110991721A (zh) | 基于改进经验模态分解和支持向量机的短期风速预测方法 | |
CN111239137B (zh) | 基于迁移学习与自适应深度卷积神经网络的谷物质量检测方法 | |
CN110244077B (zh) | 一种热式风速传感器恒功率调节与精度补偿方法 | |
CN111640099A (zh) | 一种确定图像质量的方法、装置、电子设备及存储介质 | |
WO2024045351A1 (zh) | Cmos器件寿命预测方法、装置、电子设备及介质 | |
CN110555231A (zh) | 一种动力学仿真模型修正方法 | |
CN116432543B (zh) | 功率半导体模块剩余寿命预测方法、终端设备及存储介质 | |
US20210117803A1 (en) | Executing a genetic algorithm on a low-power controller | |
CN113255181A (zh) | 基于深度学习的传热学反问题识别方法及装置 | |
CN114154401A (zh) | 基于机器学习和观测数据的土壤侵蚀模数计算方法及系统 | |
CN114330814A (zh) | 一种基于vmd分解和改进双层bilstm网络的短期负荷预测方法 | |
CN117709392A (zh) | 一种自动化多通道adc芯片性能评估测试方法及系统 | |
WO2018054198A1 (zh) | 一种集成电路器件神经网络建模样本选择方法及装置 | |
CN113095513A (zh) | 双层公平联邦学习方法、装置和存储介质 | |
CN112098782A (zh) | 一种基于神经网络的moa绝缘状态检测方法及系统 | |
CN110765420A (zh) | 一种基于pso-fi的地面自动气象站气温观测资料质量控制方法 | |
CN116046018A (zh) | 一种应用于mems陀螺仪的温度补偿方法 | |
CN115983320A (zh) | 一种基于深度强化学习的联邦学习模型参数量化方法 | |
CN113804833A (zh) | 基于凸集投影和极限学习机的电子鼻漂移通用校准方法 |
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: 22944515 Country of ref document: EP Kind code of ref document: A1 |