RBF network nonlinear temperature error compensation method based on improved particle swarm

By improving the combination of particle swarm algorithm and RBF neural network and optimizing the extended speed parameters, the problems of low accuracy and local optimality in nonlinear temperature compensation of temperature sensors are solved, and higher accuracy temperature error calibration and rapid training are achieved.

CN119089157APending Publication Date: 2024-12-06BEIJING INST OF TECH
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202411586302.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-08
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

The prior art has problems of low calibration accuracy and poor calibration effect in nonlinear temperature compensation of temperature sensors, especially the particle swarm algorithm is prone to fall into local extreme values, low search accuracy, and convergence speed is relatively high when the training samples are large. slow.

Method used

The improved particle swarm algorithm is used to combine with the RBF neural network, and through the adaptive inertial weighting strategy and the 10-fold cross-validation method, the expansion speed parameters are optimized, the global search capability and accuracy are improved, local optimization is avoided, and the accuracy of nonlinear temperature error compensation is improved.

Benefits of technology

A higher accuracy nonlinear error compensation for temperature sensors is achieved, local optimal problems are avoided, training speed and model accuracy are improved, and nonlinear temperature error calibration of temperature sensors is suitable.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119089157A_ABST
    Figure CN119089157A_ABST
Patent Text Reader

Abstract

The invention relates to an RBF (Radial Basis Function) network nonlinear temperature error compensation method based on an improved particle swarm, belongs to the field of combination of temperature sensors and deep learning, and solves the problem of nonlinear temperature error compensation of an existing temperature sensor. Comprising the steps of obtaining temperature sensor indexing table data as a sample data set; initializing an RBF neural network model; optimizing expansion speed parameters of the RBF by using an improved particle swarm algorithm to obtain a group optimal position, transmitting the group optimal position to the RBF to update the expansion speed parameters, and training the RBF after the parameters are updated by using a training set in a sample data set; a test set in the sample data set is used for verification, if the verification is not passed, the step of optimizing the expansion speed parameter of the RBF by using the improved particle swarm algorithm is returned until the verification is passed, and a trained RBF neural network model is obtained to serve as a temperature sensor compensation network; and obtaining a compensated temperature value based on the temperature sensor and the temperature sensor compensation network. And non-linear temperature error compensation of the sensor is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of temperature sensors combined with deep learning, and in particular to a nonlinear temperature error compensation method of a RBF (Radial Basis Function) network based on an improved particle swarm. Background Art

[0002] With the development of sensor technology, sensors have been widely used, including but not limited to industrial production, logistics and transportation, environmental monitoring, medical diagnosis and other business fields.

[0003] The nonlinear temperature compensation problem of temperature sensors refers to the nonlinear relationship between the sensor output and input, which leads to an error between the temperature value output by the temperature sensor and the actual temperature value. Compensation is required to improve the accuracy and reliability of temperature measurement. The temperature output value of a temperature sensor is usually affected by many factors, such as environmental conditions such as temperature, humidity, and pressure, as well as the characteristics and working state of the temperature sensor itself. Due to the complexity and nonlinear characteristics of these factors, the output of the temperature sensor cannot be accurately compensated simply through a linear model.

[0004] In order to solve the nonlinear temperature compensation problem of temperature sensors, domestic and foreign scholars have conducted a lot of research. At present, there are mainly hardware implementation methods and software compensation methods. Among them, the hardware correction method uses electronic circuits and components for correction. Due to the complexity of the compensation circuit, too many circuit influencing factors, limited compensation accuracy, and the problems of debugging zero point and full point being easily involved with each other. The software compensation method has become a hot topic in current research. The software compensation methods mainly include: table lookup method, Newton iteration method, curve fitting method, neural network method, particle swarm algorithm, support vector machine method, etc. Different methods have their own suitable application scenarios. The table lookup method is more sensitive to the segmented interval and has a great impact on its efficiency; the Newton iteration method is more classic and accurate, but the efficiency is low; the curve fitting method and linear regression method are greatly affected by the fitting model parameters and have model accuracy problems; the RBF neural network is a local approximation network that cannot accurately predict the global data and faces the difficulties of global optimality and local optimality; the particle swarm algorithm also has many disadvantages such as poor local search ability, easy to fall into local extreme values, and low search accuracy; in the case of large training samples, machine learning methods such as support vector machines will have problems such as slow convergence speed and sensitivity to data. The hardware correction method needs to find the cause of the error based on the actual application, and needs to avoid the introduction of error sources as much as possible through ultra-high part design, sophisticated manufacturing and precise installation. This method is expensive and limited by the current level.

