## 1 Introduction  
Rolling bearings are susceptible to alternating loads, machining errors, and the impact of long-time operation, making them one of the parts prone to failure. The timely diagnosis of bearing failures is of great significance for the safety and work efficiency of equipment and personnel [1; 2; 3]. Deep-learning-based fault diagnosis models can learn deep fault characteristics from rolling bearings' vibration signals and achieve high fault-diagnosis accuracy [4; 5; 6]. Convolutional neural networks (CNNs) [7] are representative of deep learning. [PERSON] et al. [8] used a CNN to identify bearing faults, which had a higher accuracy than traditional machine learning methods but was relatively limited in terms of global correlations and proved difficult to capture the relationship between distant pixels. However, transformer-based models [9; 10] can learn the global feature representations in images, which compensates for the deficiency of a CNN in ultra-long period modeling. [PERSON] et al. [11] proposed an improved transformer model with multiple self-attention mechanisms, which could better diagnose multiple faults in extreme class-imbalanced fault data. [PERSON] et al. [12] proposed a signal transformer network based on a pure attention mechanism and demonstrated its effectiveness in feature extraction and fault identification in two sets of experiments. Although deep-learning-based fault diagnosis models have powerful feature-extraction capabilities, they highly rely on large-scale training samples [13; 14; 15]. In practical work environments, machines run normally most of the time, and there are fewer samples in a faulty state. Moreover, the cost of labeling fault samples is very expensive, resulting in a scarcity of labeled fault samples [16]. In this case, of an unbalanced ratio of normal and fault samples and insufficient labeled samples, deep-learning-based fault diagnosis models are prone to overfitting and lack good generalization ability and robustness, thus affecting the accuracy of a diagnosis [17]. Due to the fact that a transformer has almost no assumptions about the structural bias of the input data, it is difficult to apply one to small-scale labeled datasets [18]. Therefore, a transformer is usually combined with other methods to introduce a structural bias and solve the problem of insufficient labeled samples. [PERSON] et al. [19] proposed a method to combine a time-series tokenizer and a transformer to achieve fault diagnoses. [PERSON] et al. [20] proposed an automatic embedded transformer for fault diagnoses with few-shot data. [PERSON] et al. [21] used convolutional layers to capture low-level local structural features, and transformers were used to segment patch sequences and model global dependencies for fault identification. Currently, how to use small-scale labeled datasets to train deep-learning models and achieve high-quality identification remains a challenge in fault-recognition research. To address the problem of an imbalanced proportion of fault-free and fault samples, some researchers have combined generative adversarial networks (GANs) [22] and derivative models [23; 24; 25; 26] to generate samples containing fault information to ensure the accuracy of deep-learning diagnostic models. To address the problem of a sample imbalance, [PERSON] et al. [27] proposed a semi-supervised GAN framework, which utilized time-frequency images to diagnose single and compound faults in gears. [PERSON] et al. [28] proposed an imbalance fault diagnosis method based on an improved multi-scale residual generative adversarial network and a feature-enhancement-driven capsule network, achieving enhanced performance in imbalanced-fault classification. [PERSON] et al. [29] combined model-agnostic meta-learning (MAML) with a conditional auxiliary classifier GAN (CACGAN) to initialize and update network parameters using MAML and then used conditional markers and auxiliary classifiers to generate samples.