# Data Compression Based on Stacked RBM-AE Model for Wireless Sensor Networks
## 3 Results and Discussion
### Transfer Learning  
In order to verify the generalization performance of the Stacked RBM-AE model, we use the data of node 7 to train the model, and then use the trained model to test the compression and reconstruction performance of all nodes. This process in deep learning is called transfer learning. At the same time, each node is trained separately to obtain the performance of the model of each node. We test the performance of the model after 10 pre-training iterations and 200 retraining iterations. We set the \(CR\) to 10 and the learning rate to 0.0001. We record the \(PRD\) value, \(QS\) value and reconstruction error of the model of each node. The \(PRD\) value and \(QS\) value of each node both are the average after summing up the value of \(PRD\) and \(QS\) of each mini-batch. The reconstruction error is the average after summing the absolute value error between the original data and the reconstructed data of each mini-batch. The red lines in Figures 9-11 show the compression and reconstruction performance of the model of each node. The compression and reconstruction performance of each node on testing with parameters of node 7 are shown in blue lines in Figures 9-11. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Algorithm** & \(PRD\) (\%) & \(QS\) & **Reconstruction Data Error (\({}^{\circ}\)C)** \\ \hline CS & 38.40 & 26.04 & 1.4143 \\ Standard RBM & 33.03 & 30.28 & 1.0423 \\ Our algorithm & 10.04 & 99.60 & 0.2815 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Compression performance comparison. Figure 8: The reconstructed data and the original data of node 7 under \(CR\) is 10. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Dataset** & \(PRD\) (\%) & \(QS\) & **Reconstruction Data Error** \\ \hline Argo (temperature) & 11.10 & 90.09 & 0.8434 (\({}^{\circ}\)C) \\ ZebraNet (location/UTM format) & 9.82 & 101.83 & 259.26 \\ CRAWDAD (speed) & 8.53 & 117.23 & 6.2056 (km/h) \\ Intel Lab (humidity) & 10.90 & 91.74 & 3.8383 (\%RH) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Model performance on other datasets. We can see from the red lines in Figures 9 and 10 that the model has good compression performance for all nodes. For most nodes, the \(PRD\) value of the model is less than 20. There are some spikes in the red line in Figure 9, such as in node 18 and node 33. For this spike parts of the red line, we analyzed the model loss value during the training process, and find that the training loss value of the model is very small, reaching 3.7652, while the training loss value of most nodes are between 8 and 10. The phenomenon of low training error and high test error shows that the model has been over-fitted. Since we use a fixed number of training iterations in our experiments, the number of training iterations exceeds the optimal number of training iterations of the model for some nodes. By reducing the number of training iterations, the phenomenon of model over-fitting can be avoided effectively. The red line in Figure 11 shows that the error of data reconstruction is less than 1 for most nodes. Except those over-fitting nodes, the minimum and maximum error of data reconstruction can reach 0.2835 \({}^{\circ}\)C and 0.9303 \({}^{\circ}\)C for all nodes. Changing data cannot cause a significant drop in the compression and reconstruction performance of the model. The blue line shows that the model trained with the data of node 7 is not very suitable for most other nodes. Compared to the red lines, the \(PRD\) value and reconstruction error value are increased. For all nodes, the biggest difference of the \(PRD\) value between red line and blue line can reach 15.37, and the smallest difference is 0.16. The minimum and maximum error of the digital difference between the data reconstruction of red line and blue line is 0.0176 \({}^{\circ}\)C and 0.9289 \({}^{\circ}\)C, respectively.