## 3 Multi-Adversarial Joint Distribution Adaptation Network
### Training Process  
The MAJDAN objective function consists of three parts, which are the label predictor loss (Equation (5)); the MMD of the source and target domains (Equation (4)); and the local domain discriminator loss (Equation (2)). By combining (2), (4), and (5), the objective function can be expressed as follows:  
\[L_{\text{total}}\ \left(\theta_{f},\theta_{c},\theta_{d}\right)=L_{\text{cls}}\ -\mu((1-\lambda)L_{\text{d}}\ -\lambda L_{\text{MMD}}) \tag{6}\]  
where \(\mu\) and \(\lambda\) are the tradeoff parameters of the objective function. The training purpose of the model is to iteratively update the parameters \(\theta_{f},\theta_{d}\), and \(\theta_{c}\). In the MAJDAN, the diagnostic accuracy of the source domain samples is guaranteed by minimizing the supervised classification loss of the source domain. On this basis, the parameters \(\theta_{f}\) and \(\theta_{c}\) are optimized by using MMD to reduce the global distribution difference between the source domain and the target domain. Concurrently, the parameter \(\theta_{d}\) is adjusted by amplifying the domain classification loss of the domain discriminator via the Gradient Reversal Layer (GRL). This is performed to blur the distinction between the two domains, enabling the feature extractor to derive domain-invariant features. Algorithm 1 displays the MAJDAN training process. ```
Training procedure for the proposed MAJDAN algorithm
```  
1. Initialization Input : data \(D_{s}=\left\{\left(\chi_{i}^{s},y_{i}^{s}\right)\right\}_{i=1}^{n_{s}}\), \(D_{t}=\left\{\chi_{i}^{t}\right\}_{j=1}^{n_{t}}\), hyperparameter\(\lambda\) and \(\mu\), learning rate \(\varepsilon\), batch size \(b\), initialization parameters \(\theta_{f},\ \theta_{d},\ \theta_{c}\). 2. Training for each epoch do: for each batch size do: for\(i\) from \(1\) to \(b\)do: Forward propagation \(G_{f}(x_{i})\gets f\left(\theta_{f},x_{i}\right)\) \(G_{c}\left(G_{f}(x_{i})\right)\gets f\left(\theta_{f},G_{f}(x_{i})\right)\) \(G_{d}\left(G_{f}(x_{i})\right)\gets f\left(\theta_{d},G_{f}(x_{i})\right)\) Back propagation using Equations (2), (4) and (5) calculate label classifier loss \(L_{cls}\), MMD loss \(L_{MMD}\), local domain discriminator loss \(L_{d}\). Update \(\theta_{f},\ \theta_{d},\ \theta_{c}\) \(\theta_{f}\leftarrow\theta_{f}-\varepsilon\left(\frac{\partial L_{cls}}{ \partial\theta_{f}}-\mu((1-\lambda)\frac{\partial L_{cls}}{\partial\theta_{f}} -\lambda\frac{\partial L_{MMD}}{\partial\theta_{f}})\right)\) \(\theta_{c}\leftarrow\theta_{c}-\varepsilon\left(\frac{\partial L_{cls}}{ \partial\theta_{c}}+are collected by the NI data acquisition board; the accelerometer measures the vibration data; and the encoder measures the rotational speed data. In this experiment, the bearing vibration data are selected as the dataset. The dataset collects bearing vibration signals of different health states under different time-varying speed conditions. The sampling frequency is 200 kHz, and the sampling time of each vibration signal is 10 s. Based on different health statuses, the dataset is categorized into three groups, as presented in Table 2.  
This dataset also collects signals from four different variable speed conditions: increasing speed, decreasing speed, increasing then decreasing speed, and decreasing then increasing speed. Table 3 shows the labels of the four different working conditions in the experiment. In this experiment, transfer tasks were designed for the data of different working conditions, including 12 groups of single-working-condition transfer tasks: T0-T1, T0-T2, T0-T3, T1-T2, T1-T3, T2-T3, T1-T0, T2-T0, T3-T0, T2-T1, T3-T1 and T3-T2, and four groups of multiple-working-condition transfer tasks: T0-T1T2T3, T1-T0T2T3, T2-T0T1T3, and T3-T0T1T2. Before the test, the data need to be processed in order to obtain a more ideal fault diagnosis result. This paper uses a 1 DLCNN as a feature extractor, which can directly extract features from the original vibration signal. But the input data need to be normalized and cut first.