A Safe-Domain Generative Adversarial Network with Swin Transformer for Noisy Imbalanced Fault Diagnosis
Abstract
1. Introduction
2. Preliminaries
2.1. Noisy Imbalanced Fault Diagnosis
2.2. Wasserstein GAN with Gradient Penalty
2.3. Swin Transformer
3. The Proposed Diagnosis Method
3.1. Framework
3.2. Safe-Domain GAN
- Construct a set D containing all labeled samples.
- For each sample p in D, compute its K nearest neighbors, where the K is a predefined constant.
- If there is at least one neighbor with a different label from p, p is considered an unsafe sample. Otherwise, randomly select a sample, denoted as q, from the K neighbors of p. In this case, p is regarded as a candidate reliable sample, and the neighborhood of q is further examined to distinguish safe and semi-safe samples.
- Compute the K nearest neighbors of sample q.
- If there is at least one neighbor with a different label from q, the local neighborhood around (p) is not fully reliable, and, thus, p is defined as a semi-safe sample. Otherwise, p is defined as safe.
- After processing all samples in D, the safe level is attached to each sample.
- For each class C, calculate the proportions of safe, semi-safe, and unsafe samples among the total samples.
- If the combined proportion of unsafe and semi-safe samples exceeds 50%, the safe domain for that class includes both safe and semi-safe samples. Otherwise, the safe domain consists only of safe samples.
3.3. Swin-Transformer-Based Classifier
4. Case Study
4.1. Case I: Experiments on CWRU Dataset
4.2. Case II: Evaluation on Real-World OCB Dataset
4.3. The Anti-Noise Performance of SDGAN
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Liu, Q.; Liu, M.; Zhou, H.; Yan, F.; Ma, Y.; Shen, W. Intelligent manufacturing system with human-cyber-physical fusion and collaboration for Process Fine Control. J. Manuf. Syst. 2022, 64, 149–169. [Google Scholar] [CrossRef]
- Wang, H.; Liu, M.; Shen, W. Industrial-generative pre-trained transformer for intelligent manufacturing systems. IET Collab. Intell. Manuf. 2023, 5, e12078. [Google Scholar] [CrossRef]
- Chen, Z.; Mauricio, A.; Li, W.; Gryllias, K. A deep learning method for bearing fault diagnosis based on cyclic spectral coherence and convolutional neural networks. Mech. Syst. Signal Process. 2020, 140, 106683. [Google Scholar] [CrossRef]
- Gonzalez-Jimenez, D.; del-Olmo, J.; Poza, J.; Garramiola, F.; Madina, P. Data-driven fault diagnosis for electric drives: A Review. Sensors 2021, 21, 4024. [Google Scholar] [CrossRef]
- Yang, Z.; Ge, Z. On paradigm of industrial big data analytics: From evolution to revolution. IEEE Trans. Ind. Inform. 2022, 18, 8373–8388. [Google Scholar] [CrossRef]
- Zhu, Z.; Lei, Y.; Qi, G.; Chai, Y.; Mazur, N.; An, Y.; Huang, X. A review of the application of deep learning in intelligent fault diagnosis of rotating machinery. Measurement 2022, 206, 112346. [Google Scholar] [CrossRef]
- Niu, G.; Liu, E.; Wang, X.; Ziehl, P.; Zhang, B. Enhanced discriminate feature learning deep residual CNN for multitask bearing fault diagnosis with information fusion. IEEE Trans. Ind. Inform. 2023, 19, 762–770. [Google Scholar] [CrossRef]
- Han, T.; Ma, R.; Zheng, J. Combination bidirectional long short-term memory and capsule network for rotating machinery fault diagnosis. Measurement 2021, 176, 109208. [Google Scholar] [CrossRef]
- Tang, X.; Xu, Z.; Wang, Z. A novel fault diagnosis method of rolling bearing based on Integrated Vision Transformer model. Sensors 2022, 22, 3878. [Google Scholar] [CrossRef]
- Zhang, X.; Wang, H.; Wang, C.; Xu, G.; Liu, M.; Liu, C. MoMD Transformer: Adaptive Multi-Modal Fault Diagnosis via Knowledge Transfer with Vibration-Current Signals. Inf. Fusion 2026, 130, 104079. [Google Scholar] [CrossRef]
- Zhang, X.; Wang, H.; Wang, C.; Liu, M.; Xu, G. Time-Segment-Wise Feature Fusion Transformer for Multi-Modal Fault Diagnosis. Eng. Appl. Artif. Intell. 2024, 138, 109358. [Google Scholar] [CrossRef]
- Quan, R.; Liang, W.; Wang, J.; Li, X.; Chang, Y. An enhanced fault diagnosis method for fuel cell system using a kernel extreme learning machine optimized with improved sparrow search algorithm. Int. J. Hydrogen Energy 2024, 50, 1184–1196. [Google Scholar] [CrossRef]
- Martin-Diaz, I.; Morinigo-Sotelo, D.; Duque-Perez, O.; de J. Romero-Troncoso, R. Early fault detection in induction motors using AdaBoost with imbalanced small data and optimized sampling. IEEE Trans. Ind. Appl. 2017, 53, 3066–3075. [Google Scholar] [CrossRef]
- Bunkhumpornpat, C.; Sinapiromsaran, K.; Lursinsap, C. Safe-level-smote: Safe-level-synthetic minority over-sampling technique for handling the class imbalanced problem. In Advances in Knowledge Discovery and Data Mining; Springer: Berlin/Heidelberg, Germany, 2009; pp. 475–482. [Google Scholar]
- Zhang, T.; Chen, J.; Li, F.; Zhang, K.; Lv, H.; He, S.; Xu, E. Intelligent fault diagnosis of machines with small & imbalanced data: A state-of-the-art review and possible extensions. ISA Trans. 2022, 119, 152–171. [Google Scholar]
- Zhou, F.; Yang, S.; Fujita, H.; Chen, D.; Wen, C. Deep learning fault diagnosis method based on global optimization gan for unbalanced data. Knowl.-Based Syst. 2020, 187, 104837. [Google Scholar] [CrossRef]
- Wang, R.; Zhang, S.; Chen, Z.; Li, W. Enhanced generative adversarial network for extremely imbalanced fault diagnosis of rotating machine. Measurement 2021, 180, 109467. [Google Scholar] [CrossRef]
- Liu, S.; Jiang, H.; Wu, Z.; Li, X. Data synthesis using deep feature enhanced generative adversarial networks for rolling bearing imbalanced fault diagnosis. Mech. Syst. Signal Process. 2022, 163, 108139. [Google Scholar] [CrossRef]
- Luo, J.; Zhu, L.; Li, Q.; Liu, D.; Chen, M. Imbalanced fault diagnosis of rotating machinery based on deep generative adversarial networks with gradient penalty. Processes 2021, 9, 1751. [Google Scholar] [CrossRef]
- Wang, C.; Wang, H.; Liu, M. A dual-attention feature fusion network for imbalanced fault diagnosis with two-stream hybrid generated data. J. Intell. Manuf. 2023, 35, 1707–1719. [Google Scholar] [CrossRef]
- Pu, X.; Li, C. Meta-self-training based on teacher–student network for industrial label-noise fault diagnosis. IEEE Trans. Instrum. Meas. 2022, 72, 3501911. [Google Scholar] [CrossRef]
- Zhang, X.; Wang, H.; Wang, C.; Liu, Q.; Liu, M. A safe-domain generative adversarial network with transformer for noisy imbalanced fault diagnosis. In Proceedings of the 2023 26th International Conference on Computer Supported Cooperative Work in Design (CSCWD), Rio de Janeiro, Brazil, 24–26 May 2023; pp. 363–368. [Google Scholar]
- Arjovsky, M.; Chintala, S.; Bottou, L. Wasserstein generative adversarial networks. In Proceedings of the International Conference on Machine Learning, Sydney, Australia, 6–11 August 2017; pp. 214–223. [Google Scholar]
- Gulrajani, I.; Ahmed, F.; Arjovsky, M.; Dumoulin, V.; Courville, A.C. Improved training of wasserstein GANs. In Proceedings of the Advances in Neural Information Processing Systems 30, Long Beach, CA, USA, 4–9 December 2017. [Google Scholar]
- Liu, Z.; Lin, Y.; Cao, Y.; Hu, H.; Wei, Y.; Zhang, Z.; Lin, S.; Guo, B. Swin transformer: Hierarchical vision transformer using shifted windows. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Montreal, BC, Canada, 11–17 October 2021; pp. 10012–10022. [Google Scholar]
- Dosovitskiy, A.; Beyer, L.; Kolesnikov, A.; Weissenborn, D.; Zhai, X.; Unterthiner, T.; Dehghani, M.; Minderer, M.; Heigold, G.; Gelly, S.; et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv 2020, arXiv:2010.11929. [Google Scholar]
- Lessmeier, C.; Kimotho, J.K.; Zimmer, D.; Sextro, W. Condition monitoring of bearing damage in electromechanical drive systems by using motor current signals of electric motors: A benchmark data set for data-driven classification. In Proceedings of the PHM Society European Conference, Bilbao, Spain, 5–8 July 2016. [Google Scholar]