[0005] In summary, there is an urgent need for a nonlinear temperature error compensation method of RBF network based on improved particle swarm to solve the nonlinear error compensation problem of sensors. Summary of the invention

[0006] In view of the above analysis, an embodiment of the present invention aims to provide a nonlinear temperature error compensation method of RBF network based on improved particle swarm, so as to solve the technical problems of low calibration accuracy and poor calibration effect of nonlinear temperature error compensation of sensors.

[0007] The embodiment of the present invention provides a RBF network nonlinear temperature error compensation method based on improved particle swarm, comprising the following steps: Get the temperature sensor graduation table data as a sample data set; Initialize the RBF neural network model; The improved particle swarm algorithm is used to optimize the expansion speed parameters of the RBF neural network model, and the optimal position of the group is obtained and passed to the RBF neural network model to update the expansion speed parameters, and the training set in the sample data set is used to train the RBF neural network model after the updated parameters; the test set in the sample data set is used for verification, and if the verification fails, the step of optimizing the expansion speed parameters of the RBF neural network model by using the improved particle swarm algorithm is returned until the verification passes, and the trained RBF neural network model is obtained as the temperature sensor compensation network; A compensated temperature value is obtained based on the temperature sensor and the temperature sensor compensation network.

[0008] Further, the samples in the sample data set include the standard resistance value of the temperature sensor element and the corresponding standard temperature value; The standard resistance value is used as an input variable of the RBF neural network model.

[0009] Furthermore, the optimization of the expansion speed parameters of the RBF neural network model by using the improved particle swarm algorithm includes: Initialize the parameters in the improved particle swarm algorithm; Initialize the initial position and initial velocity of individuals in the population; In each iteration, the individual fitness value is calculated based on the individual position and the sample data set using a 10-fold cross validation method; the inertia weight of the individual is dynamically adjusted; updating the individual velocity based on the individual inertia weight, and then updating the individual position; When the maximum number of iterations is reached, the optimal position of the group is returned, and the expansion speed parameters of the RBF neural network model are optimized and updated based on the optimal position of the group.

[0010] Further, the calculating of individual fitness values ​​based on individual positions by using a 10-fold cross validation method includes: The individual position is input into the model as the expansion speed parameter of the RBF neural network model; the sample data set is randomly divided into 10 sample subsets; In each cross-validation fitting, 9 sample subsets are used as training subsets and the remaining 1 sample subset is used as a validation subset. The RBF neural network is trained using the 9 training subsets, and then the sum of the absolute errors between the temperature fitting value obtained after the validation subset is input into the RBF neural network and the corresponding standard temperature value is calculated; Perform 10 cross validations, and add up the sums of the 10 absolute errors obtained to obtain the average value as the individual fitness value.

[0011] Furthermore, the optimal position of the group is obtained in the following way: At each iteration, the individual fitness value of each individual is compared with its historical individual optimal position, and if it is better than the historical individual optimal position, the individual optimal position is updated; Determine whether the current individual optimal position of each individual is better than the group optimal position. If so, update the group optimal position to the individual optimal position.

[0012] Furthermore, during the particle swarm iteration, it is determined whether the individual position exceeds a preset value range, and if so, the individual position is randomized.

[0013] Furthermore, the inertia weight of the individual is dynamically adjusted as follows: ; Among them, w is the inertia weight of the individual, m is the current number of iterations, M is the maximum number of iterations, , are the maximum and minimum inertia weights of the individual, is the inertia adjustment factor, p and q are random numbers.

[0014] Further, the individual speed is updated based on the inertia weight of the individual, as follows: ; in, is the speed of the individual at time t+1, is the speed of the individual at time t, , is a random number in the range of 0-1. is the individual learning factor, is the global learning factor, is the individual's current location, is the optimal position of an individual, The optimal position for the group.

[0015] Further, the particle position is updated as follows: ; in, is the position of the individual at time t+1, is the position of the individual at time t, is the velocity of the individual at time t+1.

[0016] Furthermore, it is characterized in that the particle dimension parameter of the improved particle swarm algorithm is the number of input variables of the RBF neural network model.

