# Study on Temperature Sensor Data Anomaly Diagnosis Method Based on Deep Neural Network

Authors: Wei Jing; Peng Wang; Ningchao Zhang
Journal: Scientific Programming
 (2022)

---

## Abstract

In order to solve the problems of low accuracy and low efficiency of traditional sensor data anomaly diagnosis methods, a new temperature sensor data anomaly diagnosis method based on deep neural network is proposed in this paper. Firstly, the temperature sensor data in a running cycle is collected, and the characteristics of the temperature sensor data are extracted by the sliding window technology. Secondly, based on the feature extraction results, a deep neural network model for anomaly diagnosis of temperature sensor data is constructed. The feature data are input into the model, and the result obtained is the diagnosis result. Finally, the simulation comparison experiment is carried out. The experimental results show that the error rate of feature extraction of temperature sensor data in this method changes between −2.1% and 5.9%, the diagnosis accuracy remains above 95%, the average diagnosis time is only 59 ms, and the diagnosis efficiency is high.


---

## Body

## 1. Introduction

At present, the development speed of intelligent sensors is getting faster and faster. Therefore, temperature sensors have been transformed from traditional analog to digital and intelligent [1]. Temperature sensors mainly ensure the accuracy of temperature data collection through the cooperation of hardware and software, saving a lot of design and manufacturing costs, so they have been widely used in various social fields [2]. And temperature sensor with the support of hardware and software will be linked with various microprocessor temperature sensors, and the wireless network is used to transmit data to upload, or to the specified device, but once the sensor fails, it may result in abnormal temperature sensor data [3], so you need to diagnose abnormal temperature sensor data. Therefore, it is very important to design a temperature sensor data anomaly diagnosis method to judge the running state of intelligent sensors.For the anomaly diagnosis of temperature sensor data, relatively good research results have emerged in related fields. For example, reference [4] proposed an anomaly diagnosis method of temperature sensor data based on a dual prediction model. This method mainly collected the operation data of multiple temperature sensors. The data were cleaned and deduplicated. Based on this, a support vector machine (SVM) and least squares support vector machine (LS-SVM) prediction model was built. The model is used to predict the operating state of the temperature sensor data, and the abnormality diagnosis of the temperature sensor data is realized by combining the prediction results. However, in practical application, it is found that this method takes a long time to diagnose abnormal temperature sensor data. Reference [5] proposed a temperature sensor data anomaly diagnosis method based on multiple lag regression model. This method mainly takes the building wood structure as the research object. The temperature sensor data are arranged in the building to collect the building temperature change data. Combined with the collected data, a multiple lag regression model to analyze the autocorrelation is built, periodicity and heteroscedasticity of the data. According to these characteristics, the abnormal data of the temperature sensor are diagnosed. However, this method has the problem of low diagnostic accuracy, and the practical application effect is not good. Ding et al. [6] proposed a method for abnormal temperature sensor data diagnosis based on serial correlation analysis. The temperature sensor data are collected, and the multi-dimensional time series of the sensor data are segmented and normalized, so as to obtain the judgment matrix of data correlation and obtain the correlation judgment result of the data. According to the results, a time series correlation graph model is established, and the model is used to distinguish normal temperature sensor data and abnormal temperature sensor data. The abnormal data of the temperature sensor is diagnosed. The temperature sensor data are abnormal. However, this method has the problem of high error rate of temperature sensor data feature extraction, which is far from ideal application effect.In the process of using traditional methods to diagnose the abnormal data of temperature sensor, the performance of the abnormal diagnosis model of building temperature sensor data is poor because the characteristics and extraction of temperature sensor are not analyzed. This paper aims to solve the problem of low diagnosis accuracy and efficiency of traditional sensor data abnormal diagnosis methods, and a temperature sensor data anomaly diagnosis method based on a deep neural network is proposed. Therefore, this method has the characteristics of high temperature sensor data anomaly diagnosis accuracy and diagnosis efficiency. The overall design scheme of the method is as follows:(1)
Collect the temperature sensor data within a running cycle, and use the sliding window technology to extract the temperature sensor data characteristics(2)
Based on the result of feature extraction, a deep neural network model for anomaly diagnosis of temperature sensor data is constructed. The characteristic data are input into the model, and the result obtained is the diagnosis result.(3)
Compare the error rate of feature extraction of temperature sensor data, anomaly diagnosis accuracy, and efficiency of temperature sensor data of different methods through experiments.


## 2. Design of Temperature Sensor Data Anomaly Diagnosis Method

### 2.1. Temperature Sensor Data Collection

