Temperature compensation method of optical fiber pressure sensor based on fusion of neural network and Kalman filter

Through the fusion method of neural network and Kalman filtering, the complex and difficult temperature compensation process of fiber pressure sensors is solved, and higher measurement accuracy and stability are achieved.

CN115219081BActive Publication Date: 2025-03-04HEILONGJIANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210803095.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-07
Publication Date
2025-03-04
Estimated Expiration
2042-07-07

AI Technical Summary

Technical Problem

Existing fiber optic pressure sensors have complexity and difficulty in the temperature compensation process, resulting in large errors in measurement data.

Method used

The temperature compensation of fiber optic pressure sensor is performed by fusion of neural networks and Kalman filtering. Specific steps include building a data set, optimizing the weight and threshold of the BP neural network, training and verifying the neural network, and finally denoising the noise through the Kalman filtering algorithm.

Benefits of technology

It improves the measurement accuracy and stability of the fiber optic pressure sensor, simplifies the temperature compensation process, and reduces the compensation difficulty.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115219081B_ABST
    Figure CN115219081B_ABST
Patent Text Reader

Abstract

The invention discloses a temperature compensation method for an optical fiber pressure sensor by integrating a neural network with a Kalman filter, and relates to the field of optical fiber sensing and temperature compensation. The invention solves the problem that the existing method for compensating an optical fiber pressure sensor has a complicated compensation process and a high compensation difficulty. The compensation method of the invention first constructs a data set, and optimizes the weights and thresholds of the initial BP neural network using a genetic algorithm to obtain an initially optimized BP neural network; the initially optimized BP neural network is trained using a training set, and the trained BP neural network is verified using a verification set, so as to obtain an optimal BP neural network; finally, the optimal BP neural network is used to perform temperature compensation on the actual pressure collected by the optical fiber pressure sensor to be tested, and the compensated pressure is filtered to obtain the corrected pressure. The invention is mainly used for temperature compensation of the pressure collected by an optical fiber pressure sensor.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of optical fiber sensing and temperature compensation. Background Art

[0002] The main advantages of fiber optic sensors include lightness, high sensitivity, strong resistance to electromagnetic radiation, and long transmission distance. They have been widely used in power systems, medical testing, environmental monitoring, bridge construction, military fields, etc. The most important fiber optic sensors are temperature and pressure sensors. Since changes in temperature and pressure will cause changes in the wavelength, material, structural deformation, thermal expansion, etc. of the fiber optic sensor, the influence of temperature, a non-target parameter, must be suppressed when making a pressure sensor. Because temperature affects the fiber optic pressure sensor, the data measured by the fiber optic pressure sensor has a large error. In order to solve this nonlinear problem caused by temperature, the fiber optic pressure sensor is temperature compensated in the prior art. Generally, after the temperature sensor is collected, the linear relationship is calculated using a matrix, and then compensation is performed. This compensation method has a complex processing process, and the final relationship matrix between pressure and temperature is not necessarily a linear relationship, which increases the difficulty of matrix processing, resulting in a complex temperature compensation process and great compensation difficulty in the existing temperature compensation method. Therefore, the above problems need to be solved urgently. Summary of the invention

[0003] The present invention aims to solve the problem that the existing method for compensating an optical fiber pressure sensor has a complicated compensation process and a high compensation difficulty. The present invention provides an optical fiber pressure sensor temperature compensation method integrating a neural network and a Kalman filter.

[0004] A temperature compensation method for an optical fiber pressure sensor by integrating a neural network and a Kalman filter, the method comprising the following steps:

[0005] S1. constructing a data set according to the measured temperature and measured pressure of the optical fiber pressure sensor under a given pressure, and normalizing the constructed data set, and dividing the normalized data set into two parts, namely a training set and a test set; wherein the training set and the test set both include multiple data groups, and each data group includes a given pressure, a measured temperature and a measured pressure;

[0006] S2, using a genetic algorithm to optimize the weights and thresholds of the initial BP neural network to obtain an initial optimized BP neural network;

[0007] S3, using the training set to train the initially optimized BP neural network to obtain a trained BP neural network;

[0008] S4, using the test set to verify the trained BP neural network, when the verification is passed, the trained BP neural network is used as the optimal BP neural network, and step S5 is executed;

