## 3 Proposed Method
### The Hybrid Networks
#### 3.2.3 Stage 3: Cross-Domain Diagnosis  
Feature extraction is crucial to fault diagnosis. Conventional feature extraction methods are not suitable for cross-domain diagnosis, while adversarial transfer networks can effectively extract domain-invariant features to solve cross-domain problems. Therefore, the adversarial transfer network is combined with the label generation module mentioned in Stage 2 to address the degradation of diagnosis performance due to distribution discrepancy.  
Figure 6 shows the architecture of the presented networks. Form the figure, the network is composed of a feature extractor \(G_{f}\), a label classifier \(G_{y}\) applied to identify source-domain labels, a global domain discriminator \(G_{d}\) applied to align marginal distributions of source and target domains, and \(C\) local subdomain discriminators \(G_{d}^{c}(c\in\{1,2,\cdots,C\})\) applied to align conditional distributions of source and target domains. In detail, labeled source domain data, target domain data, and pseudo-labeled data in Stage 2 are mixed as the input \(x\) of the network; then, the high-level features \(f\) are extracted by the feature extractor \(G_{f}\). Then, feature f is fed into \(G_{f}\) and the domain discriminators (including discriminator \(G_{d}\) and \(G_{d}^{c}\)) for adversarial training. Finally, optimal domain-invariant feature extraction is achieved by minimizing the loss \(L_{y}\) and maximizing \(L_{g}\) and \(L_{l}\), where \(L_{y}\) is the loss of \(G_{f}\), \(L_{g}\) is the loss of \(G_{d}\) and \(L_{l}\) is the loss of \(G_{d}^{c}\). We calculate the losses of \(L_{y}\), \(L_{g}\) and \(L_{l}\) as:  
\[L_{y}=-\frac{1}{n_{s}}\sum_{X_{i}\in D_{y}}\sum_{c=1}^{C}P_{X_{i}\to C}\log G_the dynamic adversarial factor \(\omega\) can dynamically and robustly evaluate the \(G_{d}\) and \(G_{d}^{c}\) weights according to the difference of data distribution in different diagnostic tasks. The \(\omega\) is defined as:  
\[\hat{\omega}=\frac{d_{\mathcal{A},g}(D_{s},D_{t})}{d_{\mathcal{A},g}(D_{s},D_{t })+\frac{1}{t}\sum_{c=1}^{c}d_{\mathcal{A},\mathcal{U}}(D_{s}^{c},D_{t}^{c})} \tag{17}\]  
where \(d_{\mathcal{A},g}(D_{s},D_{t})\) and \(d_{\mathcal{A},\mathcal{U}}(D_{s}^{c},D_{t}^{c})\) represent the \(\mathcal{A}\)-distance of global domain discriminator \(G_{d}\) and local domain discriminator \(G_{d}^{c}\), respectively.  
By integrating all components, the final objective function of transfer network can be expressed as:  
\[L\Big{(}\theta_{f},\theta_{y},\theta_{d},\theta_{d}^{c}|_{c=1}^{C}\Big{)}=L_{y }-\lambda\big{(}(1-\omega)L_{g}+\omega L_{t}\big{)} \tag{18}\]  
In summary, the network maps feature of source and target domain to the same space by confusing the domain labels. By adaptively measuring the distribution difference between the two domains, the target-domain data is labeled using domain-invariant features, which are indistinguishable between source and target domains. In addition, network domain adaptation and feature extraction are performed simultaneously, and label classification is supervised by source domain labels, target domain labels, and domain labels at the same time.