In order to achieve the comprehensive goal of data acquisition accuracy and efficiency of temperature sensor, this paper introduces a K-means algorithm to design the data acquisition process of temperature sensor. The operation cycle of temperature sensor is set to 6 months, and the sampling time interval is set to 1 s so as to collect more complete and reliable data to the greatest extent.Suppose there is a periodic temperature sensor dataset represented byx1,x2,…,xN, which mainly includes N observation series of random variable x [7, 8]. The goal of k-means clustering is to divide dataset N into k categories, at which a vector-value uk is introduced, where k=1,…,K and uk are the central values of the first cluster. The goal of clustering is to find each data point category and vector uk so that the sum of squares of the distance between each data point and uk can reach the minimum [9].Supposexn is used to represent the node vector, and a set of corresponding binary indicator variable rnk is introduced, where k=1,…,K means that the node vector xn belongs to class K, and xn is assigned to class k; then, rnk=1 exists, and the objective function is defined in the following form:(1)J=∑n=1N∑k=1Krnkxn−uk2.In the above formula,J represents the sum of the square of the distance between each data point and the center vector of the cluster to which it is assigned. Now, the key is to find the value of rnk and uk to achieve the minimum value.First, we determine the value ofrnk. J given by equation (1) is a linear function of rnk, so it is easy to obtain an analytical solution for rnk. Each data is independent, so we can choose to optimize each n separately, as long as we ensure that the value of xn−uk2 is small. Here, let rnk=1. In language description, we simply set the clustering of data nodes as the nearest clustering center. The function expression is as follows:(2)rnk=1,k=argminjxn−uk2,0,other.Here, if we take the derivative of the objective function and make it equal to 0, then the minimum value can be obtained, which can be expressed as(3)2∑n=1Nrnkxn−uk=0,Through solution, we obtain(4)uk=∑nrnkxn∑nrnk.For the data type in this paper, the dataset objects in the network are cooperative sensor node sets, and each temperature sensor set is a data vector [10]. Among them, n such dataset vectors form a set G, and the data of these n datasets are initialized into K categories, as shown in Figure 1:Figure 1
Temperature sensor data acquisition process based on K-means algorithm.The temperature sensor data acquisition process based on the K-means algorithm is shown as follows:(1)
K objects are randomly selected from set G of node group data set as the initial class center(2)
According to the class center value, the dataset value in theG sets is compared with the class center value, and the remaining n objects are divided into each class by comparing the minimum distance value.(3)
Update the class center value and recalculate the center value of each class through all the data values of the classes that have been classified.(4)
Calculate the criterion function and redistribute(5)
If it meets the threshold, output the data collection result of a periodic temperature sensor; otherwise, return to Step 2


### 2.2. Feature Extraction Based on Sliding Window

Suppose that the data of a periodic temperature sensor is expressed asX∈ℝN×J in the form of a two-dimensional matrix, where N and J represent the number of process samples and the number of process variables, respectively. This two-dimensional data matrix is segmented along the sampling direction by a sliding window H [11]; that is, matrix X is segmented along the horizontal axis after transposing. Assuming that the sliding step of the window is H and the data of each window is XkT∈ℝN×J, the principal component analysis method is applied to these two-dimensional matrices [12], from which the temperature sensor data features in each window can be extracted.The projection of the original set of sample points on thea-th principal axis constitutes the synthesis variable taH×1, where a=1,2,…,A. Assuming that the variation information carried by the fifth principal component 6 is represented by Varta, the following relationship exists:(5)Vart1≥Vart2≥⋯≥VartA>0.Original sample spaceX=xnjN×J=x1,…,xJ, and a comprehensive variable t1 is a linear combination of x1,…,xJ, namely:(6)t1=Xp1,p1=1.In order to maket1 carry the most original variation information, the variance of t1 is required to reach the maximum value, and the variance of t1 is(7)Vart1=1Ht12=1Hp1TXTXp1=p1TRp1.In the above formula,R=XTX is the covariance matrix of X.The above problems are translated into the solution of the following optimization problems:(8)maxp1=1p1TRp1.We writeλ1 as Lagrange operator, and let(9)λ1=p1TRp1−λ1p1Tp1−1.We take the partial derivatives ofp1 and λ1 of L, respectively:(10)∂L∂p1=2Rp1−2λ1p1=0,∂L∂p1=−p1Tp1−1=0.We obtain(11)Rp1=λ1p1,Vart1=p1TRp1=p1Tλ1p1=λ1p1Tp1=λ1.We assume thatp1 is the first principal axis, and t1=Xp1 is called the first principal component [13], so the second principal axis p2 is obtained by analogy, where p2 is orthonormal p1, p2Tp1=0,p22, and the second principal component t2=Xp2 is the second largest component carrying variation information, and Vart2 is second only to Vart1. So, we have Vart1≥Vart2≥⋯≥VartA>0. Therefore, if the data variation is used to reflect the information in the data, the first principal component t1 carries the most information, followed by t2 times. A total of J principal components were extracted. Matrix X is decomposed into the sum of the cross product of A subspaces, namely, principal component decomposition, and the extraction results of temperature sensor data features are obtained. The specific calculation formula is as follows:(12)TPT=∑a=1AtapaT=t1p1T+t2p2T+⋯+tApAT.In the above formula,T and P are principal component score matrix and load matrix, respectively, ta is H×1-dimensional principal component vector, and pa is J×1-dimensional load vector, which is also the projection direction of principal components [14].