[0009] When the verification fails, the training set is used to train the BP neural network after the first training to obtain the BP neural network after the second training; the test set is used to verify the BP neural network after the second training. When the test set verifies the BP neural network after the second training, the BP neural network after the second training is used as the optimal BP neural network, and step S5 is executed;

[0010] S5. The optimal BP neural network performs temperature compensation on the measured pressure collected by the optical fiber pressure sensor to be tested according to the measured temperature and the measured pressure collected by the optical fiber pressure sensor to be tested, so as to obtain the compensated pressure;

[0011] S6. Use the Kalman filter algorithm to reduce the noise of the compensated pressure to obtain the corrected pressure, thereby completing the temperature compensation of the optical fiber pressure sensor.

[0012] Preferably, the implementation of step S3, training the initially optimized BP neural network using the training set to obtain the trained BP neural network includes:

[0013] S31, taking the measured temperature and the measured pressure in each data group in the training set as the input of the initially optimized BP neural network in turn, using the initially optimized BP neural network to perform temperature compensation on the received measured pressure, outputting the predicted pressure, and then calculating the actual pressure error between the predicted pressure and the corresponding given pressure, and the actual pressure error is used as the actual pressure error corresponding to the current data group;

[0014] S32, iteratively updating the weights and thresholds of the initially optimized BP neural network according to the actual pressure error corresponding to each data group; until the actual pressure error corresponding to the current data group is less than the preset pressure error, thereby obtaining a trained BP neural network.

[0015] Preferably, the implementation of step S4, using the test set to verify the BP neural network after one training, includes:

[0016] First, the measured temperature and pressure in any data group in the test set are used as the input of the trained BP neural network. After the received measured pressure is temperature compensated by the trained BP neural network, the predicted pressure is output, and then the actual pressure error between the predicted pressure and the corresponding given pressure is calculated. The actual pressure error is used as the actual pressure error corresponding to the current data group.

[0017] If the actual pressure error corresponding to the current data set is less than the preset pressure error, the verification is successful;

[0018] If the actual pressure error corresponding to the current data set is greater than or equal to the preset pressure error, it means that the verification has failed.

[0019] Preferably, in step S4, the BP neural network after the first training is trained using the training set to obtain the BP neural network after the second training by:

[0020] First, the measured temperature and the measured pressure in each data group in the training set are used as the input of the trained BP neural network in turn, and the received measured pressure is temperature compensated by the trained BP neural network, and the predicted pressure is output, and then the actual pressure error between the predicted pressure and the corresponding given pressure is calculated, and the actual pressure error is used as the actual pressure error corresponding to the current data group;

[0021] Finally, the weights and thresholds of the trained BP neural network are iteratively updated according to the actual pressure error corresponding to each data group; until the actual pressure error corresponding to the current data group is less than the preset pressure error, thereby obtaining the second-trained BP neural network.

[0022] Preferably, in step S4, the condition for the test set to verify the BP neural network after secondary training is:

[0023] First, the measured temperature and pressure in any data group in the test set are used as the input of the BP neural network after secondary training. After the received measured pressure is temperature compensated by the BP neural network after secondary training, the predicted pressure is output, and then the actual pressure error between the predicted pressure and the corresponding given pressure is calculated. The actual pressure error is used as the actual pressure error corresponding to the current data group.

[0024] If the actual pressure error corresponding to the current data set is less than the preset pressure error, the verification is successful.

[0025] Preferably, the implementation of step S2, optimizing the weights and thresholds of the initial BP neural network using a genetic algorithm to obtain the initially optimized BP neural network includes:

[0026] S21, encoding the weights and thresholds of the initial BP neural network multiple times, obtaining multiple gene code chains each time, and the multiple gene code chains obtained by multiple encodings constitute a population, and each gene code chain serves as an individual in the population;

[0027] S22, Genetic selection: Use the roulette wheel selection method to select the gene code chains corresponding to all individuals in the population, and select the two best gene code chains in the population;

[0028] S23, genetic crossover: cross the two best gene code chains in the population to form a new population;

[0029] S24, genetic mutation: mutate and select all gene code chains in the new population obtained in step S23 to obtain multiple mutated gene code chains, and each mutated gene code chain is regarded as an individual;

[0030] S25, calculating the probability of the individual fitness value corresponding to each mutated gene code chain, and selecting the individual gene code chain corresponding to the individual with the maximum probability of the individual fitness value for decoding, to obtain the optimal weight and optimal threshold of the initial BP neural network, thereby obtaining the initial optimized BP neural network.

