Abstract
The traditional reconstruction algorithms based on p-norm, limited by their reconstruction model and data processing mode, are prone to reconstruction failure or long reconstruction time. In order to break through the limitations, this paper proposes a reconstruction algorithm based on the temporal neural network (TCN). A new reconstruction model based on TCN is first established, which does not need sparse representation and has large-scale parallel processing. Next, a TCN with a fully connected layer and symmetrical zero-padding operation is designed to meet the reconstruction requirements, including non-causality and length-inconsistency. Moreover, the proposed algorithm is constructed and applied to power quality disturbance (PQD) data. Experimental results show that the proposed algorithm can implement the reconstruction task, demonstrating better reconstruction accuracy and less reconstruction time than OMP, ROMP, CoSaMP, and SP. Therefore, the proposed algorithm is more attractive when dictionary design is complicated, or real-time reconstruction is required.
Keywords
Introduction
Donoho et al. 1 proposed the compressed sensing (CS) theory is the most popular topic in recent years.2,3 CS theory states that a few sampled values can reconstruct the original data if the data is sparse or compressive. The original data can be reconstructed through a few measured values – much less in number than those suggested by previous theories such as Shannon’s sampling theorem (SST). According to CS theory, there are three essential components whose mathematical description is as follows:
Sparse representation. A data
where,
Compress observation.
where,
Reconstruction algorithm. Recovering
From the mathematical model mentioned above, the algorithm based on p-norm is crucial to reconstructing the original data. Up until now, scholars have proposed many reconstruction algorithms based on p-norm.5,6 The most commonly used algorithms are the orthogonal matching pursuit algorithm (OMP),7,8 the regularized orthogonal matching pursuit algorithm (ROMP), 9 the compressive sampling matching pursuit algorithm (CoSaMP), 10 and the subspace pursuit algorithm (SP). 11
However, the performance of the above algorithms depends on their reconstruction model and data processing mode. When an observation matrix is satisfied with RIP, a dictionary and data processing mode become the key to obtain good performance. Suppose a dictionary does not match a signal well, such mismatch can lead to reconstruction failure. That is why dictionary design has always been a research focus in CS field. 12 Nevertheless, it is challenging to design a more effective dictionary, especially when dealing with complex signals. Moreover, the traditional algorithms based on p-norm limited by their data processing mode do not realize data-parallel processing. Therefore, an algorithm that is not constrained by a dictionary and can parallel process data is urgently needed.
In recent years, Bai et al. 13 proposed a superior convolution neural network (CNN) called the temporal neural network (TCN) demonstrating excellent performance in many fields such as prediction estimation, 14 anomaly detection,15,16 and recognition. 17 TCN inherits the advantages of CNN in series modeling and has large-scale parallel processing, which has an excellent attraction since it breaks through the limitations of traditional reconstruction algorithms. Therefore, TCN instead should be used instead of the traditional algorithms in terms of reconstruction data.
The main contributions and innovations of this paper are as follows:
A reconstruction algorithm based on TCN is proposed for the first time. It has the advantages of dictionary-free and parallel data processing and is suitable for fields with intricate dictionary design and high real-time demands.
A TCN with a fully connected layer and symmetrical zero-padding operation is designed to meet non-causality and length-inconsistency reconstruction requirements. It can recover data in repla-cement of the traditional reconstruction algorithms.
The proposed algorithm in power quality disturbance (PQD) data is tested. The results show that the new algorithm is better than the traditional reconstruction algorithms under the scene where instantaneous disturbance data and a vast number of data recovery.
This paper is divided into five sections. The basic concepts of TCN are introduced in Section “Preliminary.” In Section “A reconstruction algorithm based on TCN,” a reconstruction model is proposed based on TCN, and a TCN is designed as a reconstruction algorithm. In Section “Application experiment”, the proposed algorithm is constructed and applied to PQD data to verify the reconstruction performance. Conclusions are finally drawn in Section “Conclusion”.
Preliminary
TCN can extract time-series features and realize the related function through one-dimensional convolution. The relationship between the input and output of TCN is as follows
where,
(1) The Causal convolution. Constrained by the time constraint, the model of input and output is also expressed as
Where,
(2) The atrous convolution. In order to increase TCN receptive field, the function
where, k is the convolution kernel size, d is the expansion factor represents the distance between two convolution kernel elements. TCN can use fewer convolutional layers under suitable k and d to obtain a sizeable receptive field.
(3) The residual connection blocks. In order to solve gradient disappearance and degradation in a deep network, the residual connection blocks are introduced in TCN, whose model is
where,
In summary, TCN for time-series modeling is not based on the mathematical model and preliminary information and can extract time-series features with a low number of hyperparameters. Therefore, TCN is recommended as a reconstruction algorithm.
A reconstruction algorithm based on TCN
Let
Where,
Where,
Comparing equations (9) and (3) shows the exact difference between the reconstruction model based on TCN and the traditional reconstruction model. The proposed model does not need sparse representation and sparse vector calculation and inherits the advantages of TCN, as shown in Figure 1. However, TCN as a reconstruction algorithm applied in CS framework does not meet Equations 4 and 5, which the lengths between the compressed data y and the reconstruction data
Add a fully connected layer. The first layer of TCN uses a fully convolutional network (FCN) 21 to modify the compressed data length to be consistent with the reconstruction data.
Add a symmetrical zero-padding operation. The unilateral zero-padded operation of the causal convolution is altered to symmetric zero-padded to realize the non-causality of convolution in each layer.

