CN110738006A - High-precision resistance measurement algorithm based on GA-BP neural network algorithm - Google Patents
High-precision resistance measurement algorithm based on GA-BP neural network algorithm Download PDFInfo
- Publication number
- CN110738006A CN110738006A CN201910889431.0A CN201910889431A CN110738006A CN 110738006 A CN110738006 A CN 110738006A CN 201910889431 A CN201910889431 A CN 201910889431A CN 110738006 A CN110738006 A CN 110738006A
- Authority
- CN
- China
- Prior art keywords
- neural network
- algorithm
- training
- network
- layer
- 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.)
- Pending
Links
- 238000013528 artificial neural network Methods 0.000 title claims abstract description 44
- 238000005259 measurement Methods 0.000 title claims abstract description 18
- 238000012549 training Methods 0.000 claims abstract description 29
- 210000000349 chromosome Anatomy 0.000 claims description 13
- 230000006870 function Effects 0.000 claims description 11
- 210000002569 neuron Anatomy 0.000 claims description 7
- 230000004913 activation Effects 0.000 claims description 6
- 230000000644 propagated effect Effects 0.000 claims description 6
- 238000012360 testing method Methods 0.000 claims description 5
- 230000002068 genetic effect Effects 0.000 claims description 4
- 238000012545 processing Methods 0.000 claims description 4
- 230000035772 mutation Effects 0.000 claims description 2
- 238000000034 method Methods 0.000 description 7
- 230000008569 process Effects 0.000 description 5
- 238000004364 calculation method Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 2
- 238000002474 experimental method Methods 0.000 description 2
- 238000005457 optimization Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000009530 blood pressure measurement Methods 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000008303 genetic mechanism Effects 0.000 description 1
- 238000009776 industrial production Methods 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01K—MEASURING TEMPERATURE; MEASURING QUANTITY OF HEAT; THERMALLY-SENSITIVE ELEMENTS NOT OTHERWISE PROVIDED FOR
- G01K7/00—Measuring temperature based on the use of electric or magnetic elements directly sensitive to heat ; Power supply therefor, e.g. using thermoelectric elements
- G01K7/16—Measuring temperature based on the use of electric or magnetic elements directly sensitive to heat ; Power supply therefor, e.g. using thermoelectric elements using resistive elements
- G01K7/22—Measuring temperature based on the use of electric or magnetic elements directly sensitive to heat ; Power supply therefor, e.g. using thermoelectric elements using resistive elements the element being a non-linear resistance, e.g. thermistor
- G01K7/24—Measuring temperature based on the use of electric or magnetic elements directly sensitive to heat ; Power supply therefor, e.g. using thermoelectric elements using resistive elements the element being a non-linear resistance, e.g. thermistor in a specially-adapted circuit, e.g. bridge circuit
- G01K7/25—Measuring temperature based on the use of electric or magnetic elements directly sensitive to heat ; Power supply therefor, e.g. using thermoelectric elements using resistive elements the element being a non-linear resistance, e.g. thermistor in a specially-adapted circuit, e.g. bridge circuit for modifying the output characteristic, e.g. linearising
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01L—MEASURING FORCE, STRESS, TORQUE, WORK, MECHANICAL POWER, MECHANICAL EFFICIENCY, OR FLUID PRESSURE
- G01L1/00—Measuring force or stress, in general
- G01L1/20—Measuring force or stress, in general by measuring variations in ohmic resistance of solid materials or of electrically-conductive fluids; by making use of electrokinetic cells, i.e. liquid-containing cells wherein an electrical potential is produced or varied upon the application of stress
- G01L1/22—Measuring force or stress, in general by measuring variations in ohmic resistance of solid materials or of electrically-conductive fluids; by making use of electrokinetic cells, i.e. liquid-containing cells wherein an electrical potential is produced or varied upon the application of stress using resistance strain gauges
- G01L1/2268—Arrangements for correcting or for compensating unwanted effects
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01R—MEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
- G01R27/00—Arrangements for measuring resistance, reactance, impedance, or electric characteristics derived therefrom
- G01R27/02—Measuring real or complex resistance, reactance, impedance, or other two-pole characteristics derived therefrom, e.g. time constant
-
- 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/04—Architecture, e.g. interconnection topology
- G06N3/044—Recurrent networks, e.g. Hopfield networks
-
- 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
Landscapes
- Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- Artificial Intelligence (AREA)
- Biomedical Technology (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Life Sciences & Earth Sciences (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- Nonlinear Science (AREA)
- Measurement Of Resistance Or Impedance (AREA)
Abstract
The invention discloses high-precision resistance measurement algorithms based on GA-BP neural network algorithms, which achieve function fitting of nonlinear relation between measurement voltage and resistance value of a measured resistance by training a neural network, wherein more accurate global optimal solutions are obtained by iteration through the GA algorithm before parameters of the BP network are trained, then the optimal solutions of a model are obtained by training the BP neural network, the obtained network parameters are solidified on a single chip microcomputer, and the high-precision resistance value can be directly measured through an embedded system.
Description
Technical Field
The invention belongs to the field of sensor signal processing, and relates to high-precision resistance measurement algorithms based on GA-BP neural network algorithms.
Background
In the industrial production process, many large-scale equipment need to monitor parameters such as temperature and pressure during operation, most of the commonly used temperature monitoring schemes adopt PT100 and PT1000 thermal resistors, piezoresistors are usually adopted during pressure measurement, and a measurement system needs to detect the resistance values of the sensitive resistors so as to achieve the purpose of detecting the parameters such as temperature and pressure.
The BP neural network is feedforward networks trained according to error back propagation and mainly applied to data fitting, function approximation and the like, the BP neural network algorithm is forward propagation type neural network which has a network structure with three or more layers, each layer is composed of a plurality of neurons, the neurons between the layers are connected in a full connection mode, namely, each neurons are connected with all the neurons of the lower layer, which is the main application of the BP neural network is nonlinear function fitting, the BP neural network can be calculated through given data, network parameters are adjusted step by step according to the principle of reducing errors of expected output and actual output, so that the network can achieve nonlinear function fitting on the given data.
Genetic Algorithm (GA) is calculation models simulating natural selection and genetic mechanism of Darwinian biological evolution theory and searching for optimal solutions by simulating the natural evolution process, the GA algorithm has the advantages that local optimal solutions cannot be trapped in the iteration process and can be searched globally, but solutions obtained by iteration of the GA algorithm oscillate near the optimal solutions, so that accurate optimal solutions are difficult to obtain.
Disclosure of Invention
In order to solve the problems in the prior art, the invention provides high-precision resistance measurement algorithms based on GA-BP neural network algorithm, and solves the problem of low precision in the prior art of measuring precision resistance.
The technical scheme of the invention is as follows:
high-precision resistance measurement algorithms based on GA-BP neural network algorithm, which achieves function fitting of nonlinear relation between measurement voltage and resistance value of the measured resistance by training the neural network, before training parameters of the BP network, iteration is performed by the GA algorithm to obtain relatively accurate global optimal solutions, then optimal solutions of a model are obtained by training the BP neural network, obtained network parameters are solidified on a single chip microcomputer, and the high-precision resistance value can be directly measured by an embedded system.
The GA-BP neural network algorithm is realized on matlab, and specifically comprises the following steps:
(1) importing pre-measured data, dividing the data into a training set and a testing set, and performing -based processing on the data;
(2) randomly generating n populations, wherein the chromosome coding of each population adopts floating point number coding, the number of coded chromosomes is 19, wherein the first 6 represent the weight from an input layer to a hidden layer, the 7 th to the 12 th represent the weight from the hidden layer to an output layer, the 13 th to the 18 th represent the bias from the input layer to the hidden layer, and the 19 th represents the bias from the hidden layer to the output layer;
(3) calculating the fitness of the n samples to obtain the probability that the n samples can be propagated;
(4) selecting 2 parents according to the probability that each sample can be propagated, and randomly exchanging chromosomes of the two parents to obtain new filial generations;
(5) repeating the step 4 n times to obtain new filial generations;
(6) carrying out mutation on the chromosomes of the offspring, namely randomly increasing between (-0.09, 0.09) random numbers;
(7) repeating the step 2 to the step 6 for N times, namely performing N iterations of the genetic algorithm to obtain an approximate global optimal solution of the GA algorithm after the operation is finished;
(8) establishing BP neural networks, wherein the number of neurons of an input layer, a hidden layer and an output layer of the networks is 1, 6 and 1 respectively, an activation function from the input layer to the hidden layer is tansig, an activation function from the hidden layer to the output layer is sigmod, and the network parameters obtained in the step (7) are used as initialization parameters of the BP neural networks;
(9) setting a learning rate lr and a target precision e, and starting training a BP neural network;
(10) and obtaining the network parameters of the optimal solution.
Preferably, N is 60 and N is 50.
The invention has the beneficial effects that:
the invention combines the two algorithms at , firstly uses GA algorithm to obtain more accurate global optimal solutions, and then trains BP neural network, thereby obtaining the global optimal solution.
1) Compared with a linear fitting method, the GA-BP algorithm reduces the measurement error by steps, and the measurement error of the GA-BP algorithm is about 0.1%;
2) compared with the common BP neural network, the GA-BP algorithm can reduce the iteration number of training.
Drawings
FIG. 1 is a comparison of GA-BP network and BP network iteration count;
FIG. 2GA-BP network test set relative error;
FIG. 3 is a diagram of the mean square error of each iteration of the GA algorithm during pre-training;
FIG. 4 fitness of each iteration of the GA algorithm during pre-training;
fig. 5N is 50, N is 100, mean square error of GA algorithm per iteration;
fig. 6N is 50, and N is 100, the fitness of GA algorithm per iteration;
FIG. 7 mean square error during BP network training;
FIG. 8 is the linearity after BP network training is over;
fig. 9 shows the results of the non-linear fit.
Detailed Description
The present invention will be described in detail with reference to the accompanying drawings.
The invention relates to high-precision resistance measurement algorithms based on GA-BP neural network algorithms, which has the main idea that N populations are randomly generated and subjected to N iterations, the numerical value of the chromosome code of each population is decoded in the process of each iteration to obtain the parameter value of the corresponding neural network, the fitness F of each population is calculated by using two norms of the output Tout of the neural network and given data O, then the probability of selecting each population is generated according to the calculation result of the fitness, two populations are randomly selected according to the probability of each population, the higher the fitness of each population is, the higher the probability of selecting is, the new population can be generated by the selected population, and meanwhile, the new population can generate random variation.
The GA-BP neural network algorithm is realized on matlab, and the specific algorithm flow of the part is as follows:
1. and importing pre-measured data, dividing the data into a training set and a testing set, and performing processing on the data.
2. And randomly generating n populations, wherein the chromosome coding of each population adopts floating point number coding, the number of the coded chromosomes is 19, wherein the first 6 represent the weight from the input layer to the hidden layer, the 7 th to the 12 th represent the weight from the hidden layer to the output layer, the 13 th to the 18 th represent the bias from the input layer to the hidden layer, and the 19 th represents the bias from the hidden layer to the output layer.
3. And calculating the fitness of the n samples to obtain the probability that the n samples can be propagated.
4. According to the probability that each sample can be propagated, 2 parents are selected as parents, and chromosomes of the two parents are randomly exchanged to obtain new filial generations.
5. Repeating the step 4 n times to obtain new filial generations.
6. The offspring chromosomes are mutated, namely random numbers of (-0.09, 0.09) are randomly increased.
7. And repeating the step 2 to the step 6 for N times, namely performing N iterations of the genetic algorithm to obtain an approximate global optimal solution of the GA algorithm after the operation is finished.
8. Establishing BP neural networks, wherein the number of neurons of an input layer, a hidden layer and an output layer of the network is 1, 6 and 1 respectively, an activation function from the input layer to the hidden layer is tansig, and an activation function from the hidden layer to the output layer is sigmod, and taking the network parameters obtained in the step 7 as initialization parameters of the BP neural networks.
9. And setting the learning rate lr and the target precision e, and starting to train the BP neural network.
10. And obtaining the network parameters of the optimal solution.
In order to obtain the number N of the population and the number N of iterations that make the performance of the whole network excellent, the design passes through a plurality of pre-training experiments, in the training experiments, the number N of iterations is 500, as can be seen from fig. 3-4, after the number of iterations is 100, although the fitness is improved, the improved value is not changed greatly, the number N of iterations is initially 100, and the number N of the population is 50, as can be seen from fig. 5-6, when the number of iterations reaches about 60, the value of the mean square error is stabilized around 0.063 in the GA algorithm, the maximum value of the fitness in each iterations has a step-like change, and after the 70 th iteration, the maximum value of the fitness tends to 16.
And (3) giving the approximate global optimal weight calculated by the GA algorithm to a neural network, setting the learning rate lr to be 0.01, and setting the target precision e to be 10-7The training results obtained are shown in fig. 7-8 below, from which it can be seen that the performance of the entire network reaches 9.98 x 10 after 725 iterations-8The correlation coefficient R of the network training is 1, and it can be seen from the fitting effect shown in fig. 9 that the pre-trained data are uniformly distributed on the smooth fitting curve, and the training effect is good.
The network was trained using the GA-BP algorithm, and the 10 training results were recorded and compared to the results without GA algorithm optimization, as shown in fig. 1. The results show that the iteration times of GA-BP neural network training are about 1000 times, while the iteration times of the BP neural network without the GA optimization algorithm in the training process are more than 20000 times, and the iteration times of the GA-BP neural network algorithm in the training process are obviously reduced.
The trained GA-BP neural network is used for verifying the performance of the network by using a test set, and the obtained result is shown in figure 2, wherein most of the measurement errors are distributed below 0.1%, and the performance of the network is better.
The network parameters obtained from training are shown in table 1 below:
TABLE 1 network parameter training results
In table 2, 5 sets of data of input resistance and output analog voltage were randomly measured, and the following measurement results were obtained by using theoretical formula calculation, linear fitting, and GA-BP neural network, respectively, from which it can be seen that, compared with the linear fitting method, the GA-BP algorithm reduced the measurement error by steps, and the measurement error of the GA-BP algorithm was about 0.1%.
TABLE 2 theoretical formula calculation, Linear fitting, GA-BP neural network comparison
Claims (3)
- The high-precision resistance measuring algorithm based on GA-BP neural network algorithm is characterized by that it utilizes training neural network to implement function fitting of nonlinear relation between measuring voltage and resistance value of resistor to be measured, before training parameters of BP network, the GA algorithm is used to make iteration to obtain more accurate global optimum solutions, then the BP neural network training is used to obtain optimum solution of model, then the obtained network parameters are solidified on the chip microprocessor, and the high-precision resistance value can be directly measured by means of embedded system.
- 2. A high accuracy resistance measurement algorithm based on GA-BP neural network algorithm according to claim 1, wherein the GA-BP neural network algorithm is implemented on matlab, specifically comprising the following steps:(1) importing pre-measured data, dividing the data into a training set and a testing set, and performing -based processing on the data;(2) randomly generating n populations, wherein the chromosome coding of each population adopts floating point number coding, the number of coded chromosomes is 19, wherein the first 6 represent the weight from an input layer to a hidden layer, the 7 th to the 12 th represent the weight from the hidden layer to an output layer, the 13 th to the 18 th represent the bias from the input layer to the hidden layer, and the 19 th represents the bias from the hidden layer to the output layer;(3) calculating the fitness of the n samples to obtain the probability that the n samples can be propagated;(4) selecting 2 parents according to the probability that each sample can be propagated, and randomly exchanging chromosomes of the two parents to obtain new filial generations;(5) repeating the step 4 n times to obtain new filial generations;(6) carrying out mutation on the chromosomes of the offspring, namely randomly increasing between (-0.09, 0.09) random numbers;(7) repeating the step 2 to the step 6 for N times, namely performing N iterations of the genetic algorithm to obtain an approximate global optimal solution of the GA algorithm after the operation is finished;(8) establishing BP neural networks, wherein the number of neurons of an input layer, a hidden layer and an output layer of the networks is 1, 6 and 1 respectively, an activation function from the input layer to the hidden layer is tansig, an activation function from the hidden layer to the output layer is sigmod, and the network parameters obtained in the step (7) are used as initialization parameters of the BP neural networks;(9) setting a learning rate lr and a target precision e, and starting training a BP neural network;(10) and obtaining the network parameters of the optimal solution.
- 3. A high accuracy resistance measurement algorithm based on GA-BP neural network algorithm according to claim 2, wherein N-60, N-50.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910889431.0A CN110738006A (en) | 2019-09-19 | 2019-09-19 | High-precision resistance measurement algorithm based on GA-BP neural network algorithm |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910889431.0A CN110738006A (en) | 2019-09-19 | 2019-09-19 | High-precision resistance measurement algorithm based on GA-BP neural network algorithm |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110738006A true CN110738006A (en) | 2020-01-31 |
Family
ID=69268117
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910889431.0A Pending CN110738006A (en) | 2019-09-19 | 2019-09-19 | High-precision resistance measurement algorithm based on GA-BP neural network algorithm |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110738006A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111783940A (en) * | 2020-06-05 | 2020-10-16 | 广西民族大学 | Method for reducing fire false alarm rate based on GA-BP neural network algorithm |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110059803A (en) * | 2019-04-03 | 2019-07-26 | 东华大学 | A kind of temperature-compensation method of the optical fibre displacement sensor based on GA-BP |
-
2019
- 2019-09-19 CN CN201910889431.0A patent/CN110738006A/en active Pending
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110059803A (en) * | 2019-04-03 | 2019-07-26 | 东华大学 | A kind of temperature-compensation method of the optical fibre displacement sensor based on GA-BP |
Non-Patent Citations (1)
Title |
---|
李小珉;尹明;: "基于遗传算法的BP神经网络电子***状态预测方法研究", 电子测量技术 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111783940A (en) * | 2020-06-05 | 2020-10-16 | 广西民族大学 | Method for reducing fire false alarm rate based on GA-BP neural network algorithm |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104361414B (en) | Power transmission line icing prediction method based on correlation vector machine | |
CN111414977A (en) | Weighted integration temperature sensitive point combination selection method for machine tool spindle thermal error modeling | |
CN110689171A (en) | Turbine health state prediction method based on E-LSTM | |
CN114109859B (en) | Centrifugal pump performance neural network prediction method without flow sensing | |
CN108920812A (en) | A kind of machining surface roughness prediction technique | |
CN110083125B (en) | Machine tool thermal error modeling method based on deep learning | |
CN112926265A (en) | Atmospheric porous probe measurement calibration method based on genetic algorithm optimization neural network | |
CN108760592B (en) | Fly ash carbon content online measurement method based on BP neural network | |
CN111191726B (en) | Fault classification method based on weak supervision learning multilayer perceptron | |
CN109460621A (en) | Based on the gas turbine blades fault detection method for improving neural network | |
CN114166318A (en) | Ultrasonic water meter flow data calibration method based on deep learning | |
CN117390591B (en) | Operation monitoring method and system for coal conveying belt sampling machine based on electric parameter analysis | |
CN114897277B (en) | Burst-type landslide displacement prediction method based on LSTM | |
CN110796281A (en) | Wind turbine state parameter prediction method based on improved deep belief network | |
CN110738006A (en) | High-precision resistance measurement algorithm based on GA-BP neural network algorithm | |
CN110909492B (en) | Sewage treatment process soft measurement method based on extreme gradient lifting algorithm | |
CN113707228B (en) | Wet flue gas desulfurization optimization method based on LightGBM algorithm | |
CN105300868A (en) | Detection method for air permeability of perforated tipping paper used in tobacco industry | |
CN103778327A (en) | Curve fitting method | |
CN113077110A (en) | GRU-based harmonic residual segmented tide level prediction method | |
CN114186771A (en) | Hybrid regularization random configuration network industrial process operation index estimation method | |
CN112581311A (en) | Method and system for predicting long-term output fluctuation characteristics of aggregated multiple wind power plants | |
CN112685954A (en) | Method and device for predicting wind speed and fan rotating speed of automobile environment wind tunnel | |
CN117556365B (en) | Method and device for training process data drift detection model and drift detection method and device | |
CN111707795B (en) | Method and system for monitoring Biochemical Oxygen Demand (BOD) of surface water |
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 | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20200131 |
|
WD01 | Invention patent application deemed withdrawn after publication |