[0031] Preferably, in step S25, the implementation method of calculating the probability of the individual fitness value includes:

[0032] Calculate the fitness value F of the kth individual in the population k =y k -o k , and population fitness According to F k and F, obtain the kth individual fitness value probability P k =F k / F;

[0033] Among them, y k represents the kth prediction output of the initial BP neural network, o k Represents the kth expected output of the initial BP neural network, k and M are both positive integers, and k = 1, 2, 3...M.

[0034] Preferably, in S2, the initial BP neural network is a three-layer BP network model, and its specific structure 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 trainlm function.

[0035] Preferably, the normalization process in step S1 is implemented as follows:

[0036]

[0037] in, represents the normalized result, x represents the input value, and x min Indicates the smallest value in the row, x max Indicates the maximum value in the row.

[0038] The beneficial effects brought by the present invention are as follows: the present invention combines the neural network with the Kalman filter to perform temperature compensation on the optical fiber pressure sensor. The specific process is as follows: the initial BP neural network is optimized by using a genetic optimization algorithm to obtain the optimal solution as the weight and threshold of the initial optimized BP neural network, thereby solving the problem that the traditional BP neural network is prone to fall into the minimum value; the initial optimized BP neural network established according to the optimal solution is trained and verified to obtain the optimal BP neural network;

[0039] In the prior art, the coefficient matrix is ​​determined by the relationship between the wavelength offset and the temperature and pressure. However, as the fiber optic sensor goes deeper, the coefficient matrix becomes complicated. At the same time, the traditional BP neural network is prone to fall into the local minimum and the traditional Kalman is only optimal when the mathematical model is determined. Therefore, this application first establishes the optimal BP neural network, which reduces the complexity and difficulty of the traditional Kalman in mathematical modeling; the data obtained by the optimal BP neural network is first processed by the Kalman filter algorithm for noise reduction. It has been verified by experiments that the measurement accuracy and stability of the fiber optic pressure sensor can be greatly improved, and a good compensation effect can be obtained. The entire temperature compensation method is simple and the compensation difficulty is small. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 It is a flow chart of the temperature compensation method of the optical fiber pressure sensor integrating the neural network and the Kalman filter according to the present invention;

[0041] Figure 2 It is a structural diagram of a three-layer BP network model;

[0042] Figure 3 Flowchart for obtaining the optimal weights and thresholds of the initial BP neural network;

[0043] Figure 4 It is the input and output pressure curve diagram after the optimal BP neural network identification of the present invention;

[0044] Figure 5 The error diagram of the optimal BP neural network (GA-BP) obtained by the present invention and the traditional BP neural network (BP);

[0045] Figure 6 This is the filtering effect diagram of the Kalman filtering algorithm;

[0046] Figure 7 It is a relative error comparison diagram after compensation by the optimal BP neural network (GA-BP) described in the present invention and after filtering by the Kalman algorithm. DETAILED DESCRIPTION

[0047] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0048] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.

[0049] Embodiment 1:

[0050] See also Figure 1 The present embodiment 1 is described. The temperature compensation method of the optical fiber pressure sensor by integrating the neural network and the Kalman filter described in the present embodiment 1 comprises the following steps:

[0051] S1. constructing a data set according to the measured temperature and measured pressure of the optical fiber pressure sensor under a given pressure, and normalizing the constructed data set, and dividing the normalized data set into two parts, namely a training set and a test set; wherein the training set and the test set both include multiple data groups, and each data group includes a given pressure, a measured temperature and a measured pressure;

[0052] S2, using a genetic algorithm to optimize the weights and thresholds of the initial BP neural network to obtain an initial optimized BP neural network;

[0053] S3, using the training set to train the initially optimized BP neural network to obtain a trained BP neural network;

[0054] S4, using the test set to verify the trained BP neural network, when the verification is passed, the trained BP neural network is used as the optimal BP neural network, and step S5 is executed;

[0055] When the verification fails, the training set is used to train the BP neural network after the first training to obtain the BP neural network after the second training; the test set is used to verify the BP neural network after the second training. When the test set verifies the BP neural network after the second training, the BP neural network after the second training is used as the optimal BP neural network, and step S5 is executed;

[0056] S5. The optimal BP neural network performs temperature compensation on the measured pressure collected by the optical fiber pressure sensor to be tested according to the measured temperature and the measured pressure collected by the optical fiber pressure sensor to be tested, so as to obtain the compensated pressure;