[0017] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects: 1. The improvement of the individual inertia weight of the improved particle swarm algorithm makes the inertia weight nonlinear, and satisfies the condition of nonlinear decreasing inertia weight during the entire search process of the particle swarm; on the other hand, the random adjustment strategy of beta distribution is introduced in the calculation of inertia weight to generate a random quantity to dynamically adjust the inertia weight w of the individual particle, thereby improving the global search capability and later search accuracy of the algorithm; maintaining the diversity of the particle population, improving the global search capability, and avoiding falling into the local optimum; 2. The improved particle swarm algorithm is globally convergent, which improves the problem that the neural network itself is prone to fall into the local optimal solution, making the RBF neural network model predict the temperature value after compensation more accurately than the single RBF neural network; 3. The present invention uses a 10-fold cross validation method in the improved particle swarm algorithm to calculate the fitness value of individual particles. Based on the individual fitness value, the optimal position of the group is finally selected as the value of the spread speed parameter spread of the RBF neural network model; 4. The expansion speed spread is a key parameter of the RBF neural network model. The improved particle swarm algorithm is used to optimize it to improve the accuracy of the RBF neural network model in compensating nonlinear temperature errors. 5. The RBF neural network model used in the present invention has only one hidden layer, a simple structure, and is fast in training to obtain the compensated temperature value, and is easy to implement and adjust.

[0018] In the present invention, the above-mentioned technical solutions can also be combined with each other to achieve more preferred combination solutions. Other features and advantages of the present invention will be described in the subsequent description, and some advantages can become obvious from the description, or can be understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained through the contents particularly pointed out in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The accompanying drawings are only used for the purpose of illustrating specific embodiments and are not to be considered as limiting the present invention. In the entire drawings, the same reference symbols represent the same components; Figure 1 This is a flow chart of a RBF network nonlinear error temperature compensation method based on improved particle swarm; Figure 2 It is the structural diagram of RBF neural network model; Figure 3 This is the principle diagram of nonlinear temperature error compensation. DETAILED DESCRIPTION

[0020] The preferred embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.

[0021] In view of the many drawbacks of the particle swarm algorithm, such as poor local search ability, easy to fall into local extreme values, low search accuracy, etc., a new mechanism for controlling particles is introduced to speed up the convergence speed and avoid local optimality. The present invention uses an adaptive inertia weight strategy to adaptively adjust the particle inertia weight to speed up the search speed and avoid local optimality.

[0022] In the case of large training samples, machine learning methods such as support vector machines will have problems such as slow convergence speed and sensitivity to data. The use of RBF neural networks can avoid such problems. However, RBF neural networks will face the problem of local optimality. The present invention combines the improved particle swarm algorithm with the RBF neural network, and uses the improved particle swarm algorithm with adaptive inertia weights to help the RBF neural network parameters to perform global optimization and achieve high-precision nonlinear error compensation.

[0023] In view of the problems of poor local search ability and easy falling into local extreme values ​​of traditional particle swarm algorithm, dynamic inertia weight is used to control the individual speed of particles, and 10-fold cross validation is combined with updating the individual position of particles to select the optimal position of the particle group and pass it to the RBF neural network model as the value of the key parameter expansion speed of the model. RBF neural network has been proven to fit nonlinear relationships and has a better approximation degree than traditional BP (Back Propagation) network. Therefore, it is suitable for the functional relationship between the resistance value sample data and temperature value of the temperature sensor. By improving the particle swarm to obtain the optimal position of the group, the expansion speed parameter of the RBF neural network is optimized and updated to obtain the compensated temperature value.

[0024] Exemplarily, the temperature sensor in the present invention takes a Pt100 temperature sensor as an example.

[0025] Pt100 is a commonly used thermal resistance temperature sensor. The resistance value of the temperature sensor element changes with temperature. When the temperature is 0 degrees, the resistance value is 100 ohms.