### 2.3. Data Anomaly Diagnosis Based on Deep Neural Network Model

Deep neural networks (DNNs) can be understood as a neural network with many hidden layers, also known as deep feedforward network (DFN) and multilayer perceptron (MLP). The deep neural network has many advantages such as high speed and low error, and has been widely used in various fields. Therefore, this paper uses the deep neural network model to diagnose the data anomaly of temperature sensor. The topology of deep neural network is shown in Figure2.Figure 2
Topology of deep neural network.The measures to improve the generalization performance of the deep neural network are as follows:(1)
Use more data: on the premise of conditions, obtaining as much training data as possible is the most ideal method. More data can fully learn the model and easily improve the generalization ability.(2)
Use larger batches: under the condition of the same number of iterations and learning rate, using more data in each batch will help the model better learn the correct mode, and the output result of the model will be more stable.(3)
Adjust data distribution: the data distribution in most scenarios is uneven. If the model learns too much about a certain type of data, its output results will tend to this type of data. At this time, the generalization ability can be improved to a certain extent by adjusting the input data distribution.In the deep neural network, the input information is tagged, so the deep neural network can be simplified into a simple modeling unit, as shown in Figure3.Figure 3
Simple modeling unit.In order to ensure the integrity of data, a decoder was added [15]. Therefore, the autoencoder modeling unit is shown in Figure 4.Figure 4
Modeling unit of autoencoder.In order to minimize the network reconstruction error [16], this paper constructed a new multilayer autoencoder, whose structure is shown in Figure 5.Figure 5
Structure of multilayer autoencoder.In order to minimize errors, this paper mainly uses the attention mechanism to train the deep neural network model, and the process is as follows:The usual convolution operation in the deep neural network can be formulated as follows:(13)Y=X⊙W.In the above formula,W is the 4-dimensional tensor, and Wi,j,k,l is the weight parameter of the position of the y-th channel input in the i-th convolution kernel.The attention mechanism can further constrain and adjust each factor by observing globally and learning the relationship between each parameter and its influence on the result. After this restriction is introduced in the training process of convolution, the parameters of the convolution layer supervised by the attention mechanism can be expressed in the following form:(14)Wi,j,k,la=Wi,j,k,l⋅atti,j,k,l.In the above formula,att is the attention weight obtained after global observation, and Wi,j,k,l′ obtained will be used for the final convolutional feature extraction. It can be divided into two parts: channel attention and shape attention.(15)Wi,j,k,la=Wi,j,k,l⋅atti,jc⋅atti,k,ls.The information of different channels can be considered as the image description information extracted from different angles or using different features, and the filter will combine these feature information with different weights. Some features are focused on, while others tend to be ignored. Channel attention applies this idea.The average response of the convolution kerneli to the input channel y can be represented by the average value of the filter weights of the corresponding channel, namely:(16)avgi,jc=meanWi,j,k,l=1WH∑k=0H−1∑l=0WS−1Wi,j,k,l.The average response of these channels is then input into the full connection layer used to analyze their relationships, and the Sigmoid activation function is used as the threshold.(17)attc=sigmoidfccavgc.In this representation, the attention weight of each channel can be related to the filter parameters of other channels, introducing the interaction between channels. Similarly, the shape of the convolution kernel is usually used to describe the importance of features extracted from different positions of the filter, and the response weight of each position can be obtained by averaging the weights of all channels at that position.(18)avgi,k,ls=meanWi,j,k,l=1C∑j=0C−1Wi,j,k,l.A similar attention model can then be used to obtain shape weights.(19)atts=sigmoidfcsavgs.At this point, for each parameter of the convolution layer, the parameter ultimately affected by the global parameter can be obtained through formula (15). After the training of the network is completed, the weights obtained by the attention mechanism can be directly solidified on the original parameters of the convolutional layer without recalculation during the network operation.The characteristic data are input into the trained deep neural network model, and the result is the anomaly diagnosis result of temperature sensor data.


## 2.1. Temperature Sensor Data Collection

