Aiming at the shortcomings of the traditional bearing fault diagnosis technology field, a rolling bearing fault diagnosis method based on the generalized dataset is used to realize small sample transfer learning. Firstly, the generalized dataset is used as the source domain to train the Resent model, and Dropout and regularization mechanisms are added to improve the model learning ability; then the real rolling bearing fault data samples are classified and numbered, and the two-dimensional time-frequency maps of the fault vibration signals are obtained by the wavelet transform; Finally, mean squared error (MSE) and structural similarity (SSIM) were used to analyze the number of layers of frozen layers, and the real fault dataset is imported into the improved ResNet model as the training domain for transfer learning, so as to establish a rolling bearing fault diagnosis model based on the generalized dataset to realize the transfer learning of small samples. Validation is carrying out through the bearing fault dataset of Case Western Churches University (CWRU), and the results show that the accuracy of fault diagnosis of the proposed method reaches more than 95% after transfer learning. It is proved that the method can effectively improve the accuracy of bearing fault diagnosis and provide an effective diagnostic tool for realizing the self-diagnosis function of intelligent bearings. Different from other papers that use a single method to improve the network or migrate only to the same domain for small-sample problems, this paper uses parameters such as Dropout and L2 regularization and mean square error to improve the network, and conducts cross-domain experiments on the source domain in the transfer of small-sample problems, and the final training accuracy rate is significantly improved.