*2.3. Data Augmentation*

Augmentation methods should always be selected appropriately for the case under consideration [14]. For example, when applied to a time series containing outliers, the sliding window may not be able to capture the mutation features. Therefore, this research deals with every hour, that is, the full length of the sample.

Data enhancement includes two steps: data expansion of a small number of data samples and down-sampling of all samples.

Data expansion is applied to a small number of samples, namely outlier and drift, in the numerical simulation. Not all abnormal samples need to be expanded.

Outlier data can be defined as individual points of the normal data whose amplitude greatly exceeds the normal range. Therefore, a data expansion method that magnifies individual points is used for outlier samples. *x* is a normal sample {*<sup>x</sup>*1, *x*2, ... , *<sup>x</sup>N*}, and the proposed method is shown in Equation (2),

$$\mathbf{x}(p) = mean + \boldsymbol{\beta} \times range\tag{2}$$

where *p* is a random number between 10 and 60, *mean* is the mean value of *x*, *β* is a random number between −2 and 2, and *range* is the difference between the maximum and minimum values in *x*.

The method of symmetrical flipping and noise addition is used to expand the data of drift samples. The drift data has a random drift upwards or downwards. Therefore, the method of up-and-down symmetrical flipping can construct an effective sample. For the time series {*<sup>x</sup>*1, *x*2, ... , *<sup>x</sup>N*}, symmetrical flipping can generate a new time series {*x*1, *<sup>x</sup>*2,..., *<sup>x</sup>N*} with the same anomaly labels where *<sup>x</sup>*i= −*x*i. Different degrees of Gaussian white noise are added to the original sequence to generate more samples with the same anomaly labels. Two examples of data expansion are shown in Figure 3. The horizontal axis represents the number of sampling points, and the vertical axis represents the acceleration amplitude in m/s2.

The sample dimension of a single hour is 1 × 72,000, which is relatively large as the input of the neural network. Therefore, down-sampling is used to reduce the dimensionality of the sample while retaining the characteristics of the sample as much as possible to increase the efficiency of the neural network. The upper and lower contours of a sample are both useful features. Therefore, a down-sampling method that uses a sliding window to symmetrically extract the maxi-mum and minimum values is used. All 1 × 72,000 samples are down-sampled over the entire sample length. A step size is selected, which is 20 in this article, and the maximum and minimum values in the sequence are taken out for every sampling point of the step size. Therefore, after processing each of the 72,000 samples, a 2 × 3600 sample size will be obtained. The comparison chart of some examples before and after down-sampling is shown in Figure 4a,b. The horizontal axis represents the number of sampling points, and the vertical axis represents the acceleration amplitude in m/s2.