In order to achieve the comprehensive goal of data acquisition accuracy and efficiency of temperature sensor, this paper introduces a K-means algorithm to design the data acquisition process of temperature sensor. The operation cycle of temperature sensor is set to 6 months, and the sampling time interval is set to 1 s so as to collect more complete and reliable data to the greatest extent.Suppose there is a periodic temperature sensor dataset represented byx1,x2,…,xN, which mainly includes N observation series of random variable x [7, 8]. The goal of k-means clustering is to divide dataset N into k categories, at which a vector-value uk is introduced, where k=1,…,K and uk are the central values of the first cluster. The goal of clustering is to find each data point category and vector uk so that the sum of squares of the distance between each data point and uk can reach the minimum [9].Supposexn is used to represent the node vector, and a set of corresponding binary indicator variable rnk is introduced, where k=1,…,K means that the node vector xn belongs to class K, and xn is assigned to class k; then, rnk=1 exists, and the objective function is defined in the following form:(1)J=∑n=1N∑k=1Krnkxn−uk2.In the above formula,J represents the sum of the square of the distance between each data point and the center vector of the cluster to which it is assigned. Now, the key is to find the value of rnk and uk to achieve the minimum value.First, we determine the value ofrnk. J given by equation (1) is a linear function of rnk, so it is easy to obtain an analytical solution for rnk. Each data is independent, so we can choose to optimize each n separately, as long as we ensure that the value of xn−uk2 is small. Here, let rnk=1. In language description, we simply set the clustering of data nodes as the nearest clustering center. The function expression is as follows:(2)rnk=1,k=argminjxn−uk2,0,other.Here, if we take the derivative of the objective function and make it equal to 0, then the minimum value can be obtained, which can be expressed as(3)2∑n=1Nrnkxn−uk=0,Through solution, we obtain(4)uk=∑nrnkxn∑nrnk.For the data type in this paper, the dataset objects in the network are cooperative sensor node sets, and each temperature sensor set is a data vector [10]. Among them, n such dataset vectors form a set G, and the data of these n datasets are initialized into K categories, as shown in Figure 1:Figure 1
Temperature sensor data acquisition process based on K-means algorithm.The temperature sensor data acquisition process based on the K-means algorithm is shown as follows:(1)
K objects are randomly selected from set G of node group data set as the initial class center(2)
According to the class center value, the dataset value in theG sets is compared with the class center value, and the remaining n objects are divided into each class by comparing the minimum distance value.(3)
Update the class center value and recalculate the center value of each class through all the data values of the classes that have been classified.(4)
Calculate the criterion function and redistribute(5)
If it meets the threshold, output the data collection result of a periodic temperature sensor; otherwise, return to Step 2


## 2.2. Feature Extraction Based on Sliding Window

Suppose that the data of a periodic temperature sensor is expressed asX∈ℝN×J in the form of a two-dimensional matrix, where N and J represent the number of process samples and the number of process variables, respectively. This two-dimensional data matrix is segmented along the sampling direction by a sliding window H [11]; that is, matrix X is segmented along the horizontal axis after transposing. Assuming that the sliding step of the window is H and the data of each window is XkT∈ℝN×J, the principal component analysis method is applied to these two-dimensional matrices [12], from which the temperature sensor data features in each window can be extracted.The projection of the original set of sample points on thea-th principal axis constitutes the synthesis variable taH×1, where a=1,2,…,A. Assuming that the variation information carried by the fifth principal component 6 is represented by Varta, the following relationship exists:(5)Vart1≥Vart2≥⋯≥VartA>0.Original sample spaceX=xnjN×J=x1,…,xJ, and a comprehensive variable t1 is a linear combination of x1,…,xJ, namely:(6)t1=Xp1,p1=1.In order to maket1 carry the most original variation information, the variance of t1 is required to reach the maximum value, and the variance of t1 is(7)Vart1=1Ht12=1Hp1TXTXp1=p1TRp1.In the above formula,R=XTX is the covariance matrix of X.The above problems are translated into the solution of the following optimization problems:(8)maxp1=1p1TRp1.We writeλ1 as Lagrange operator, and let(9)λ1=p1TRp1−λ1p1Tp1−1.We take the partial derivatives ofp1 and λ1 of L, respectively:(10)∂L∂p1=2Rp1−2λ1p1=0,∂L∂p1=−p1Tp1−1=0.We obtain(11)Rp1=λ1p1,Vart1=p1TRp1=p1Tλ1p1=λ1p1Tp1=λ1.We assume thatp1 is the first principal axis, and t1=Xp1 is called the first principal component [13], so the second principal axis p2 is obtained by analogy, where p2 is orthonormal p1, p2Tp1=0,p22, and the second principal component t2=Xp2 is the second largest component carrying variation information, and Vart2 is second only to Vart1. So, we have Vart1≥Vart2≥⋯≥VartA>0. Therefore, if the data variation is used to reflect the information in the data, the first principal component t1 carries the most information, followed by t2 times. A total of J principal components were extracted. Matrix X is decomposed into the sum of the cross product of A subspaces, namely, principal component decomposition, and the extraction results of temperature sensor data features are obtained. The specific calculation formula is as follows:(12)TPT=∑a=1AtapaT=t1p1T+t2p2T+⋯+tApAT.In the above formula,T and P are principal component score matrix and load matrix, respectively, ta is H×1-dimensional principal component vector, and pa is J×1-dimensional load vector, which is also the projection direction of principal components [14].


