#### Abstract

When thermopile sensor is used for safety monitoring of equipment in industrial environments, particularly for measuring the thermal radiation information of device, the measured result of this kind of sensor is usually affected by ambient temperature due to its unique structure. An improved PSO-BP algorithm is proposed for temperature compensation of thermopile sensor and correcting the error in the condition of the system accuracy requirements reduced by temperature. The core of improved PSO-BP algorithm is to improve the certainty of initial weights and thresholds that belonged to BP neural network and then train the samples by using BP neural network for enhancing the generalization ability and stability of system. The experimental results show that the proposed PSO-BP network outperforms other similar algorithms with faster convergence speed, lower errors, and higher accuracy.

#### 1. Introduction

Condition monitoring of man-made systems is an important task in terms of system maintenance and process automation. In order to keep the security operation of various systems, many scholars have been working on the area of fast identification of faulty components based on various types of sensor data and intelligent evolutionary algorithms, which provides a basis for the fault isolation.

In the numerous fault monitoring, temperature is an essential factor about health status of the equipment. For the majority of electrical devices, equipment failure usually leads to temperature increment on the surface of device, which is the omen of short circuit or overcurrent. In particular, the joint position is easy to heat. Instead of the point-to-point temperature-measuring device, we use a real-time device named thermopile sensor for monitoring electrical equipment. Thermopile sensor is equivalent to several point-type infrared sensors, which can provide the distribution of temperature about mini-type area around the target. It turned the thermal radiation information into temperature data based on the theory of black-body radiation. The accuracy of temperature measurement is affected by the radiation information of environment or ambient temperature, which is a typical nonlinear programming problem. Several methods or models are proposed for solving this kind of problems such as expert system [1], artificial neural network (ANN) [2], fuzzy theory [3], and optimization theory [4]. These methods still have some disadvantages. For example, the knowledge base of the expert system is difficult to obtain from the complex working conditions. And the accurate fuzzy rules and membership functions are harder to determine. In the framework of ANN-based method, numerous training samples are closely related to the accuracy of output data. But back propagation (BP) neural network is usually used to solve some application problems based on its unique advantages such as high accuracy and simple operation. So our emphasis is on reducing the uncertainty of initial weight value and threshold of BP neural network for improving its directional generalization ability, which is a typical optimization problem.

There are many intelligence algorithms with different performance for solving the optimization problem such as genetic algorithm (GA) [4] and particle swarm optimization (PSO) [5]. Compared with other algorithms, PSO has few parameters to adjust, which is easy to implement. So it is one of the most popular optimization algorithms. Lazzús [6] combined the advantage of BP and PSO for predicting thermal properties of the organic compounds, which can improve the convergence speed and prediction accuracy of the traditional BP network. Zhang et al. [7] and Li and Zhou [8] proposed two kinds of improved PSO algorithm for overcoming shortcoming of the traditional BP network, which can adjust the inertia weight coefficients and learning factors adaptively.

In this paper, we propose an improved PSO algorithm based on optimizing the initial weight value and threshold for increasing the generalization ability of BP network. Then the improved PSO-BP algorithm is used to solve the temperature compensation of thermopile sensor. In order to demonstrate the effectiveness of the proposed method, we compare the proposed one with traditional BP and two kinds of improved PSO-BP algorithm [7, 8].

The rest of this paper is organized as follows. In Section 2, we introduce the basic PSO and the improved PSO algorithm. The improved PSO-BP method is proposed in Section 3; then we regarded some temperature data in the different ambient temperature conditions as the test set. The result and analysis of experiments are shown in Section 4 and the important conclusions are drawn in Section 5.

#### 2. Basic and Improved PSO Algorithm

##### 2.1. Basic PSO Algorithm

The inspiration of PSO algorithm is derived from the phenomenon of birds’ cluster which solves the problem of continuous variable optimization as its background. In the theoretical framework of PSO, every potential feasible solution is represented as a particle existing in the search space. There are two important variables that belonged to each particle: the position vector and velocity vector . The velocity vector is used to control the speed in which the particle moves towards the optimal solution. Meanwhile, every position vector has correlation with the particle fitness value. In the process of iteration, the particle updates its velocity and positions based on the following equations:where is the inertia weight, the larger is easy to result in global optimization, the smaller one is easy to generate local optimization, and . and are learning factors which represent two kinds of evolution ability such as self-learning and social learning, respectively. is the best solution and is the best known position existing in the entire swarm.