[0026] In view of the nonlinear temperature error compensation of the temperature sensor, a specific embodiment of the present invention discloses a nonlinear temperature error compensation method of RBF network based on improved particle swarm, such as Figure 1 As shown, the following steps are included: Step S1, obtaining temperature sensor graduation table data as a sample data set; Step S2, initializing the RBF neural network model; optimizing the expansion speed parameters of the RBF neural network model using the improved particle swarm algorithm, obtaining the optimal position of the group and passing it to the RBF neural network to update the expansion speed parameters, and training the RBF neural network model after the updated parameters using the training set in the sample data set; verifying using the test set in the sample data set, if the verification fails, returning to the step of optimizing the expansion speed parameters of the RBF neural network model using the improved particle swarm algorithm until the verification passes, and obtaining the trained RBF neural network model as the temperature sensor compensation network; Step S3: obtaining a compensated temperature value based on the temperature sensor and the temperature sensor compensation network.

[0027] Step S1, specifically.

[0028] Get the temperature sensor graduation table data as a sample data set; The samples in the sample data set include the standard resistance value of the temperature sensor element and the corresponding standard temperature value; The standard resistance value is used as an input variable of the RBF neural network model.

[0029] The temperature sensor's graduation table data includes the standard resistance value of the temperature sensor element and the corresponding standard temperature value, and the two are in a one-to-one correspondence; Obtain the standard resistance value and the corresponding standard temperature value from the temperature sensor's graduation table as sample data.

[0030] Exemplarily, the sample data set includes more than 13,000 pieces of sample data, each sample including a standard resistance value and a corresponding standard temperature value of a temperature sensor element.

[0031] The sample data set is divided into a training set and a test set. The training set is used to train the RBF neural network model, and the test set is used to verify the RBF neural network model.

[0032] Exemplarily, the ratio of the sample size of the training set to the sample size of the test set is 8:2.

[0033] Step S2, includes steps S21-S23, specifically.

[0034] Step S21, initializing the RBF neural network model; RBF neural network model, such as Figure 2 As shown in Figure 1, it includes 1 input layer, 1 hidden layer and 1 output layer. The hidden layer is composed of a set of radial basis functions.

[0035] The standard resistance value of the temperature sensor is used as the input data of the input layer of the RBF neural network model, and the output data of the output layer is the compensated temperature value. The RBF neural network model is built based on this.

[0036] like Figure 2 As shown in , the input layer input data x is 1 input, which is the standard resistance value of the temperature sensor; the output layer output y is the compensated temperature value.

[0037] The nonlinear temperature error of the temperature sensor includes the nonlinear temperature error caused by the "temperature drift" of the electronic element and the nonlinear temperature error of the amplifier circuit.

[0038] like Figure 3 As shown, the temperature compensation principle is .

[0039] is the input-output function of the temperature sensor, that is, the actual measured output of the temperature sensor, is the temperature sensor compensation network function, and the output is the compensated temperature value. is the actual temperature of the measured environment, that is, the standard temperature value in the graduation table. is the temperature value after compensation.

[0040] The purpose of the temperature sensor compensation network is to make the compensated temperature value equal to the actual temperature value of the measured environment after compensation, satisfying the requirements of formula (1): ; Right now ; in, is the resistance value of the temperature sensor of the sample, is the actual temperature of the measured environment.

[0041] The purpose of the temperature sensor compensation network is also the predetermined goal of the training of the RBF neural network model.

[0042] What is known is the standard resistance value under the standard temperature value. Now we need to get the temperature value based on the standard resistance value, which is the relationship between the function and the inverse function.

[0043] Since in the above formula is a nonlinear function, we know It is also a nonlinear function. Through the powerful approximation function of the RBF neural network model, it can approximate with arbitrary accuracy. , thereby completing the nonlinear temperature error compensation for the temperature sensor.

[0044] The spread speed is a key parameter of the RBF neural network model. The value of the spread speed will affect the network fitting effect. Generally speaking, the larger the spread speed, the smoother the final fitted function will be, but the error will be larger, the number of neurons in the intermediate hidden layer will be larger, and the amount of calculation will be larger; The smaller the spread value, the better the function approximation effect will be, but the approximation curve will be not smooth. The RBF neural network model needs to obtain a suitable spread value, that is, the input range of the neuron response should cover a large enough range, and each neuron should not overlap.

[0045] For covering a large enough input range: the value of the expansion speed spread should be selected to ensure that the response range of each RBF neuron is large enough to cover the main features in the input space. If the expansion speed spread value is set too small, some input data may not be covered, thus affecting the fitting ability of the RBF neural network model. Therefore, the expansion speed spread value should be large enough to cover the entire distribution range of the input data resistance value; To avoid overlap between neurons: At the same time, the value of the spread speed should not be set too large, so as to cause overlap between adjacent neurons. If neurons overlap, the output of the RBF neural network model will be unstable, and it will be difficult to accurately fit the input data. The selection of the spread speed value also needs to ensure that the response ranges of the neurons do not overlap.