## 2.3. Data Anomaly Diagnosis Based on Deep Neural Network Model

Deep neural networks (DNNs) can be understood as a neural network with many hidden layers, also known as deep feedforward network (DFN) and multilayer perceptron (MLP). The deep neural network has many advantages such as high speed and low error, and has been widely used in various fields. Therefore, this paper uses the deep neural network model to diagnose the data anomaly of temperature sensor. The topology of deep neural network is shown in Figure2.Figure 2
Topology of deep neural network.The measures to improve the generalization performance of the deep neural network are as follows:(1)
Use more data: on the premise of conditions, obtaining as much training data as possible is the most ideal method. More data can fully learn the model and easily improve the generalization ability.(2)
Use larger batches: under the condition of the same number of iterations and learning rate, using more data in each batch will help the model better learn the correct mode, and the output result of the model will be more stable.(3)
Adjust data distribution: the data distribution in most scenarios is uneven. If the model learns too much about a certain type of data, its output results will tend to this type of data. At this time, the generalization ability can be improved to a certain extent by adjusting the input data distribution.In the deep neural network, the input information is tagged, so the deep neural network can be simplified into a simple modeling unit, as shown in Figure3.Figure 3
Simple modeling unit.In order to ensure the integrity of data, a decoder was added [15]. Therefore, the autoencoder modeling unit is shown in Figure 4.Figure 4
Modeling unit of autoencoder.In order to minimize the network reconstruction error [16], this paper constructed a new multilayer autoencoder, whose structure is shown in Figure 5.Figure 5
Structure of multilayer autoencoder.In order to minimize errors, this paper mainly uses the attention mechanism to train the deep neural network model, and the process is as follows:The usual convolution operation in the deep neural network can be formulated as follows:(13)Y=X⊙W.In the above formula,W is the 4-dimensional tensor, and Wi,j,k,l is the weight parameter of the position of the y-th channel input in the i-th convolution kernel.The attention mechanism can further constrain and adjust each factor by observing globally and learning the relationship between each parameter and its influence on the result. After this restriction is introduced in the training process of convolution, the parameters of the convolution layer supervised by the attention mechanism can be expressed in the following form:(14)Wi,j,k,la=Wi,j,k,l⋅atti,j,k,l.In the above formula,att is the attention weight obtained after global observation, and Wi,j,k,l′ obtained will be used for the final convolutional feature extraction. It can be divided into two parts: channel attention and shape attention.(15)Wi,j,k,la=Wi,j,k,l⋅atti,jc⋅atti,k,ls.The information of different channels can be considered as the image description information extracted from different angles or using different features, and the filter will combine these feature information with different weights. Some features are focused on, while others tend to be ignored. Channel attention applies this idea.The average response of the convolution kerneli to the input channel y can be represented by the average value of the filter weights of the corresponding channel, namely:(16)avgi,jc=meanWi,j,k,l=1WH∑k=0H−1∑l=0WS−1Wi,j,k,l.The average response of these channels is then input into the full connection layer used to analyze their relationships, and the Sigmoid activation function is used as the threshold.(17)attc=sigmoidfccavgc.In this representation, the attention weight of each channel can be related to the filter parameters of other channels, introducing the interaction between channels. Similarly, the shape of the convolution kernel is usually used to describe the importance of features extracted from different positions of the filter, and the response weight of each position can be obtained by averaging the weights of all channels at that position.(18)avgi,k,ls=meanWi,j,k,l=1C∑j=0C−1Wi,j,k,l.A similar attention model can then be used to obtain shape weights.(19)atts=sigmoidfcsavgs.At this point, for each parameter of the convolution layer, the parameter ultimately affected by the global parameter can be obtained through formula (15). After the training of the network is completed, the weights obtained by the attention mechanism can be directly solidified on the original parameters of the convolutional layer without recalculation during the network operation.The characteristic data are input into the trained deep neural network model, and the result is the anomaly diagnosis result of temperature sensor data.


## 3. Simulation Experiment Design

### 3.1. Experimental Scheme