The difference between the proposed reconstruction model and the traditional reconstruction model in CS framework: (a) the model of using the traditional reconstruction algorithms and (b) the proposed model of using the reconstruction algorithm based on TCN.
The designed structure of TCN, shown in Figure 2, comprises the input layer, FCN layer, hidden layers, and output layer. The input layer connects the compressed data, and the output layer outputs the reconstructed data. Moreover, the FCN layer can alter the lengths and extract low-level features, and the hidden layers can further extract high-level features and relative position information. It should be noted that the number of hidden layers should be high enough to ensure TCN has enough receptive field, usually satisfying the following formula

The structure of TCN as the reconstruction algorithm.
Where,
Furthermore, the reconstruction algorithm based on TCN implementation process is shown in Figure 3. The steps include establishing the original and compressed data sets, constructing TCN, training and testing TCN, and adjusting TCN. For the sake of evaluating the training and testing, the root means square error (RMSE) is selected as the loss function, and the determinable coefficient (R2) is selected as the accuracy rate function. The calculated formulas are

The implementation processing of the reconstruction algorithm based on TCN.
Where,
Application experiment
PQD is an event that can destroy the rated voltage and current of the power system, which easily leads to power equipment failure, power system collapse, and even life-threatening.18,19 With the power system structure becoming complex, PQD events also become more diverse in their varieties, such as instantaneous pulse, attenuation oscillation, voltage sag, harmonic, voltage fluctuation,20,21 whose mathematical models are shown in Table 1. Recently, CS theory has been a useful method to process PQD data, and one of its critical tasks is to guarantee effective reconstruction. In this section, PQD data is used to verify the feasibility and superiority of the proposed algorithm. OMP, ROMP, CoSaMP, and SP are selected as the comparison algorithms.
Five typical PQD data mathematical models and their time-frequency parameters.
Construction
According to Figure 3, the original and compressed data sets first needs to be established. Because there are only ten published PQD data sets from IEEE 1159.2 Working Group, the data is not adequate for training and testing the proposed algorithm. Therefore, PQD data sets are created as shown in Table 1, obtaining 25,000 original data with
Secondly, the reconstruction algorithm based on TCN is constructed. The used tools as follows: PyCharm 2020.2.2 in Win 10 operating system, Python version 3.8, Intel i710750H processor with six cores, 2.4 GHz dominant frequency, content is 16G, 1T hard disk, and RTX2070 graphics card. The loss function is set to le-3. The maximum number of iterations is set to 500. The tolerance of early stopping is set to 10. After the proposed algorithm is trained and tested, RMSE and R2 are shown in Table 2. The optimal convolution number is 64, and the batch is 32. Thirdly, training and testing are executed many times under optimal hyperparameters and different c, as shown in Figure 4. The results suggest that RMSE shows a significant downward trend, R2 exhibits a significant upward trend, and RMSE and R2 reach the setting value except for c = 5%. In summary, the designed TCN in this paper achieves reconstruction tasks at different c and can be used as a reconstruction algorithm.
Training and testing results under different hyperparameters (

Training (a) and testing (b) results under the optimal hyperparameters and different
Comparison
Some comparison experiments are developed to verify the superiority and feasibility of the proposed algorithm. The specific experiments are as follows:
(1) The simulation data recovering test.
In the first experiment, we select FFT as a dictionary in the traditional reconstruction model. 24 has proved the sparsity of PQD data in the dictionary. Next, we randomly choose data from the compressed data sets and import them into OMP, ROMP, CoSaMP, SP, and the proposed algorithm, respectively, in which the reconstruction effects are shown in Figure 5. It can be seen that the proposed algorithm recoveries all kinds of PQD data successfully and has the best reconstruction performance. Conversely, the traditional reconstruction algorithms all fail for the instantaneous pulse data due to the poor sparsity, and OMP demonstrates better performance than the other traditional algorithms for the other PQD data. The experimental results verify that the traditional algorithms are limited to the selected dictionary, that is, the more mismatched dictionary with data is, the worse sparsity is, and the worse reconstruction performance is. However, the proposed algorithm is not needed to consider any dictionary and sparsity. Indeed, the overcomplete dictionary can resolve the reconstruction failure problem and improve the reconstruction accuracy. 25 The commonly used overcomplete dictionary is Gobar dictionary, Hybrid dictionary, and time-frequency atoms dictionary.26–28 However, the overcomplete dictionary will result in excessive calculation and poor real-time, which is more evident in a large number of data recovering, as shown in the following experimental results.

The reconstruction results under the traditional reconstruction algorithms and the proposed algorithm (c = 20%): (a) instantaneous pulse, (b) attenuation oscillation, (c) voltage sag, (d) harmonic, and (e) voltage fluctuation.
In the second experiment, we first select the time-frequency atoms as an overcomplete dictionary for the instantaneous pulse data and FFT for others, making all data have sparsity. Then 1000 data from the compressed PQD data sets are chosen and send in the proposed algorithm and the comparison algorithms. The average reconstruction accuracy RMSE and the reconstruction time t under different c are obtained and shown in Table 3. The above results reflect that the time-frequency atoms dictionary can solve reconstruction failure but affect the reconstruction speed. Furthermore, no matter which the traditional reconstruction algorithms, RMSE will decrease with the increase of c, but t increases significantly. Conversely, t has not changed significantly in the proposed algorithm, such as the minimum t is 3.12s at c = 5%, but it reaches 3.16s at c = 35%. This experiment verifies that the traditional algorithms are limited to non-data-parallel processing mode, that is, the more data to be recovered, the worse real-time performance. Nevertheless, the proposed algorithm has excellent real-time due to data-parallel processing.
(2) The measured data recovering test.
The Comparison of recovery large number of data under different c.
In order to verify the feasibility of the proposed algorithm, we design the experimental equipment shown in Figure 6. Its structure and function are described as follows: The signal generator module output the measured data from IEEE 1159.2 Working Group Sets and the pseudo-random sequence. The observation matrix module compresses the measured data through a random demodulat-ion analog information converter (RD-AIC).29,30 The recovering module reconstructs original data through the reconstruction algorithms developed on a computer, including the proposed algorithm and OMP. The data in IEEE 1159.2 Working Group sets are voltage sags. According to the above device function, we first randomly choose a voltage sag data, import it to the signal generator, obtain the compressed data by RD-AIC, and achieve reconstruction and calculate residuals by computer. The output waveforms of each module are shown in Figure 7, which illustrates that the proposed algorithm is feasible for practical PQD data recovery, and the performance is equal to OMP.

The experimental equipment: (a) the structure of the experimental equipment and (b) the physical device of the experimental equipment. 1. Power supply( 15 V/ 5 V), 2. Multiplier with AD835, 3. Low-pass filter with UAF42, 4. NI ELVIS II development board, 5. USB, 6. PC.

The output waveforms of each module of experimental equipment.
Conclusion
This paper provides a new reconstruction algorithm based on TCN to overcome the disadvantages of traditional algorithms. Some conclusions are shown as follows:
The proposed reconstruction model in CS framework does not require sparse representation and has data-parallel processing characteristics suitable to the scene where dictionary design is complicated, or real-time reconstruction is required.
The designed TCN can meet the reconstruction requirements that input and output data is demanded the length inconsistency and non-causality.
The developed experiments show that the proposed algorithm can achieve the reconstruction function no matter the simulation data and the measured data. Moreover, it has the best reconstruction performance for instantaneous pulse data recovery and has the fastest reconstruction speed for all kinds of PQD data recovery.
Footnotes
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was supported by the National Natural Science Foundation of China under Grant No.62073206, the Natural Science Basic Research Plan in Shaanxi Province of China No. 2019JQ-551, and Light Industry Intelligent Detection and Control Innovation Team No. AI2019005.
