Abstract Bearing is an important component in mechanical equipment. Its main function is to support the rotating mechanical body and reduce the friction coefficient and axial load. In the actual operating environment, the bearings are affected by complex working conditions and other factors. Therefore, it is very difficult to effectively obtain data that meets the conditions of independent and identical distribution of training data and test data, which result in unsatisfactory fault diagnosis results. As a transfer learning method, joint distribution adaptive (JDA) can effectively solve the learning problem of inconsistent distribution of training data and test data. In this paper, a new bearing fault diagnosis method based on JDA and deep belief network (DBN) with improved sparrow search algorithm (CWTSSA), namely JACADN is proposed. In the JACADN, the JDA is employed to carry out feature transfer between the source domain samples and target domain samples, that is, the source domain samples and target domain samples are mapped into the same feature space by the kernel function. Then the maximum mean difference is used as the metric to reduce the joint distribution difference between the samples in the two domains. Aiming at the parameter selection of the DBN, an improved sparrow search algorithm (CWTSSA) with global optimization ability is used to optimize the parameters of the DBN in order to construct an optimized DBN model. The obtained source domain samples and target domain samples are divided into training set and test set, which are input the optimized DBN to construct a bearing fault diagnosis model for improving the diagnosis accuracy. The effectiveness of the proposed method is verified by vibration data of QPZZ-II rotating machinery. The experimental results show that the proposed JACADN method can effectively improve the fault diagnosis accuracy of rolling bearings under variable operating conditions.