Error prediction of a capacitor voltage transformer using dilated causal convolution and LSTM

To timely and accurately complete the error prediction of capacitor voltage transformers, this paper proposes an error prediction algorithm for capacitor voltage transformers that combines dilated causal convolution and LSTM. The algorithm is divided into two parts: one part updates the state of the input sequence using LSTM, while the other part extracts features through dilated causal convolution, maintaining data causality about the original sequence. Finally, the outputs of these two parts are combined to make the obtained sequence feature information more accurate and enriched. Experiments show that the MSE between the error prediction results obtained by this method and the actual error samples of capacitor voltage transformers is only 0.0003, which can accurately and efficiently complete the error prediction of capacitor voltage transformers.


Introduction
The capacitor voltage transformer (CVT) is a kind of voltage transformer that is widely used in electric energy measurement systems.It proportionally reduces the high-level voltage on the primary side of the electric system and then sends it to the secondary side to help achieve the measurement work of electricity [1] [2].However, with long-term use of CVT, affected by factors such as the environment, there will be abnormal situations with low measurement error accuracy, which will affect the accuracy of electric energy measurement and the safety of the power system [3].Accuracy prediction of the measurement error of CVT can give an early warning of the abnormal state of the electric energy measurement systems.
The current research on online monitoring of the CVT metering error compares the secondary output voltage of the CVT and a standard voltage transformer by introducing a standard voltage transformer and calculating the online monitoring value of the metering error of the CVT [4].However, the online monitoring system can only obtain the current measurement error situation and cannot predict the subsequent development trend of the CVT measurement error, which brings difficulties to the accurate measurement and operation and maintenance early warning of the electric energy measurement system.As deep learning improves by leaps and bounds, prediction algorithms based on neural networks are widely used.Therefore, this paper applies it to the error prediction research of capacitor voltage transformers.
Traditional mainstream forecasting models include mean regression, ARIMA, and exponential smoothing forecasting [5][6][7].Prediction models based on deep learning neural networks include RNN, which is a recurrent neural network; LSTM, which is a long short-term memory neural network; and TCN, which is a temporal convolutional network [8][9][10].However, the accuracy rate of these algorithms is low when they are directly used in CVT measurement error prediction.Therefore, to address the inconvenience of accurately predicting error online for CVT, this paper improves the existing neural network prediction model and proposes a capacitor voltage transformer error prediction algorithm that combines dilated causal convolution and LSTM to make the final prediction result more accurate.LSTM is a valid algorithm for processing sequence data, which allows the model to better capture long-term dependencies.LSTM achieves memory and forgetting by introducing three gating mechanisms that allow the model to selectively update and forget information.The three gating mechanisms are the input gating mechanism, forget gating mechanism and the output gating mechanism.The input gating mechanism can determine how much new information is supposed to be joined in the cell state at the current time.It standardizes the output range of a value between 0 and 1 by a sigmoid function, where 0 is completely ignored and 1 is completely accepted.The forget-gating mechanism determines how much old information should be forgotten in the current time step.Similar to the input gating mechanism, the forget gating mechanism also sets an output value range of 0 and 1, where 0 represents complete forgetting and 1 represents complete retention.The output gating mechanism determines how much cell state information can be passed to the output like the sigmoid activation function and the tangent activation function.Figure 2 shows the structure of the LSTM network.

Improved network model structure
To more effectively use the advantages of dilated causal convolution and LSTM algorithms, this paper makes an effective combination of the two modules.Through an idea similar to the residual structure, the input t x is divided into two parts: one part is sent to the LSTM algorithm for state update, and the other part is extracted by dilated causal convolution to maintain the causality of the original sequence.Then, the output of the expanded causal convolution is added to the hidden layer t c in the LSTM to obtain a new candidate state through the tanh node and then sent to the output gating mechanism in the LSTM to obtain the final result.The improved LSTM network is displayed in Figure 3.The overall process can be expressed in the following formula:

Experimental data and parameters
The error data used in the experiment in this paper are the ratio error data collected in the past using records and repaired records of an electric station.This paper intercepts the ratio error data of 10, 000 sample points as the data set for training the network model.The environment used in the experiment is computer equipment with a Windows 10 system.The CPU is an Intel(R) Core(TM) i7-13700H, the GPU is a GeForce RTX4050, and the video memory is 6 GB.The deep learning environment used is Python 3.7.4 and PyTorch-GPU 1.8.0.

Experimental evaluation indicators
To quantitatively evaluate the prediction effect of our improved algorithm in this article, three indicators, MSE (mean squared error), RMSE (root mean squared error), and MAE (mean absolute error), were introduced as prediction evaluation indicators.Their expression can be expressed as follows: (10) where i y ˆ represents the value predicted by the algorithms at point i .i y is the real value of the ratio error at the i sampling point, and n is the total number of samples intercepted.From the definition of the formula, it is obvious that the above evaluation indicators are in reverse ratio to the prediction effect of the algorithm.This means that the smaller the indicators are, the more accurate the prediction result is.

Experimental results
Intending to verify the effectiveness of the improved algorithm, this paper designed an ablation experiment for comparative analysis of the results, input the error data into the original LSTM network and the improved LSTM network for training, and then performed error prediction through the trained network model.The output of each prediction was recorded and compared with the real value.The comparison curves between the experimentally predicted error results and actual error values are shown in Figure 4 and Figure 5:  The above figure is a comparison curve of the prediction results obtained from 500 sampling points.The abscissa in the figure above is the number of sample points, and the ordinate is the ratio error.The orange dotted line represents the real error data collected, while the blue solid line is the prediction error data output by the algorithm in this paper.The accuracy of the prediction results of the algorithm can be reflected in the fit degree of the two curves in the figure.We find that the predicted error result of the LSTM network is less closely fitted to the actual error than the improved LSTM network.Therefore, we can also find that the predicted result of the improved LSTM network is more in line with the actual value.
Intending to further verify the effect of the improved algorithm in this paper, we performed a comparative experiment with RNN and TCN.The comparison results are shown in Table 1 below.From Table 1, we can see that the MSE, RMSE, and MAE of the original LSTM algorithms are higher than that of the TCN, indicating that its prediction effect is not as good as that of the TCN.This is because the causal convolution in the TCN can effectively preserve the dependency between sequence data, that is, the causality of data.However, in RNN and LSTM, this dependency cannot be restricted to network learning.In the transmission of network layer information, some information violates the time sequence constraints, leading to relatively poor final prediction results.However, our improved LSTM algorithms solved the problem by adding dilated causal convolution to the LSTM network, effectively utilizing and limiting the temporal causal correlation of the data, determining the principle of data dependency before and after, and improving the final prediction effect.It can be seen that the improved LSTM algorithms are much lower than the original LSTM and the other two algorithms concerning MSE, RMSE, and MAE, indicating that their prediction effect has been greatly improved.

Conclusion
In this article, we developed an error prediction algorithm that fused dilated causal convolution and LSTM.The data set is established through the historical ratio error data, and then an improved LSTM algorithm model is built to use the error data set to train the improved LSTM model.Through the ablation experiment, the improved LSTM algorithm has a better error prediction effect than the original

2. 1 .
Dilated causal convolution and LSTM algorithm Dilated causal convolution combines two characteristics of causal convolution with dilated convolution.It can not only capture wider context information by setting a larger rate parameter d in convolution but also maintain the causality of sequence data by causal convolution.Figure 1 displays the detailed workflow of dilated causal convolution.

b
are the bias terms of the input gating mechanism, output gating mechanism, forget gating mechanism, and cell state.
is the input sequence of the improved LSTM, t h indicates that the network has an output at time t x

Table 1 .
Comparison of algorithm results.