## 1 Introduction
The above methods explain the learning process of deep models in terms of statistical and dimensionality reduction visualization, achieving good diagnostic results. The proposal of attention mechanisms [29] opens up a whole new path for interpretable learning. The attention mechanism reinforces important information and suppresses secondary information, dynamically weighting the abstract features extracted by the convolution kernel. In this way, the potential relationships between system inputs and outputs can be further explored. The advent of Squeezed-Excitation Networks (SENet) [30] allows the model to adaptively select feature map channels, thereby reducing noise. [PERSON] et al. [31] proposed a new adaptive densely connected convolutional autoencoder (ADCAE) for feature extraction directly from one-dimensional vibration signals, which allows unsupervised learning. [PERSON] et al. [32] used attention-dense connected CNNs to accomplish similar work. [PERSON] et al. [33] introduced the kernel selection attention module and the residual attention module to design a multi-scale attention kernel residual network (AKRNet). [PERSON] et al. [34] proposed an improved multiscale convolutional neural network model (IMS-FACNN) incorporating a feature attention mechanism with a coarse granulation process in the model training phase. [PERSON] et al. [35] converted the raw signal into a 2-D grayscale map and completed the fault diagnosis of the bearing in combination with a multi-headed attention mechanism. [PERSON] et al. [36] proposed LEFE-Net, which combines a spatial attention mechanism to adjust the weights of the output feature maps with a light weight, efficiency and robustness. While the above methods apply attention modules in feature extraction and fault diagnosis, they lack a discussion of model interpretability. In the literature [37; 38], the model learning results are correlated with the inputs by visualizing the attention weights on the input data segments, but further dissection of the intermediate processes is still necessary. In addition to the above issues, the sampling frequencies selected will vary as different equipment fault characteristic frequencies are in different frequency bands. In order to include the complete fault cycle, cutting lengths often vary across different datasets. In summary, the current deep learning fault diagnosis methods lack a universal model with interpretability and generalization ability. In this study, a general framework for intelligent fault diagnosis with stacked residual multi-attentive networks (SRMANet) is proposed,with variable length raw signal fragments at the input. The main contributions of this paper can be summarized as follows:  
1. Two self-attention mechanisms, Squeeze-Attention and External-Attention, are proposed for extracting vibration signals. This work will also discuss the affinity of features in the temporal direction that can be obtained, as well as the subject of refining the features by fusing the two methods. 2. The adaptability of the model to the length of the data is preserved from noise using the convolution block. The feature extraction stage introduces a Squeeze-Excitation one-dimensional residual block (SE-Res block), which removes redundant features contained in the residual connections and captures the nonlinear interactions between channels. This is achieved through the multi-level linkage of attention, focusing on the relationship between feature maps with high fault correlation and channels. 3. Visualizing arbitrary layer attention weights on input signals using reverse gradients makes the model interpretable. According to the results, it is found that the attention mechanism can assign higher weights to the impulse components of the time-domain signal and lower weights to the fault-independent feature components. 4. Laboratory planetary gearbox compound faults and single faults of different levels are effectively identified. SRMANet has also been shown in adaptive experiments to be more robust when the load/speed changes.