## 2 Data Enhancement
### Bandpass Filter  
The dominant frequency distribution of the field data is shown in Figure 2. The dominant frequency of the effective signal is below 180 Hz. The purpose of the bandpass filter is to increase the number of training sets and prepare for upsampling. Figure 3 illustrates the waveform and spectrum of an example sample, whose label is 3, which has a time sampling interval of 0.2 ms and a length of 4000 sampling points.  
According to the spectrogram, the original waveform recording contains a lot of high-frequency noise. Bandpass filtering is used to improve the SNR and realize the purpose of increasing the number of training set samples. Figure 4 illustrates the waveform and spectrum after bandpass filtering. The comparison of Figures 3 and 4 illustrates that bandpass filtering does not change the label of the waveform.  
Figure 1: Schematic of three typical waveforms in the original training set.  
Figure 2: The dominant frequency distribution of original data set.  
used in this paper, the first class of data can be called the \"popular class\", and the other two types of data can be called the \"minority class\".  
The operation of making multiple copies of the minority class is called upsampling, and the operation of taking a partial sample from the popular class is called downsampling. Both sampling methods have their own shortcomings: some samples will appear repeatedly in the data after upsampling, and the trained model will have a certain over-fitting. Downsampling, on the other hand, loses some data, and the resulting model is only a part of the overall model. To avoid duplicate samples during upsampling, we can add some slight perturbations (random noise) to the newly generated samples to improve the balance of the data set without overfitting.  
The next step is to verify the effect of adding noise on the sample labels. The bandpass-filtered signal is regarded as the effective signal, and the residual between the original signal and the effective signal is regarded as the noise. The \(SNR\) of the sample can be calculated by using the following equation.  
\[SNR= 10 lg\frac{\sum\limits_{i=1}^{N}{S(i)}^{2}}{\sum\limits_{i=1}^{N}{N(i)}^{2}} \tag{2}\]  
As for the waveform example, the original \(SNR=\)11.35. Then, Gaussian noise of certain energy is added to the filtered effective signal (the final SNR should be different from the \(SNR\) of the original signal), where the SNR is set as \(SNR=\) 5, and then new sample data are obtained. The waveform and spectrum of the new sample are shown in Figure 5.  
The comparison of Figures 4 and 5 illustrates that adding Gaussian noise does not change the kind of waveform, and the method of increasing the number of samples by adding noise to the signal is correct.  
To balance the data set, in the upsampling process, the bandpass-filtered samples of class 2 and class 3 are upsampled and injected with Gaussian noise of different energy four times according to the original SNR. The SNR of the events in class 2 and class 3 after noise injection is 2 dB, 3 dB, 4 dB, and 6 dB lower than the original SNR, respectively.  
Figure 5: Signal waveform and spectrum of \(SNR=\) 5 after noise injection. (**a**) is the waveform, (**b**) is the spectrum.  
The number of training events at this time is as follows:  
\[\begin{array}{ll}N_{n2}&=N_{n1}+4\times(N_{2}+N_{3})\\ &=5988+4\times(361+314)\\ &=8688\end{array} \tag{3}\]  
The numbers of samples of various classes in the training set at this time are 4638, 2166, and 1884. After upsampling and adding noise, the data ratio of various types in the training set is close to 23:11:9, and the data balance has been greatly improved. The total number of samples in class 1 is still larger than the other two classes, therefore the balance still needs to be further improved.