## 2 Materials and Methods
### Model-Building Steps  
Here, we elaborate on each module of the model in detail:  
1. Conversion of one-dimensional vibration signals into two-dimensional time-frequency diagrams. When a water pump malfunctions, for example, due to bearing corrosion or wear, its vibration signals are shaped by multiple factors including the pump itself and the surrounding aquatic environment. These signals are characterized by both nonlinearity and nonstationarity. Compared with previous analysis methods that independently analyze the time domain or the frequency domain, an analytical method that merges these two domains can extract critical features more effectively [22; 23]. The continuous wavelet transform (_CWT_) can perform local transformations in space and time, and can efficiently extract key information from signals [24; 25]. So, the _CWT_ was selected here to convert the water pump vibration data into time-frequency images, using Equation (2). \[CWT(a,b)=\frac{1}{\sqrt{a}}\int_{-\infty}^{+\infty}x(t)\varphi\left(\frac{t-b }{a}\right)dt\] (2) In the above formula for _CWT_, \(x(t)\) is the input data; \(a\) is the scale parameter; \(b\) is the translation parameter; and \(\varphi\) is the wavelet basis function. The _CWT_'s parameters were set as follows: sampling period = 1/12,000, total scale = 128, and wavelet basis function = 'cmor1-1'.
2. The time-frequency image data are inputted into the CNN. After passing through the convolutional activation layer, the maximum pooling layer, the convolutional activation layer, and the maximum pooling layer again [26; 27], the output data are finally used as the input for the next module in the model.
3. The output data of the previous module serve as input of this module. The transformer mainly consists of two parts: an encoder and a decoder, which may be used separately according to a given task's requirements. In this paper, only the encoder part was actually used. It contains a multi-head self-attention mechanism and a feed-forward neural network. Residual connections and layer normalization are used to process the output of each sub-layer to enhance model training and convergence [28]. Finally, the output result is designated as input for use in the next module.
4. The output data of the previous module act as input for the BiGRU module. The model is improved upon by changing the GRU into a two-directional one. The forward GRU processes the data from the start of a sequence to its end, fully capturing its forward information; conversely, the backward GRU processes the data from the end of the sequence to its start, thus capturing its reverse information. This BiGRU is a powerful sequence data processing model. Through its bidirectional structure and gating mechanism, it can effectively capture the context information of the sequence and overcome the problem of gradient disappearance [29; 30; 31].  
Finally, in classification problems, the fully connected layer is often used as the last layer of the neural network, and the number of its output nodes is usually equal to the number of classification categories. After completing the feature extraction and transformation of each previous layer, the fully connected layer calculates the score of each category according to the input features. Next, the Softmax function converts these scores into a probability distribution. By determining the magnitude of each probability value,the category with the maximum probability value is selected to determine the specific classification of the input sample.