## 3 Experiments
### Fault Detection and Anti-Noise Analysis  
Since many sensor nodes work outdoors, some fault data and noise data will inevitably be collected during the data collection process. Because there are too many factors affecting the accuracy of data collection in the natural environment, anti-noise capability is essential for a WSN data compression model. In this experiment, we use the proposed model to compress the original data with fault, and observe the data reconstructed by the model. We first use the original sample data of Node 7 to train the model, then use the fault injection method [39] to add different numbers of fault data to the original sample data of Node 7, and use these original samples with fault data to test the compression performance of the trained model. We call this process the anti-noise ability analysis of the model. At the same time, we explored the fault detection ability of the proposed model, that is, whether the model can identify fault data that is different from the original sample data. We equate the fault detection problem with a binary classification problem, the category of the data is judged by the label. Specifically, we record the index of the fault data in the data sample when adding the fault data. When testing, we calculate the fault detection ability of the model based on the fault data index judged by the model. We inject three data faults into the IBRL: noise fault, short-term fault, and fixed fault. We first calculate the number of fault data we want to inject, and then we randomly select the corresponding number of sample points from the original data and inject data faults into these sample points. The injection of noise fault is achieved by adding a normally distributed random number \(\varepsilon=N\big{(}0,\sigma^{2}\big{)}\) to all the selected sample points. The standard deviation \(\sigma\) of noise \(\varepsilon\) is three times the standard deviation of normal data:  
\[x_{f}=x_{o}+\varepsilon \tag{9}\]  
where \(x_{f}\) is the fault data, \(x_{o}\) is the selected sample point of original data. Short-term fault injection is achieved by increasing the amplitude of the selected sample point by \(f\) times (\(f\) is a constant). In this paper, \(f\) is set to \(\pm 0.25\). We set the value of \(f\) by setting a random number \(\rho\) to ensure that the two calculation probabilities are equal when calculating \(x_{f}\):  
\[x_{f}=\left\{ \begin{array}{ll}x_{o}+0.25*x_{o},&\rho<0\\ x_{o}-0.25*x_{o},&\rho\geq 0\end{array} \right. \tag{10}\]  
Fixed fault injection is to set the selected sample point to a fixed value:  
\[x_{f}=x_{o}^{1} \tag{11}\]  
where \(x_{o}^{1}\) is the original data of node1 with the same index point position as the selected sample point. We use three evaluation indicators commonly used in the binary classification problem to measure the fault detection performance of the model: _precision_, _recall_ and \(F_{1}\)_score_. The _precision_ refers to the ratio of the number of samples that the model prediction is correct to the number of samples that the model predicts to be true. \[precision=\frac{TP}{TP+FP} \tag{12}\]  
where \(TP\) (True Positive) refers to the quantity that predicts the true positive as a positive. \(FP\) (False Positive) refers to the quantity that predicts the true negative as a positive. The _recall_ refers to the ratio of the number of samples that the model prediction is correct to the number of true samples. \[recall=\frac{TP}{TP+FN} \tag{13}\]  
where \(FN\) (False Negative) refers to the quantity that predicts the true positive as a negative. For the classification model, separate high _precision_ and separate high _recall_ do not indicate the classification performance of the model. In general, the increase of _precision_ will cause the decrease of _recall_. Similarly, the increase of _recall_ will cause the decrease of _precision_. We want both _precision_ and _recall_ to have higher values for a classification model.