Data-driven soft sensors have emerged as indispensable tools for predicting quality variables in complex industrial processes because of their cost-effectiveness and ease of maintenance. In particular, soft sensors based on deep learning have been utilized in extensive research and successful applications in recent years. However, traditional deep learning methods capture hierarchical data features by minimizing global fitting errors, neglecting the local structural characteristics implied in the original data. In this paper, we propose a new deep learning method for soft sensor development. Utilizing autoencoders as the foundational architecture of our network, a new semisupervised strategy is adopted for layerwise pretraining optimization. On the one hand, more representative data features are extracted by maintaining the local spatiotemporal structure of the data; on the other hand, layer-by-layer supervised learning is employed to identify the critical features that are aligned with the ultimate task, which aids in obtaining the optimal network parameters and improving the resulting prediction accuracy. Subsequently, a local spatiotemporal structure-preserving stacked semisupervised autoencoder (LSP-SuAE) is established. To evaluate the feasibility and effectiveness of the proposed approach, experiments are carried out in a real industrial process. A soft sensor based on the LSP-SuAE is developed to predict the rate of ethylbenzene conversion during the dehydrogenation of styrene. The experimental results demonstrate that, compared to five other common or similar data-driven modeling methods, LSP-SuAE exhibits higher prediction accuracy and better stability.