[0057] S6. Use the Kalman filter algorithm to reduce the noise of the compensated pressure to obtain the corrected pressure, thereby completing the temperature compensation of the optical fiber pressure sensor.

[0058] When applied, firstly, a calibration experiment is carried out on the optical fiber pressure sensor to obtain experimental data, that is, a data set is constructed according to the measured temperature and measured pressure of the optical fiber pressure sensor under a given pressure; then, based on the genetic algorithm, as well as the training set and the test set, the optimal BP neural network is obtained; finally, the optical fiber pressure sensor to be tested is used to perform temperature compensation on the measured pressure received by the optimal BP neural network to obtain the compensated pressure, and the compensated pressure is de-noised by Kalman filtering, thereby completing the temperature compensation of the optical fiber pressure sensor. The present invention can effectively improve the defects of the traditional BP neural network, which is easy to fall into the local minimum. At the same time, the traditional BP neural network is optimized by the genetic algorithm, and then trained and verified to obtain the optimal BP neural network, and then the optimal BP neural network is used for temperature compensation and identification, which reduces the complexity and difficulty of the traditional Kalman in mathematical modeling. After the compensated pressure output after the optimal BP neural network identification is passed through the Kalman filter, the error is further reduced, and the stability and accuracy of the optical fiber pressure sensor under different ambient temperatures are improved.

[0059] Furthermore, in step S3, the BP neural network after initial optimization is trained using the training set to obtain the trained BP neural network, including:

[0060] S31, taking the measured temperature and the measured pressure in each data group in the training set as the input of the initially optimized BP neural network in turn, using the initially optimized BP neural network to perform temperature compensation on the received measured pressure, outputting the predicted pressure, and then calculating the actual pressure error between the predicted pressure and the corresponding given pressure, and the actual pressure error is used as the actual pressure error corresponding to the current data group;

[0061] S32, iteratively updating the weights and thresholds of the initially optimized BP neural network according to the actual pressure error corresponding to each data group; until the actual pressure error corresponding to the current data group is less than the preset pressure error, thereby obtaining a trained BP neural network.

[0062] Furthermore, the implementation of step S4, using the test set to verify the trained BP neural network once, includes:

[0063] First, the measured temperature and pressure in any data group in the test set are used as the input of the trained BP neural network. After the received measured pressure is temperature compensated by the trained BP neural network, the predicted pressure is output, and then the actual pressure error between the predicted pressure and the corresponding given pressure is calculated. The actual pressure error is used as the actual pressure error corresponding to the current data group.

[0064] If the actual pressure error corresponding to the current data set is less than the preset pressure error, the verification is successful;

[0065] If the actual pressure error corresponding to the current data set is greater than or equal to the preset pressure error, it means that the verification has failed.

[0066] Furthermore, in step S4, the BP neural network after the first training is trained using the training set to obtain the BP neural network after the second training in the following manner:

[0067] First, the measured temperature and the measured pressure in each data group in the training set are used as the input of the trained BP neural network in turn, and the received measured pressure is temperature compensated by the trained BP neural network, and the predicted pressure is output, and then the actual pressure error between the predicted pressure and the corresponding given pressure is calculated, and the actual pressure error is used as the actual pressure error corresponding to the current data group;

[0068] Finally, the weights and thresholds of the trained BP neural network are iteratively updated according to the actual pressure error corresponding to each data group; until the actual pressure error corresponding to the current data group is less than the preset pressure error, thereby obtaining the second-trained BP neural network.

[0069] When applied, the weight update expression is: Among them, η is the number of learning times, w is the weight, and E is the actual pressure error.

[0070] Furthermore, in step S4, the condition for the test set to verify the BP neural network after secondary training is:

[0071] First, the measured temperature and pressure in any data group in the test set are used as the input of the BP neural network after secondary training. After the received measured pressure is temperature compensated by the BP neural network after secondary training, the predicted pressure is output, and then the actual pressure error between the predicted pressure and the corresponding given pressure is calculated. The actual pressure error is used as the actual pressure error corresponding to the current data group.

[0072] If the actual pressure error corresponding to the current data set is less than the preset pressure error, the verification is successful.

[0073] For further details, see Figure 3 Step S2, using a genetic algorithm to optimize the weights and thresholds of the initial BP neural network, and the implementation method of obtaining the initial optimized BP neural network includes:

[0074] S21, encoding the weights and thresholds of the initial BP neural network multiple times, obtaining multiple gene code chains each time, and the multiple gene code chains obtained by multiple encodings constitute a population, and each gene code chain serves as an individual in the population;

[0075] S22, Genetic selection: Use the roulette wheel selection method to select the gene code chains corresponding to all individuals in the population, and select the two best gene code chains in the population;

[0076] S23, genetic crossover: cross the two best gene code chains in the population to form a new population;

[0077] S24, genetic mutation: mutate and select all gene code chains in the new population obtained in step S23 to obtain multiple mutated gene code chains, and each mutated gene code chain is regarded as an individual;

[0078] S25, calculating the probability of the individual fitness value corresponding to each mutated gene code chain, and selecting the individual gene code chain corresponding to the individual with the maximum probability of the individual fitness value for decoding, to obtain the optimal weight and optimal threshold of the initial BP neural network, thereby obtaining the initial optimized BP neural network.

[0079] Furthermore, in step S25, the implementation method of calculating the probability of the individual fitness value includes:

[0080] Calculate the fitness value F of the kth individual in the population k =y k -o k , and population fitness According to F k and F, obtain the kth individual fitness value probability P k =F k / F;

[0081] Among them, y k represents the kth prediction output of the initial BP neural network, o k Represents the kth expected output of the initial BP neural network, k and M are both positive integers, and k = 1, 2, 3...M.

[0082] For further details, see Figure 2 ,In S2, the initial BP neural network is a three-layer BP network model, and its specific structure includes 2 output layers, 5 hidden layers and 1 output layer;

[0083] And the learning function in the initial BP neural network is learngdm, and the training function is trainlm function.

[0084] When applied, the two output layers are used to receive the measured temperature and the measured pressure of the optical fiber pressure sensor respectively.

[0085] Furthermore, the implementation of step S1, normalization processing, is as follows:

[0086]

[0087] in, represents the normalized result, x represents the input value, and x min Indicates the smallest value in the row, x max Indicates the maximum value in the row.

[0088] In specific applications, the implementation of the Kalman filter algorithm is as follows:

[0089] The state equation is:

[0090] x(k)=Ax(k-1)+Bu(k)+w(k);

[0091] The observation equation is:

[0092] z(k)=Hx(k)+v(k);

[0093] The state update equation is:

[0094] x(k|k)=x(k|k-1)+K(k)ε(k); where, ε(k)=z(k)-H(k)x(k|k-1);

[0095] The error variance matrix prediction equation is:

[0096] P(k|k-1)=AP(k-1|k-1)A T +Q;

[0097] The filter gain matrix equation is:

[0098] K(k)=P(k|k-1)H T (HP(k|k-1)H T +R) -1 ;

[0099] The error variance matrix update equation is:

[0100] P(k|k)=[1-K(k)H]P(k|k-1);

[0101] Where: x(k) is the state vector at time k, A represents the state transfer matrix, B represents the input control matrix, x(k-1) is the state vector at time k-1, u(k) represents the control amount 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 the observation matrix; v(k) is the observation noise at time k, x(k|k) is the state vector at the current time, x(k|k-1) is the state vector at the previous time, K(k) is the Kalman filter gain at time k, ε(k) is the new information at time k, H(k) is the observation matrix at time k, P(k|k-1) is the error variance prediction value of the previous k-1 time for predicting the k time, P(k-1|k-1) is the error variance value at time k-1, P(k|k) is the error variance value at time k, Q is the variance matrix of w(k), and is the process noise variance value, R is the v(k) observation noise variance matrix, and is the observation noise variance.

[0102] The following drawings verify the technical effects of this application:

[0103] Figure 4 It is an input-output curve diagram after the optimal BP neural network identification. It can be seen from the figure that after the optimal BP neural network compensation identification, the given pressure and the output pressure at each temperature basically maintain a straight line, and the given pressure and the output pressure at multiple different temperatures basically maintain a straight line, and multiple straight lines basically coincide. 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.

[0104] Figure 5 Figure 1 is an error diagram of the optimal BP neural network (i.e., GA-BP) obtained by the present invention and the traditional BP neural network (BP). It can be seen from the figure that the error of the BP neural network after being optimized by the genetic algorithm, that is, the optimal BP neural network obtained by the present invention is smaller than that of the traditional BP neural network alone; Figure 5 It can be seen that the error curve corresponding to GA-BP is more stable and the error amplitude is small. It can be seen that the prediction accuracy of the optimal BP neural network (i.e. GA-BP) of the present invention is higher, while the error curve corresponding to the BP neural network (i.e. BP) fluctuates greatly, 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.