[0046] When selecting the expansion speed spread value, it is necessary to comprehensively consider the distribution of input data, neural network fitting, and the mutual influence between neurons, so as to find a suitable expansion speed spread value that can cover the input space and avoid overlapping of the corresponding ranges of neurons, and determine the optimal spread value to obtain the best RBF neural network performance.

[0047] Step S22, optimizing the expansion speed parameters of the RBF neural network model using the improved particle swarm algorithm includes: Initialize the parameters in the improved particle swarm algorithm; Initialize the initial position and initial velocity of individuals in the population; In each iteration, the individual fitness value is calculated based on the individual position and the sample data set using a 10-fold cross validation method; the inertia weight of the individual is dynamically adjusted; updating the individual velocity based on the individual inertia weight, and then updating the individual position; When the maximum number of iterations is reached, the optimal position of the group is returned, and the expansion speed parameters of the RBF neural network model are optimized and updated based on the optimal position of the group.

[0048] Step S22 is divided into steps S221-S224, specifically.

[0049] Step S221, initializing the parameters in the improved particle swarm algorithm; initializing the initial position and initial velocity of individuals in the population; Initialization parameters are as follows: Particle individual learning factor , global learning factor ; The number of individuals in the particle group (total number of particles) N, that is, the group size; Particle dimension Dim; The number of algorithm iterations M; The maximum value of the particle individual position L max , minimum value L min ; Particle individual inertia weight , where i represents the i-th particle, d represents the d-th dimension, and each dimension of each particle corresponds to an inertia coefficient; Initial inertia weight ; Inertia weight at the maximum number of iterations of the algorithm ; Inertia adjustment factor ; Random numbers p, q.

[0050] Among them, the particle dimension parameter of the improved particle swarm algorithm is the number of input variables of the RBF neural network model.

[0051] The input of the RBF neural network model is the standard resistance value of the temperature sensor element, 1 variable, so the particle dimension Dim=1; The number of algorithm iterations M is the preset maximum number of iterations.

[0052] The input variable of the RBF neural network model is the standard resistance value of the temperature sensor element, which ensures that the optimal position of the group output by the improved particle swarm algorithm is a value.

[0053] If the individual learning factor , then the individual particles only have group experience, and the particle swarm algorithm converges faster, but it is easy to fall into the local optimum; If the global learning factor , then the particles do not share information as a group. A particle group of size N is equivalent to running N individual particles that act independently. The probability of obtaining a solution is very small. Therefore, it is generally set In this way, the individual experience of particles and the group experience have the same important influence, making the final group optimal position more accurate.

[0054] For example, .

[0055] In the initial stage of the algorithm, the individual inertia weight is set to a larger value to promote global search, because a larger inertia weight will make the particle more inclined to move along the original moving direction, thus helping to jump out of the global optimal solution.

[0056] As the number of iterations increases, the inertia weight gradually decreases. At the maximum number of iterations, the inertia weight is set to a smaller value to ensure that the algorithm can adjust the particle movement direction more finely in the later stages of the search and better converge to the global optimal solution.

[0057] For example, The default value is 0.9; The default value is 0.4.

[0058] Initialize the initial positions and initial velocities of individuals in the population; The individual initial position and individual initial velocity are randomly generated. The position and velocity of each individual (ie particle) are initialized.

[0059] The initial position and initial velocity of the individual are randomly initialized within a certain range to ensure that the initial state of each individual has a certain diversity.

[0060] Step S222: In each iteration, the individual fitness value is calculated based on the individual position and the sample data set using a 10-fold cross validation method; The calculation of individual fitness values ​​based on individual positions using a 10-fold cross validation method includes: The individual position is input into the model as the expansion speed parameter of the RBF neural network model; the sample data set is randomly divided into 10 sample subsets; In each cross-validation fitting, 9 sample subsets are used as training subsets and the remaining 1 sample subset is used as a validation subset. The RBF neural network is trained using the 9 training subsets, and then the sum of the absolute errors between the temperature fitting value obtained after the validation subset is input into the RBF neural network and the corresponding standard temperature value is calculated; Perform 10 cross validations, and add up the sums of the 10 absolute errors obtained to obtain the average value as the individual fitness value.

