Pressure sensor temperature compensation method and system based on integrated neural network
By using integrated neural networks in pressure sensors for temperature compensation, the problem that the existing technology cannot adapt to changes in different environments is solved, high-precision pressure data acquisition in complex environments is achieved, and the operational efficiency and safety of the system are improved.
Patent Information
- Application Number
- CN202510075504.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-17
- Publication Date
- 2025-05-06
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing pressure sensor temperature compensation system cannot adapt to the subtle changes between pressure and temperature in different environments, resulting in errors in complex environments and affecting accuracy.
The temperature compensation method of pressure sensor based on integrated neural network is adopted. Through the integrated neural network training method and pressure compensation method, the original data set is collected, feature selection and model training is performed, the temperature compensation integrated neural network model is built, and it is embedded in the pressure sensor. Combining real-time data and polynomial fitting is combined, the fusion process is carried out to achieve temperature compensation.
It effectively reduces the error of sensors in complex environments, improves the accuracy and reliability of pressure data, and enables the system to provide real pressure data under changing environmental conditions, improving operational efficiency and safety.
Smart Images

Figure CN119935407A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of mechanical sensing technology, and in particular to a temperature compensation method and system for a pressure sensor based on an integrated neural network. Background Art
[0002] In modern industrial and scientific applications, pressure sensors are widely used to monitor and control pressure in various applications. However, pressure readings are often affected by temperature, so pressure sensors need to be temperature compensated to eliminate temperature effects.
[0003] For example, a Chinese patent with publication number CN118565695A discloses a temperature compensation system for a pressure sensor, including a data acquisition unit, a judgment trigger unit, a temperature compensation unit, an optimization analysis unit, and a result output unit. In the present invention, the data acquired by the data acquisition unit can be received by the data receiving module, and then the threshold judgment module is used to assist in judging whether temperature compensation is needed, thereby improving the accuracy of the temperature compensation trigger. The model constructed by the model construction module can combine the least squares method with the interpolation method to process the temperature drift of the pressure sensor. The model training module and the combined optimization module can assist in the subsequent optimization of the model, thereby reducing the impact of extreme abnormal points on the sensor, avoiding the pathological problem caused by too high a fitting number, and ensuring the initial compensation effect of the sensor. The compensation analysis module is used to analyze the compensation results, and secondary optimization processing can be performed after analysis.
[0004] However, in the process of implementing relevant technical solutions, it was found that at least the following technical problems exist: The functional relationship between temperature and pressure varies with the environment. The above solution cannot adapt to environmental changes. For example, the relationship between pressure and temperature in plateau environments and tropical environments will be slightly different. Therefore, when performing temperature compensation, it will be affected by the environment, resulting in errors in complex environments and affecting accuracy. Summary of the invention
[0005] In order to solve the above problems, an embodiment of the present invention provides a temperature compensation method for a pressure sensor based on an integrated neural network, the method comprising an integrated neural network training method and a pressure compensation method; The integrated neural network training methods include: Collect the original dataset; Perform feature selection on the original data set to obtain the training set; Using the training set to train the pre-built initial integrated network model to obtain a temperature compensation integrated neural network model; Embed the temperature compensation integrated neural network model into the pressure sensor temperature compensation module; Pressure compensation methods include: Collect real-time data sets; Input the real-time data set into the temperature compensation integrated neural network model and output the integrated prediction value; Perform polynomial fitting on real-time data sets to obtain polynomial prediction values; The integrated prediction value is merged with the polynomial prediction value to obtain compensation data; The data output of the pressure sensor is adjusted according to the compensation data and the compensation data is displayed.
[0006] Furthermore, the method for obtaining the training set includes: Calculate the correlation coefficient between each training set feature and the target variable in the original data set; Correlation coefficient The calculation methods include: ; In the formula, is the training set feature; is the corresponding target variable; is the mean of the training set features; is the mean of the corresponding target variable; is the number of the training set features and the corresponding target variables; The absolute value of the correlation coefficient is compared with the preset correlation threshold. If it is greater than the correlation threshold, the corresponding training set feature is input into the database. If it is less than or equal to the preset correlation threshold, the corresponding training set feature is deleted. The feature elimination model is used to recursively eliminate the training set features in the database to obtain the training set.
[0007] Furthermore, the recursive feature elimination method includes: 101: Input the training set features in the database into the pre-built feature elimination model framework for training, and obtain the feature elimination model after the training is completed; 102: Input the training set features in the database into the feature elimination model to obtain the importance score; 103: Rank the importance scores of the training set features in ascending order, and delete the training set features whose ranking is less than a preset ranking threshold from the database; 104: Replace the feature elimination model framework with the feature elimination model and loop, loop 101 to 103, if the preset number of features is reached, stop the loop, concentrate the training set features in the database, and obtain the training set.
[0008] Furthermore, the training method of the feature elimination model includes: The training set features are used as the input of the feature elimination model. The feature elimination model uses the importance score corresponding to the prediction of each group of training set features as the output, the actual importance score corresponding to each group of training set features as the prediction target, and the sum of the first prediction accuracies of minimizing all predicted importance scores as the training target; the feature elimination model is trained until the sum of the first prediction accuracies reaches convergence, and the training is stopped; the feature elimination model is a random forest model.
[0009] Furthermore, the initial integrated network model includes an input layer, a multi-layer perceptron model framework, an integration layer, a fusion layer and an output layer; wherein the training set is input from the input layer to the multi-layer perceptron model framework, the multi-layer perceptron model framework includes a first hidden layer, a second hidden layer and a third hidden layer, the activation functions of the first hidden layer, the second hidden layer and the third hidden layer are all ReLU functions, the first hidden layer has N neurons, the second hidden layer has N neurons, the third hidden layer exists N neurons, N is a preset value. The training set passes through the multi-layer perceptron model framework to obtain a training feature selection set, which is input into the integration layer by the multi-layer perceptron model framework; the integration layer includes a first sub-model, a second sub-model and a third sub-model; the first sub-model is a multi-layer perceptron model, which has the same structure as the multi-layer perceptron model framework; the second sub-model is a random forest model; the third sub-model is a gradient boosting machine model; the fusion layer is a weighted average mathematical model, which performs k-fold cross validation on the first sub-model, the second sub-model and the third sub-model to obtain the weights corresponding to the first sub-model, the second sub-model and the third sub-model, and the weighted average mathematical model performs weighted average calculation on the output values of the first sub-model, the second sub-model and the third sub-model according to the weights to obtain the integrated prediction value; the training feature selection set includes the training set features.
[0010] Furthermore, the training method of the first sub-model includes: The training feature selection set is used as the input of the first sub-model. The first sub-model uses the first sub-model output value corresponding to each group of training feature selection sets as the output, the actual first sub-model output value corresponding to each group of training feature selection sets as the prediction target, and the sum of the second prediction accuracies of all predicted first sub-model output values is minimized as the training target. The first sub-model is trained until the sum of the second prediction accuracies reaches convergence and the training is stopped.
[0011] Furthermore, the training method of the second sub-model includes: Traverse the training feature selection set, select the middle value of two adjacent training set features in the training feature selection set as the candidate split point; according to the candidate split point, set the left subset and the right subset for each candidate split point, the left subset is the training set feature less than or equal to the current candidate split point, and the right subset is the training set feature greater than the current candidate split point; calculate the mean square error of the training set features in the left subset and the right subset; calculate the total mean square error of the candidate split point based on the mean square error of the training set features in the left subset and the right subset; the total mean square error The calculation methods include: ; In the formula, is the number of training set features in the left subset, is the number of training set features of the right subset, is the total number of features in the training set, is the mean square error of the training set features in the left subset, is the mean square error of the training set features in the right subset; Select the candidate split point with the smallest total mean square error as the best split point; The left subset and the right subset of the best split point are recursively operated until any one of the termination conditions of the second sub-model training is met.
[0012] Furthermore, the training method of the third sub-model includes: Set the initial output value of the third sub-model to the mean of the target variable; For the third sub-model Iterates until any one of the termination conditions of the third sub-model training is met; ≥ ≥1, no. The calculation method for the iterations includes: Calculate the residual, residual The calculation methods include: ; In the formula, is the number of the training set feature, For the The target variable is the training set features, For the The output value of the third sub-model at the iteration, For the training set features; The residual is used as the target variable for the next iteration, a new decision tree model is trained to fit the residual, and the output value of the third sub-model is updated according to the trained decision tree model.
[0013] Furthermore, the polynomial fitting method includes: Define the polynomial mathematical model, which includes: ; In the formula, is the polynomial prediction value, are the coefficients of the polynomial, For real-time datasets, is the degree of the polynomial; Minimize the residual sum of squares using a polynomial mathematical model, the residual sum of squares The calculation methods include: ; In the formula, is the total number of data points (i.e., temperature data and environmental variable data) in the real-time data set, Number the data points; The partial derivative of the residual sum of squares with respect to each polynomial coefficient is taken and set to zero, the optimal value of each polynomial coefficient is calculated, the optimal value is replaced into the polynomial mathematical model, the polynomial prediction value is obtained according to the polynomial mathematical model, and the polynomial fitting is completed.
[0014] A pressure sensor temperature compensation system based on an integrated neural network, the system comprising a training module, an embedding module and a pressure sensor temperature compensation module; The training module includes a training data acquisition unit, a preprocessing unit and an integrated neural network unit; A training data collection unit, wherein the training data collection unit is used to collect an original data set; A preprocessing unit, wherein the preprocessing unit is used to perform feature selection on the original data set to obtain a training set; An integrated neural network unit, wherein the integrated neural network unit is used to train a pre-built initial integrated network model using a training set to obtain a temperature compensation integrated neural network model; The embedding module is used to embed the temperature compensation integrated neural network model into the pressure sensor temperature compensation module; The pressure sensor temperature compensation module includes a real-time data collection unit, a first compensation fusion unit, a second compensation fusion unit, a third compensation fusion unit and a real-time compensation unit; A real-time data collection unit, wherein the real-time data collection unit is used to collect real-time data sets; A first compensation fusion unit, the first compensation fusion unit is used to input the real-time data set into the temperature compensation integrated neural network model and output an integrated prediction value; a second compensation fusion unit, the second compensation fusion unit being used to perform polynomial fitting on the real-time data set to obtain a polynomial prediction value; A third compensation fusion unit, the third compensation fusion unit is used to fuse the integrated prediction value with the polynomial prediction value to obtain compensation data; A real-time compensation unit is used to adjust the data output of the pressure sensor according to the compensation data and display the compensation data.
[0015] The technical effects and advantages of the pressure sensor temperature compensation system based on integrated neural network provided by the present invention are as follows: This solution effectively solves the problem of deviation in pressure sensor readings caused by environmental factors such as temperature and humidity, reduces the error of the sensor in complex environments, and enables it to provide real and reliable pressure data under changing environmental conditions, allowing related industries to carry out monitoring and control work efficiently, further improving operational efficiency and safety. The integrated neural network of this scheme can fully utilize the advantages of different models by combining multiple sub-models (such as multi-layer perceptron, random forest and gradient boosting machine), reduce the overfitting or underfitting problems that may be caused by a single model, and integrate the outputs of multiple models to obtain more accurate pressure compensation prediction values. By combining the integrated neural network and polynomial fitting, the system can effectively capture complex nonlinear relationships, adjust the output of the pressure sensor in real time, and overcome the reading deviation caused by environmental factors such as temperature and humidity. The real-time data update mechanism adopted enables the system to cope with changing environmental conditions, adjust the compensation strategy in time, and reduce the error of the sensor in complex environments. Through recursive feature elimination and correlation analysis, the features that significantly affect the model performance are further screened out to ensure the effectiveness and interpretability of the constructed temperature compensation integrated neural network model. The integrated prediction value and the polynomial prediction value are fused by the weighted average method, taking into account the performance of different models in different scenarios. The final output compensation data is more accurate, the error is reduced, and the overall performance of the system is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 This is a connection diagram of the pressure sensor temperature compensation system based on integrated neural network in Example 1; Figure 2 This is a flow chart of the recursive feature elimination method in Embodiment 1; Figure 3 This is a schematic diagram of the initial integrated network model structure in Example 1; Figure 4 This is a flow chart of the temperature compensation method for a pressure sensor based on an integrated neural network in Example 2. DETAILED DESCRIPTION
[0017] 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.
[0018] Embodiment 1: See also Figure 1 As shown, the pressure sensor temperature compensation system based on integrated neural network described in this embodiment includes a training module, an embedding module and a pressure sensor temperature compensation module; The training module includes a training data acquisition unit, a preprocessing unit and an integrated neural network unit; A training data collection unit collects raw data sets; The preprocessing unit performs feature selection on the original data set to obtain a training set; An integrated neural network unit is used to train a pre-built initial integrated network model using a training set to obtain a temperature compensation integrated neural network model; Embedding module, embedding the temperature compensation integrated neural network model into the pressure sensor temperature compensation module; The pressure sensor temperature compensation module includes a real-time data collection unit, a first compensation fusion unit, a second compensation fusion unit, a third compensation fusion unit and a real-time compensation unit; A real-time data collection unit collects real-time data sets; The first compensation fusion unit inputs the real-time data set into the temperature compensation integrated neural network model and outputs an integrated prediction value; The second compensation fusion unit performs polynomial fitting on the real-time data set to obtain the polynomial prediction value; The third compensation fusion unit fuses the integrated prediction value with the polynomial prediction value to obtain compensation data; The real-time compensation unit adjusts the data output of the pressure sensor according to the compensation data and displays the compensation data.
[0019] The original data set includes temperature data, pressure data, timestamp, environmental variable data and target variables; temperature data is obtained by temperature sensor and stored as temperature sensor readings; pressure data is obtained by pressure sensor and is first-hand data that has not been processed subsequently; timestamp is used to record the specific time of each data collection, which is helpful for subsequent time series analysis. The format is ISO 8601 format (such as YYYY-MM-DD HH:MM:SS) to accurately identify the time of each pair of temperature and pressure data; environmental variable data is environmental condition data that affects the relationship between pressure and temperature, such as humidity, air pressure, etc. The corresponding relationship between temperature and pressure in various environments is different. Humidity affects the density and fluidity of gas, thereby indirectly affecting pressure measurement. In a high humidity environment, the presence of water vapor may replace part of the air, resulting in a decrease in gas density. Therefore, under the same temperature conditions, increased humidity may cause the pressure sensor reading to decrease slightly; changes in atmospheric pressure (such as due to changes in weather systems) will directly affect the pressure sensor reading. In a low pressure state, the absolute pressure measured in the sensor may It will change with the decrease of atmospheric pressure. If the pressure sensor works in different pressure environments without compensation, it may cause different pressure values at the same temperature. For example, at high altitudes, the atmospheric pressure drops, so the pressure sensor reading will be lower than the reading at low altitudes at the same temperature. The temperature compensation integrated neural network model should take this into account to avoid unnecessary compensation errors. If the pressure sensor operates under high humidity conditions without considering this factor, it may cause errors. In the temperature compensation integrated neural network model, if the influence of humidity changes is not included, the changes caused by humidification treatment may be mistakenly interpreted as temperature changes, thereby affecting the final pressure reading; The methods for obtaining the training set include: Calculate the correlation coefficient between each training set feature and the target variable in the original data set. The training set features include temperature data, pressure data, timestamp, and environmental variable data. The target variable is the pressure data after temperature compensation. Correlation coefficient The calculation methods include: ; In the formula, is the training set feature; is the corresponding target variable; is the mean of the training set features; is the mean of the corresponding target variable; is the number of the training set features and the corresponding target variables.
[0020] The absolute value of the correlation coefficient is compared with the preset correlation threshold. If it is greater than the correlation threshold, the corresponding training set feature is input into the database. If it is less than or equal to the preset correlation threshold, the corresponding training set feature is deleted.
[0021] Using the feature elimination model to recursively eliminate the training set features in the database to obtain a training set; Among them, Figure 2 As shown, the method of recursive feature elimination includes: 101: Input the training set features in the database into the pre-built feature elimination model framework for training, and obtain the feature elimination model after the training is completed; 102: Input the training set features in the database into the feature elimination model to obtain the importance score; 103: Rank the importance scores of the training set features in ascending order, and delete the training set features whose ranking is less than a preset ranking threshold from the database; 104: Replace the feature elimination model framework with the feature elimination model and loop, loop 101 to 103, if the preset number of features is reached, stop the loop, concentrate the training set features in the database, and obtain the training set.
[0022] Through the two methods of correlation analysis and recursive feature elimination, the features that have a greater impact on model performance can be effectively screened out. Correlation analysis helps to identify the relationship between features and target variables, while recursive feature elimination gradually removes unimportant features through model feedback, thereby enhancing the interpretability and predictive ability of the model. The combination of the two can provide a more accurate feature selection strategy for the subsequent construction of the temperature compensation integrated neural network model, ensuring the effectiveness and interpretability of the temperature compensation integrated neural network model.
[0023] The training methods for the feature elimination model include: The training set features are used as the input of the feature elimination model. The feature elimination model uses the importance score corresponding to the prediction of each group of training set features as the output, the actual importance score corresponding to each group of training set features as the prediction target, and the sum of the first prediction accuracies that minimizes all predicted importance scores as the training target.
[0024] Among them, the calculation formula for the first prediction accuracy is: ,in, is the number of each set of training set features, is the first prediction accuracy, For the The importance score of the prediction corresponding to the training set feature, For the The actual importance scores corresponding to the features of the group training set are obtained; the feature elimination model is trained until the sum of the first prediction accuracies reaches convergence and the training is stopped; the feature elimination model is a random forest model.
[0025] like Figure 3 As shown, the initial integrated network model includes an input layer, a multi-layer perceptron model framework, an integration layer, a fusion layer and an output layer; wherein the training set is input from the input layer to the multi-layer perceptron model framework, and the multi-layer perceptron model framework includes a first hidden layer, a second hidden layer and a third hidden layer. The activation functions of the first hidden layer, the second hidden layer and the third hidden layer are all ReLU functions. There are N neurons in the first hidden layer and N neurons in the second hidden layer. N neurons, the third hidden layer exists N neurons, N is a preset value, the training set passes through the multi-layer perceptron model framework to obtain the training feature selection set, and the training feature selection set is input into the integration layer by the multi-layer perceptron model framework; the integration layer includes the first sub-model, the second sub-model and the third sub-model; the first sub-model is a multi-layer perceptron model, which has the same structure as the multi-layer perceptron model framework; the second sub-model is a random forest model; the third sub-model is a gradient boosting machine model; the fusion layer is a weighted average mathematical model, which performs k-fold cross validation on the first sub-model, the second sub-model and the third sub-model to obtain the weights corresponding to the first sub-model, the second sub-model and the third sub-model, and the weighted average mathematical model performs weighted average calculation on the output values of the first sub-model, the second sub-model and the third sub-model according to the weights to obtain the integrated prediction value; Exemplarily, k-fold cross validation is performed on the first sub-model, the second sub-model, and the third sub-model, and the mean square errors are respectively: First submodel: MSE = 0.3; Second submodel: MSE = 0.5; Third sub-model: MSE = 0.2.
[0026] By inverting the MSE (the better the performance, the higher the weight), we can get the corresponding weights: First submodel weight : ; Second sub-model weight : ; The third sub-model weight : .
[0027] Real-time data sets include temperature data, pressure data, and environmental variable data; Through multiple hidden layers and nonlinear activation functions (such as ReLU), the multi-layer perceptron can effectively capture the complex nonlinear relationship between input features (such as temperature, pressure, environmental variables, etc.) and target variables (temperature-compensated pressure, that is, the pressure value obtained by the test, which is the default accurate data reference). This enables the multi-layer perceptron to show strong learning ability when processing data with complex interaction effects and nonlinear characteristics; the random forest model has strong robustness in the face of noisy data and outliers by constructing multiple decision trees and voting or averaging their results. This feature can reduce the impact caused by environmental changes or measurement errors when processing actual sensor data, thereby improving the stability of temperature compensation; the gradient boosting machine model continuously reduces the prediction error of the model by gradually fitting the residual, which is the reason why it performs well in regression and classification problems. For complex temperature compensation problems, the gradient boosting machine model can continuously optimize on the basis of the previous round of models to improve the accuracy of the final prediction; the three sub-models complement each other in the integrated network model to jointly build a robust and efficient temperature compensation integrated neural network model to ensure that the pressure sensor can provide accurate pressure readings under various environmental conditions.
[0028] The training method of the first sub-model includes: The training feature selection set is used as the input of the first sub-model. The first sub-model takes the first sub-model output value corresponding to each group of training feature selection sets as the output, the actual first sub-model output value corresponding to each group of training feature selection sets as the prediction target, and minimizing the sum of the second prediction accuracies of all predicted first sub-model output values as the training target.
[0029] Among them, the calculation formula for the second prediction accuracy is: ,in, Select the set number for each set of training features, is the second prediction accuracy, For the The output value of the first sub-model corresponding to the training feature selection set, For the The actual first sub-model output value corresponding to the group training feature selection set is trained on the first sub-model, and the training is stopped when the sum of the second prediction accuracies reaches convergence.
[0030] The training method of the second sub-model includes: Traverse the training feature selection set, select the middle value of two adjacent training set features in the training feature selection set as the candidate split point; according to the candidate split point, set the left subset and the right subset for each candidate split point, the left subset is the training set feature less than or equal to the current candidate split point, and the right subset is the training set feature greater than the current candidate split point; calculate the mean square error of the training set features in the left subset and the right subset; calculate the total mean square error of the candidate split point based on the mean square error of the training set features in the left subset and the right subset; the total mean square error The calculation methods include: ; In the formula, is the number of training set features in the left subset, is the number of training set features of the right subset, is the total number of features in the training set, is the mean square error of the training set features in the left subset, is the mean square error of the training set features in the right subset.
[0031] Select the candidate split point with the smallest total mean square error as the best split point; Recursively operate the left subset and the right subset of the best split point, and repeat the operation of selecting the best split point until any one of the termination conditions of the second sub-model training is met; The termination conditions for the second sub-model training include maximum depth limit, minimum sample number limit and convergence; the maximum depth limit is the preset tree depth, and the minimum sample number limit is that the number of samples of the leaf node is less than the set threshold.
[0032] It should be noted that the leaf node is the best splitting point for each recursion.
[0033] The training method of the third sub-model includes: Set the initial output value of the third sub-model to the mean of the target variable; For the third sub-model Iterations are performed until any one of the termination conditions for the training of the third sub-model is reached; the termination conditions for the training of the third sub-model include the maximum number of iterations of the third sub-model and the convergence of the loss function of the third sub-model, and the maximum number of iterations of the third sub-model is a preset value.
[0034] ≥ ≥1, no. The calculation method for the iterations includes: Calculate the residual, residual The calculation methods include: ; In the formula, is the number of the training set feature, For the The target variable is the training set features, For the The output value of the third sub-model at the iteration, For the training set features.
[0035] The residual is used as the target variable of the next iteration, and a new decision tree model is trained to fit the residual. The decision tree model at this time is a new decision tree framework, that is, a decision tree model that has not been trained. The decision tree model in the previous iteration will be abolished; Update the output value of the third sub-model according to the trained decision tree model.
[0036] Polynomial fitting methods include: Define the polynomial mathematical model, which includes: ; In the formula, is the polynomial prediction value, are the coefficients of the polynomial, For real-time datasets, is the degree of the polynomial.
[0037] Minimize the residual sum of squares using a polynomial mathematical model, the residual sum of squares The calculation methods include: ; In the formula, is the total number of data points (i.e., temperature data and environmental variable data) in the real-time data set, Number the data points; The partial derivative of the residual sum of squares with respect to each polynomial coefficient is taken and set to zero, the optimal value of each polynomial coefficient is calculated, the optimal value is replaced into the polynomial mathematical model, the polynomial prediction value is obtained according to the polynomial mathematical model, and the polynomial fitting is completed.
[0038] The fusion method of the integrated prediction value and the polynomial prediction value is the weighted average method, and the compensation data is the pressure display value after temperature compensation.
[0039] Exemplarily, it is assumed that the following data is present in the third compensation fusion unit: Ensemble prediction value (from ensemble neural network): 101.5 kPa; Polynomial predictions (from polynomial fit): 102.0 kPa; The weight of the ensemble prediction value is preset to 0.7, and the weight of the polynomial prediction value is preset to 0.3; The compensation data is 0.7×101.5+0.3×102.0=71.05+30.6=101.65kPa.
[0040] Combining the advantages of two different models helps to improve the final output accuracy, especially when affected by environmental factors such as temperature and humidity. Through the continuous updating of real-time data, the compensation process can be carried out dynamically to improve the overall performance and stability of the system.
[0041] It should be noted that the data displayed on the pressure sensor is actually the data after being affected by various factors, while the compensated data is the predicted pressure data after eliminating the impact.
[0042] Embodiment 2: like Figure 4 As shown, based on the same inventive concept as the pressure sensor temperature compensation system based on integrated neural network in the above-mentioned embodiment, the present application provides a pressure sensor temperature compensation method based on integrated neural network. The method and system embodiment in the present application are based on the same inventive concept. The method includes an integrated neural network training method and a pressure compensation method; The integrated neural network training methods include: Collect the original dataset; Perform feature selection on the original data set to obtain the training set; Using the training set to train the pre-built initial integrated network model to obtain a temperature compensation integrated neural network model; Embed the temperature compensation integrated neural network model into the pressure sensor temperature compensation module; Pressure compensation methods include: Collect real-time data sets; Input the real-time data set into the temperature compensation integrated neural network model and output the integrated prediction value; Perform polynomial fitting on real-time data sets to obtain polynomial prediction values; The integrated prediction value is merged with the polynomial prediction value to obtain compensation data; The data output of the pressure sensor is adjusted according to the compensation data and the compensation data is displayed.
[0043] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
[0044] What has been described above is only a preferred specific implementation manner of the embodiments of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can make equivalent substitutions or changes according to the technical scheme and concept of the present application within the technical scope disclosed in the present application, which should be covered by the protection scope of the present application.
Claims
1. A temperature compensation method for a pressure sensor based on an integrated neural network, characterized in that: The method includes an integrated neural network training method and a pressure compensation method; The integrated neural network training methods include: Collect the original dataset; Perform feature selection on the original data set to obtain the training set; Using the training set to train the pre-built initial integrated network model to obtain a temperature compensation integrated neural network model; Embed the temperature compensation integrated neural network model into the pressure sensor temperature compensation module; Pressure compensation methods include: Collect real-time data sets; Input the real-time data set into the temperature compensation integrated neural network model and output the integrated prediction value; Perform polynomial fitting on real-time data sets to obtain polynomial prediction values; The integrated prediction value is merged with the polynomial prediction value to obtain compensation data; The data output of the pressure sensor is adjusted according to the compensation data and the compensation data is displayed.
2. The method according to claim 1, characterized in that The method for obtaining the training set includes: Calculate the correlation coefficient between each training set feature and the target variable in the original data set; Correlation coefficient The calculation methods include: ; In the formula, is the training set feature; is the corresponding target variable; is the mean of the training set features; is the mean of the corresponding target variable; is the number of the training set features and the corresponding target variables; The absolute value of the correlation coefficient is compared with the preset correlation threshold. If it is greater than the correlation threshold, the corresponding training set feature is input into the database. If it is less than or equal to the preset correlation threshold, the corresponding training set feature is deleted. The feature elimination model is used to recursively eliminate the training set features in the database to obtain the training set.
3. The method according to claim 2, characterized in that The method of recursive feature elimination comprises: 101: Input the training set features in the database into the pre-built feature elimination model framework for training, and obtain the feature elimination model after the training is completed; 102: Input the training set features in the database into the feature elimination model to obtain the importance score; 103: Rank the importance scores of the training set features in ascending order, and delete the training set features whose ranking is less than a preset ranking threshold from the database; 104: Replace the feature elimination model framework with the feature elimination model and loop, loop 101 to 103, if the preset number of features is reached, stop the loop, concentrate the training set features in the database, and obtain the training set.
4. The method according to claim 3, characterized in that The training method of the feature elimination model includes: The training set features are used as the input of the feature elimination model. The feature elimination model uses the importance score corresponding to the prediction of each group of training set features as the output, the actual importance score corresponding to each group of training set features as the prediction target, and the sum of the first prediction accuracies of minimizing all predicted importance scores as the training target; the feature elimination model is trained until the sum of the first prediction accuracies reaches convergence, and the training is stopped; the feature elimination model is a random forest model.
5. The method according to claim 1, characterized in that The initial integrated network model includes an input layer, a multi-layer perceptron model framework, an integration layer, a fusion layer and an output layer; wherein the training set is input from the input layer to the multi-layer perceptron model framework, the multi-layer perceptron model framework includes a first hidden layer, a second hidden layer and a third hidden layer, the activation functions of the first hidden layer, the second hidden layer and the third hidden layer are all ReLU functions, the first hidden layer has N neurons, the second hidden layer has N neurons, the third hidden layer exists N neurons, N is a preset value. The training set passes through the multi-layer perceptron model framework to obtain a training feature selection set, which is input into the integration layer by the multi-layer perceptron model framework; the integration layer includes a first sub-model, a second sub-model and a third sub-model; the first sub-model is a multi-layer perceptron model, which has the same structure as the multi-layer perceptron model framework; the second sub-model is a random forest model; the third sub-model is a gradient boosting machine model; the fusion layer is a weighted average mathematical model, which performs k-fold cross validation on the first sub-model, the second sub-model and the third sub-model to obtain the weights corresponding to the first sub-model, the second sub-model and the third sub-model, and the weighted average mathematical model performs weighted average calculation on the output values of the first sub-model, the second sub-model and the third sub-model according to the weights to obtain the integrated prediction value; the training feature selection set includes the training set features.
6. The method according to claim 5, characterized in that The training method of the first sub-model includes: The training feature selection set is used as the input of the first sub-model. The first sub-model uses the first sub-model output value corresponding to each group of training feature selection sets as the output, the actual first sub-model output value corresponding to each group of training feature selection sets as the prediction target, and the sum of the second prediction accuracies of all predicted first sub-model output values is minimized as the training target. The first sub-model is trained until the sum of the second prediction accuracies reaches convergence and the training is stopped.
7. The method according to claim 5, characterized in that The training method of the second sub-model includes: Traverse the training feature selection set, select the middle value of two adjacent training set features in the training feature selection set as the candidate split point; according to the candidate split point, set the left subset and the right subset for each candidate split point, the left subset is the training set feature less than or equal to the current candidate split point, and the right subset is the training set feature greater than the current candidate split point; calculate the mean square error of the training set features in the left subset and the right subset; calculate the total mean square error of the candidate split point based on the mean square error of the training set features in the left subset and the right subset; the total mean square error The calculation methods include: ; In the formula, is the number of training set features in the left subset, is the number of training set features of the right subset, is the total number of training set features, is the mean square error of the training set features in the left subset, is the mean square error of the training set features in the right subset; Select the candidate split point with the smallest total mean square error as the best split point; The left subset and the right subset of the best split point are recursively operated until any one of the termination conditions of the second sub-model training is met.
8. The method according to claim 5, characterized in that The training method of the third sub-model includes: Set the initial output value of the third sub-model to the mean of the target variable; For the third sub-model Iterates until any one of the termination conditions of the third sub-model training is met; ≥ ≥1, no. The calculation method for the iterations includes: Calculate the residual, residual The calculation methods include: ; In the formula, is the number of the training set feature, For the The target variable is the training set features, For the The output value of the third sub-model at the iteration, For the training set features; The residual is used as the target variable for the next iteration, a new decision tree model is trained to fit the residual, and the output value of the third sub-model is updated according to the trained decision tree model.
9. The method according to claim 1, characterized in that The polynomial fitting method comprises: Define the polynomial mathematical model, which includes: ; In the formula, is the polynomial prediction value, are the coefficients of the polynomial, For real-time datasets, is the degree of the polynomial; Minimize the residual sum of squares using a polynomial mathematical model, the residual sum of squares The calculation methods include: ; In the formula, is the total number of data points (i.e., temperature data and environmental variable data) in the real-time data set, Number the data points; The partial derivative of the residual sum of squares with respect to each polynomial coefficient is taken and set to zero, the optimal value of each polynomial coefficient is calculated, the optimal value is replaced into the polynomial mathematical model, the polynomial prediction value is obtained according to the polynomial mathematical model, and the polynomial fitting is completed.
10. A pressure sensor temperature compensation system based on an integrated neural network, characterized in that: The system includes a training module, an embedding module and a pressure sensor temperature compensation module; The training module includes a training data acquisition unit, a preprocessing unit and an integrated neural network unit; A training data collection unit, wherein the training data collection unit is used to collect an original data set; A preprocessing unit, wherein the preprocessing unit is used to perform feature selection on the original data set to obtain a training set; An integrated neural network unit, wherein the integrated neural network unit is used to train a pre-built initial integrated network model using a training set to obtain a temperature compensation integrated neural network model; The embedding module is used to embed the temperature compensation integrated neural network model into the pressure sensor temperature compensation module; The pressure sensor temperature compensation module includes a real-time data collection unit, a first compensation fusion unit, a second compensation fusion unit, a third compensation fusion unit and a real-time compensation unit; A real-time data collection unit, wherein the real-time data collection unit is used to collect real-time data sets; A first compensation fusion unit, the first compensation fusion unit is used to input the real-time data set into the temperature compensation integrated neural network model and output an integrated prediction value; a second compensation fusion unit, the second compensation fusion unit being used to perform polynomial fitting on the real-time data set to obtain a polynomial prediction value; A third compensation fusion unit, the third compensation fusion unit is used to fuse the integrated prediction value with the polynomial prediction value to obtain compensation data; A real-time compensation unit is used to adjust the data output of the pressure sensor according to the compensation data and display the compensation data.
Citation Information
Patent Citations
Pressure sensor temperature compensation system
CN118565695A
Cited By
Neural network algorithm fusion-based sensor precision improvement method and system
CN121253035A
Sensor precision improvement method and system based on neural network algorithm fusion
CN121253035B