To verify the validity of the temperature sensor data anomaly diagnosis method based on the deep neural network designed in this paper as the research objective, a simulation experiment scheme is designed. The specific experimental scheme is as follows:(1)
Experimental environment: in order to ensure the authenticity of experimental results, experimental environmental parameters need to be designed in detail in this experiment. The specific parameter settings are shown in Table1.(2)
Experimental data: multiple types of temperature sensors are taken as research objects to keep them running, and the operating data of temperature sensors are taken as experimental sample data, and the collected data are denoised to improve the authenticity of the simulation results. Because the setting of experimental parameters will affect the simulation results, in order to maximize the accuracy of the simulation experiment, the simulation experimental parameters are adjusted many times in this experiment, and the parameters in the optimal running state of the simulation software are taken as the initial simulation parameters.(3)
Experimental methods and evaluation indicators.Table 1
Experimental parameter settings.
ProjectParameterCPUIntel XeonCPU hard disk capacity1.5 TCPU frequency1.2 GHzRandom access memory128 GBOperating systemWindows 10Monitor resolution1280∗ 1024Interface typeUSBNetwork band2.4–2.5 GHzTransmission rate28 Mb/sSimulation softwareMATLAB 7.0In this paper, reference [4] method and reference [5] method are selected as experimental comparison methods, and the practical application effects of the two methods and the proposed method are verified by comparing the error rate of feature extraction, diagnostic accuracy, and diagnostic efficiency of temperature sensor data.Among them, the lower the error rate of temperature sensor data feature extraction, the higher the accuracy of data feature extraction, and the more accurate the result of feature extraction. The diagnostic accuracy is an important index to verify the anomaly diagnosis method of temperature sensor data. The higher the anomaly diagnosis accuracy of temperature sensor data, the more accurate the diagnosis result is. The diagnostic efficiency of temperature sensor data refers to the time it takes to diagnose temperature sensor data anomalies. The shorter the diagnostic time, the higher the diagnostic efficiency.


### 3.2. Analysis of Experimental Results

#### 3.2.1. Data Feature Extraction Error

The error rate of feature extraction of temperature sensor data by reference [4] method, reference [5] method, and this method is compared, and the results are shown in Figure 6.Figure 6
Error rate of feature extraction from temperature sensor data.According to the data in Figure6, the error rate of feature extraction of temperature sensor data in reference [4] is between −12.5% and 14.65%, and that of temperature sensor data in reference [5] is between −9.6% and 12.15%. Compared with these two comparison methods, the error rate of temperature sensor data feature extraction in this method varies from −2.1% to 5.9%, which is the lowest among the three methods. The reason is that this method uses the K-means algorithm to collect the temperature sensor data in an operation cycle and uses the sliding window technology to extract the temperature sensor data features, which improves the accuracy of temperature sensor data feature extraction, and can lay a solid data foundation for subsequent diagnosis and analysis.


#### 3.2.2. Diagnostic Accuracy

The diagnostic accuracy of abnormal temperature sensor data of reference [4] method, reference [5] method, and this method is compared, and the results are shown in Figure 7.Figure 7
Temperature sensor data anomaly diagnosis accuracy.According to the data in Figure7, the minimum and maximum diagnostic accuracy of abnormal temperature sensor data in reference [4] are 73% and 93%, respectively, and the minimum and maximum diagnostic accuracy of abnormal temperature sensor data in reference [5] are 76% and 91%, respectively. Compared with these two methods, the anomaly diagnosis accuracy of temperature sensor data obtained by the proposed method is always above 95%, which is much higher than the two experimental comparison methods, indicating that the anomaly diagnosis results of temperature sensor data obtained by the proposed method are more accurate. The reason is that this method constructs a deep neural network model for abnormal diagnosis of temperature sensor data, inputs the characteristic data into the model, and the obtained result is the diagnosis result.


#### 3.2.3. Diagnostic Efficiency

The anomaly diagnosis time of temperature sensor data of reference [4] method, reference [5] method, and this method is compared to test the diagnosis efficiency of different methods. The results are shown in Table 2.Table 2
Anomaly diagnosis time of temperature sensor data (unit: ms).
Number of experimentsReference [4] methodReference [5] methodMethod of this method12561605911352151572124713455312691786341284163575126717558612431216371217106648128513752912441136910123110757Average value26314059According to the average value of anomaly diagnosis time of temperature sensor data of different methods after multiple experiments, the diagnosis efficiency of different methods can be obtained. The average value of anomaly diagnosis time of temperature sensor data of reference [4] method is 263 ms, and the average value of anomaly diagnosis time of temperature sensor data of reference [5] method is 140 ms. Compared with these two methods, the average value of anomaly diagnosis time of temperature sensor data in this method is the lowest, only 59 ms, which proves that this method has the highest efficiency and the best practical application effect. The reason is that this method uses the K-means algorithm to collect the temperature sensor data in a running cycle, constructs a deep neural network model for abnormal diagnosis of temperature sensor data, and inputs the characteristic data into the model to realize abnormal diagnosis.


