For wireless sensor networks (WSNs), sensor nodes lose a certain amount of energy during the information collection and transmission process, and sensor nodes powered by non‐replaceable batteries have limited energy and need to be controlled for energy consumption. In the face of the energy consumption issue in WSN data transmission, research has been conducted to analyze data fusion methods in order to reduce energy consumption. Based on machine learning techniques, a Deep Stacked Auto‐Encoder (DSAE) model is constructed and trained using a layer‐wise greedy approach. By combining this model with WSN, an algorithm based on the DSAE model, called Deep Stacked Auto‐Encoder Data Fusion Algorithm (DSAEDFA), is obtained to do data fusion. The results show that compared to other algorithms, the proposed fusion algorithm has better fusion performance. When the number of iterations is set to 500, the DSAEDFA has 281 surviving nodes, which is 10 more than the Back‐Propagation Data Fusion Algorithm (BPDFA) and 144 more than the Low Energy Adaptive Clustering Hierarchy (LEACH) algorithm. When the number of failed nodes is 40, the DSAEDFA has a network survival time of 2562 rounds, which is 746 rounds longer than the LEACH algorithm. The research method effectively extends the lifespan of wireless sensor networks and reduces data transmission energy consumption. Compared to previous methods, the proposed method consider the factors of node residual energy and distance on the basis of traditional routing protocols, making the selection of cluster heads more reasonable. The proposed method can organically combine the DSAE model with the clustering model, optimize the data fusion method, and improve the performance of the algorithm. In addition, by combining the DSAE model, a machine learning technique with clustering models has been expanded in terms of the application scope.