Solving the small sample problem can not only save data acquisition costs, but also enhance the model's generalization ability to unknown data, thereby ensuring the accuracy and reliability of fault diagnosis results. Therefore, this paper proposes a small-sample bearing fault diagnosis method that combines the ECA attention mechanism and the DenseNet network (ECA-DenseNet). First, the two-dimensional DenseNet network and ECA attention mechanism are converted into one-dimensional networks to reduce computational complexity and information loss. Secondly, the size and position of the convolutional layer in the network are improved and adjusted, and the 1D-ECA module is introduced into the DenseNet model. Finally, we use the original signal as the input of ECA-DenseNet. After feature recognition, the network classifier completes fault feature classification. We verified the effect of the proposed model under different working conditions on the laboratory PT500 bearing data set, and compared it with other diagnostic models. Experimental results show that the proposed method has high fault identification accuracy and generalization ability under small sample conditions.