[0061] Based on the individual fitness value, the optimal position of the individual is obtained and the optimal position of the group .

[0062] At the beginning of the iteration, the initial individual fitness value calculated based on the individual initial position is used as the individual optimal position , the minimum value of the optimal position of all individuals in the particle swarm is taken as the optimal position of the initial group .

[0063] In the iterative process, the optimal position of the individual is determined :Each particle individual records the individual optimal position it has reached in history. If the current individual fitness value is less than the individual optimal position, the individual optimal position is updated to the current position. Individual optimal position It is the best position that the individual particle can reach during the search process; The optimal position of the group is obtained as follows: At each iteration, the individual fitness value of each individual is compared with its historical individual optimal position, and if it is better than the historical individual optimal position, the individual optimal position is updated; Determine whether the current individual optimal position of each individual is better than the group optimal position. If so, update the group optimal position to the individual optimal position.

[0064] In short, the individual optimal position is the optimal position of each particle itself, while the group optimal position of the particle swarm is the best position historically achieved by the entire particle swarm.

[0065] These positions are updated continuously during the algorithm iteration process to gradually optimize the search effect of the particle swarm.

[0066] Step S223: dynamically adjust the inertia weight of the particle. The dynamic adjustment of the individual inertia weight is shown in formula (3): ; Among them, w is the inertia weight of the individual, m is the current number of iterations, M is the maximum number of iterations, , are the maximum and minimum inertia weights of the individual, is the inertia adjustment factor, p and q are random numbers.

[0067] Item 1 and the second Through the exponential function Change, the inertia weight is large in the early stage, and it decreases nonlinearly with the increase of iteration number; the third item Then use the beta distribution to adjust the overall value distribution of w and add the inertia adjustment factor To control the deviation of the inertia weight, the dynamic adjustment of the inertia weight w is more reasonable.

[0068] Function that generates random numbers that follow a beta distribution with two random parameters p and q.

[0069] Inertia adjustment factor The value is between 0 and 1, which is used to control the degree of adjustment of the inertia weight. The specific value of the inertia adjustment factor can be adjusted and optimized according to specific problems and experimental experience.

[0070] For example, when the inertia adjustment factor is set to 0.5, the change of the inertia weight will be relatively balanced and will not tend to decrease too quickly or too slowly.

[0071] Step S224: Update particle velocity and particle position.

[0072] The individual velocity is updated based on the individual inertia weight, as shown in formula (4): ; in, is the speed of the individual at time t+1, is the speed of the individual at time t, , is a random number in the range of 0-1. is the individual learning factor, is the global learning factor, is the individual's current location, is the optimal position of an individual, The optimal position for the group.

[0073] The velocity of the particle at time t+1 is composed of the velocity inertia of the particle at time t, the self-cognition part velocity and the global cognition part velocity.

[0074] The self-perception part of the speed makes the particle move toward the individual historical optimal position, that is, the best position that the particle believes it has obtained in the past search; The global recognition of the partial velocity enables particles to move toward the historical optimal position of the group.

[0075] When updating the speed, particles will take into account their own movement speed inertia, individual historical optimal position and group historical optimal position, so that particles can explore and utilize information more comprehensively in the search space.

[0076] Update the particle position as shown in formula (5): ; in, is the position of the individual at time t+1, is the position of the individual at time t, is the velocity of the individual at time t+1.

[0077] The position of the particle at time t+1 is equal to the position of the particle at time t and the velocity of the particle at time t+1 The sum of the movement time, where the movement time is 1s.

[0078] During the particle swarm iteration, it is determined whether the individual position exceeds a preset value range, and if so, the individual position is randomized.

[0079] Determine whether the particle position exceeds the value range [L min , L max ], if exceeded, the individual particle positions will be randomized.

[0080] Check the updated individual particle position to determine whether it exceeds the preset particle position range. If it exceeds the range, adjust the particle position and regenerate the particle individual position using a randomization method. That is, regenerate a random position for the particle within the specified value range.

[0081] Ensure that the position of the particles is always within a reasonable range, thus ensuring the stability and effectiveness of the algorithm.

