## 3 Proposed Method
### The Hybrid Networks
#### 3.2.2 Stage 2: Label Generation  
In traditional fault diagnosis method, the accuracy of diagnosis model is determined by the quantity of data labels. Cross-domain diagnostic tasks cannot be performed if there are sufficient signals but not enough labels [52]. Specifically, SSL can provide an effective approach to reducing the dependence on labeled data by using unlabeled data [53]. Figure 4: Diagram of the GAF conversion process. Therefore, this paper introduces an SSL-based generative label extension network, which utilizes unlabeled images to predict and generate artificial labels. The generated labels can be used for subsequent transfer learning to improve the accuracy of diagnosis models. First, we define \(\mathcal{X}=\{(x_{b},\mathbf{p}_{b}):b\in(1,2,\cdots,B)\}\) as a batch of \(B\)-labeled samples for an \(L\)-class classification problem, where \(x_{b}\) are the training examples and \(\mathbf{p}_{b}\) denotes one-hot labels. Then, let \(\mathcal{U}=\{u_{b}:b\in(1,2,\cdots,\mu B)\}\) be a batch of \(\mu B\) unlabeled examples where \(\mu\) is a hyperparameter used to dictate the relevant sizes of \(\mathcal{X}\) and \(\mathcal{U}\). \(\mathbf{p}_{m}(y|x)\) is the prediction category distribution generated by the input \(\mathcal{X}\). Additionally, we define \(H(\mathbf{p},\mathbf{q})\) as the cross-entropy between two probability distributions \(\mathbf{p}\) and \(\mathbf{q}\). Finally, two types of augmentations are leveraged in the proposed method: strong and weak, denoted by \(\mathcal{A}(\cdot)\) and \(\alpha(\cdot)\), respectively. In this work, weak augmentation makes use of standard flip-and-shift strategy, while strong augmentation first uses RandAugment [54] or CTAugment [55], then uses CutOut [56] to enhance images; severely distorted input images are output in the end. The training process consists of two parts as depicted in Figure 5: supervised training and unsupervised training. Labeled data perform supervised training, and conventional classification tasks are carried out to reduce the supervised loss. For unlabeled data, use their weakly-augmented versions to train the model to output predictions. When the probability for a class is higher than the threshold, the prediction of that class is considered a pseudo-label. Next, this pseudo-label is used to supervise the output of a strongly-augmented version of the same image. The detailed training process is as follows:  
Step 1. Input:  
Prepare the labeled batch \(\mathcal{X}=\{(x_{b},\mathbf{p}_{b}):b\in(1,2,\cdots,B)\}\), the unlabeled batch \(\mathcal{U}=\{u_{b}:b\in(1,2,\cdots,\mu B)\}\), and unlabeled data ratio \(\mu\). Step 2. Supervised training:  
Use the conventional cross-entropy loss \(H(\mathbf{p},\mathbf{q})\) for classification task of labeled data, and the supervised loss \(\ell_{s}\) with labeled data being defined as  
\[\ell_{s}=\frac{1}{B}\sum_{k=1}^{B}\mathrm{H}(\mathbf{p}_{b},\mathbf{p}_{m}(y|\alpha(x_ {b}))) \tag{11}\]  
Figure 5: The flowchart of label generative module. where \(\alpha\) denotes a random function. Step 3. Pseudo-labeling:  
Apply weak and strong augmentation to unlabeled data to, respectively, obtain augmented data. Then feed them into the model to acquire predictions and select the weakly augmented prediction to generate pseudo-label using argmax. Step 4. Consistency regularization:  
Compute the cross-entropy loss \(H(\mathbf{p},\mathbf{q})\) between strongly augmented predicted value and weakly augmented pseudo-label value; the unsupervised loss \(\ell_{u}\) of unlabeled data is defined as  
\[\ell_{u}=\frac{1}{\mu B}\sum_{b=1}^{\mu B}\mathbb{Z}(\text{max}(\mathbf{q}_{b}) \geq\tau)\text{H}(\mathbf{\hat{q}}_{b},\mathbf{p}_{m}(y|\mathcal{A}(u_{b}))) \tag{12}\]  
where \(\mathbf{q}_{b}=\mathbf{p}_{m}(y|\mathbf{\alpha}(u_{b}))\), \(\mathbf{\hat{q}}_{b}=\text{argmax}(\mathbf{q}_{b})\) denotes pseudo-label, \(\tau\) is a scalar hyperparameter denoting the threshold for pseudo-label, and \(\mathbb{Z}(\cdot)\) represents the indicator function. Step 5.