# Research on Fault Diagnosis Method for Rotating Machinery Based on Edge Computing
## 4 Fault Diagnosis Method Based on Edge Computing
### Data Augmentation  
Modern equipment is typically subjected to rigorous design and testing, resulting in high reliability and, consequently, a low frequency of faults. This implies that, during normal operation, the amount of fault data collected are significantly less than the data gathered under regular operating conditions. To address this issue, one solution is to apply data augmentation to the collected fault data. Since the collected data are time-series data, this study employs a sliding window method to enhance both the temperature data and vibration data separately. The formula for this process is as follows:  
\[\mathrm{SW_{i}}=\frac{1}{\mathrm{n}}\sum_{j=0}^{n-1}\mathrm{x_{i+j}} \tag{11}\]  
where \(\mathrm{SW_{i}}\) represents the sliding window result at the i-th position; n denotes the size of the window (i.e., the number of elements it contains); and \(\mathrm{x_{i+j}}\) represents the i+j-th element in the data sequence. Different strides and multiple iterations in the sliding window can generate a large amount of data for training the model. As shown in Figure 3, during the data generation process using a sliding window, the stride and window size are two important parameters. Their ratio is denoted by Relative Windowing Width (RWW), and the specific formula is as follows [31]:  
\[\mathrm{RWW}=\frac{\mathrm{S}}{\mathrm{W}} \tag{12}\]  
where S is the window stride and W is the window size. Due to the differences in the modalities of vibration data and temperature data, different methods are used to quantitatively characterize the correlation of the data before and after augmentation. For periodic data, such as vibration signals, the correlation coefficient (CC) of time-domain signals is more suitable for quantitatively characterizing the correlation of data before and after augmentation. The Pearson Correlation Coefficient is commonly used for this purpose. The formula for calculating the Pearson Correlation Coefficient is as follows:  
\[\mathrm{r}=\frac{\mathrm{n}(\sum\mathrm{xy})-(\sum\mathrm{x})(\sum\mathrm{y})}{ \sqrt{\left[\mathrm{n}(\sum\mathrm{x}^{2}-(\sum\mathrm{x})^{2}\right]\left[ \mathrm{n}(\sum\mathrm{y}^{2}-(\sum\mathrm{y})^{2}\right]}\right]} \tag{13}\]  
where n is the number of samples. x and y are the two variables (in this case, the original data and the augmented data); \(\sum\mathrm{xy}\) is the sum of the products of the corresponding elements x and y; \(\sum\mathrm{x}\) and \(\sum\mathrm{y}\) are the sums of x and y, respectively; and \(\sum\mathrm{x}^{2}\) and \(\sum\mathrm{y}^{2}\) are the sums of the squares of x and y, respectively. For temperature data, the mean squared error (MSE) is more appropriate. The calculation formula is as follows:  
\[\mathrm{MSE}=\frac{1}{\mathrm{n}}{\sum_{i=1}^{n}}(\hat{\mathrm{x}_{i}}- \mathrm{x_{i}})^{2} \tag{14}\]  
where n is the number of samples; \(\hat{\mathrm{x}_{i}}\) is the augmented data of the i-th sample; and \(\mathrm{x_{i}}\) is the original data of the i-th sample. * Vibration Data  
From a statistical perspective, the relationship between the magnitude of the correlation coefficient and the strength of the correlation is shown in Table 2. The results of the correlation analysis of vibration signals at different RWWs are shown in Figure 4. As shown in Figure 4, when the stride of the sliding window equals the window size (RWW = 1), there is no overlap between adjacent windows, meaning that the data in each window are independent of the others. Therefore, when calculating the correlation coefficient, the data in each window will have a correlation of 1 with itself, which may result in an overall correlation coefficient of 1. In this case, the value of the correlation coefficient is influenced by the choice of the sliding window, rather than accurately reflecting the inherent correlation of the data. Additionally, it can be observed that the data exhibit a high degree of correlation for most RWW values.