##### 2.2. Improved PSO Algorithm

###### 2.2.1. The Inertia Weight

In all kinds of improved algorithms, the inertia weight occupies an important role in the PSO, which is the balance point between the global and local search ability. For avoiding PSO algorithm into local optimum, different solutions are put forward for updating . Zhan et al. [9] proposed the following adjustment strategies and Zhang et al. [7] proved its effectiveness:where and are the maximum and minimum distance between all particles and optimal particle and is Euclidean distance between the th particle and the optimal particle, which is defined aswhere is the dimensions of each particle, and are the position value on the th dimension that belonged to the th particle and the optimal particle at the -iteration of PSO, respectively. is a constant. is the linear decreasing function for directed searching of . is the number of iterations where is the maximum value. The update rule based on Euclidean distance shown in (2) has more outstanding performance for enhancing the global search result to some extent. But the computational complexity of searching is more than which increases the burden of computer. Li and Zhou [8] proposed a simple method for updating based on the fitness function and proved the effectiveness of selection rules in the framework of PSO-BP algorithm. So we also use the fitness function to revise the formula shown in (2), which is written as follows:where is the fitted value in the current position where and are the minimum and maximum values, respectively. In addition, .

###### 2.2.2. Learning Factors and

The learning factors and , called acceleration constants, are responsible for controlling individual cognitive component and group cognitive component . Due to the lack of methods and formula, the learning factor is usually determined on a general scope. Li and Zhou [8] utilized formula (1) at the different number of iterations for building a special linear difference equation with constant coefficients and gave the value range of and . Let ; the range of and is shown as follows [8]:

We suppose an extreme case for narrowing the scope of . Let us assume that is equal to , so the ideal range of is , which can provide the basis of constant selection about the adjusted equation inspired by Gao and Liao [10]. Two learning factors are updated by using the following criterion [10]:where is the average distance between each particle and the optimal particle at the th iteration, which is shown aswhere denotes the number of the swarm. In addition, Gao and Liao [10] proved that the PSO algorithm ultimately tends to the optimal solution with the help of updating the two factors based on the rule mentioned above. In the proposed algorithm, we also use the rule mentioned above and limit the scope of , which affects the convergence speed and accuracy. In the subsequent trial, we set .

#### 3. Improved PSO-BP Flow (IPSO-BP)

BP neural network [11] is a feed-forward network, which is composed of input layer, hidden layer, and output layer. It substantially turns an input/output problem into a nonlinear optimization problem. BP algorithm depends on learning and training a certain amount of samples for determining weights and threshold of the network. Traditional BP network not only requires a large number of iterations but easily falls into local minimum. So we use the improved PSO algorithm to optimize the initial weights and the thresholds of basic BP algorithm and then train the samples for enhancing the generalization ability and stability of BP network. When BP network is used for temperature compensation, the original input is the measured temperature based on the thermopile sensor and ambient temperature; meanwhile, the output of network is the actual temperature of targets. The algorithm flow chart is shown in Figure 1.

The algorithm steps are shown as follows.

*Step 1. *
Considering the process of initialization such as population size , particle dimension , the maximum number of iterations , the error precision of particles , the maximum speed , and the position .

*Step 2. *The initial weights and the thresholds of basic BP algorithm are become a column which are the initial population of PSO algorithm. Suppose the number of initial population is and the number of initial weights and thresholds is . is the initial position of one particle, .

*Step 3. *Initialize the velocity vector of particles. The forward network built by newff is regarded as the fitness function . The output of is , where is the data after normalized calibration [8].

*Step 4. *Compute the fitness value of every particle and find the best position along with updating particle based on formula (1) until training the best position of the whole particle swarm.

*Step 5. *Terminal condition: if the fitness value is less than the error precision of particles or is reached, the algorithm terminates; otherwise, go to Step 4.

#### 4. Experiment and Analysis

##### 4.1. Experimental Platform

The infrared temperature measurement system is shown in Figure 2, which consists of temperature sensor DS18B20, infrared thermopile sensor MLX90620, ultrasonic ranging module, and the core processor AT91SAM7S256. The role of components is displayed as follows.