## 3.1. Experimental Scheme

To verify the validity of the temperature sensor data anomaly diagnosis method based on the deep neural network designed in this paper as the research objective, a simulation experiment scheme is designed. The specific experimental scheme is as follows:(1)
Experimental environment: in order to ensure the authenticity of experimental results, experimental environmental parameters need to be designed in detail in this experiment. The specific parameter settings are shown in Table1.(2)
Experimental data: multiple types of temperature sensors are taken as research objects to keep them running, and the operating data of temperature sensors are taken as experimental sample data, and the collected data are denoised to improve the authenticity of the simulation results. Because the setting of experimental parameters will affect the simulation results, in order to maximize the accuracy of the simulation experiment, the simulation experimental parameters are adjusted many times in this experiment, and the parameters in the optimal running state of the simulation software are taken as the initial simulation parameters.(3)
Experimental methods and evaluation indicators.Table 1
Experimental parameter settings.
ProjectParameterCPUIntel XeonCPU hard disk capacity1.5 TCPU frequency1.2 GHzRandom access memory128 GBOperating systemWindows 10Monitor resolution1280∗ 1024Interface typeUSBNetwork band2.4–2.5 GHzTransmission rate28 Mb/sSimulation softwareMATLAB 7.0In this paper, reference [4] method and reference [5] method are selected as experimental comparison methods, and the practical application effects of the two methods and the proposed method are verified by comparing the error rate of feature extraction, diagnostic accuracy, and diagnostic efficiency of temperature sensor data.Among them, the lower the error rate of temperature sensor data feature extraction, the higher the accuracy of data feature extraction, and the more accurate the result of feature extraction. The diagnostic accuracy is an important index to verify the anomaly diagnosis method of temperature sensor data. The higher the anomaly diagnosis accuracy of temperature sensor data, the more accurate the diagnosis result is. The diagnostic efficiency of temperature sensor data refers to the time it takes to diagnose temperature sensor data anomalies. The shorter the diagnostic time, the higher the diagnostic efficiency.


## 3.2. Analysis of Experimental Results

### 3.2.1. Data Feature Extraction Error

The error rate of feature extraction of temperature sensor data by reference [4] method, reference [5] method, and this method is compared, and the results are shown in Figure 6.Figure 6
Error rate of feature extraction from temperature sensor data.According to the data in Figure6, the error rate of feature extraction of temperature sensor data in reference [4] is between −12.5% and 14.65%, and that of temperature sensor data in reference [5] is between −9.6% and 12.15%. Compared with these two comparison methods, the error rate of temperature sensor data feature extraction in this method varies from −2.1% to 5.9%, which is the lowest among the three methods. The reason is that this method uses the K-means algorithm to collect the temperature sensor data in an operation cycle and uses the sliding window technology to extract the temperature sensor data features, which improves the accuracy of temperature sensor data feature extraction, and can lay a solid data foundation for subsequent diagnosis and analysis.


### 3.2.2. Diagnostic Accuracy

The diagnostic accuracy of abnormal temperature sensor data of reference [4] method, reference [5] method, and this method is compared, and the results are shown in Figure 7.Figure 7
Temperature sensor data anomaly diagnosis accuracy.According to the data in Figure7, the minimum and maximum diagnostic accuracy of abnormal temperature sensor data in reference [4] are 73% and 93%, respectively, and the minimum and maximum diagnostic accuracy of abnormal temperature sensor data in reference [5] are 76% and 91%, respectively. Compared with these two methods, the anomaly diagnosis accuracy of temperature sensor data obtained by the proposed method is always above 95%, which is much higher than the two experimental comparison methods, indicating that the anomaly diagnosis results of temperature sensor data obtained by the proposed method are more accurate. The reason is that this method constructs a deep neural network model for abnormal diagnosis of temperature sensor data, inputs the characteristic data into the model, and the obtained result is the diagnosis result.


### 3.2.3. Diagnostic Efficiency

The anomaly diagnosis time of temperature sensor data of reference [4] method, reference [5] method, and this method is compared to test the diagnosis efficiency of different methods. The results are shown in Table 2.Table 2
Anomaly diagnosis time of temperature sensor data (unit: ms).
Number of experimentsReference [4] methodReference [5] methodMethod of this method12561605911352151572124713455312691786341284163575126717558612431216371217106648128513752912441136910123110757Average value26314059According to the average value of anomaly diagnosis time of temperature sensor data of different methods after multiple experiments, the diagnosis efficiency of different methods can be obtained. The average value of anomaly diagnosis time of temperature sensor data of reference [4] method is 263 ms, and the average value of anomaly diagnosis time of temperature sensor data of reference [5] method is 140 ms. Compared with these two methods, the average value of anomaly diagnosis time of temperature sensor data in this method is the lowest, only 59 ms, which proves that this method has the highest efficiency and the best practical application effect. The reason is that this method uses the K-means algorithm to collect the temperature sensor data in a running cycle, constructs a deep neural network model for abnormal diagnosis of temperature sensor data, and inputs the characteristic data into the model to realize abnormal diagnosis.


