**1. Introduction**

Fault diagnosis of wind turbines plays an important role in equipment health management. Recently, deep learning (DL) has become a promising method in intelligent fault diagnosis. DL methods usually follow two principles: (1) the dataset should be large and well labeled and (2) the training and testing datasets are subject to the same distribution. However, in reality, wind turbines often face the problems of working condition variation, sample imbalance, and few fault samples, which brings challenges for deep learning to achieve wind turbine fault diagnosis. Compared with DL, transfer learning (TL) allows different probability distributions of samples between source and target domains. This means that a new but related task in the target domain can be effectively addressed by the learned knowledge from the source domain.

TL-based models have been employed for intelligent fault diagnosis under different working conditions. Li et al. proposed a novel weighted adversarial transfer network (WATN) for partial domain fault diagnosis [1]. Huang et al. proposed a deep adversarial capsule network (DACN) to embed multi-domain generalization into the intelligent compound fault diagnosis [2]. Li et al. proposed a two-stage transfer adversarial network (TSTAN) for multiple new faults detection of rotating machinery [3]. Chen et al. proposed a transferable convolutional neural network to improve the learning of target tasks [4].

**Citation:** Liu, X.; Ma, H.; Liu, Y. A Novel Transfer Learning Method Based on Conditional Variational Generative Adversarial Networks for Fault Diagnosis of Wind Turbine Gearboxes under Variable Working Conditions. *Sustainability* **2022**, *14*, 5441. https://doi.org/10.3390/ su14095441

Academic Editors: Luis Hernández-Callejo, Sergio Nesmachnow and Sara Gallardo Saavedra

Received: 26 March 2022 Accepted: 29 April 2022 Published: 30 April 2022

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

Li et al. proposed a method named deep adversarial transfer learning network (DATLN) for new emerging fault detection [5]. Li et al. proposed a data-driven fault feature separation method (DFSM) that can eliminate the working condition features from all the information and employ the rest of the fault information for diagnosis [6]. Qian et al. proposed a method called improved joint distribution adaptation (IJDA) to align both the marginal and conditional distributions of datasets more comprehensively [7]. Guo et al. proposed a deep convolutional transfer learning network (DCTLN), which consists of condition recognition and domain adaptation, for intelligent fault diagnosis of machines with unlabeled data [8]. Yang et al. proposed a feature-based transfer neural network (FTNN) to identify the health states of real-case machines with the help of the diagnosis knowledge from laboratory machines [9].

Domain adaptive (DA) technology plays an important role in transfer learning. Maximum mean discrepancy (MMD) is commonly used to measure the distribution discrepancy of the transferable features [10]. The MMD-based domain adaptive technology has been widely used to accomplish transfer learning tasks in the fields of computers [11,12]. The key to domain adaptation is to find a way to decrease the distribution divergence between different domains. Feature matching and instance reweighting are the main learning strategies for DA research. Zhang et al. applied the maximum variance discrepancy (MVD) for combining with the maximum mean discrepancy (MMD) for the feature matching [13]. Zhang et al. proposed a novel geodesic flow kernel-based domain adaptation approach for intelligent fault diagnosis under varying working conditions [14]. An et al. proposed a novel adaptive cross-domain feature extraction (ACFE) method that can automatically extract similar features between different feature spaces [15]. Qian et al. proposed a novel distribution discrepancy evaluating method called auto-balanced high-order Kullback–Leibler (AHKL) divergence for DA [16]. Based on polynomial kernel-induced MMD (PK-MMD), Yang et al. proposed a model that was constructed to reuse diagnosis knowledge from one machine to another [17].

However, an important problem in TL-based fault diagnosis methods is that target domain mechanical fault datasets are always highly imbalanced with abundant normal condition mechanical samples but a paucity of samples from rare fault conditions. The generative adversarial network (GAN) [18] uses the adversarial principle of generator and discriminator to enhance the diversity of data and provides the possibility to solve the above problems. Zheng et al. proposed a dual discriminator conditional generative adversarial network to enhance the accuracy of imbalance fault diagnosis [19]. Wang et al. implemented a Wasserstein generative adversarial network (WGAN) to generate simulated signals based on a labeled dataset [20]. There has been a proliferation of adversarial models presented by GAN, such as AnoGANs [21], GANormaly [22], etc. GAN has been developed in the field of fault diagnosis and anomaly detection [23–26]. Auto-encoder (AE) is another way of generating samples. AE has now developed numerous variants, e.g., variational AE (VAE) [27], adversarial AE (AAE) [28], etc.

The problem of missing data from wind turbines can be effectively solved by GAN and AE. Qu et al. proposed a data imputation method with multiple optimizations based on generative adversarial networks (GANs) for wind turbines [29]. Guo et al. proposed improved adversarial learning to generate fault features for the fault diagnosis of a wind turbine gearbox with unbalanced fault classes [30]. Jiang et al. proposed an improved oversampling algorithm to generate and develop a balanced dataset based on the imbalanced dataset of unfixed-length [31]. Jing et al. proposed an improved context encoder network (ICE) for missing wind speed data reconstruction [32]. In the literature [33], an improved auto-encoder (AE) network with a transfer layer was designed to eliminate the effect of SCADA data in the ambiguous status and enhance the reliability of a training dataset.

However, the samples generated by AE are often very fuzzy because there is no advanced discriminant network, and GAN has problems such as unstable training and mode collapse. Therefore, the two are combined to generate data to achieve better results, such as VAE-GAN [34], etc. Bao et al. proposed CVAE-GAN [35], which takes labels as

conditional inputs to the model to generate images of specified classification and produced relatively good images in all categories.

Gearboxes are important components for power transmission and speed regulation in mechanical equipment. In wind turbines, the downtime and power loss caused by the failure of gearbox components is the highest among all components. Wind turbine gearboxes operate under variable conditions for long periods of time. Due to the difficulty in obtaining operating data for different operating conditions, the diagnostic accuracy can be low when only data from a single operating condition is used to train the neural network for fault diagnosis. By generating data for unknown operating conditions through GAN and solving the problem of data imbalance, the fault diagnosis accuracy of wind turbine gearboxes can be effectively improved.

In this paper, we proposed a model named transfer learning based on conditional variational generative adversarial networks (TL-CVAE-GAN). An improved CVAE-GAN is used for transfer learning to achieve the generation of unknown samples for wind turbine transmission platforms in different conditions and solve the classification problem of variable conditions data. The known data are used to train CVAE-GAN1, and then the MMD between the known and unknown conditions is calculated. The MMD is added to the loss of CVAE-GAN2, which is an unknown generator, to achieve the generator's domain migration. The problem of data imbalance for wind turbine gearboxes is solved by generating missing data for unknown working conditions via CVAE-GAN2. The raw data and generated data are fed into the classifier to train the model for classification.

The rest of this paper is organized as follows. Section 2 introduces the basic concepts of DA and CVAE-GAN. In Section 3, a novel fault diagnosis model named transfer learning based on conditional variational generative adversarial networks (TL-CVAE-GAN) for a wind turbines testbench is proposed. In Section 4, the wind turbine testbench datasets are input into the proposed model for training and testing, and the results are analyzed. Section 5 presents the conclusion.