DS18B20 is a kind of contact-type chip for targets’ surface temperature measurement. After being demarcated by mercurial thermometer with the accuracy of 0.1°C, the accuracy of DS18B20 reaches ±0.2°C within the limits of [−10°C, +85°C], whose data is used to be the reference data.

MLX90620 is the thermopile chip of noncontact temperature measurement, whose data is the aim of compensation. The measuring distance affects the accuracy of MLX90620 seriously, and its maximum distance is 1 m.

The ultrasonic module HC-SR04 is used for keeping distance between the sensor and the target which has the accuracy of 0.5%.

##### 4.2. Sample Data Acquisition

The experiment was carried out on eight different environmental temperatures, and we use MLX90620 sensor to measure the surface temperature of eight different targets at the same distance, respectively. The sample data is shown in Table 1, where AT denotes the ambient temperature based on black ball temperature method that reflected environmental thermal radiation information. Reference and measured data are obtained from DS18B20 and MLX90620, respectively. Restricted by experimental conditions and methods, the range of AT is set to [15°C, 50°C].

We select 15.2°C, 19.4°C, 26.7°C, 35.2°C, 39.3°C as the training sample set, and 30.0°C, 43.5°C, 46.2°C is regarded as the test sample set. In order to make the collected data unified, we present a normalization to deal with these data according to formula (8) shown as follows. All the data are normalized to aswhere is the ambient temperature, and are the maximum and minimum of ambient temperature, respectively. is the normalized data. Similarly, we can obtain the target’s normalized data of measured temperature value.

##### 4.3. Experimental Results

In this section, we adopt three algorithms such as basic BP, improved PSO-BP [7], and improved PSO-BP [8] for illustrating the effectiveness of the proposed approach. Kinds of basic parameter are set as follows: PSO: , , , , , , , , , .

BP: we adopted three-layer topology for building the network. The numbers of input, hidden, and output layer neurons are 2, 19, and 1, respectively. The training maximum number is 8000 and expects error to be 0.001; the hidden layer transfer function adopts S type tangent function “tansig,” the output layer transfer function uses linear function “purelin,” and the training function is “trainlm.”

In order to analyze the compensation effect quantitatively, we contrast the effect by the absolute value of error , which is written aswhere is the absolute error and is the reference value. Temperature compensation results are shown in Tables 2, 3, and 4.

From Tables 2 to 4, we can see that temperature compensation algorithm based on BP network is fit for improving the accuracy of measurement. However, BP network has great volatility and contingency in continuous operation with the larger error precision. The maximum error of BP optimization actually reached 13.1%. Compared with traditional BP network, kinds of improved algorithm based on PSO have superiority in the area of reliability and stability with the help of optimizing the weights and threshold of BP network. They reduce the opportunity of falling into local minimum to a large extent, which is very meaningful for enhancing the effectiveness of temperature compensation. From the whole analysis, the proposed IPSO-BP algorithm has lower absolute error than other improved IPSO-BP. Meanwhile, the proposed method gives a higher precision with less training times due to the constraint condition about learning factor and inertia weight which improves the generalization ability. The compensation effect of the proposed method is obviously better than other algorithms, which greatly reduces the influence of ambient temperature on the thermopile sensor. In practical application, we could increase the number of samples based on the requirement of system.

#### 5. Conclusions

An improved PSO-BP network is proposed in this paper, which is superior to the traditional BP neural network in several aspects such as low study efficiency, slow convergence speed, and being easily jumped out of local optimal. The core of the proposed algorithm is to reduce the uncertainty of selecting the initial values and weights of BP network for improving the ability of generalization. Compared with the traditional BP and two kinds of improved PSO-BP [7, 8], we demonstrate the effectiveness of the proposed approach. The compensation results show that the network optimized by the improved PSO algorithm has better performance with faster convergence speed, lower errors, higher accuracy, and learning ability.

The proposed algorithm is used for the condition monitoring of electrical equipment which reflects long-term variation trend. So we use upper computer to optimize temperature data and meet the demand of status forecast.

#### Conflict of Interests

The authors declare that there is no conflict of interests regarding the publication of this paper.

#### Acknowledgments

This work is supported by The Postdoctoral Fund in Jiangsu Province under Grant 1302027C. Thanks are due to the support of Image Processing Lab of Jiang Su University of Science and Technology.