## 3.2.1. Data Feature Extraction Error

The error rate of feature extraction of temperature sensor data by reference [4] method, reference [5] method, and this method is compared, and the results are shown in Figure 6.Figure 6
Error rate of feature extraction from temperature sensor data.According to the data in Figure6, the error rate of feature extraction of temperature sensor data in reference [4] is between −12.5% and 14.65%, and that of temperature sensor data in reference [5] is between −9.6% and 12.15%. Compared with these two comparison methods, the error rate of temperature sensor data feature extraction in this method varies from −2.1% to 5.9%, which is the lowest among the three methods. The reason is that this method uses the K-means algorithm to collect the temperature sensor data in an operation cycle and uses the sliding window technology to extract the temperature sensor data features, which improves the accuracy of temperature sensor data feature extraction, and can lay a solid data foundation for subsequent diagnosis and analysis.


## 3.2.2. Diagnostic Accuracy

The diagnostic accuracy of abnormal temperature sensor data of reference [4] method, reference [5] method, and this method is compared, and the results are shown in Figure 7.Figure 7
Temperature sensor data anomaly diagnosis accuracy.According to the data in Figure7, the minimum and maximum diagnostic accuracy of abnormal temperature sensor data in reference [4] are 73% and 93%, respectively, and the minimum and maximum diagnostic accuracy of abnormal temperature sensor data in reference [5] are 76% and 91%, respectively. Compared with these two methods, the anomaly diagnosis accuracy of temperature sensor data obtained by the proposed method is always above 95%, which is much higher than the two experimental comparison methods, indicating that the anomaly diagnosis results of temperature sensor data obtained by the proposed method are more accurate. The reason is that this method constructs a deep neural network model for abnormal diagnosis of temperature sensor data, inputs the characteristic data into the model, and the obtained result is the diagnosis result.


## 3.2.3. Diagnostic Efficiency

The anomaly diagnosis time of temperature sensor data of reference [4] method, reference [5] method, and this method is compared to test the diagnosis efficiency of different methods. The results are shown in Table 2.Table 2
Anomaly diagnosis time of temperature sensor data (unit: ms).
Number of experimentsReference [4] methodReference [5] methodMethod of this method12561605911352151572124713455312691786341284163575126717558612431216371217106648128513752912441136910123110757Average value26314059According to the average value of anomaly diagnosis time of temperature sensor data of different methods after multiple experiments, the diagnosis efficiency of different methods can be obtained. The average value of anomaly diagnosis time of temperature sensor data of reference [4] method is 263 ms, and the average value of anomaly diagnosis time of temperature sensor data of reference [5] method is 140 ms. Compared with these two methods, the average value of anomaly diagnosis time of temperature sensor data in this method is the lowest, only 59 ms, which proves that this method has the highest efficiency and the best practical application effect. The reason is that this method uses the K-means algorithm to collect the temperature sensor data in a running cycle, constructs a deep neural network model for abnormal diagnosis of temperature sensor data, and inputs the characteristic data into the model to realize abnormal diagnosis.


## 4. Conclusion

As people production and living standards continue to improve, various sensors has been widely applied in all fields, especially the temperature sensor because of its high precision and convenient advantages, such as the application on a large scale in the areas of agricultural production, scientific research and life, but also easy to appear abnormal temperature sensor data. Therefore, it is necessary to diagnose abnormal temperature sensor data. Aiming at the problems of high error rate of current temperature sensor data feature extraction, abnormal diagnosis accuracy, and low efficiency of temperature sensor data, this paper proposes a temperature sensor data anomaly diagnosis method based on the deep neural network. Finally, a comparative simulation experiment is conducted to verify the performance of the proposed method in data anomaly diagnosis. The experimental results show that the error rate of feature extraction of temperature sensor data in this method varies from −2.1% ∼ 5.9%, the diagnosis accuracy remains above 95%, and the average diagnosis time is only 59 ms, indicating that this method has low error rate of feature extraction of temperature sensor data, high accuracy, and efficiency of abnormal diagnosis of temperature sensor data. It can fully solve the problems of traditional methods and can be widely used in the field of temperature sensor data anomaly diagnosis.



---

*Source: 9662374-2022-04-12.xml*