CN117308876A - Air pressure sensor error correction compensation method and system based on LSTM neural network - Google Patents

Air pressure sensor error correction compensation method and system based on LSTM neural network Download PDF

Info

Publication number
CN117308876A
CN117308876A CN202311279003.9A CN202311279003A CN117308876A CN 117308876 A CN117308876 A CN 117308876A CN 202311279003 A CN202311279003 A CN 202311279003A CN 117308876 A CN117308876 A CN 117308876A
Authority
CN
China
Prior art keywords
air pressure
pressure sensor
error
measurement
neural network
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
CN202311279003.9A
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.)
Beijing Huaqing Future Energy Technology Research Institute Co ltd
Huake Inno Jiangsu Energy Technology Co ltd
Huake Inno Qingdao Energy Technology Co ltd
Shandong Huake Information Technology Co ltd
Original Assignee
Beijing Huaqing Future Energy Technology Research Institute Co ltd
Huake Inno Jiangsu Energy Technology Co ltd
Huake Inno Qingdao Energy Technology Co ltd
Shandong Huake Information Technology Co ltd
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 Beijing Huaqing Future Energy Technology Research Institute Co ltd, Huake Inno Jiangsu Energy Technology Co ltd, Huake Inno Qingdao Energy Technology Co ltd, Shandong Huake Information Technology Co ltd filed Critical Beijing Huaqing Future Energy Technology Research Institute Co ltd
Priority to CN202311279003.9A priority Critical patent/CN117308876A/en
Publication of CN117308876A publication Critical patent/CN117308876A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01CMEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
    • G01C5/00Measuring height; Measuring distances transverse to line of sight; Levelling between separated points; Surveyors' levels
    • G01C5/06Measuring height; Measuring distances transverse to line of sight; Levelling between separated points; Surveyors' levels by using barometric means
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01CMEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
    • G01C25/00Manufacturing, calibrating, cleaning, or repairing instruments or devices referred to in the other groups of this subclass
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01DMEASURING NOT SPECIALLY ADAPTED FOR A SPECIFIC VARIABLE; ARRANGEMENTS FOR MEASURING TWO OR MORE VARIABLES NOT COVERED IN A SINGLE OTHER SUBCLASS; TARIFF METERING APPARATUS; MEASURING OR TESTING NOT OTHERWISE PROVIDED FOR
    • G01D21/00Measuring or testing not otherwise provided for
    • G01D21/02Measuring two or more variables by means not covered by a single other subclass
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/004Artificial life, i.e. computing arrangements simulating life
    • G06N3/006Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/044Recurrent networks, e.g. Hopfield networks
    • G06N3/0442Recurrent networks, e.g. Hopfield networks characterised by memory or gating, e.g. long short-term memory [LSTM] or gated recurrent units [GRU]
    • 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/0985Hyperparameter optimisation; Meta-learning; Learning-to-learn

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Molecular Biology (AREA)
  • Evolutionary Computation (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Mathematical Physics (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Remote Sensing (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Manufacturing & Machinery (AREA)
  • Testing Or Calibration Of Command Recording Devices (AREA)

Abstract

The invention belongs to the technical field of electronic measurement, and provides an error correction and compensation method and system for an air pressure sensor based on an LSTM neural network. And finally, removing errors from the measurement result of the air pressure sensor to realize real-time correction of the errors. The modeling influence factors based on the air pressure sensor errors are considered, the loss of the error model prediction precision is effectively controlled, the precision and the effect of error correction are improved, and the method can be applied to multiple fields.

Description

Air pressure sensor error correction compensation method and system based on LSTM neural network
Technical Field
The invention belongs to the technical field of electronic measurement, and particularly relates to an error correction and compensation method and system for an air pressure sensor based on an LSTM neural network.
Background
The statements in this section merely provide background information related to the present disclosure and may not necessarily constitute prior art.
The air pressure sensor is used for measuring the absolute pressure of air, and can be applied to weather forecast, height positioning and the like. The altitude at present can be calculated according to the air pressure measured by the pressure sensor in the mobile phone; the air pressure sensor can be used for assisting navigation, so that errors in navigation on the viaduct are reduced; and when the signal is not in a zone, accurate positioning can be realized according to the air pressure sensor and simultaneously by matching with equipment such as an accelerometer, a gyroscope and the like.
Indoor navigation is one typical application of barometric pressure sensors, where air pressure data may be used to determine which floor in a building a user is currently located on, and thus ascertain the path of travel of someone in a mall or underground parking garage. Of course, in an outdoor environment, the barometric pressure sensor also has the function of correcting positioning data, such as GPS positioning. Because the GPS technology is also limited, the GPS can be inaccurately positioned due to the influence of tree, building, bad weather conditions or insufficient satellite collection, and the intelligent mobile phone can compare the measured height data with the data in the database by adding the air pressure sensor so as to compensate the positioning error of the GPS. However, barometric sensors are also subject to errors during the measurement process, which may occur due to instrument itself, tightness errors, environmental factors, and additional errors associated with other devices during the measurement process over time.
Disclosure of Invention
In order to solve at least one technical problem in the background art, the invention provides an error correction and compensation method and system for an air pressure sensor based on an LSTM neural network, which are used for solving an error by using a measured value and a true value of the air pressure sensor and establishing an LSTM neural network model by using the error. And finally, removing errors from the measurement result of the air pressure sensor to realize real-time correction of the errors.
In order to achieve the above purpose, the present invention adopts the following technical scheme:
the first aspect of the invention provides an error correction and compensation method for an air pressure sensor based on an LSTM neural network, which comprises the following steps:
obtaining a measurement error of the air pressure sensor according to the measurement height data and the actual height data;
acquiring temperature and humidity values of a measurement place;
based on the measurement error of the air pressure sensor, the temperature and humidity value of the measurement place, and the air pressure sensor error prediction model, the error at different heights is predicted; the construction process of the air pressure sensor error prediction model comprises the following steps:
improving an LSTM model by using a sparrow algorithm, taking learning rate and hidden unit number parameter codes in the LSTM model as position vectors of the sparrows, taking an optimal solution obtained by the sparrow algorithm as super parameters of the LSTM model, taking a measurement error of the air pressure sensor and temperature and humidity values of a measurement place as inputs, learning errors generated in the measurement process of the air pressure sensor, and predicting measurement error values generated at different heights;
and obtaining a corrected height value by using the errors and the measured values at different heights.
A second aspect of the present invention provides an LSTM neural network-based air pressure sensor error correction compensation system, comprising:
the data acquisition module is used for acquiring a measurement error of the air pressure sensor according to the measurement height data and the actual height data and acquiring a temperature and humidity value of a measurement place;
the error prediction module is used for predicting the errors at different heights by combining the air pressure sensor error prediction model based on the measurement errors of the air pressure sensor and the temperature and humidity values of the measurement place; the construction process of the air pressure sensor error prediction model comprises the following steps:
an improved sparrow algorithm is adopted to improve an LSTM model, learning rate and hidden unit number parameter codes in the LSTM model are used as position vectors of sparrows, an optimal solution obtained through the sparrow algorithm is used as super parameters of the LSTM model, measurement errors of an air pressure sensor, temperature and humidity values of a measurement place are used as inputs, errors generated in the measurement process of the air pressure sensor are learned, and measurement error values generated at different heights are predicted;
and the correction compensation module is used for obtaining a corrected height value by utilizing the errors and the measured values at different heights.
A third aspect of the present invention provides a computer-readable storage medium.
A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps in the LSTM neural network based barometric pressure sensor error correction compensation method described above.
A fourth aspect of the invention provides a computer device.
A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps in the LSTM neural network based barometric sensor error correction compensation method as described above when the program is executed.
Compared with the prior art, the invention has the beneficial effects that:
1. the invention calculates the error by using the measured value and the true value of the air pressure sensor, and then establishes the LSTM neural network model by using the error. And finally, removing errors from the measurement result of the air pressure sensor to realize real-time correction of the errors, and correcting the errors generated when the air pressure sensor is used for measuring the height.
2. The invention adopts the sparrow algorithm to improve the LSTM model to learn the errors generated in the measuring process of the air pressure sensor, predicts the error values generated at different heights, and then performs error compensation when the sensor is used for measuring. The sparrow algorithm is based on the principle of crowd wisdom, and combines a plurality of LSTM models to learn together by simulating the behavior of sparrows in the foraging process. The method can increase the diversity and the robustness of the model and improve the adaptability of the model to different error modes. In addition, the air pressure sensor may be affected by various interference factors during the measurement process, resulting in error generation. The sparrow algorithm can help the LSTM model to effectively model the errors, so that the characteristics of different error sources can be better understood and captured, and the prediction and correction capability of the errors can be improved.
Additional aspects of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the invention.
FIG. 1 is a schematic overall flow chart of an error correction and compensation method for an air pressure sensor based on an LSTM neural network according to an embodiment of the present invention;
fig. 2 is a schematic diagram of an improved sparrow search algorithm for improving LSTM model according to an embodiment of the present invention.
Detailed Description
The invention will be further described with reference to the drawings and examples.
It should be noted that the following detailed description is illustrative and is intended to provide further explanation of the invention. Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
It is noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of exemplary embodiments according to the present invention. As used herein, the singular is also intended to include the plural unless the context clearly indicates otherwise, and furthermore, it is to be understood that the terms "comprises" and/or "comprising" when used in this specification are taken to specify the presence of stated features, steps, operations, devices, components, and/or combinations thereof.
Aiming at the technical problems mentioned in the background art of the application, the invention adopts the levy flight strategy to improve the sparrow algorithm, then the improved sparrow algorithm is used for improving the LSTM model to learn the errors generated in the measuring process of the air pressure sensor, then the error values generated at different heights are predicted, and then the errors are compensated when the sensor is used for measuring. The error of the sensor causes the error of the instrument, the tightness error, the environmental error and other factors, so that the modeling based on the air pressure sensor error has a plurality of influence factors to be considered. The method comprises the steps of determining the error of a device, wherein the error of the device is based on the error of the device and the error of tightness, and the error is solved by using test data modeling of the same type of device; the main sources of environmental errors are temperature and humidity, so the invention builds an error model of the same equipment under the conditions of different temperatures and humidity.
The invention adopts the difference between the measured value of the air pressure sensor and the actual value to obtain the measured error value of the air pressure sensor, then utilizes the WheatA software to obtain the temperature and humidity weather factors of the region, uses the temperature and humidity factors as influencing factors, uses the improved sparrow algorithm to improve the LSTM neural network model to model the error, and finally uses the model to predict the error under the conditions of different temperatures and humidity to carry out error correction on the measured value of the air pressure sensor, thus obtaining the corrected value.
Example 1
As shown in fig. 1, the embodiment provides a method for correcting and compensating an error of a barometric sensor based on an LSTM neural network, which includes the following steps:
step 1: acquiring measurement height data and actual height data of the air pressure sensor;
step 2: obtaining an error according to the measured height data and the actual height data;
step 3: acquiring local weather data, including temperature and humidity values;
step 4: adopting an improved sparrow algorithm to improve the LSTM neural model to obtain an LSTM neural network model with optimized parameters;
step 5: taking the height errors of different positions at the time t, the temperature at the time t and the humidity at the time t as inputs, and predicting and obtaining the errors at different heights based on the LSTM neural network model after parameter optimization;
step 6: and obtaining a corrected height value by using the predicted error and the measured value of the air pressure sensor.
In order to more clearly illustrate the technical scheme of the invention, the following is a specific description in the form of examples.
In step 1, the height values H of the air pressure sensors of the same model under different temperatures and humidity are obtained by using the same brand measure ={h 1 ,h 2 ,...,h n N is the nth position, h n Is the height of the nth position.
In step 2, the actual height value H of the corresponding position is used real ={h 1 ′,h 2 ′,...,h n ' and barometric sensor measuring height H measure The difference is taken to obtain the height error delta H=H at different positions real -H measure ={Δh 1 ,Δh 2 ,...,Δh n N is the nth position, Δh n Is the error of the nth position.
In step 3, in this embodiment, the weather a software is used to obtain the temperature and humidity of the measured date, and the temperature p= { P at the measurement time is selected 1 ,p 2 ,...,p n Humidity w= { W 1 ,w 2 ,...,w n N is the nth position, w n Is the humidity of the nth position, p n Is the temperature at the nth location.
In step 4, a sparrow algorithm is adopted to improve the LSTM model, as shown in fig. 2, and the sparrow search algorithm is an intelligent optimization algorithm derived from natural activities of sparrow foraging and escape predation. Sparrow divides the population into discoverers and followers according to proportion to feed, and meanwhile, a danger early warning mechanism is superimposed to prevent predation. The finders in the sparrows are responsible for the group to find the responsibility of food and provide the direction of foraging for the followers, and a certain proportion of sparrows are selected as the finders to discard the food after the finders find danger. Each sparrow represents the attribute of the sparrow through the position and the fitness value, the fitness value of each individual is calculated and ordered, the positions of the discoverers, the joiners and the detectors are updated continuously along with the increase of the iteration times, and the whole population is close to the optimal solution, namely the optimal food position. SSA has high convergence rate and good stability due to strong optimizing capability, and is applied to a plurality of practical engineering fields, and the problem of low network convergence rate and precision can be solved by optimizing the LSTM neural network. However, the sparrow algorithm has the defect of being trapped in local optimum, so that the sparrow algorithm is improved, disturbance variation is carried out on an optimum solution, and the local escape capacity is enhanced.
The LSTM model is improved by adopting a sparrow algorithm, and the method comprises the following steps of:
step 201: coding two parameters, namely a learning rate and the number of hidden units in the LSTM neural network to obtain a sparrow position vector d;
step 202: initializing a population, wherein the proportion of discoverers is 0.2, the proportion of joiners is 0.7, and the proportion of detectors is 0.1;
step 203: determining a fitness function:
the fitness function is used to measure the performance of the LSTM model under certain hyper-parameter combinations.
The present embodiment uses the Mean Square Error (MSE) as the fitness function, measuring the difference between the model prediction error and the actual error. The smaller the value of the fitness function, the better the fitting of the LSTM model.
Where n represents the number of samples, y i Is the actual output value of the i-th sample,is the predicted output value of the LSTM model;
step 204: calculating the fitness value of individuals in the population, and sequencing;
the population consisting of n sparrows can be expressed as follows:
where d represents the dimension of the variable to be optimized and n is the number of sparrows. Then, the fitness value of all sparrows can be expressed as follows:
where f represents a fitness value. In SSA, discoverers with better fitness values will take food preferentially during the search. In addition, because the discoverers are responsible for finding food for the entire sparrow population and providing directions for all the participants to find food. Thus, the discoverer can obtain a larger search range for forages than the joiner.
Step 205: according to equations (2) and (3), the position of the finder is updated during each iteration:
where t represents the current number of iterations, the range of j is (1, 2., d),the value of the j dimension of the ith sparrow at the t-th generation is shown. Ter (iter) max The maximum number of selections is set, i.e., the value that is to be set how many times it is to be selected to end. Alpha epsilon (0, 1)]Is a random number, R 2 (R 2 ∈[0,1]) And ST (ST.epsilon.0.5, 1.0]) Respectively representing an alarm value and a safety threshold. Q is a random number satisfying normal distribution, L is a matrix of 1×d, and the elements inside are all 1.
When R is 2 When < ST, this means that there are no predators around the foraging environment at this time, the discoverer can perform a broad search operation when R 2 When ST is not less, this means that some sparrows in the population have found predators and alert others in the population, at which point all the sparrows need to fly quickly to other safe places for foraging. For the joiner, they need to perform equation (4) and equation (5).
As described above, during the foraging process, some participants monitor the discoverers at all times, and once they perceive that the discoverers have found better food, they immediately leave the current location to compete for food. If they win, they can immediately get the finder's food, otherwise, it is necessary to continue to execute equation (5).
Step 206: updating the location of the enrollee:
wherein X is p Is the optimal position occupied by the present discoverer,representing the value of the j dimension of the ith sparrow at the t-th generation,/>Represents the optimal position occupied by the finder iterated to t+1 times, X worst Then the current fullThe worst local position. A represents a 1×d matrix in which each element is randomly assigned 1 or-1, and A + =A T (AA T ) -1 When->This indicates that the ith participant with a lower fitness value does not gain food and is in a very starved condition where it needs to fly to other places to gain more energy.
In simulation experiments, it was assumed that these dangerously perceived sparrows account for 10% to 20% of the total number. The initial positions of the sparrows are randomly generated in the population.
Step 207: optimizing update of the location of the inspector:
wherein v is 1 And v 2 A random number of 0 to 1, alpha being a constant,representing the value of the j dimension of the ith sparrow, X, at the t-th generation best Is the current global optimum. Beta is a random number subject to a normal distribution with a mean value of 0 and a variance of 1 as a step control parameter. K epsilon [ -1,1]Is a random number f i Then the fitness value of the current sparrow individual is f g And f w The current global best and worst fitness values, respectively, epsilon is the smallest constant to avoid a denominator of 0. When f i >f g Indicating that sparrows are at the edge of the population at this time, are extremely vulnerable to predators. X is X best It is also quite safe that sparrows representing this location are the best locations in the population. f (f) i =f g This indicates that sparrows in the middle of the population are aware of the danger and need to be close to other sparrows to minimize their risk of predation. K represents the direction of sparrow movement and is also a step control parameter.
Where Γ is the gamma function and α is a constant.
Step 208: calculating a fitness value and updating the sparrow position;
step 209: judging whether the maximum iteration times are reached, if so, restoring the optimal position (the individual with the minimum MSE value) into the corresponding initial parameters of the LSTM neural network, otherwise, repeating the steps 204-208;
step 210: selecting optimal super parameters, and after convergence, selecting an individual X with the minimum fitness function value best The corresponding LSTM super-parameters are used as the optimal input dimension and hidden layer dimension.
In step 3, predicting the error value under different heights based on the LSTM neural network model after parameter optimization includes:
establishing an LSTM error model by taking the height, the temperature and the humidity as influence factors, and predicting:
x t =[ΔH t ,P t ,W t ] (8)
wherein x is t Representing the input value of the LSTM model [ delta H ] t ,P t ,W t ]The table shows the difference in height at time t, the temperature at time t, and the humidity at time t.
The method specifically comprises the following steps:
step 301: controlling the passage of information by the forgetting gate layer through sigmoid, comprising:
according to the output h of the last moment t-1 (empty at first input) and current input x t ,[ΔH t ,P t ,W t ]To generate an f of 0 to 1 t Values. To determine whether to let the last learned information C t-1 Pass through or partially pass through. The following are provided:
f t =σ(W f ·[h t-1 ,x t ]+b f ) (9)
in which W is f Is the weight moment of forgetting gateArray, [ h ] t-1 ,x t ]Representing the joining of two vectors into one longer vector, b f Is a bias term for the forgetting gate and σ is a sigmoid function.
Step 302: generating new information to be updated, this step comprising two parts, the first one being that an input layer decides updated values by sigmoid and the second one being that a tanh layer is used to generate new candidate valuesIt may be added to the cell state as a candidate value generated by the current layer. The values generated by the two parts are combined for updating:
i t =σ(W i ·[h t-1 ,x t ]+b i ) (10)
in which W is i Is the weight matrix of the input gate, b i Is an offset term of the input gate; w (W) C Is the weight matrix of the input gate, b C Is an offset term of the input gate; c (C) t Is the state of the cell at the current time, which is the state C of the cell at the last time t-1 Multiplying element by forget gate and reusing currently entered cell stateElement-wise multiplication by input gate i t The two products are summed to produce the product.
Step 302: determining the output of a model, namely firstly obtaining an initial output through a sigmoid layer, then scaling a C_t value to be between-1 and 1 by using tanh, and multiplying the initial output by the output obtained by the sigmoid pair by pair so as to obtain the output of the model:
o t =σ(W o ·[h t-1 ,x t ]+b O ) (13)
h t =o t *tanh C t (14)
in which W is o Is the weight matrix of the output gate, b o Is the bias term of the output gate. h is a t Is the final output value.
In the formulas (9), (10), (11), (13), W f 、W i 、W C 、W o Are all matrices, if the dimension of the input is d x The dimension of the hidden layer is d h The dimension of the cell state is d c In general d c =d h Then use the weight matrix W of forgetting gate f By way of example, W f Dimension is d c ×(d h +d x ). In fact, the weight matrix W f The two matrixes are spliced to form: one is W fh It corresponds to the input item h t-1 Its dimension is d c ×d h The method comprises the steps of carrying out a first treatment on the surface of the One is W fx It corresponds to the input item x t Its dimension is d c ×d x 。W f Can be written as:
the bias term is equal to the number of neurons of the out layer of the hidden layer, and as can be seen from the above, the parameter weight matrix and the bias term are determined by the input dimension and the hidden layer dimension.
The invention adopts LSTM neural network method, has no stability requirement on error sequence, uses less data, effectively controls the loss of error model prediction precision, and improves the precision and effect of error correction. The air pressure sensor error compensation technology based on the LSTM neural network can be applied to various fields, such as meteorological observation, flight control, industrial automation and the like.
In meteorological observation applications, barometric pressure sensors are instruments commonly used in meteorological observations for measuring atmospheric pressure. However, the air pressure sensor may be affected by environmental factors such as temperature, humidity, etc., to generate errors. The error compensation technology based on the LSTM neural network can capture the relation between the sensor error and the environmental factors by learning a large amount of historical observation data, correct the sensor output in real time and improve the accuracy of the meteorological observation data.
In flight control applications, barometric pressure sensors are commonly used in aircraft to measure altitude and airspeed parameters, which are critical to flight control. However, during flight, the air pressure may be disturbed by factors such as climate, altitude change, etc., resulting in errors in the sensor output. By utilizing the error compensation technology of the LSTM neural network, the attitude data and the environmental information of the aircraft can be analyzed in real time, and the data of the air pressure sensor can be corrected, so that the accuracy and the safety of flight control are improved.
In industrial automation applications, barometric pressure sensors are widely used to monitor pressure changes in pipes, vessels, etc. in some industrial processes. However, the sensor itself has limitations in terms of accuracy, sensitivity, and the like, and may also be affected by environmental changes. The error compensation technology based on the LSTM neural network can utilize historical data to model a sensor error model, correct sensor output in real time and improve the stability and accuracy of an industrial automation process.
Example two
The embodiment provides an air pressure sensor error correction compensation system based on an LSTM neural network, which comprises:
the data acquisition module is used for acquiring a measurement error of the air pressure sensor according to the measurement height data and the actual height data and acquiring a temperature and humidity value of a measurement place;
the error prediction module is used for predicting the errors at different heights by combining the air pressure sensor error prediction model based on the measurement errors of the air pressure sensor and the temperature and humidity values of the measurement place; the construction process of the air pressure sensor error prediction model comprises the following steps:
improving an LSTM model by using a sparrow algorithm, taking learning rate and hidden unit number parameter codes in the LSTM model as position vectors of the sparrows, taking an optimal solution obtained by the sparrow algorithm as super parameters of the LSTM model, taking a measurement error of the air pressure sensor and temperature and humidity values of a measurement place as inputs, learning errors generated in the measurement process of the air pressure sensor, and predicting measurement error values generated at different heights;
and the correction compensation module is used for obtaining a corrected height value by utilizing the errors and the measured values at different heights.
Example III
The present embodiment provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps in the LSTM neural network-based barometric sensor error correction compensation method described above.
Example IV
The embodiment provides a computer device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the program to realize the steps in the error correction and compensation method of the air pressure sensor based on the LSTM neural network.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, magnetic disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Those skilled in the art will appreciate that implementing all or part of the above-described methods in accordance with the embodiments may be accomplished by way of a computer program stored on a computer readable storage medium, which when executed may comprise the steps of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random access Memory (Random AccessMemory, RAM), or the like.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. The air pressure sensor error correction compensation method based on the LSTM neural network is characterized by comprising the following steps of:
obtaining a measurement error of the air pressure sensor according to the measurement height data and the actual height data;
acquiring temperature and humidity values of a measurement place;
based on the measurement error of the air pressure sensor, the temperature and humidity value of the measurement place, and the air pressure sensor error prediction model, the error at different heights is predicted; the construction process of the air pressure sensor error prediction model comprises the following steps:
improving an LSTM model by using a sparrow algorithm, taking learning rate and hidden unit number parameter codes in the LSTM model as position vectors of the sparrows, taking an optimal solution obtained by the sparrow algorithm as super parameters of the LSTM model, taking a measurement error of the air pressure sensor and temperature and humidity values of a measurement place as inputs, learning errors generated in the measurement process of the air pressure sensor, and predicting measurement error values generated at different heights;
and obtaining a corrected height value by using the error value and the measured value at different heights.
2. The error correction and compensation method of air pressure sensor based on LSTM neural network as claimed in claim 1, wherein disturbance variation is performed when obtaining the optimal solution by sparrow algorithm, and the optimal solution is found by means of random walk and local search.
3. The error correction and compensation method for air pressure sensor based on LSTM neural network as claimed in claim 1, wherein the measured height data is measured heights of air pressure sensors of the same brand and the same model under different temperature and humidity conditions, and the height values under various temperatures and humidities are obtained.
4. The method for compensating error correction of air pressure sensor based on LSTM neural network as claimed in claim 1, wherein the method for improving LSTM model by using sparrow algorithm, wherein learning rate and hidden unit number parameter code in LSTM model are used as sparrow position vector, and optimal solution obtained by sparrow algorithm is used as super parameter of LSTM model, specifically comprising:
step 1: initializing a population, namely dividing sparrows into discoverers, joiners and investigation persons according to a proportion;
step 2: determining an fitness function, and measuring the performance of the LSTM model under a specific hyper-parameter combination by adopting the fitness function;
step 3: calculating fitness function values of individual sparrows, and iterating to obtain fitness values of all sparrows;
step 4: in the process of each iteration, the position of the finder, the position of the joiner and the position of the inspector are updated, disturbance variation is added, and the position of the inspector is optimized.
Step 5: calculating a fitness value and updating the sparrow position;
step 6: judging whether the maximum iteration times are reached, if so, restoring the optimal position to the corresponding initial parameters of the LSTM neural network, otherwise, repeating the steps 1-6;
step 7: and selecting the optimal super parameters, and after convergence, selecting the LSTM super parameters corresponding to the individual with the minimum fitness function value as the optimal input dimension and hidden layer dimension.
5. The LSTM neural network-based barometric sensor error correction compensation method of claim 3, wherein the fitness function uses a mean square error.
6. The LSTM neural network-based barometric sensor error correction compensation method of claim 3, wherein in each iteration, the expressions for updating the position of the finder and the position of the joiner are:
wherein t representsThe current number of iterations, j, ranges from (1, 2, …, d), d representing the dimension of the variable to be optimized, iter max Is the maximum number of generations, alpha epsilon (0, 1]Is a random number, R 2 ∈[0,1]And ST.epsilon.0.5, 1.0]Representing the alarm value and the security threshold, respectively, Q is a random number satisfying a normal distribution, L is a matrix of 1 xd,representing the value of the j dimension of the ith sparrow at the t-th generation,/>Representing the current global worst position, +.>Represents the optimal position occupied by iterating to t+1 discoverers, A represents a 1×d matrix.
7. The method for compensating error correction of barometric sensor based on LSTM neural network as claimed in claim 3, wherein the formula for adding disturbance variation and optimizing the position of the inspector is:
is the current global optimal position, beta is the step control parameter, f i Is the fitness value of the current sparrow individual, f g And f w The current global best and worst fitness values, respectively, ε is the smallest constant, v 1 And v 2 A random number of 0 to 1, a is a constant, and δ is a perturbation factor.
8. Air pressure sensor error correction compensation system based on LSTM neural network, characterized by comprising:
the data acquisition module is used for acquiring a measurement error of the air pressure sensor according to the measurement height data and the actual height data and acquiring a temperature and humidity value of a measurement place;
the error prediction module is used for predicting the errors at different heights by combining the air pressure sensor error prediction model based on the measurement errors of the air pressure sensor and the temperature and humidity values of the measurement place; the construction process of the air pressure sensor error prediction model comprises the following steps:
improving an LSTM model by using a sparrow algorithm, taking learning rate and hidden unit number parameter codes in the LSTM model as position vectors of the sparrows, taking an optimal solution obtained by the sparrow algorithm as super parameters of the LSTM model, taking a measurement error of the air pressure sensor and temperature and humidity values of a measurement place as inputs, learning errors generated in the measurement process of the air pressure sensor, and predicting measurement error values generated at different heights;
and the correction compensation module is used for obtaining a corrected height value by utilizing the errors and the measured values at different heights.
9. A computer-readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the steps in the LSTM neural network-based barometric sensor error correction compensation method according to any one of claims 1 to 7.
10. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor performs the steps in the LSTM neural network based barometric sensor error correction compensation method of any one of claims 1-7 when the program is executed.
CN202311279003.9A 2023-09-28 2023-09-28 Air pressure sensor error correction compensation method and system based on LSTM neural network Pending CN117308876A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311279003.9A CN117308876A (en) 2023-09-28 2023-09-28 Air pressure sensor error correction compensation method and system based on LSTM neural network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311279003.9A CN117308876A (en) 2023-09-28 2023-09-28 Air pressure sensor error correction compensation method and system based on LSTM neural network

Publications (1)

Publication Number Publication Date
CN117308876A true CN117308876A (en) 2023-12-29

Family

ID=89273352

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311279003.9A Pending CN117308876A (en) 2023-09-28 2023-09-28 Air pressure sensor error correction compensation method and system based on LSTM neural network

Country Status (1)

Country Link
CN (1) CN117308876A (en)

Similar Documents

Publication Publication Date Title
Yin et al. Intelligent particle filter and its application to fault detection of nonlinear system
CN109597864B (en) Method and system for real-time positioning and map construction of ellipsoid boundary Kalman filtering
Ryan et al. Particle filter based information-theoretic active sensing
Azami et al. Classification of GPS satellites using improved back propagation training algorithms
CN108682023A (en) Close coupling Unscented kalman tracking filter algorithm based on Elman neural networks
Li et al. Neural network based FastSLAM for autonomous robots in unknown environments
CN111310965A (en) Aircraft track prediction method based on LSTM network
CN113268074B (en) Unmanned aerial vehicle flight path planning method based on joint optimization
CN110068330B (en) Autonomous positioning method of robot based on ARMA model
CN107065897A (en) Three Degree Of Freedom helicopter explicit model forecast Control Algorithm
Hasan et al. Automatic estimation of inertial navigation system errors for global positioning system outage recovery
CN114819068A (en) Hybrid target track prediction method and system
Mokhtari et al. A novel bilateral fuzzy adaptive unscented kalman filter and its implementation to nonlinear systems with additive noise
Raza et al. Comparative study of powerful predictive modeling techniques for modeling monthly reference evapotranspiration in various climatic regions
CN110779526B (en) Path planning method, device and storage medium
Oosterom et al. Virtual sensor for the angle-of-attack signal in small commercial aircraft
CN117308876A (en) Air pressure sensor error correction compensation method and system based on LSTM neural network
CN115097548B (en) Sea fog classification early warning method, device, equipment and medium based on intelligent prediction
CN116502539A (en) VOCs gas concentration prediction method and system
CN114970745B (en) Intelligent security and environment big data system of Internet of things
Kakati et al. Remaining useful life predictions for turbofan engine degradation using online long short-term memory network
Essahafi et al. Microclimate control of a greenhouse by adaptive generalized linear quadratic strategy
Abdulsadda et al. An improved SPSA algorithm for system identification using fuzzy rules for training neural networks
Javed et al. Modelling and optimization of residential heating system using random neural networks
US11514268B2 (en) Method for the safe training of a dynamic model

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