[0105] Figure 6 This is the filtering effect diagram of the Kalman filtering algorithm. Figure 6Specifically, the data obtained by the optimal BP neural network identification is subjected to noise reduction processing by the Kalman filter algorithm; Figure 6 The four curves in the figure represent the expected value curve of the optimal BP neural network, the observed value curve of the optimal BP neural network with the process noise added to the real value predicted, the real value curve of the Kalman filter algorithm with the observation noise added to the observed value, and the Kalman filter value of the real value predicted by the optimal BP neural network after Kalman filtering. Figure 6 It can be seen that the value after Kalman filtering has a good denoising effect and is closer to the expected value. Among them, the optimal expected value curve of the BP neural network is also the given pressure curve of the continuously given optical fiber sensing pressure sensor, and the given pressure is continuously 6Mpa.

[0106] Figure 7 is a relative error comparison diagram after compensation by the optimal BP neural network (GA-BP) described in the present invention and after filtering by the Kalman algorithm; Figure 7 It can be seen 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.

[0107] The present invention uses a genetic optimization algorithm to obtain the weights and thresholds of the optimal solution as the weights and thresholds of the initial BP neural network, thereby solving the problem that the traditional BP neural network is prone to fall into the minimum value problem; the initial optimized BP neural network established according to the optimal solution is trained and verified to obtain the optimal BP neural network;

[0108] The present invention optimizes the initial BP neural network by using a genetic optimization algorithm to obtain the optimal solution as the weight and threshold of the initially optimized BP neural network, thereby solving the problem that the traditional BP neural network is prone to fall into the minimum value; the initial optimized BP neural network established according to the optimal solution is trained and verified to obtain the optimal BP neural network for identification, thereby reducing the complexity and difficulty of the traditional Kalman in mathematical modeling; the data obtained according to the optimal BP neural network is then subjected to noise reduction processing by the Kalman filtering algorithm, and experimental verification shows that the measurement accuracy and stability of the optical fiber pressure sensor are greatly improved, and a good compensation effect is obtained.

[0109] Although the present invention is described herein with reference to specific embodiments, it should be understood that these embodiments are merely examples of the principles and applications of the present invention. It should therefore be understood that many modifications may be made to the exemplary 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 the various dependent claims and features described herein may be combined in a manner different from that described in the original claims. It should also be understood that features described in conjunction with individual embodiments may be used in other described embodiments.

Claims

