The issue of cross-device fault diagnosis is a focal point in bearing fault diagnosis. Nevertheless, due to the imbalance in bearing fault data, conventional fault diagnosis methods have certain limitations in practical applications. To overcome this problem, this paper proposes a bearing fault diagnosis method based on Synthetic Minority Over-sampling Technique for Nominal and Continuous (SMOTENC) and deep transfer learning. Firstly, the SMOTENC algorithm is employed to oversample the imbalanced bearing vibration signals, thereby obtaining a balanced dataset. Secondly, a six-layer deep transfer neural network model is constructed, and a novel conditional distribution metric loss function is utilized to minimize the distance between the source and target domains. Lastly, the proposed method is applied to 12 cross-device bearing fault diagnosis tasks under an imbalanced dataset, and validated using three performance metrics. The research findings demonstrate that the bearing fault diagnosis method based on SMOTENC and deep transfer learning exhibits significant advantages in handling imbalanced data, offering an effective solution for research in the field of bearing fault diagnosis.