| Layer Name | Output Shape | Attention Head Number | |
|---|---|---|---|
| Patch Partition Module | (32,32,16) | - | |
| Stage 1 | Linear Embedding | (32,32,16) | - |
| 2 blocks | (32,32,16) | 3 | |
| Stage 2 | Patch Merging | (16,16,32) | |
| 2 blocks | (16,16,32) | 6 | |
| Stage 3 | Patch Merging | (8,8,64) | - |
| 2 blocks | (8,8,64) | 12 | |
| Stage 4 | Patch Merging | (4,4,128) | - |
| 2 blocks | (4,4,128) | 24 | |
| MeanPooling | (1,128) | - | |
| MLP Classification Head | (1,10) | - | |
| Dataset | Fault Diameter (mm) | Image Size | Training Set | Valid Set | Test Set | Label | |
|---|---|---|---|---|---|---|---|
| Majority | Normal | 128 × 128 | 300 | 20 | 80 | 0 | |
| Minority (1:10/1:20/1:30) | Inner Race | 0.007 | 128 × 128 | 30(6 a)/15(3)/10(2) | 20 | 80 | 1 |
| 0.014 | 128 × 128 | 30(6)/15(3)/10(2) | 20 | 80 | 2 | ||
| 0.021 | 128 × 128 | 30(6)/15(3)/10(2) | 20 | 80 | 3 | ||
| Ball | 0.007 | 128 × 128 | 30(6)/15(3)/10(2) | 20 | 80 | 4 | |
| 0.014 | 128 × 128 | 30(6)/15(3)/10(2) | 20 | 80 | 5 | ||
| 0.021 | 128 × 128 | 30(6)/15(3)/10(2) | 20 | 80 | 6 | ||
| Outer Race | 0.007 | 128 × 128 | 30(6)/15(3)/10(2) | 20 | 80 | 7 | |
| 0.014 | 128 × 128 | 30(6)/15(3)/10(2) | 20 | 80 | 8 | ||
| 0.021 | 128 × 128 | 30(6)/15(3)/10(2) | 20 | 80 | 9 | ||
| Generation Model | Classifier | Imbalance Ratio | ||
|---|---|---|---|---|
| 1:10 | 1:20 | 1:30 | ||
| SDGAN | Swin Transformer | 98.88 b | 97.63 | 97.50 |
| ViT | 98.38 | 97.00 | 96.50 | |
| CNN | 97.75 | 96.25 | 96.25 | |
| WGAN-GP | Swin Transformer | 94.13 | 92.00 | 88.00 |
| ViT | 85.13 | 82.63 | 81.50 | |
| CNN | 93.63 | 84.88 | 84.25 | |
| -- | Swin Transformer | 84.75 | 71.25 | 69.38 |
| ViT | 70.00 | 58.50 | 51.25 | |
| CNN | 81.38 | 66.13 | 60.50 | |
| Dataset | Image Size | Training Set | Test Set | Label | |
|---|---|---|---|---|---|
| Majority | Normal | 128 × 128 | 300 | 400 | 0 |
| Minority (1:10/1:20/1:30) | Inner Race | 128 × 128 | 30(6)/15(3)/10(2) | 400 | 1 |
| Outer Race | 128 × 128 | 30(6)/15(3)/10(2)3 | 400 | 2 | |
| Generation Model | Classifier | Imbalance Ratio | ||
|---|---|---|---|---|
| 1:10 | 1:20 | 1:30 | ||
| SDGAN | Swin Transformer | 100.00 | 100.00 | 100.00 |
| ViT | 99.75 | 99.50 | 99.50 | |
| CNN | 99.08 | 98.92 | 98.92 | |
| WGAN-GP | Swin Transformer | 99.92 | 99.83 | 99.92 |
| ViT | 95.67 | 89.83 | 89.83 | |
| CNN | 98.25 | 97.75 | 98.33 | |
| -- | Swin Transformer | 66.67 | 66.67 | 33.33 |
| ViT | 33.33 | 33.33 | 33.33 | |
| CNN | 33.33 | 33.33 | 33.33 | |
| Method | SDGAN-ST | WGAN-GP-ST | |
|---|---|---|---|
| CWRU | 20% | 98.88 | 94.13 |
| 30% | 97.75 | 90.38 | |
| 40% | 97.75 | 88.38 | |
| OCB | 20% | 100 | 99.92 |
| 30% | 100 | 99.83 | |
| 40% | 100 | 99.75 | |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 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.
Share and Cite
Lai, X.; Zhang, X.; Xie, Z.; Liu, M. A Safe-Domain Generative Adversarial Network with Swin Transformer for Noisy Imbalanced Fault Diagnosis. Sensors 2026, 26, 3754. https://doi.org/10.3390/s26123754
Lai X, Zhang X, Xie Z, Liu M. A Safe-Domain Generative Adversarial Network with Swin Transformer for Noisy Imbalanced Fault Diagnosis. Sensors. 2026; 26(12):3754. https://doi.org/10.3390/s26123754
Chicago/Turabian StyleLai, Xiao, Xiaohan Zhang, Zhiqi Xie, and Min Liu. 2026. "A Safe-Domain Generative Adversarial Network with Swin Transformer for Noisy Imbalanced Fault Diagnosis" Sensors 26, no. 12: 3754. https://doi.org/10.3390/s26123754
APA StyleLai, X., Zhang, X., Xie, Z., & Liu, M. (2026). A Safe-Domain Generative Adversarial Network with Swin Transformer for Noisy Imbalanced Fault Diagnosis. Sensors, 26(12), 3754. https://doi.org/10.3390/s26123754

