Deep learning is one of the best machine learning algorithms for modeling complex mapping relationships between independent and dependent variables, and thus it can be viewed as an ideal approach to predict porosity. In this study, to overcome the deficiencies in current porosity prediction based on deep learning and improve the prediction accuracy, we proposed a deep learning model based on bidirectional temporal convolutional network (BTCN) and bidirectional long short-term memory (BLSTM) network, called bidirectional spatio-temporal neural network (BSTNN), to establish a porosity prediction model. First, the maximum information coefficient is used to analyze the correlation between well logs and porosity, which provides a basis for determining the inputs of the prediction model. Then, a hybrid network structure is constructed by using BTCN and BLSTM, in which BTCN goes to learn the bidirectional long sequence features and BLSTM goes to learn the variation trend and context information with depth, so the hybrid network structure can learn richer logging signal features. Finally, the extracted features are passed through the fully connected layer to output the porosity prediction results. Porosity prediction experiment are conducted by using the actual field data set. The results show that the proposed method has the lower prediction errors for the porosity modeling (RMSE = 0.368 and MAE = 0.260) compared to the benchmark models convolutional neural network (RMSE = 0.404 and MAE = 0.292) and long short-term memory network (RMSE = 0.418 and MAE = 0.298), which verifies the effectiveness of this prediction method.