CN115219081A - Neural network and Kalman filtering fused optical fiber pressure sensor temperature compensation method - Google Patents

Neural network and Kalman filtering fused optical fiber pressure sensor temperature compensation method Download PDF

Info

Publication number
CN115219081A
CN115219081A CN202210803095.5A CN202210803095A CN115219081A CN 115219081 A CN115219081 A CN 115219081A CN 202210803095 A CN202210803095 A CN 202210803095A CN 115219081 A CN115219081 A CN 115219081A
Authority
CN
China
Prior art keywords
neural network
pressure
training
optical fiber
temperature compensation
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
Application number
CN202210803095.5A
Other languages
Chinese (zh)
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.)
Heilongjiang University
Original Assignee
Heilongjiang 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 Heilongjiang University filed Critical Heilongjiang University
Priority to CN202210803095.5A priority Critical patent/CN115219081A/en
Publication of CN115219081A publication Critical patent/CN115219081A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01LMEASURING FORCE, STRESS, TORQUE, WORK, MECHANICAL POWER, MECHANICAL EFFICIENCY, OR FLUID PRESSURE
    • G01L1/00Measuring force or stress, in general
    • G01L1/24Measuring force or stress, in general by measuring variations of optical properties of material when it is stressed, e.g. by photoelastic stress analysis using infrared, visible light, ultraviolet
    • G01L1/242Measuring force or stress, in general by measuring variations of optical properties of material when it is stressed, e.g. by photoelastic stress analysis using infrared, visible light, ultraviolet the material being an optical fibre
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01LMEASURING FORCE, STRESS, TORQUE, WORK, MECHANICAL POWER, MECHANICAL EFFICIENCY, OR FLUID PRESSURE
    • G01L11/00Measuring steady or quasi-steady pressure of a fluid or a fluent solid material by means not provided for in group G01L7/00 or G01L9/00
    • G01L11/02Measuring steady or quasi-steady pressure of a fluid or a fluent solid material by means not provided for in group G01L7/00 or G01L9/00 by optical means
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01LMEASURING FORCE, STRESS, TORQUE, WORK, MECHANICAL POWER, MECHANICAL EFFICIENCY, OR FLUID PRESSURE
    • G01L19/00Details of, or accessories for, apparatus for measuring steady or quasi-steady pressure of a fluent medium insofar as such details or accessories are not special to particular types of pressure gauges
    • G01L19/04Means for compensating for effects of changes of temperature, i.e. other than electric compensation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/12Computing arrangements based on biological models using genetic models
    • G06N3/126Evolutionary algorithms, e.g. genetic algorithms or genetic programming

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Biophysics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Theoretical Computer Science (AREA)
  • Molecular Biology (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Physiology (AREA)
  • Genetics & Genomics (AREA)
  • Measuring Fluid Pressure (AREA)

Abstract

A neural network and Kalman filtering fused optical fiber pressure sensor temperature compensation method relates to the field of optical fiber sensing and temperature compensation. The problems that the existing method for compensating the optical fiber pressure sensor is complex in compensation process and high in compensation difficulty are solved. The compensation method comprises the steps of firstly constructing a data set, and optimizing the weight and the threshold of an initial BP neural network by using a genetic algorithm to obtain the initially optimized BP neural network; training the initially optimized BP neural network by using a training set, verifying the trained BP neural network by using a verification set so as to obtain an optimal BP neural network, finally performing temperature compensation on the actually measured pressure acquired by the optical fiber pressure sensor to be measured by using the optimal BP neural network, and filtering the compensated pressure to obtain the corrected pressure. The invention is mainly used for temperature compensation of the pressure acquired by the optical fiber pressure sensor.

Description

Optical fiber pressure sensor temperature compensation method fusing neural network and Kalman filtering
Technical Field
The invention relates to the field of optical fiber sensing and temperature compensation.
Background
The optical fiber sensor has the main advantages of portability, higher sensitivity, strong electromagnetic radiation resistance, longer propagation distance and the like, and is widely used in the aspects of power systems, medical detection, environmental monitoring, bridge construction, military fields and the like. The optical fiber sensor is mainly a temperature sensor and a pressure sensor, and the temperature and the pressure change can cause the change of the wavelength, the material, the structural deformation, the thermal expansion and the like of the optical fiber sensor, so the influence of the temperature which is a non-target parameter must be restrained when the pressure sensor is manufactured. Because the temperature affects the optical fiber pressure sensor, the error of data measured by the optical fiber pressure sensor is larger, and in order to solve the nonlinear problem caused by the temperature, the temperature compensation is carried out on the optical fiber pressure sensor in the prior art, after the data is generally collected by the temperature sensor, the linear relation is calculated by using a matrix and then the compensation is carried out.
Disclosure of Invention
The invention aims to solve the problems of complex compensation process and high compensation difficulty of the existing method for compensating the optical fiber pressure sensor. The invention provides a temperature compensation method for an optical fiber pressure sensor with fusion of a neural network and Kalman filtering.
The temperature compensation method of the optical fiber pressure sensor with the fusion of the neural network and the Kalman filtering comprises the following steps:
s1, constructing a data set according to the actual measurement temperature and the actual measurement pressure of an optical fiber pressure sensor under given pressure, carrying out normalization processing on the constructed data set, and dividing the normalized data set into two parts which are respectively a training set and a testing set; the training set and the test set respectively comprise a plurality of data sets, and each data set comprises given pressure, measured temperature and measured pressure;
s2, optimizing the weight and the threshold of the initial BP neural network by using a genetic algorithm to obtain the initially optimized BP neural network;
s3, training the initially optimized BP neural network by using a training set to obtain a BP neural network after primary training;
s4, verifying the BP neural network after the primary training by using a test set, and executing the step S5 by taking the BP neural network after the primary training as the optimal BP neural network when the verification is passed;
when the verification fails, training the BP neural network after the primary training by using a training set to obtain a BP neural network after the secondary training; verifying the BP neural network after the secondary training by using the test set, and executing the step S5 by taking the BP neural network after the secondary training as the optimal BP neural network after the test set passes the verification of the BP neural network after the secondary training;
s5, the optimal BP neural network carries out temperature compensation on the actual measurement pressure collected by the optical fiber pressure sensor to be measured according to the actual measurement temperature and the actual measurement pressure collected by the optical fiber pressure sensor to be measured, and compensated pressure is obtained;
and S6, denoising the compensated pressure by using a Kalman filtering algorithm to obtain the corrected pressure, thereby completing the temperature compensation of the optical fiber pressure sensor.
Preferably, the step S3 of training the initially optimized BP neural network by using the training set, and the implementation manner of obtaining the trained BP neural network includes:
s31, sequentially taking the measured temperature and the measured pressure in each data set in the training set as the input of a BP neural network after initial optimization, performing temperature compensation on the received measured pressure by using the BP neural network after initial optimization, outputting predicted pressure, calculating the actual pressure error between the predicted pressure and the given pressure corresponding to the predicted pressure, and taking the actual pressure error as the actual pressure error corresponding to the current data set;
s32, iteratively updating the weight and the threshold of the initially optimized BP neural network according to the actual pressure error corresponding to each data set; and obtaining the BP neural network after one training until the actual pressure error corresponding to the current data set is smaller than the preset pressure error.
Preferably, the step S4 of verifying the BP neural network after one training by using the test set includes:
firstly, taking the measured temperature and the measured pressure in any data group in a test set as the input of a trained BP neural network, outputting a predicted pressure after carrying out temperature compensation on the received measured pressure by using the BP neural network after one training, and then calculating the actual pressure error between the predicted pressure and a given pressure corresponding to the predicted pressure, wherein the actual pressure error is taken as the actual pressure error corresponding to the current data group;
if the actual pressure error corresponding to the current data set is smaller than the preset pressure error, the verification is passed;
and if the actual pressure error corresponding to the current data set is greater than or equal to the preset pressure error, the verification is proved to be failed.
Preferably, in step S4, the training set is used to train the BP neural network after the primary training, and the implementation manner of obtaining the BP neural network after the secondary training is as follows:
firstly, sequentially taking the measured temperature and the measured pressure in each data set in a training set as the input of a BP neural network after one training, carrying out temperature compensation on the received measured pressure by using the BP neural network after one training, outputting predicted pressure, calculating the actual pressure error between the predicted pressure and the given pressure corresponding to the predicted pressure, and taking the actual pressure error as the actual pressure error corresponding to the current data set;
finally, iteratively updating the weight and the threshold of the BP neural network after one training according to the actual pressure error corresponding to each data set; until the actual pressure error corresponding to the current data set is smaller than the preset pressure error, and therefore the BP neural network after secondary training is obtained.
Preferably, in step S4, the condition that the test set passes the verification of the BP neural network after the secondary training is as follows:
firstly, the measured temperature and the measured pressure in any data set in a test set are used as the input of a BP neural network after secondary training, the BP neural network after the secondary training is used for carrying out temperature compensation on the received measured pressure, the predicted pressure is output, then the actual pressure error between the predicted pressure and the given pressure corresponding to the predicted pressure is calculated, and the actual pressure error is used as the actual pressure error corresponding to the current data set;
and if the actual pressure error corresponding to the current data set is smaller than the preset pressure error, the verification is passed.
Preferably, the step S2 of optimizing the weight and the threshold of the initial BP neural network by using a genetic algorithm, and the implementation manner of obtaining the initially optimized BP neural network includes:
s21, coding the weight and the threshold of the initial BP neural network for multiple times, wherein multiple gene code chains are obtained by each coding, the multiple gene code chains obtained by the multiple coding form a population, and each gene code chain is used as an individual in the population;
s22, genetic selection: selecting gene code chains corresponding to all individuals in the population by using a roulette selection method, and selecting two optimal gene code chains in the population;
s23, genetic crossing: crossing two optimal gene code chains in the population to form a new population;
s24, genetic variation: all the gene code chains in the new population obtained in the step S23 are mutated and selected to obtain a plurality of mutated gene code chains, and each mutated gene code chain is taken as an individual;
s25, calculating the individual fitness value probability corresponding to each mutated gene code chain, selecting the gene code chain of the individual corresponding to the maximum individual fitness value probability for decoding, and obtaining the optimal weight and the optimal threshold of the initial BP neural network, thereby obtaining the initially optimized BP neural network.
Preferably, in step S25, the implementation of calculating the probability of the individual fitness value includes:
calculating the fitness value F of the kth individual in the population k =y k -o k And a population fitness value
Figure BDA0003735076710000031
And then according to F k And F, obtaining the k individual fitness value probability P k =F k /F;
Wherein, y k K-th prediction output, o, representing the initial BP neural network k Representing the kth expected output of the initial BP neural network, k and M are both positive integers, and k =1,2,3 \8230; \8230m.
Preferably, the S2 medium and initial BP neural network is a three-layer BP network model, and the specific structure thereof includes 2 output layers, 5 hidden layers and 1 output layer; and the learning function in the initial BP neural network is learngdm and the training function is a trainlm function.
Preferably, the step S1 and the normalization processing are implemented as follows:
Figure BDA0003735076710000041
wherein the content of the first and second substances,
Figure BDA0003735076710000042
representing the result after normalization, x representing the input value, x min Indicates the smallest value, x, in the row max Indicating the maximum value in the row.
The invention has the following beneficial effects: the invention fuses a neural network and Kalman filtering to perform temperature compensation on an optical fiber pressure sensor, and the specific process comprises the following steps: the initial BP neural network is optimized by using a genetic optimization algorithm, so that the optimal solution is obtained and is used as the weight and the threshold of the initially optimized BP neural network, and the problem that the traditional BP neural network is easy to fall into the minimum value is solved; training and verifying the initially optimized BP neural network according to the initially optimized BP neural network established by the optimal solution to obtain the optimal BP neural network;
in the prior art, a coefficient matrix is determined by using the relationship between the offset of the wavelength and the temperature and the pressure, but the coefficient matrix becomes complex as the optical fiber sensor goes deep, meanwhile, the traditional BP neural network is easy to fall into a local minimum value, and the traditional Kalman is only optimal under the condition of determination of a mathematical model. Therefore, the optimal BP neural network is established first, and the complexity and difficulty of the traditional Kalman in mathematical modeling are reduced; the data obtained by the optimal BP neural network is subjected to noise reduction processing by a Kalman filtering algorithm, and the measurement precision and stability of the optical fiber pressure sensor can be greatly improved and a good compensation effect can be obtained through experimental verification.
Drawings
FIG. 1 is a flow chart of a neural network and Kalman filtering fused optical fiber pressure sensor temperature compensation method according to the present invention;
FIG. 2 is a schematic structural diagram of a three-layer BP network model;
FIG. 3 is a flowchart of obtaining the optimal weight and optimal threshold of the initial BP neural network;
FIG. 4 is a graph of the input and output pressure curves identified by the optimal BP neural network of the present invention;
FIG. 5 is an error diagram of the optimal BP neural network (GA-BP) obtained by the present invention and the conventional BP neural network (BP);
FIG. 6 is a diagram of the filtering effect of the Kalman filtering algorithm;
FIG. 7 is a graph of the relative error after compensation by the optimal BP neural network (GA-BP) according to the present invention and filtering by Kalman algorithm.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict.
Example 1:
referring to fig. 1 to explain the present embodiment 1, the method for temperature compensation of an optical fiber pressure sensor with a neural network and kalman filter fused according to the present embodiment 1 includes the following steps:
s1, constructing a data set according to the actual measurement temperature and the actual measurement pressure of an optical fiber pressure sensor under the given pressure, and carrying out normalization processing on the constructed data set, wherein the normalized data set is divided into two parts which are respectively a training set and a testing set; the training set and the test set respectively comprise a plurality of data sets, and each data set comprises given pressure, measured temperature and measured pressure;
s2, optimizing the weight and the threshold of the initial BP neural network by using a genetic algorithm to obtain the initially optimized BP neural network;
s3, training the initially optimized BP neural network by using a training set to obtain a BP neural network after one training;
s4, verifying the BP neural network after the primary training by using a test set, and executing the step S5 by taking the BP neural network after the primary training as the optimal BP neural network when the verification is passed;
when the verification fails, training the BP neural network after the primary training by using a training set to obtain a BP neural network after the secondary training; verifying the BP neural network after the secondary training by using the test set, and executing the step S5 by taking the BP neural network after the secondary training as the optimal BP neural network after the test set passes the verification of the BP neural network after the secondary training;
s5, the optimal BP neural network carries out temperature compensation on the actual measurement pressure collected by the optical fiber pressure sensor to be measured according to the actual measurement temperature and the actual measurement pressure collected by the optical fiber pressure sensor to be measured, and compensated pressure is obtained;
and S6, denoising the compensated pressure by using a Kalman filtering algorithm to obtain the corrected pressure, thereby completing the temperature compensation of the optical fiber pressure sensor.
When the method is applied, firstly, a calibration experiment is carried out on the optical fiber pressure sensor to obtain experiment data, namely, a data set is constructed according to the actual measurement temperature and the actual measurement pressure of the optical fiber pressure sensor under the given pressure; then, based on a genetic algorithm, a training set and a test set, obtaining an optimal BP neural network; and finally, carrying out temperature compensation on the received actually measured pressure by using the optimal BP neural network optical fiber pressure sensor to be measured to obtain compensated pressure, and carrying out noise reduction on the compensated pressure through Kalman filtering so as to finish temperature compensation on the optical fiber pressure sensor. The method can effectively improve the defects of the traditional BP neural network, is easy to fall into a local minimum value, meanwhile, the traditional BP neural network is optimized by using a genetic algorithm, then training and verification are carried out, the optimal BP neural network is obtained, temperature compensation and identification are carried out by using the optimal BP neural network, the complexity and difficulty of the traditional Kalman in mathematical modeling are reduced, after Kalman filtering is carried out on the compensated pressure output after the optimal BP neural network is identified, errors are further reduced, and the stability and the accuracy of the optical fiber pressure sensor at different environmental temperatures are improved.
Further, step S3, training the initially optimized BP neural network by using a training set, and an implementation manner of obtaining the trained BP neural network includes:
s31, sequentially taking the measured temperature and the measured pressure in each data set in the training set as the input of a BP neural network after initial optimization, performing temperature compensation on the received measured pressure by using the BP neural network after initial optimization, outputting predicted pressure, calculating the actual pressure error between the predicted pressure and the given pressure corresponding to the predicted pressure, and taking the actual pressure error as the actual pressure error corresponding to the current data set;
s32, iteratively updating the weight and the threshold of the initially optimized BP neural network according to the actual pressure error corresponding to each data group; and obtaining the BP neural network after one training until the actual pressure error corresponding to the current data set is smaller than the preset pressure error.
Further, the step S4, the implementation manner of verifying the BP neural network after one training by using the test set includes:
firstly, the actually measured temperature and the actually measured pressure in any data set in a test set are used as the input of a trained BP neural network, the received actually measured pressure is subjected to temperature compensation by using the BP neural network after primary training, the predicted pressure is output, the actual pressure error between the predicted pressure and the given pressure corresponding to the predicted pressure is calculated, and the actual pressure error is used as the actual pressure error corresponding to the current data set;
if the actual pressure error corresponding to the current data set is smaller than the preset pressure error, the verification is passed;
and if the actual pressure error corresponding to the current data set is greater than or equal to the preset pressure error, the verification is proved to be failed.
Further, in step S4, the training set is used to train the BP neural network after the first training, and the implementation manner of obtaining the BP neural network after the second training is as follows:
firstly, sequentially taking the measured temperature and the measured pressure in each data set in a training set as the input of a BP neural network after one training, carrying out temperature compensation on the received measured pressure by using the BP neural network after one training, outputting predicted pressure, calculating the actual pressure error between the predicted pressure and the given pressure corresponding to the predicted pressure, and taking the actual pressure error as the actual pressure error corresponding to the current data set;
finally, iteratively updating the weight and the threshold of the BP neural network after one training according to the actual pressure error corresponding to each data set; and obtaining the BP neural network after secondary training until the actual pressure error corresponding to the current data set is smaller than the preset pressure error.
When in application, the weight value updating expression is as follows:
Figure BDA0003735076710000071
wherein eta is the learning frequency, w is the weight, and E is the actual pressure error.
Further, in step S4, the condition that the test set passes the verification of the BP neural network after the secondary training is as follows:
firstly, taking the measured temperature and the measured pressure in any data group in a test set as the input of a BP neural network after secondary training, outputting predicted pressure after carrying out temperature compensation on the received measured pressure by using the BP neural network after secondary training, and then calculating the actual pressure error between the predicted pressure and the given pressure corresponding to the predicted pressure, wherein the actual pressure error is taken as the actual pressure error corresponding to the current data group;
and if the actual pressure error corresponding to the current data set is smaller than the preset pressure error, the verification is passed.
Further, referring to fig. 3 specifically, in step S2, the implementation manner of optimizing the weight and the threshold of the initial BP neural network by using the genetic algorithm to obtain the initially optimized BP neural network includes:
s21, coding the weight and the threshold of the initial BP neural network for multiple times, wherein multiple gene code chains are obtained by each coding, the multiple gene code chains obtained by the multiple coding form a population, and each gene code chain is used as an individual in the population;
s22, genetic selection: selecting the gene code chains corresponding to all individuals in the population by using a roulette selection method, and selecting two optimal gene code chains in the population;
s23, genetic crossing: crossing two optimal gene code chains in the population to form a new population;
s24, genetic variation: performing variation and selection on all gene code chains in the new population obtained in the step S23 to obtain a plurality of varied gene code chains, wherein each varied gene code chain is used as an individual;
s25, calculating the individual fitness value probability corresponding to each mutated gene code chain, selecting the gene code chain of the individual corresponding to the maximum individual fitness value probability for decoding, and obtaining the optimal weight and the optimal threshold of the initial BP neural network, thereby obtaining the initially optimized BP neural network.
Further, in step S25, the implementation of calculating the probability of the individual fitness value includes:
calculating the fitness value F of the kth individual in the population k =y k -o k And a population fitness value
Figure BDA0003735076710000072
And then according to F k And F, obtaining the k individual fitness value probability P k =F k /F;
Wherein, y k K-th prediction output, o, representing the initial BP neural network k Representing the kth expected output of the initial BP neural network, k and M are both positive integers, and k =1,2,3 \8230; M.
Further, referring specifically to fig. 2, the initial BP neural network in S2 is a three-layer BP network model, and the specific structure thereof includes 2 output layers, 5 hidden layers and 1 output layer;
and the learning function in the initial BP neural network is learngdm and the training function is a trainlm function.
When the optical fiber pressure sensor is used, the 2 output layers are respectively used for receiving the measured temperature and the measured pressure of the optical fiber pressure sensor.
Further, the step S1 and the normalization process are implemented as follows:
Figure BDA0003735076710000081
wherein the content of the first and second substances,
Figure BDA0003735076710000082
representing the result after normalization, x representing the input value, x min Indicates the smallest value, x, in the row max Indicating the maximum value in the row.
In specific application, the Kalman filtering algorithm is realized as follows:
the state equation is:
x(k)=Ax(k-1)+Bu(k)+w(k);
the observation equation is:
z(k)=Hx(k)+v(k);
the state update equation is:
x (K | K) = x (K | K-1) + K (K) epsilon (K); wherein ∈ (k) = z (k) -H (k) x (k | k-1);
the error variance matrix prediction equation is:
P(k|k-1)=AP(k-1|k-1)A T +Q;
the filter gain matrix equation is:
K(k)=P(k|k-1)H T (HP(k|k-1)H T +R) -1
the error variance matrix updating equation is as follows:
P(k|k)=[1-K(k)H]P(k|k-1);
wherein: x (k) is a state vector at time k, a represents a state transition matrix, B represents an input control matrix, x (k-1) is a state vector at time k-1, u (k) represents a control quantity at time k, where u (k) =0; w (k) is the process noise at time k; z (k) represents the observation vector at time k; h represents an observation matrix; v (K) is observation noise at the moment K, x (K | K) is a state vector at the current moment, x (K | K-1) is a state vector at the previous moment, K (K) is a Kalman filter gain at the moment K, epsilon (K) is an innovation at the moment K, H (K) is an observation matrix at the moment K, P (K | K-1) is an error variance prediction value for predicting the moment K at the previous moment K-1, P (K-1) is an error variance value at the moment K-1, P (K | K) is an error variance value at the moment K, Q is a variance matrix of w (K), and
Figure BDA0003735076710000091
Figure BDA0003735076710000092
for process noise variance values, R is a v (k) observation noise variance matrix, and
Figure BDA0003735076710000093
Figure BDA0003735076710000094
to observe the noise variance values.
The technical effects of the application are verified through the attached drawings:
fig. 4 is an input/output curve diagram after identification by the optimal BP neural network, and it can be seen from the diagram that after compensation identification by the optimal BP neural network, given pressure and output pressure at each temperature substantially maintain a straight line, given pressure and output pressure at a plurality of different temperatures substantially maintain a straight line, and the straight lines substantially coincide with each other, so that it can be determined that the optimal BP neural network obtained by the present invention has a good temperature compensation effect for data at different temperatures.
Fig. 5 is an error diagram of the optimal BP neural network (GA-BP) obtained by the present invention and the conventional BP neural network (BP), and it can be seen from the error diagram that the BP neural network is optimized by the genetic algorithm, that is: the error of the optimal BP neural network obtained by the invention is smaller than that of a single traditional BP neural network; it can be seen from fig. 5 that the error curve corresponding to the GA-BP is more stable and has a small error amplitude, and it can be seen that the prediction accuracy of the optimal BP neural network (i.e., GA-BP) of the present invention is higher, and the error curve corresponding to the BP neural network (i.e., BP) has a large fluctuation, and the maximum error far exceeds the maximum error of the optimal BP neural network, which further proves that the prediction accuracy of the BP neural network (i.e., BP) is low and the effect is poor.
FIG. 6 is a filtering effect diagram of Kalman filtering algorithm, and FIG. 6 is a filtering effect diagram of Kalman filtering algorithm, wherein the data obtained by optimal BP neural network identification is subjected to denoising treatment by Kalman filtering algorithm; the 4 curves in fig. 6 respectively represent an expected value curve of the optimal BP neural network, an observed value curve of the predicted true value of the optimal BP neural network added with process noise, an observed value of the Kalman filter algorithm added with the true value curve of the observed noise, and a Kalman filter value of the predicted true value of the optimal BP neural network after Kalman filtering. It can be seen from fig. 6 that the value after kalman filtering has a good denoising effect, and is closer to the expected value. The expected value curve of the optimal BP neural network is also a given pressure curve of a continuous given optical fiber sensing pressure sensor, and the given pressure is continuously 6MPa.
FIG. 7 is a graph of the relative error after compensation by the optimal BP neural network (GA-BP) and filtering by Kalman algorithm according to the present invention; it can be seen from fig. 7 that the data of the relative error curve after kalman filtering is more stable and the relative error is smaller. And error/expected error = relative error.
According to the invention, by using a genetic optimization algorithm, the weight and the threshold of the optimal solution are obtained and are used as the weight and the threshold of the initial BP neural network, so that the problem that the traditional BP neural network is easy to fall into the minimum value is solved; training and verifying the initially optimized BP neural network according to the initially optimized BP neural network established by the optimal solution to obtain the optimal BP neural network;
according to the method, the initial BP neural network is optimized by using a genetic optimization algorithm, an optimal solution is obtained and is used as the weight and the threshold of the initially optimized BP neural network, and the problem that the traditional BP neural network is easy to fall into the minimum value is solved; according to the initially optimized BP neural network established according to the optimal solution, the optimal BP neural network is obtained for identification after the initially optimized BP neural network is trained and verified, and the complexity and the difficulty of the traditional Kalman in mathematical modeling are reduced; and the data obtained according to the optimal BP neural network is subjected to noise reduction processing by a Kalman filtering algorithm, and the measurement precision and stability of the optical fiber pressure sensor are greatly improved through experimental verification, so that a good compensation effect is obtained.
Although the invention herein has been described with reference to particular embodiments, it is to be understood that these embodiments are merely illustrative of the principles and applications of the present invention. It is therefore to be understood that numerous modifications may be made to the illustrative embodiments and that other arrangements may be devised without departing from the spirit and scope of the present invention as defined by the appended claims. It should be understood that features described in different dependent claims and herein may be combined in ways different from those described in the original claims. It is also to be understood that features described in connection with individual embodiments may be used in other described embodiments.

Claims (9)

1. The temperature compensation method of the optical fiber pressure sensor fused with the neural network and the Kalman filtering is characterized by comprising the following steps:
s1, constructing a data set according to the actual measurement temperature and the actual measurement pressure of an optical fiber pressure sensor under the given pressure, and carrying out normalization processing on the constructed data set, wherein the normalized data set is divided into two parts which are respectively a training set and a testing set; the training set and the test set respectively comprise a plurality of data sets, and each data set comprises given pressure, measured temperature and measured pressure;
s2, optimizing the weight and the threshold of the initial BP neural network by using a genetic algorithm to obtain the initially optimized BP neural network;
s3, training the initially optimized BP neural network by using a training set to obtain a BP neural network after primary training;
s4, verifying the BP neural network after the primary training by using a test set, and executing the step S5 by taking the BP neural network after the primary training as the optimal BP neural network when the verification is passed;
when the verification fails, training the BP neural network after the primary training by using a training set to obtain a BP neural network after the secondary training; verifying the BP neural network after the secondary training by using the test set, and executing the step S5 by taking the BP neural network after the secondary training as the optimal BP neural network after the test set passes the verification of the BP neural network after the secondary training;
s5, the optimal BP neural network carries out temperature compensation on the actual measurement pressure collected by the optical fiber pressure sensor to be measured according to the actual measurement temperature and the actual measurement pressure collected by the optical fiber pressure sensor to be measured, and compensated pressure is obtained;
and S6, denoising the compensated pressure by using a Kalman filtering algorithm to obtain the corrected pressure, thereby completing the temperature compensation of the optical fiber pressure sensor.
2. The temperature compensation method for the optical fiber pressure sensor fusing the neural network and the Kalman filtering according to claim 1, wherein the step S3 of training the initially optimized BP neural network by using a training set comprises the following steps:
s31, sequentially taking the measured temperature and the measured pressure in each data set in the training set as the input of a BP neural network after initial optimization, outputting predicted pressure after the temperature compensation is carried out on the received measured pressure by using the BP neural network after the initial optimization, and then calculating the actual pressure error between the predicted pressure and the given pressure corresponding to the predicted pressure, wherein the actual pressure error is taken as the actual pressure error corresponding to the current data set;
s32, iteratively updating the weight and the threshold of the initially optimized BP neural network according to the actual pressure error corresponding to each data group; and obtaining the BP neural network after one training until the actual pressure error corresponding to the current data set is smaller than the preset pressure error.
3. The temperature compensation method for the optical fiber pressure sensor fusing the neural network and the Kalman filtering according to claim 1, wherein the step S4 of verifying the BP neural network after one training by using a test set comprises the following implementation modes:
firstly, taking the measured temperature and the measured pressure in any data group in a test set as the input of a trained BP neural network, outputting a predicted pressure after carrying out temperature compensation on the received measured pressure by using the BP neural network after one training, and then calculating the actual pressure error between the predicted pressure and a given pressure corresponding to the predicted pressure, wherein the actual pressure error is taken as the actual pressure error corresponding to the current data group;
if the actual pressure error corresponding to the current data set is smaller than the preset pressure error, the verification is passed;
and if the actual pressure error corresponding to the current data set is greater than or equal to the preset pressure error, the verification is proved to be failed.
4. The temperature compensation method for the optical fiber pressure sensor fusing the neural network and the kalman filter according to claim 1, wherein in step S4, the BP neural network after the first training is trained by using the training set, and the realization method for obtaining the BP neural network after the second training is as follows:
firstly, sequentially taking the measured temperature and the measured pressure in each data set in a training set as the input of a BP neural network after one training, carrying out temperature compensation on the received measured pressure by using the BP neural network after one training, outputting predicted pressure, calculating the actual pressure error between the predicted pressure and the given pressure corresponding to the predicted pressure, and taking the actual pressure error as the actual pressure error corresponding to the current data set;
finally, iteratively updating the weight and the threshold of the BP neural network after one training according to the actual pressure error corresponding to each data set; until the actual pressure error corresponding to the current data set is smaller than the preset pressure error, and therefore the BP neural network after secondary training is obtained.
5. The temperature compensation method for the optical fiber pressure sensor fusing the neural network and the Kalman filtering according to claim 1, wherein in step S4, the conditions for passing the verification of the test set on the BP neural network after the secondary training are as follows:
firstly, taking the measured temperature and the measured pressure in any data group in a test set as the input of a BP neural network after secondary training, outputting predicted pressure after carrying out temperature compensation on the received measured pressure by using the BP neural network after secondary training, and then calculating the actual pressure error between the predicted pressure and the given pressure corresponding to the predicted pressure, wherein the actual pressure error is taken as the actual pressure error corresponding to the current data group;
and if the actual pressure error corresponding to the current data set is smaller than the preset pressure error, the verification is passed.
6. The method for temperature compensation of the optical fiber pressure sensor fusing the neural network and the Kalman filtering according to claim 1, wherein the step S2 of optimizing the weight and the threshold of the initial BP neural network by using a genetic algorithm to obtain the initially optimized BP neural network comprises the following implementation modes:
s21, coding the weight and the threshold of the initial BP neural network for multiple times, wherein multiple gene code chains are obtained by each coding, the multiple gene code chains obtained by the multiple coding form a population, and each gene code chain is used as an individual in the population;
s22, genetic selection: selecting the gene code chains corresponding to all individuals in the population by using a roulette selection method, and selecting two optimal gene code chains in the population;
s23, genetic crossing: crossing two optimal gene code chains in the population to form a new population;
s24, genetic variation: performing variation and selection on all gene code chains in the new population obtained in the step S23 to obtain a plurality of varied gene code chains, wherein each varied gene code chain is used as an individual;
s25, calculating individual fitness value probability corresponding to each mutated gene code chain, selecting the gene code chain of the individual corresponding to the maximum individual fitness value probability for decoding, and obtaining the optimal weight and the optimal threshold of the initial BP neural network, thereby obtaining the initially optimized BP neural network.
7. The neural network and Kalman filtering fused optical fiber pressure sensor temperature compensation method according to claim 6, wherein in step S25, the implementation manner of calculating the individual fitness value probability comprises:
calculating the k individual fitness value F in the population k =y k -o k And a population fitness value
Figure FDA0003735076700000031
According to F k And F, obtaining the k individual fitness value probability P k =F k /F;
Wherein, y k Represents the kth prediction output of the initial BP neural network,o k representing the kth expected output of the initial BP neural network, k and M are both positive integers, and k =1,2,3 \8230; M.
8. The temperature compensation method for the optical fiber pressure sensor fusing the neural network and the Kalman filtering according to claim 1, characterized in that the S2 middle and initial BP neural networks are three-layer BP network models, and the specific structure thereof comprises 2 output layers, 5 hidden layers and 1 output layer; and the learning function in the initial BP neural network is learngdm and the training function is a trainlm function.
9. The neural network and Kalman filtering fused optical fiber pressure sensor temperature compensation method according to claim 1, characterized in that the step S1 and normalization processing are realized in the following manner:
Figure FDA0003735076700000032
wherein, the first and the second end of the pipe are connected with each other,
Figure FDA0003735076700000033
representing the result after normalization, x representing the input value, x min Indicates the smallest value, x, in the row max Indicating the maximum value in the row.
CN202210803095.5A 2022-07-07 2022-07-07 Neural network and Kalman filtering fused optical fiber pressure sensor temperature compensation method Pending CN115219081A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210803095.5A CN115219081A (en) 2022-07-07 2022-07-07 Neural network and Kalman filtering fused optical fiber pressure sensor temperature compensation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210803095.5A CN115219081A (en) 2022-07-07 2022-07-07 Neural network and Kalman filtering fused optical fiber pressure sensor temperature compensation method

Publications (1)

Publication Number Publication Date
CN115219081A true CN115219081A (en) 2022-10-21

Family

ID=83610620

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210803095.5A Pending CN115219081A (en) 2022-07-07 2022-07-07 Neural network and Kalman filtering fused optical fiber pressure sensor temperature compensation method

Country Status (1)

Country Link
CN (1) CN115219081A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116046018A (en) * 2023-01-31 2023-05-02 无锡凌思科技有限公司 Temperature compensation method applied to MEMS gyroscope

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116046018A (en) * 2023-01-31 2023-05-02 无锡凌思科技有限公司 Temperature compensation method applied to MEMS gyroscope
CN116046018B (en) * 2023-01-31 2023-11-14 无锡凌思科技有限公司 Temperature compensation method applied to MEMS gyroscope

Similar Documents

Publication Publication Date Title
Lu et al. Generalized radial basis function neural network based on an improved dynamic particle swarm optimization and AdaBoost algorithm
Bian et al. Adaptive dynamic programming and optimal control of nonlinear nonaffine systems
CN113723010B (en) Bridge damage early warning method based on LSTM temperature-displacement correlation model
CN110852515B (en) Water quality index prediction method based on mixed long-time and short-time memory neural network
KR102275126B1 (en) Electrical facility safety evaluation system using artificial intelligence technique
CN110059887B (en) BP neural network risk identification method and system based on adaptive genetic algorithm
CN109919356B (en) BP neural network-based interval water demand prediction method
CN115219081A (en) Neural network and Kalman filtering fused optical fiber pressure sensor temperature compensation method
CN112235043B (en) Distributed optical fiber abnormal data restoration device based on self-adaptive long-term and short-term memory
CN108960334A (en) A kind of multi-sensor data Weighted Fusion method
CN110059803A (en) A kind of temperature-compensation method of the optical fibre displacement sensor based on GA-BP
Yu et al. Distributed consensus-based estimation with unknown inputs and random link failures
CN114088890A (en) Self-adaptive temperature and humidity compensation method and system based on deep BP neural network
CN116451514A (en) Bridge structure state evaluation method and device and electronic equipment
Li et al. Evolutionary deep learning with extended Kalman filter for effective prediction modeling and efficient data assimilation
CN115660688A (en) Financial transaction abnormity detection method and cross-region sustainable training method thereof
CN107526294B (en) Intelligent identification method for thermal field temperature-silicon single crystal diameter nonlinear time lag system
CN114189047A (en) False data detection and correction method for active power distribution network state estimation
CN116894180B (en) Product manufacturing quality prediction method based on different composition attention network
CN112784331B (en) Soil stress-strain relation determination method based on improved LSTM deep learning method
CN116840764A (en) Method and system for evaluating comprehensive error state of capacitive voltage transformer
Wang Data preprocessing for soft sensor using generative adversarial networks
CN117252085A (en) Cable-stayed bridge cable force tolerance optimization method and system based on neural network and particle swarm
CN115688924A (en) Multi-sample combined multivariate self-adaptive regression spline model
CN115659201A (en) Gas concentration detection method and monitoring system for Internet of things

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