[0082] Track and record the best state of particles in the search process, including individual optimal position and group optimal position. By recording the historical optimal position, they are compared in subsequent iterations of the improved particle swarm algorithm to timely update the individual optimal position and group optimal position, thereby guiding the particles to search in a more promising direction.

[0083] Improve the particle swarm algorithm to update the optimal position of each particle in the iterative process and the optimal position of the group .

[0084] Traverse the individual optimal position of each individual particle, find the optimal fitness value of the group in the particle group, update the optimal position of the group to the position of the particle with the optimal fitness value, and pass the optimal position of the group back to the RBF neural network model as the value of the key parameter spread of the RBF neural network model.

[0085] Exemplarily, the maximum number of iterations of the improved particle swarm algorithm is preset to 500 times.

[0086] The maximum number of iterations may vary in actual applications. The specific value needs to be determined based on the complexity of the problem, the availability of computing resources, and the requirements for the accuracy of the results. The maximum number of iterations can usually be set based on the specific problem and computing resources. The more iterations, the larger the space the algorithm searches, but it also increases the computational cost. The specific value needs to be adjusted based on the complexity of the problem and the limitations of computing resources to minimize the computational time while ensuring the search effect.

[0087] Step S23, obtaining the optimal position of the group and passing it to the RBF neural network model to update the expansion speed parameters, using the training set in the sample data set to train the RBF neural network model after the updated parameters; using the test set in the sample data set to verify, if the verification fails, returning to the step of optimizing the expansion speed parameters of the RBF neural network model using the improved particle swarm algorithm until the verification passes, and obtaining the trained RBF neural network model as the temperature sensor compensation network; Improve the optimal position of the particle swarm algorithm, send it back to the RBF neural network model, and use this value to update the expansion speed parameter spread; The training set in the sample data set is used to train the RBF neural network model after updating the parameters, and then the test set is used for verification. If the verification fails, the improved particle swarm algorithm is used to optimize the expansion speed parameters until the verification passes.

[0088] The trained RBF neural network model is used as the temperature sensor compensation network.

[0089] Step S3, specifically.

[0090] like Figure 3 As shown, based on the resistance value of the temperature sensor, a temperature value after temperature sensor compensation is obtained through a temperature sensor compensation network.

[0091] Based on the standard resistance value of the temperature sensor, the temperature sensor compensation network after updating the spread speed parameter spread value predicts or estimates the actual temperature by learning the relationship between the resistance value and the actual temperature.

[0092] During the training process, the known standard resistance value and its corresponding standard temperature are used as input-output to train the temperature sensor compensation network, so that the temperature sensor compensation network can learn the mapping relationship between the resistance value and the actual temperature.

[0093] Once trained, when given a new resistance value, the compensation network can use the learned relationship to predict or estimate the corresponding compensated temperature value.

[0094] In this way, the temperature sensor compensation network can be used to obtain the temperature value after the temperature sensor is compensated.

[0095] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects: 1. The improvement of the individual inertia weight of the improved particle swarm algorithm makes the inertia weight nonlinear, and satisfies the condition of nonlinear decreasing inertia weight during the entire search process of the particle swarm; on the other hand, the random adjustment strategy of beta distribution is introduced in the calculation of inertia weight to generate a random quantity to dynamically adjust the inertia weight w of the individual particle, thereby improving the global search capability and later search accuracy of the algorithm; maintaining the diversity of the particle population, improving the global search capability, and avoiding falling into the local optimum; 2. The improved particle swarm algorithm is globally convergent, which improves the problem that the neural network itself is prone to fall into the local optimal solution, making the RBF neural network model predict the temperature value after compensation more accurately than the single RBF neural network; 3. The present invention uses a 10-fold cross validation method in the improved particle swarm algorithm to calculate the fitness value of individual particles. Based on the individual fitness value, the optimal position of the group is finally selected as the value of the spread speed parameter spread of the RBF neural network model; 4. The expansion speed spread is a key parameter of the RBF neural network model. The improved particle swarm algorithm is used to optimize it to improve the accuracy of the RBF neural network model in compensating nonlinear temperature errors. 5. The RBF neural network model used in the present invention has only one hidden layer, a simple structure, and is fast in training to obtain the compensated temperature value, and is easy to implement and adjust.

[0096] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.

[0097] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.

Claims