1. A temperature compensation method for an optical fiber pressure sensor based on a fusion of a neural network and a Kalman filter, characterized in that: The method comprises the following steps: S1. constructing a data set according to the measured temperature and measured pressure of the optical fiber pressure sensor under a given pressure, and normalizing the constructed data set, and dividing the normalized data set into two parts, namely a training set and a test set; wherein the training set and the test set both include multiple data groups, and each data group includes a given pressure, a measured temperature and a measured pressure; S2. Optimize the weights and thresholds of the initial BP neural network using a genetic algorithm to obtain an initial optimized BP neural network; specifically: S21, encoding the weights and thresholds of the initial BP neural network multiple times, obtaining multiple gene code chains each time, and the multiple gene code chains obtained by multiple encodings constitute a population, and each gene code chain serves as an individual in the population; S22, Genetic selection: Use the roulette wheel selection method to select the gene code chains corresponding to all individuals in the population, and select the two best gene code chains in the population; S23, genetic crossover: cross the two best gene code chains in the population to form a new population; S24, genetic mutation: mutate and select all gene code chains in the new population obtained in step S23 to obtain multiple mutated gene code chains, and each mutated gene code chain is regarded as an individual; S25, calculating the probability of the individual fitness value corresponding to each mutated gene code chain, and selecting the individual gene code chain corresponding to the individual with the maximum probability of the individual fitness value for decoding, to obtain the optimal weight and optimal threshold of the initial BP neural network, thereby obtaining the initial optimized BP neural network; The implementation methods for calculating the probability of individual fitness values ​​include: Calculate the fitness value F of the kth individual in the population k =y k -o k , and population fitness According to F k and F, obtain the kth individual fitness value probability P k =F k / F; Among them, y k represents the kth prediction output of the initial BP neural network, o k represents the kth expected output of the initial BP neural network, k and M are both positive integers, and k = 1, 2, 3...M; S3, using the training set to train the BP neural network after initial optimization to obtain a trained BP neural network; specifically: S31, taking the measured temperature and the measured pressure in each data group in the training set as the input of the initially optimized BP neural network in turn, using the initially optimized BP neural network to perform temperature compensation on the received measured pressure, outputting the predicted pressure, and then calculating the actual pressure error between the predicted pressure and the corresponding given pressure, and the actual pressure error is used as the actual pressure error corresponding to the current data group; S32, iteratively updating the weights and thresholds of the initially optimized BP neural network according to the actual pressure error corresponding to each data group; until the actual pressure error corresponding to the current data group is less than the preset pressure error, thereby obtaining a trained BP neural network; S4, using the test set to verify the trained BP neural network, when the verification is passed, the trained BP neural network is used as the optimal BP neural network, and step S5 is executed; When the verification fails, the training set is used to train the BP neural network after the first training to obtain the BP neural network after the second training; the test set is used to verify the BP neural network after the second training. When the test set verifies the BP neural network after the second training, the BP neural network after the second training is used as the optimal BP neural network, and step S5 is executed; The implementation method of obtaining the BP neural network after secondary training is: First, the measured temperature and the measured pressure in each data group in the training set are used as the input of the trained BP neural network in turn, and the received measured pressure is temperature compensated by the trained BP neural network, and the predicted pressure is output, and then the actual pressure error between the predicted pressure and the corresponding given pressure is calculated, and the actual pressure error is used as the actual pressure error corresponding to the current data group; Finally, the weights and thresholds of the trained BP neural network are iteratively updated according to the actual pressure error corresponding to each data group; until the actual pressure error corresponding to the current data group is less than the preset pressure error, thereby obtaining the second-trained BP neural network; S5. The optimal BP neural network performs temperature compensation on the measured pressure collected by the optical fiber pressure sensor to be tested according to the measured temperature and the measured pressure collected by the optical fiber pressure sensor to be tested, so as to obtain the compensated pressure; S6. Use the Kalman filter algorithm to reduce the noise of the compensated pressure to obtain the corrected pressure, thereby completing the temperature compensation of the optical fiber pressure sensor.

2. The temperature compensation method for an optical fiber pressure sensor by integrating a neural network and a Kalman filter according to claim 1 is characterized in that: Step S4, the implementation method of using the test set to verify the BP neural network after one training includes: First, the measured temperature and pressure in any data group in the test set are used as the input of the trained BP neural network. After the received measured pressure is temperature compensated by the trained BP neural network, the predicted pressure is output, and then the actual pressure error between the predicted pressure and the corresponding given pressure is calculated. The actual pressure error is used as the actual pressure error corresponding to the current data group. If the actual pressure error corresponding to the current data set is less than the preset pressure error, the verification is successful; If the actual pressure error corresponding to the current data set is greater than or equal to the preset pressure error, it means that the verification has failed.

3. The temperature compensation method for an optical fiber pressure sensor by integrating a neural network and a Kalman filter according to claim 1, characterized in that: In step S4, the conditions for the test set to verify the BP neural network after secondary training are: First, the measured temperature and pressure in any data group in the test set are used as the input of the BP neural network after secondary training. After the received measured pressure is temperature compensated by the BP neural network after secondary training, the predicted pressure is output, and then the actual pressure error between the predicted pressure and the corresponding given pressure is calculated. The actual pressure error is used as the actual pressure error corresponding to the current data group. If the actual pressure error corresponding to the current data set is less than the preset pressure error, the verification is successful.

4. The temperature compensation method for an optical fiber pressure sensor by integrating a neural network and a Kalman filter according to claim 1, characterized in that: In S2, the initial BP neural network is a three-layer BP network model, and its specific structure 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 trainlm function.

5. The temperature compensation method for optical fiber pressure sensor by integrating neural network and Kalman filter according to claim 1 is characterized in that: Step S1, normalization processing is implemented as follows: in, represents the normalized result, x represents the input value, and x min Indicates the smallest value in the row, x max Indicates the maximum value in the row.

Citation Information

Patent Citations

  • Calibration device, calibration method, and measurement system

    CN107884099A

  • Pile group node stress monitoring system based on neural network algorithm and early warning method thereof

    CN114544040A