Motor-bearing fault diagnosis is critical for industrial equipment reliability, yet traditional data-driven methods require extensive labeled data, which are often scarce in real-world applications. To address this challenge, we propose a Transformer transfer learning network (TTLN) for accurate fault diagnosis under cross-condition scenarios, particularly when target domain data are limited. First, we develop a Transformer-based fault diagnosis model that captures long-range dependencies in sequential data through self-attention, achieving high accuracy under single operating conditions. Second, we introduce the TTLN framework, which integrates domain adaptation to align marginal and conditional distributions, enabling robust cross-condition fault diagnosis with minimal target domain samples. Finally, we validated the proposed method on the CWRU and PU datasets, demonstrating the TTLN’s superior performance in data-scarce scenarios. For example, the TTLN achieved over 95% accuracy with only 100 target samples, outperforming traditional methods and fine-tuning-based approaches. The results underscore the TTLN’s effectiveness in cross-condition fault diagnosis, offering a practical solution for industrial applications with limited labeled data.
Cross-session variability in neural signal statistics often leads to distribution shifts that substantially degrade the generalization performance of motor decoding models. To address this challenge, this study proposes a CNN-enhanced Transformer with distribution alignment (CNN-Trans-DA), which integrates local temporal feature extraction with global sequence modeling and a lightweight domain adaptation strategy. A one-dimensional convolutional module is introduced prior to the Transformer encoder to capture local firing patterns, while multi-head attention is used to learn long-range temporal dependencies. For cross-session adaptation, we design a joint distribution alignment method that simultaneously minimizes marginal and conditional distribution discrepancies through maximum mean discrepancy (MMD) and correlation alignment (CORAL). Using four-direction monkey fingertip movement data, the proposed CNN-Trans-DA model achieves an accuracy of 84.64 percent under single-session decoding, outperforming the standard Transformer (81.22%), CNN (80.78%), and BiLSTM (79.29%). In cross-session transfer experiments, the model maintains an 82.42 percent decoding accuracy, showing clear improvements over models without distribution alignment. These results demonstrate that the proposed approach can effectively handle session-induced distribution drift and achieve robust motor intention decoding, providing a scalable and generalizable solution for cross-session brain–machine interface applications.