# A Collaborative Domain Adversarial Network for Unlabeled Bearing Fault Diagnosis
## 3 Collaborative Domain Adversarial Network
### Forward Propagation of Network Models  
Firstly, define the input of the network model, and define the source domain and target domain samples as follows:  
\[\Psi_{S\_train}=\left\{\left(x_{S}^{i},y_{S}^{i}\right)_{i=1}^{i=n_{S}}\right\} \tag{3}\]  
\[\Psi_{T\_train}=\left\{\left(x_{T}^{j}\right)_{j=1}^{j=n_{T}}\right\} \tag{4}\]  
\[\Psi_{T\_test}=\left\{\left(x_{test}^{j},y_{test}^{i}\right)_{j=1}^{j=m}\right\} \tag{5}\]  
where \(\Psi_{S\_train}\), \(\Psi_{T\_train}\), and \(\Psi_{T\_test}\), respectively, represent the sets of source domain samples, the artificial fault samples in the laboratory used for training, and the real fault samples used for testing. The samples in \(\Psi_{T\_train}\) and \(\Psi_{T\_test}\) are distinct. \(x_{S}^{i}\) and \(x_{T}^{j}\) denote artificial fault samples in the laboratory (source domain) and the real fault samples (target domain), respectively. \(n_{S}\), \(n_{T}\), and \(m\) represent the numbers of source domain samples, target domain training samples, and target domain testing samples. The forward propagation process of the DA network is illustrated in Figure 2, and the network parameters are defined as shown in Table 2.  
The feature extractor operation in the network model is represented by \(G_{S}\) (\(m\) = 1, 2, 3), the domain discriminator is represented by \(D\), the state classifier is represented by \(D\), and \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Network Module** & **Network Structure** & **Network Parameters** & **Activation Function** \\ \hline \multirow{8}{*}{Feature extractors GS} & Conv-layer & \(64\times 1\times 2/3\) & ReLU \\  & Conv-layer & \(16\times 1\times 4/3\) & ReLU \\  & Max-pool & \(2\times 1/2\) & Non \\  & Conv-layer & \(7\times 1\times 8/1\) & ReLU \\  & Conv-layer & \(5\times 1\times 16/1\) & ReLU \\  & Max-pool & \(2\times 1/2\) & Non \\  & Conv-layer & \(3\times 1\times 32/1\) & ReLU \\  & BN & \(3\times 1\times 64/3\) & ReLU \\ \hline \multirow{3}{*}{Domain discriminator D} & Flatten layer & Non & Non \\  & FC & \(1964\times 64\) & ReLU \\  & FC & \(64\times 16\) & ReLU \\  & FC & \(16\times 2\) & Softmax \\ \hline \multirow{4}{*}{Classifier C} & FC & \(1964\times 64\) & ReLU \\  & Dropout layer & \(0.5\) & Non \\ \cline{1-1}  & FC & \(64\times 16\) & ReLU \\ \cline{1-1}  & Dropout layer & \(0.5\) & Non \\ \cline{1-1}  & FC & \(16\times k\) & Softmax \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Model parameters of deep domain adversarial transfer network. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Network Module** & **Symbol** & **Initialization** & **Optimal Parameters** \\ \hline \multirow{2}{*}{Feature extractor} & \(G_{S}\) & \(\theta_{G}^{S}\) & \(\theta_{G}^{S}\) \\  & \(G_{T}\) & \(\theta_{G}^{T}\) & \(\theta_{G}^{T}\) \\ \hline Domain discriminator & \(D\) & \(\theta_{D}\) & \(\theta_{D}\) \\ \hline Classifier & \(C\) & \(\theta_{C}\) & \(\theta_{C}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Network module parameter definition. the flattening operation is represented by Flatten. The feature expressions of the \(f_{S}\) and \(f_{T}\) sets can be obtained as follows:  
\[\left\{ \begin{array}{l}f_{S}^{i}=flatten\left(G_{S}(x_{i}^{S},\theta_{G}^{S}) \right)\\ f_{T}^{j}=flatten\left(G_{T}\left(x_{j}^{T},\theta_{G}^{T}\right)\right)\\ \end{array} \right.,\;\;s.t.\left\{ \begin{array}{l}x_{i}^{S}\subset\mathbb{D }_{S},f_{S}^{i}\subset f_{S}\\ x_{j}^{T}\subset\mathbb{D}_{T},f_{S}^{i}\subset f_{T}\\ \end{array} \right. \tag{6}\]  
The obtained mapping features are input into the domain discriminator for sample source identification. The role of the domain discriminator is to distinguish the source of the samples as much as possible, that is, to identify the differences in features between the source domain samples and the target domain samples to the greatest extent possible, and then use them to train the feature extractor.