1. A nonlinear temperature error compensation method of RBF network based on improved particle swarm, characterized in that: The steps include: Get the temperature sensor graduation table data as a sample data set; Initialize the RBF neural network model; Using an improved particle swarm algorithm to optimize the expansion speed parameters of the RBF neural network model, obtaining the optimal position of the group and passing it to the RBF neural network model to update the expansion speed parameters, and using the training set in the sample data set to train the RBF neural network model after the updated parameters; Using the test set in the sample data set to verify, if the verification fails, returning to the step of optimizing the expansion speed parameters of the RBF neural network model using the improved particle swarm algorithm until the verification passes, and obtaining the trained RBF neural network model as the temperature sensor compensation network; A compensated temperature value is obtained based on the temperature sensor and the temperature sensor compensation network.

2. The method according to claim 1, characterized in that The samples in the sample data set include the standard resistance value of the temperature sensor element and the corresponding standard temperature value; The standard resistance value is used as an input variable of the RBF neural network model.

3. The method according to claim 2, characterized in that The method of optimizing the expansion speed parameters of the RBF neural network model by using the improved particle swarm algorithm includes: Initialize the parameters in the improved particle swarm algorithm; Initialize the initial position and initial velocity of individuals in the population; In each iteration, the individual fitness value is calculated based on the individual position and the sample data set using a 10-fold cross validation method; the inertia weight of the individual is dynamically adjusted; updating the individual velocity based on the individual inertia weight, and then updating the individual position; When the maximum number of iterations is reached, the optimal position of the group is returned, and the expansion speed parameters of the RBF neural network model are optimized and updated based on the optimal position of the group.

4. The method according to claim 3, characterized in that The calculation of individual fitness values ​​based on individual positions using a 10-fold cross validation method includes: The individual position is input into the model as the expansion speed parameter of the RBF neural network model; the sample data set is randomly divided into 10 sample subsets; In each cross-validation fitting, 9 sample subsets are used as training subsets and the remaining 1 sample subset is used as a validation subset. The RBF neural network is trained using the 9 training subsets, and then the sum of the absolute errors between the temperature fitting value obtained after the validation subset is input into the RBF neural network and the corresponding standard temperature value is calculated; Perform 10 cross validations, and add up the sums of the 10 absolute errors obtained to obtain the average value as the individual fitness value.

5. The method according to claim 4, characterized in that The optimal position of the group is obtained as follows: At each iteration, the individual fitness value of each individual is compared with its historical individual optimal position, and if it is better than the historical individual optimal position, the individual optimal position is updated; Determine whether the current individual optimal position of each individual is better than the group optimal position. If so, update the group optimal position to the individual optimal position.

6. The method according to claim 3, characterized in that: During the particle swarm iteration, it is determined whether the individual position exceeds a preset value range, and if so, the individual position is randomized.

7. The method according to claim 3, characterized in that The inertia weight of the individual is dynamically adjusted as follows: ; Among them, w is the inertia weight of the individual, m is the current number of iterations, M is the maximum number of iterations, , are the maximum and minimum inertia weights of the individual, is the inertia adjustment factor, p and q are random numbers.

8. The method according to claim 7, characterized in that Update the individual velocity based on the individual inertia weight as follows: ; in, is the speed of the individual at time t+1, is the speed of the individual at time t, , is a random number in the range of 0-1. is the individual learning factor, is the global learning factor, is the individual's current location, is the optimal position of an individual, The optimal position for the group.

9. The method according to claim 8, characterized in that Update the particle position as follows: ; in, is the position of the individual at time t+1, is the position of the individual at time t, is the velocity of the individual at time t+1.

10. The method according to any one of claims 1 to 9, characterized in that: The particle dimension parameter of the improved particle swarm algorithm is the number of input variables of the RBF neural network model.

Citation Information

Patent Citations

  • Radial basis function (RBF) neural network parameter self-optimizing-based multi-step prediction method for water quality

    CN102737288A

  • CPA method in chemical process with viscosity of actuated valve

    CN103246279A

  • Pressure guide wire temperature compensation method of improved Particle Swarm Optimization neural network

    CN106503790A

  • FOA-RBF based high-voltage circuit breaker fault diagnosis method

    CN106707153A

  • MEMS gyroscope temperature compensation method based on particle swarm optimization radial basis function neural network

    CN112880705A