# Predicting the Life of Varistors via a Nonlinear Coefficient Based on a Small-Scale Data Model
## 2 Materials and Methods
### Life Prediction Model  
A flow chart for the proposed life prediction model is shown in Figure 7. The model consists of five steps: data collection, data enhancement, data preprocessing, network training and prediction.  
* Data collection  
A certain current is used to impact the varistor at a certain time interval to simulate its actual working conditions. A varistor undergoing several impacts from full health until complete damage is recorded as one experiment. In the experiment, the nonlinear coefficient is calculated directly by the experimental equipment. The nonlinear coefficient of the varistor in one experiment was recorded as one set of data A.  
* Data enhancement  
The nonlinear coefficient data obtained from the surge impact test provide the original data for establishing a life prediction model for a varistor. However, due to the long test cycle and high cost, there is the problem that the amount of data available is small, which may affect the prediction effect of the model. In order to further improve the accuracy and generalization ability of the network, this paper uses data enhancement to improve the sample quality. It should be considered that the experimental data are discrete and have time sequence regularity. Common methods, such as flipping, clipping and interpolation, would break the regularity. Finally, add-noise is selected for data enhancement.  
Gaussian white noise with SNR 50 is added to the original data to enhance the data in a ratio of 1:1. Some of the generated data is shown in Figure 8.  
* Data preprocessing  
In the degradation process of different varistors in the impact test, the variation curves of the nonlinear coefficients are bound to be different. In order to make the established life model have better generalization and migration, the nonlinear coefficients are normalized by 0-1 to be the life parameters A, i.e.  
\[\mathrm{\AA}=(\mathrm{A}-\mathrm{A}_{\mathrm{min}})/(\mathrm{A}_{\mathrm{max} }-\mathrm{A}_{\mathrm{min}}), \tag{10}\]  
where \(\mathrm{A}_{\mathrm{max}}\) is the maximum value in this set of data, namely, the nonlinear coefficient in full health state; \(\mathrm{A}_{\mathrm{min}}\) is the minimum value in this set of data, that is, the nonlinear coefficient after complete damage.  
Figure 7: Flow chart for the proposed life prediction.  
The data set \(\tilde{\text{A}}\) of sample length N is divided and reconstructed, and its continuous n data \(\tilde{\text{A}}_{i}\), \(\tilde{\text{A}}_{i+1}\), \(\ldots\), \(\tilde{\text{A}}_{i\text{n}-1}\) are taken as a sample, \(\tilde{\text{A}}_{i+n}\), to serve as the supervision label of the sample as shown in Figure 9, i.e.  
\[\text{x}_{i}=[\text{A}_{i},\text{A}_{i+1},\ldots,\text{A}_{i+n-1}]^{\text{T}}, \tag{11}\]  
\[\text{X}=[\text{x}_{1},\text{x}_{2},\ldots,\text{x}_{\text{N}-\text{n}}]^{\text {T}}, \tag{12}\]  
\[\text{Y}=[\text{y}_{1},\text{y}_{2},\ldots,\text{y}_{\text{N}-\text{n}}]^{\text {T}}=[\tilde{\text{A}}_{n+1},\tilde{\text{A}}_{n+2},\ldots,\tilde{\text{A}}_{ \text{N}}]^{\text{T}}, \tag{13}\]  
where X is the sample set and Y is the sample label set. X and Y constitute a data set, and each experiment generates a data set.  
* Network training and prediction The network includes several BiLSTM layers, a full connection layer and a regression layer. The overall structure is shown in Figure 10. The normalized and divided data set is taken as the input of the network. The output of the network is the value predicted by the lifetime model.  
Figure 8: The data are enhanced by adding white Gaussian noise.  
Figure 10: Structure of life prediction model.  
Figure 9: Divide and reconstruct Å.