Abstract: Because of the limited energy available to sensor nodes in wireless sensor networks (WSNs), data compression is critical in these networks. The majority of the time, data communication results in energy consumption; however, by minimizing data transmission and reception, the lifetime of sensor nodes may usually be extended significantly. To compress sensor data, we present a new Improved Stacked RBM Auto-Encoder model, which is built of two layers: an encode layer and a decode layer, which is described in detail in this work. Data from sensors is compressed and decompressed in the encode layer; data from sensors is reconstructed and compressed in the decode layer. The encode layer and the decode layer are both made up of four conventional Restricted Boltzmann Machines that are used throughout the system (RBMs). We also present an energy optimization strategy that, by trimming the parameters of the model, can further minimize the energy consumption of the model storage and calculation. We evaluate the model's performance by comparing it to the data acquired by Intel Lab in the environment. Assuming that the model's compression ratio is 10, the average Percentage RMS Difference value is 9.84 percent, and the average temperature reconstruction error value is 0.312 degrees Celsius. It is possible to minimize the energy consumption of node communication in WSNs by 92 percent. When compared to the traditional method, the proposed model achieves higher compression efficiency and reconstruction accuracy while maintaining the same compression ratio as the old method. The results of our experiments demonstrate that the new neural network model can not only be applied to data compression for WSNs, but it also has high compression efficiency and an excellent transfer learning capability. Keywords: Data Compression; Stacked-Autocoder; transfer learning; energy, consumption optimization