Introduction

Reservoir evaluation is the core link in oil and gas exploration and development, and its core objective is to provide basic data support for reservoir modeling, reserve calculation and development plan design through quantitative analysis of physical parameters1. Porosity, as a core physical parameter of reservoir, not only directly determines the storage capacity of the reservoir, but also has a complex coupling relationship with permeability, water saturation and other parameters2. Its measurement methods include direct measurement which involves physically measuring porosity on core samples in a laboratory with the highest accuracy but high cost3 and indirect estimation which involves estimating porosity from downhole logging data seismic data or other geophysical methods combined with petrophysical models4. Indirect estimation needs to integrate geological and logging information to build prediction models but strong nonlinearity under complex geological conditions limits the accuracy of traditional methods5,6. Porosity prediction on seismic data is more complex than on log data due to lower resolution higher noise interference and greater uncertainty from multiple solutions in seismic inversion. Seismic data inherently contains noise from acquisition and processing which distorts the reflection signals related to porosity. Its vertical and horizontal resolution is insufficient to capture fine-scale porosity variations especially in heterogeneous reservoirs. Moreover, the mapping relationship between seismic attributes and porosity is affected by multiple factors including lithology fluid properties and subsurface inhomogeneity leading to ambiguity in prediction. Recently geostatistical inversion combined with data-driven methods7 and using seismic attributes8 has improved the accuracy of indirect estimation9.

Machine learning handles reservoir parameter relationships through nonlinear fitting SVM10, BP neural networks11 and others12 are widely used in porosity prediction, but they rely on manual feature extraction and have local optimization issues13. Recent optimization algorithms namely PSO-optimized SVM14 enhanced SVM’s performance in reservoir parameter prediction via particle swarm optimization. Gradient boosting models15 improved carbonate reservoir permeability prediction through refined tuning. Machine learning applications in heterogeneous carbonate gascondensate reservoirs16 have also achieved reliable permeability prediction results. A parametric study17 validated machine learning’s effectiveness in reservoir permeability prediction. Tree-based ensemble learning18 excelled in lithofacies classification and permeability prediction for heterogeneous reservoirs. These have significantly improved prediction performance.

Deep learning solves the limitations of traditional methods through automatic feature extraction19. It enables end-to-end learning from raw reservoir data eliminating the need for manual feature engineering20. CNN models have been applied to predict key reservoir parameters including porosity by capturing local spatial patterns in logging and seismic data21. LSTM networks with their ability to handle sequential data have improved predictions in reservoirs with strong vertical continuity22. Bidirectional variants like BiLSTM further enhance performance by leveraging both past and future data dependencies23. CRNN models combining convolutional and recurrent layers effectively capture both spatial and temporal features in complex carbonate reservoirs24. These advancements have made deep learning a powerful tool for reservoir property prediction. Yet existing studies still have obvious gaps most rely on field-measured data for training lacking support from large-scale and diverse synthetic datasets generated by petrophysical models meanwhile single LSTM or BiLSTM cannot fully capture multi-layer features of complex geological data and few studies combine bidirectional sequence modeling with attention mechanisms resulting in insufficient performance in characterizing nonlinear relationships and noise resistance.

To address these limitations this study proposes a petrophysically-driven stacked bidirectional long short-term memory S-BiLSTM neural network with three key novelties. First it generates large-scale diverse synthetic datasets of elastic and anisotropic parameters through shale petrophysical modeling overcoming the constraint of limited field-measured data and providing training data that closely simulates real geological environments. Second it adopts a stacked bidirectional LSTM structure where multiple bidirectional LSTM layers are stacked to capture both forward and backward data dependencies while extracting multi scale features addressing the insufficiency of single LSTM in characterizing complex geological data. Third it integrates an attention mechanism and Dropout regularization to enhance the model’s ability to focus on key features and resist noise ensuring stable performance even with noisy data. Derived from BiLSTM an improved LSTM variant25 that realizes bidirectional information propagation through two opposite-direction hidden layers integrating complete past and future information for each sequence point26. This S-BiLSTM model is validated using real reservoir parameter data from an oil field in Southwest China. Results confirm its high accuracy robustness and noise immunity in porosity distribution prediction.

Materials and methods

Petrophysical modeling

Petrophysical modeling describes subsurface rocks and their properties using mathematical and physical equations. It first calculates key rock properties including acoustic velocities densities normal weakness and tangential weakness from well log data27. These calculated properties then serve as inputs for seismic forward modeling which predicts seismic data and relevant reservoir physical parameters by simulating the physical response of different rock types and saturations in the reservoir.

Shale oil and gas have garnered significant attention in recent years. To accurately characterize the physical properties of shale rocks, this study constructs an equivalent medium petrophysical model of shale based on multi-theoretical coupling (in Fig. 1). This shale petrophysical model sequentially calculates the matrix modulus dry rock skeleton modulus and fluid-saturated rock modulus by integrating the Voigt-Reuss-Hill averaging method the equivalent medium model the linear slip model and the anisotropic Gassmann fluid substitution equation. It comprehensively accounts for the effects of matrix minerals pore structure oriented fractures and pore fluids in shale to determine the equivalent medium rock modulus and elastic parameters of shale. This petrophysical model provides a comprehensive dataset and a near-actual data environment for training deep learning networks. Training with samples derived from this petrophysical modeling offers a theoretical foundation for the accurate prediction of physical parameters and significantly enhances the generalization of predictions. Subsequently, five parameters - longitudinal wave velocity (\(\:{V}_{p}\)), transverse wave velocity (\(\:{V}_{s}\)), rock density (\(\:\rho\:\)), normal weakness (\(\:{\varDelta\:}_{N}\)), and tangential weakness (\(\:{\varDelta\:}_{T}\)) - were selected as inputs to the neural network for predicting porosity. The five parameters were selected for their inherent links to porosity in petrophysical modeling. \(\:{V}_{p}\), \(\:{V}_{s}\) and \(\:\rho\:\) reflect matrix–fluid interactions while \(\:{\varDelta\:}_{N}\) and \(\:{\varDelta\:}_{T}\) capture fracture-induced elastic anisotropy.

Fig. 1
figure 1

Shale petrophysical modeling process.

Long short-term memory neural network

Long Short-Term Memory networks are an advanced recurrent neural network architecture to address gradient explosion or vanishing and long-term temporal dependency issues of conventional RNNs28. As illustrated in Fig. 2, their architecture includes three regulatory gate mechanisms and a dedicated memory cell unit29. The memory unit stores input information, the forgetting gate manages information retention or discarding30,the input gate updates the memory unit via Sigmoid and tanh functions and the output gate controls information output.

Fig. 2
figure 2

Structure of LSTM neural network.

Stacked bidirectional LSTM neural network modeling

To enhance the predictive capability of traditional LSTM neural networks for reservoir physical property parameters, this paper innovatively proposes a new neural network structure. Key modifications distinct from standard LSTM and BiLSTM include three critical improvements. First, the input sequence direction is extended from unidirectional to bidirectional enabling capture of both forward and backward data dependencies31. Second, multiple bidirectional LSTM layers are stacked to extract multi scale features addressing limitations of single layer designs in characterizing complex geological data. Third, an attention mechanism is integrated to prioritize key features alongside Dropout regularization to resist noise. These modifications collectively strengthen feature extraction and noise tolerance critical for reservoir porosity prediction under complex geological conditions. In conclusion, stacked bi-directional LSTM neural network is stronger than traditional LSTM neural network with the following three advantages:

  1. 1.

    Better feature extraction ability: by stacking multiple LSTM layers to extract richer features, can better solve complex tasks;

  2. 2.

    Better capture of long-term dependencies: can capture forward and backward dependencies, can better handle long sequence data;

  3. 3.

    With stronger robustness: through multiple LSTM layers to enhance the resistance to noise and interference, can work in complex environments.

Bidirectional LSTM neural network

The structure of the Bi-LSTM neural network is shown in Fig. 3, which combines two sub-networks, the forward and backward LSTMs, and is capable of capturing bidirectional dependencies. Compared with unidirectional LSTM, it can refer to both past and future information at any moment t, and the prediction results are more accurate, which is especially suitable for the task that needs to understand the long-term dependency of elements32.

In Fig. 3, \(\:W\) and \(\:{W}^{{\prime\:}}\) are weight matrices from the input layer to the hidden layer. \(\:W\) is used for the forward layer, while \(\:{W}^{{\prime\:}}\) is used for the backward layer. They are respectively used to transform the input \(\:{x}_{t}\) into the forward hidden state and the backward hidden state. \(\:U\) and \(\:{U}^{{\prime\:}}\) are weight matrices from the hidden state to the hidden state, used to capture the dependencies between time steps in the sequence. \(\:U\) is used for the forward layer, and \(\:{U}^{{\prime\:}}\) is used for the backward layer. They are respectively used to compute the recursive relationships of the forward and backward hidden states. \(\:{S}_{0}\) is Forward Hid Init and \(\:{S}_{t}\) is Forward Hid Final. They are the initial and final state vectors of the forward hidden layer respectively. \(\:{S}_{0}^{{\prime\:}}\) is Backward Hid Init and \(\:{S}_{t}^{{\prime\:}}\) is Backward Hid Final. They are the initial and final state vectors of the backward hidden layer respectively. \(\:{A}_{t}\) and \(\:{A}_{t}^{{\prime\:}}\) represent the hidden states of the forward and backward layers at time step \(\:t\), respectively. The forward-computing LSTM is labeled as \(\:{A}_{0}\to\:{A}_{1}\to\:{A}_{2}\to\:\cdots\:\to\:{A}_{t}\), and its input at the moment t consists of two parts: the sequence data \(\:{x}_{t}\) at the current moment and the output \(\:{A}_{t-1}\) of \(\:\left(t-1\right)\) at the previous moment. The reverse-computing LSTM is labeled as \(\:{A}_{0}^{{\prime\:}}\to\:{A}_{1}^{{\prime\:}}\to\:{A}_{2}^{{\prime\:}}\to\:\cdots\:\to\:{A}_{t}^{{\prime\:}}\), and its input at the moment t consists of the sequence data \(\:{x}_{t}\) at the current moment and the output \(\:{A}_{t+1}^{{\prime\:}}\) of \(\:\left(t+1\right)\) at the latter moment. Eventually, the output value is jointly determined by \(\:{A}_{t-1}\) and \(\:{A}_{t+1}^{{\prime\:}}\), which reflects the advantage of the bidirectional LSTM in processing sequence data that can consider both the preceding and following information. Eventually, the output value is jointly determined by the forward and backward hidden states, as shown by \(\:{y}_{2}=g\left(V{A}_{2}+{V}^{{\prime\:}}{A}_{2}^{{\prime\:}}\right)\). This reflects the advantage of the bidirectional LSTM that it can consider both preceding and following information when processing sequence data.

Fig. 3
figure 3

Structure of bidirectional LSTM network (Bi-LSTM).

Stacked neural network

Stacked neural networks vertically integrate multiple neural architectures into a hierarchical framework that progressively enhances feature extraction capabilities. By sequentially propagating outputs from preceding layers as inputs to subsequent layers through cascaded network tiers, this architecture enables the construction of deep hierarchical representations with superior nonlinear modeling capacity33. In the studied, southwest China oilfield the Longmaxi Formation shale reservoir exhibits distinct geological characteristics including deep burial complex pore networks vertical lithological layering and fracture induced lateral heterogeneity. These features create multi scale relationships between elastic parameters and porosity that single layer networks cannot fully capture. Stacked bidirectional LSTM layers address this by capturing basic correlations between elastic parameters and porosity through initial processing while subsequent layers focus on higher order interactions including the combined effects of fracture-induced anisotropy parameters on porosity distribution. This hierarchical division mirrors the reservoir’s nested structure where small scale pores within shale matrix interact with large scale fracture zones to control overall porosity patterns.

Parameter settings

In this study, the stacked bidirectional LSTM architecture includes three bidirectional LSTM layers each with 128 neurons. Each bidirectional layer connects forward and backward hidden states to capture sequential dependencies in both directions. An attention layer follows the stacked LSTM layers to emphasize critical features. A dropout layer with a rate of 0.5 is applied between layers to reduce overfitting. The output layer is a fully connected layer with linear activation to produce porosity predictions.

Comparative analysis of activation functions reveals that the ReLU function exhibits superior computational efficiency relative to tanh and sigmoid functions, while simultaneously introducing beneficial sparsity through selective neuron deactivation. This sparsity induction mechanism reduces parameter interdependency by strategically nullifying non-critical neural pathways, thereby optimizing network resource allocation34. Therefore, in this paper, when constructing the stacked bidirectional LSTM neural network, the neurons in the hidden layer choose ReLU, and the output layer uses linear activation function, which ensures that the output can take any value.

In the process of neural network training, the main role of the loss function is to quantify the gap between the predicted value \(\:f\left(x\right)\) and the actual value y of the network model35. The prediction of physical parameters of the reservoir in this paper is essentially a regression prediction problem, so the loss function-mean-square error (MSE) function suitable for regression problems is used, which is given by:

$$\:L\left(y,f\left(x\right)\right)=\frac{1}{n}\sum\:_{i=1}^{n}{\left({y}_{i}-f\left({x}_{i}\right)\right)}^{2}$$
(1)

In Eq. (1), \(\:f\left({x}_{i}\right)\) is the predicted value, \(\:{y}_{i}\) is the true value in the training sample, and n is the number of samples trained36.

Optimizers play a pivotal role in neural network training by computing and updating network parameters, with appropriate selection critically influencing model convergence speed and overfitting mitigation37. Adam was adopted as the optimizer for S-BiLSTM training because among prevalent optimizers it stands out by adaptively adjusting learning rates through gradient variance estimation. This mechanism enables aggressive initial step sizes for rapid early-stage convergence followed by automatic step size reduction for precise late-stage optimization effectively preventing gradient explosion/vanishing while maintaining consistent performance across training phases38.

The attention mechanism emulates human cognitive prioritization by dynamically allocating computational resources through weighted feature emphasis, where higher-weight features receive augmented processing focus39. Integration of this mechanism within bidirectional LSTM architectures enables enhanced utilization of discriminative data patterns, significantly improving model efficacy.

Stacked bidirectional LSTM

As demonstrated in Fig. 4, our augmented Stacked Bidirectional LSTM (S-BiLSTM) architecture incorporates attention layers to optimize feature relevance assessment.

Fig. 4
figure 4

Workflow of the neural network with the attention mechanism.

The Input Layer accepts the input data and converts it into embedding vectors, which are then converted into dense vectors. The similarity of the training dataset is computed by Stacked BiLSTM layers, and the softmax algorithm is used to assign probabilities in order to obtain the contribution of the hidden layer, which is weighted and summed to obtain the output value. Adding the attention mechanism can improve the generalization performance of S-BiLSTM model39.

The workflow of the neural network with the new structure is that when the input sequence, \(\:\left({x}_{1},{x}_{2},{x}_{3},\cdots\:,{x}_{t}\right)\) is processed through Stacked BiLSTM Layers that generates two sets of hidden states, \(\:\left({h}_{1},{h}_{2},{h}_{3},\cdots\:,{h}_{t}\right)\) and \(\:\left({h}_{1}^{{\prime\:}},{h}_{2}^{{\prime\:}},{h}_{3}^{{\prime\:}},\cdots\:,{h}_{t}^{{\prime\:}}\right)\). These two sets of hidden states are fed into the Attention Layer, which integrates them into a context vector that is placed into the Fully Connected Layer, which ultimately outputs the desired value, \(\:y\). The neural network’s depth and complexity are greatly increased. Where \(\:{e}_{1},\:{e}_{2},\:{e}_{3},\:\cdots\:,\:{e}_{t}\) are the outputs of the Embedding Layer for each time step \(\:{x}_{1},\:{x}_{2},\:{x}_{3},\:\cdots\:,\:{x}_{t}\) in the Input Layer. \(\:\overrightarrow{{h}_{1}},\:\overrightarrow{{h}_{2}},\:\overrightarrow{{h}_{3}},\:\cdots\:,\:\overrightarrow{{h}_{t}}\) is the hidden state of the forward LSTM layer at each time step. \(\:\overleftarrow{{h}_{1}^{{\prime\:}}},\:\overleftarrow{{h}_{2}^{{\prime\:}}},\:\overleftarrow{{h}_{3}^{{\prime\:}}},\:\cdots\:,\:\overleftarrow{{h}_{t}^{{\prime\:}}}\) is the hidden state of the backward LSTM layer at each time step. In the attention layer, \(\:{h}_{1},\:{h}_{2},\:{h}_{3},\:\cdots\:,\:{h}_{t}\) represents the hidden state after weighting by the attention mechanism.

Model evaluation metrics and performance optimization

The optimization of hyperparameters plays a pivotal role in determining neural network performance. For S-BiLSTM architectures, two critical hyperparameters require systematic tuning: hidden layer neuron dimensionality, governing model capacity; and dropout rate, controlling regularization intensity. This paper adopts a progressive optimization strategy that sequentially adjusts these parameters - first establishing network architecture through neuron configuration, and fine-tuning generalization performance through dropout rate modulation. This parameter-decoupled optimization strategy simultaneously enhances computational efficiency and model performance.

Model performance evaluation metrics

In the regression prediction task, the model prediction results and the real value can be plotted in the same graph to directly observe the degree of agreement, the image method is concise and intuitive, but is susceptible to subjective influence and lack of specific comparison. Therefore, in addition to the image comparison, this paper also uses the mean absolute error (MAE) and root mean square error (RMSE) to objectively evaluate the model prediction performance.

The formula is as follows:

$$\:MAE=\frac{1}{n}\sum\:_{i=1}^{n}\left|{y}_{i}-{\widehat{y}}_{i}\right|$$
(2)
$$\:RMSE=\sqrt{\frac{1}{n}\sum\:_{i=1}^{n}{\left({y}_{i}-{\widehat{y}}_{i}\right)}^{2}}$$
(3)

Where \(\:{y}_{i}\) represents the true value of the ith sample point, \(\:{\widehat{y}}_{i}\) is the predicted value of the ith sample point, and \(\:n\) is the total number of samples.

MAE is less sensitive to outliers, and a smaller MAE value indicates a smaller prediction error. RMSE measures the degree of error between the predicted value and the actual value, the smaller it is, the closer the predicted value is to the actual value, and the higher the prediction accuracy and effect of the model.

Hidden neuron number optimization

The number of neurons in the hidden layer is a key factor affecting the complexity of the model, the more the number, the stronger the model expression ability, but the higher the risk of overfitting, according to the size and complexity of the training data to choose the appropriate value40.

Table 1 Effect of the number of neurons in the hidden layer on the S-BiLSTM model.

In the training, the number of hidden layer neurons is set to 32, 64, 128, 256, 512 and iterated for 1000 rounds of test training, and it is found that with the increase of the number, the model’s MAE and RMSE of the physical parameters of the storage layer are high and then low and then rise, and the prediction accuracy is first low and then high and then low, and reaches the local optimal solution at 128. In order to verify whether 128 is the global optimal solution, the hidden layer neurons are set to 96, 112, 120, 124, 126, 130, 132, 136, 144, 160 experiments, and the results are shown in Table 1; Fig. 5, when the number of 128, the S-BiLSTM neural network model has the optimal performance and the highest prediction accuracy. This reflects a trade-off between model capacity and overfitting risk. Increasing the number from 32 to 128 enhances feature extraction ability, which is indicated by decreasing MAE and RMSE values along with rising predictive accuracy. However, exceeding this value leads to performance degradation as a result of overfitting.

Fig. 5
figure 5

Relationship between the number of neurons in the hidden layer and evaluation indexes.

Dropout size optimization

Table 2 Effect of dropout size on the S-BiLSTM model.
Fig. 6
figure 6

Relationship between dropout size and evaluation indexes.

Determining the optimal Dropout rate requires consideration of several factors such as dataset characteristics, network architecture and parameters during training. In the neural network training, the Dropout size was set to 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8 and 1000 rounds of iterations were performed for test training. The results show that the validation set model is not overfitted and has the highest prediction accuracy when the Dropout size is 0.5.

As shown in Table 2; Fig. 6, different Dropout rates lead to variations in MAE, RMSE, and prediction accuracy. The S-BiLSTM model performs best and achieves the highest prediction accuracy with a Dropout rate of 0.5. This value balances regularization and information retention. In contrast, lower dropout values such as 0.1 to 0.3 inadequately prevent overfitting and result in poorer accuracy, while higher values around 0.7 to 0.8 excessively restrict feature learning and reduce performance.

S-BiLSTM model hyperparameter setting

By designing the network structure and optimizing the hyperparameters of this model, the parameter values are set as shown in Table 3. The optimal hyperparameters for the RNN model and the LSTM model were also determined through multiple experiments by setting their batch size to 64 and learning rate to 0.001.

Table 3 S-BiLSTM model hyperparameter value settings.

Experimental dataset

The experimental data used to train the neural network in this study are based on petrophysical modeling of real logging data from an oil and gas field in southwest China, with 50,000 sets of training data. The field logging data used to build the petrophysical model include details of mineral composition porosity and fracture characteristics of the Longmaxi Formation shale in the study area. These logging data together with pre-stack seismic records of different incident angles provide the basis for generating the synthetic dataset. The longitudinal wave velocity (\(\:{V}_{p}\)), transverse wave velocity (\(\:{V}_{s}\)), density (\(\:\rho\:\)), normal weakness (\(\:{\varDelta\:}_{N}\)) and tangential weakness (\(\:{\varDelta\:}_{T}\)) were taken as five parameters as inputs and labeled with the labeled columns of porosity (por). In order to achieve comparison and analysis on a uniform scale, the dataset obtained from the petrophysical model needs to be preprocessed before it is fed into the neural network for training. The data normalization method used in this paper is maximum-minimum normalization, which performs a linear transformation on the sample data to reduce the data range within 0–141.

The dataset is divided by the cross-validation division method, which can reduce the influence of chance and enhance the model generalization ability and data utilization efficiency, and the ten-fold cross-validation division method is used. The ten-fold cross-validation process begins by randomly dividing the 50000-group dataset into ten equal subsets each with 5000 groups42. During each iteration one subset is used as the validation set for evaluation and the other nine form the training set for S-BiLSTM model training43. This cycle repeats ten times so every subset serves as the validation set once44. Final performance metrics including MAE RMSE and predictive accuracy are determined by averaging all validation outcomes improving robustness and reducing partitioning randomness45. The dataset in this study is first divided into training set and test set according to 9:1, and the training set is further divided into training set and validation set according to 9:1, with 81% of the training set (40,500 groups), 9% of the validation set (4,500 groups), and 10% of the test set (5,000 groups). As shown in Fig. 7; Table 4, the entire data generation workflow and final results are presented.

Fig. 7
figure 7

Petrophysical-driven data generation workflow.

In order to ensure the generalization performance of the model, the training set is used for training and then the validation set is used for secondary validation, and finally the test set is used to objectively assess the prediction effect.

Table 4 Table of details of data set segmentation.

Results

S-BiLSTM model application performance

After the training of the neural network model was completed, it was analyzed in comparison with RNN, LSTM models and S-BiLSTM model without the Attention layer added to validate the performance of the model in this paper. Porosity prediction was performed separately and model performance was evaluated using mean absolute error (MAE) and root mean square error (RMSE). When dividing the dataset, the impact of the dataset size on the model performance is taken into account, so it is found through experiments that 81% of the training set size is a reasonable choice, which strikes a balance between the model performance and generalization ability.

Table 5 Evaluation metrics of different models for porosity prediction.
Table 6 Comparison of computational efficiency of model training.
Fig. 8
figure 8

Prediction of “porosity” by each neural network model.

For a better presentation, 64 data points were selected from the model’s 5000-group test set for visual comparison, and the model’s overall performance was evaluated based on the entire 5000-group test set. The advantages and potential of the S-BiLSTM model are more clearly demonstrated using graphical methods. Figure 8 shows a one-dimensional plot of the predicted versus true values of porosity by the four neural networks, and Table 5 summarizes the evaluation data of the four neural networks. Table 6 labels the time spent on the training of each different model, and it can be seen that the S-BiLSTM model is more computationally efficient than RNN and LSTM.

It can be observed that the S-BiLSTM neural network has the best prediction effect, S-BiLSTM neural network without added attention mechanism is next, then LSTM neural network, and lastly RNN neural network. The porosity prediction accuracy of S-BiLSTM model is improved by 7.81% compared with that of the LSTM model, and 14.06% compared with that of the RNN model. And the porosity prediction accuracy is improved by 4.69% after adding the attention mechanism. The reliability of these performance improvements is supported by our ten-fold cross-validation. The S-BiLSTM exhibited lower MAE and RMSE than RNN, LSTM, and the un-attention S-BiLSTM in every validation fold. This consistent error reduction across all data partitions confirms the model’s superiority is not a result of randomness. In the comparison of Fig. 8, the S-BiLSTM neural network also has the best fit between the predicted and real values, which is better than the other networks.

S-BiLSTM model noise resistance analysis

In the comparison test in the previous section, the trained S-BiLSTM model outperformed the other models in porosity prediction. However, real data are often contaminated by noise, which requires the neural network to maintain high prediction accuracy in the face of noisy data. Real geological signals are preserved through time-depth calibration band-pass filtering and abnormal data detection in data preprocessing. The attention mechanism and Dropout technique in model design help reduce noise interference and avoid artifact generation. In order to verify the noise resistance of the model in this paper, three sets of Gaussian white noise data with signal-noise ratios of 10dB, 5dB and 1dB are set up in the experiments. These SNR levels are selected based on actual seismic data characteristics of the target oilfield in southwest China. The SNR of seismic data in this area generally ranges from 1dB to 10dB. Areas with high well control and low data interference have an SNR of approximately 10dB. Most conventional exploration areas have an SNR of approximately 5dB. Deep complex geological structure areas have an SNR as low as 1dB due to multiple interferences. These settings fully cover the noise scenarios that may be encountered in actual exploration of the study area. MAE, RMSE and prediction accuracy are used as the evaluation indexes to compare the noise resistance performance of the four neural network models RNN, LSTM, Un-attention S-BiLSTM and S-BiLSTM.

Table 7 Statistics of model prediction metrics under different signal-noise ratios.

The performance of the above four models in predicting porosity under different signal-noise ratios was investigated. As shown in Table 7, the S-BiLSTM model performs best at high SNR (10 dB), medium SNR (5 dB), and low SNR (1 dB), and the general trend observed is that the performance of all models deteriorated as the SNR decreased, but the S-BiLSTM network is always in the leading position, followed by the LSTM with the RNN model performing the least effectively. It can also be seen that both noise immunity and prediction performance are significantly improved by adding the attention mechanism. The advantages of S-BiLSTM neural network lie in its stacking structure, bidirectional LSTM structure, Dropout technique and the introduction of attention mechanism. Its stacking structure can learn deep nonlinear relationships. The bidirectional LSTM structure provides a comprehensive understanding of the sequence data, and the Dropout technique reduces the risk of overfitting and enhances the generalization ability. The attention mechanism enables the model to focus on important information. As a result, it can maintain high accuracy with low signal-noise ratio, highlighting its superiority in handling noisy data.

Practical applications

In this study, the physical parameters of the reservoir are predicted with the help of neural network, based on the relationship between elasticity and physical parameters and the timing characteristics, and the parameters are input into the network by seismic inversion, so as to obtain accurate physical parameter prediction results.

Petrophysical modeling and analysis of shale in the actual work area

In practical applications, taking a work area in southwest China as an example. This work area is located in the north of the southern Sichuan low-fold structural belt in the Sichuan Basin. The NE-trending structure is dominant. From west to east, the Gufoshan structure, Desheng syncline, Longdongping-Jiukuishan anticline, Yunjin syncline and others are developed, presenting the characteristics of wide and gentle synclines and narrow anticlines. The main reservoir is high-quality shale of the Longmaxi Formation. This shale has a large burial depth. The main body is buried at a depth between 3500 and 4000 m. Some are buried at a depth of 4000 to 4500 m, and are scattered at 3000 to 3500 m. The thickness of high-quality shale is 30 to 60 m. Pre-stack seismic records for this area are presented in Fig. 9.

Fig. 9
figure 9

Prediction stacking seismic records with different incidence angles. (a) 9°, (b) 18°, (c) 27°.

To match the frequency and sampling rate of seismic data, three key measures are implemented. First, time-depth calibration is carried out. The log acoustic travel time curve in the work area is used to establish the depth-time conversion relationship. Elastic and anisotropic parameters including P-wave velocity, S-wave velocity, density, normal weakness and tangential weakness derived from log data are converted from the depth domain to the time domain. The sampling rate of log data in the depth domain is 0.125 m, and the sampling rate of seismic data in the time domain is 2 milliseconds to achieve sampling rate matching. Second, band-pass filtering is applied. Based on the frequency range of elastic parameters derived from log data, band-pass filtering is performed on seismic data to ensure consistent frequency ranges between the two. The frequency range of log-derived parameters is 5–80 Hz, and the frequency range of seismic data is aligned with it after filtering. Third, dynamic correction and gather flattening are conducted. Dynamic correction is used to eliminate time differences between seismic traces caused by differences in propagation paths. Gather flattening aligns signals from the same reflection interface on the time axis to further ensure signal consistency after sampling rate matching.

The establishment of the petrophysical model provides the necessary training dataset for the subsequent neural network training. The shale petrophysical modeling process is illustrated in Fig. 10. The accuracy and reliability of the model parameters significantly impact the training efficacy of the neural network model.

Fig. 10
figure 10

Shale petrophysical modeling process.

Based on the established modeling techniques and processes, the well log interpretation results were employed to accurately predict the fracture and anisotropy parameters along the wellbore, as illustrated in Fig. 11. The average absolute errors for the predicted longitudinal and transverse wave velocities were 1.41% and 1.72%, respectively. These results substantiate the validity and reliability of the model. Figure 11c,d correspond to normal and tangential weaknesses, showing fracture development in some areas.

Fig. 11
figure 11

Petrophysical modeling results of the Longmaxi formation shale stratum in a well in the actual work area. (a) longitudinal wave velocity; (b) transverse wave velocity; (c) normal weakness; (d) tangential weakness.

Fig. 12
figure 12

Reservoir profiles for each parameter. (a) longitudinal wave velocity, (b) shear wave velocity, (c) density, (d) normal weakness, (e) tangential weakness.

Figure 12 shows the results obtained by AVA approximation equations and inversion techniques for the target reservoir parameters in the actual work area. Where (a) and (b) are the longitudinal and transverse wave velocity, (c) is the density, and (d) and (e) are the normal and tangential weakness. From the profile, it can be seen that the density is high in the upper and lower parts of the reservoir and low in the middle, and the cracks are more developed in the area of road number 3500–3800 and depth 1850 m.

S-BiLSTM model vs. cross-plot method

The elasticity and anisotropy parameters inverted in the previous section are inputted into the trained neural network to obtain the predicted physical properties parameters. The cross-plot method establishes a statistical relationship model based on the reservoir parameters and logging profile data, and Fig. 13a shows the prediction results of reservoir porosity by the S-BiLSTM model, and Fig. 13b shows the calculation results of the cross-plot method. It can be seen that in porosity prediction, the S-BiLSTM neural network predicts the profile with continuous and smooth color, which can better capture the subtle changes, while the cross-plot method has discrete color and poor detail capture. Its prediction results are highly consistent with actual geological characteristics. The area with trace numbers 3500–3800 and at a depth of 1850 m in the actual work area is a fracture-developed zone. The high porosity distribution predicted by the S-BiLSTM model in this area is consistent with the fracture characteristics of this zone and also matches the fracture development shown by the imaging logs. Meanwhile, the porosity content of the Longmaxi Formation reservoir in a well of the actual work area varies from 0.73% to 6.8%. The proportion of samples with predicted values of the S-BiLSTM model within this range reaches 92.75%, which further verifies the correctness of the prediction results. The cross-plot method has discrete colors in the predicted profile and shows poor detail capture. The proportion of its predicted values within the above porosity range is only 84.31%. In terms of quantitative metrics, the cross-plot method for porosity prediction yields an MAE of 0.0058, an RMSE of 0.0179, and a predictive accuracy of 84.31%. Here, predictive accuracy is defined as the percentage of samples for which the relative error between the predicted and measured porosity is less than 5%. In contrast, the S-BiLSTM model achieves an MAE of 0.0026, an RMSE of 0.0120, and a predictive accuracy of 92.75%. Compared to the cross-plot method, the S-BiLSTM model reduces the MAE by 0.0032 and the RMSE by 0.0059 while improving predictive accuracy by 8.44%.

Fig. 13
figure 13

Section of porosity prediction results. (a) S-BiLSTM model, (b) cross-plot method.

In summary, the S-BiLSTM neural network demonstrates significant advantages in predicting reservoir physical properties parameters. The results are more consistent with actual conditions, thereby providing reliable data for reservoir evaluation.

S-BiLSTM model vs. support vector machine (SVM)

Figure 14a will show the prediction results of reservoir porosity by S-BiLSTM neural network. Figure 14b, on the other hand, shows the prediction results obtained using Support Vector Machine (SVM).

Fig. 14
figure 14

Section of porosity prediction results. (a) S-BiLSTM model, (b) SVM model.

Fig. 15
figure 15

Comparison of porosity prediction and logging curves by methods.

Comparing the profiles and logging curves of the two methods, the S-BiLSTM model predicts finer results than SVM. Furthermore, when juxtaposed with the cross-plot method, the SVM model demonstrates certain advantages. Quantitative comparison shows that the SVM for porosity prediction has an MAE of 0.0042, an RMSE of 0.0146, and a predictive accuracy of 87.38%. The S-BiLSTM model, in contrast, has an MAE of 0.0026, an RMSE of 0.0120, and a predictive accuracy of 92.75%. Compared to the SVM, the S-BiLSTM reduces the MAE by 0.0016 and the RMSE by 0.0026, while improving predictive accuracy by 5.37%. As illustrated in Fig. 15, the comparison of logging curves reveals that the data produced by the S-BiLSTM neural network aligns more closely with the actual logging values than the predicted values obtained from the SVM model. This indicates that the S-BiLSTM model is more effective and superior to the SVM model in predicting the physical parameters of the reservoir. The predictions made by the S-BiLSTM model are accurate and reliable, showcasing significant advantages over the SVM model.

Discussion

Addressing the prevalent issues of suboptimal prediction accuracy and inadequate noise resistance in porosity prediction, this study introduces a novel framework that integrates stacked bidirectional Long Short-Term Memory (S-BiLSTM) neural networks with petrophysical modeling for enhanced reservoir porosity parameter prediction. Specifically, the incorporation of shale petrophysical modeling facilitates the generation of comprehensive and diverse training datasets, thereby enabling the neural network to effectively simulate the actual data environment and discern intricate relationships within the data.The S-BiLSTM architecture excels in capturing long-term dependencies and contextual information through its multi-layer LSTM network and bidirectional information transfer mechanism. This is complemented by the integration of several advanced techniques, including the ReLU activation function, MSE loss function, Adam optimization algorithm, Dropout regularization, and Attention mechanism, which collectively enhance the model’s nonlinear fitting capabilities and robustness.

For model evaluation and performance optimization, systematic experimentation was conducted to determine optimal hyperparameters, including the number of neurons in the hidden layers, batch size, and Dropout rate. The visualization tools employed in this study provide valuable insights into the model’s learning process and feature interpretation, thereby enhancing its interpretability and explanatory power. In terms of feature importance, the contributions of the five input parameters to porosity prediction align with their petrophysical significance as elaborated in Sect. 2.1. Longitudinal wave velocity, transverse wave velocity, and rock density, which reflect matrix-fluid interactions, play relatively prominent roles in prediction due to their direct association with pore fluid storage capacity. Normal weakness and tangential weakness, which capture fracture-induced elastic anisotropy, contribute to predicting porosity variations in fractured zones, complementing the matrix-related parameters.

Comparative analysis demonstrates that the S-BiLSTM model exhibits superior performance in porosity prediction, achieving higher precision and accuracy relative to conventional RNN and LSTM networks. Practical application of the model in a southwestern Chinese oil and gas field yielded promising results, with the S-BiLSTM predictions demonstrating superior accuracy and reliability when compared against cross-plot analysis, Support Vector Machine (SVM) methods, and actual logging data. Such reliable porosity predictions can further support operational decisions in drilling by helping identify areas with more favorable reservoir conditions to optimize target selection. Beyond prediction accuracy, computational efficiency is another critical factor for engineering application of the model. According to the training time presented in Table 6, the S-BiLSTM model exhibits higher computational efficiency than RNN and LSTM models under the current dataset.

However, its stacked bidirectional LSTM layers and attention mechanism may lead to increased computational costs when handling larger-scale or higher-dimensional datasets. While this framework has demonstrated strong porosity prediction performance with real field data, it is worth noting that the synthetic data generated through petrophysical modeling may not fully capture the differences in petrophysical properties of Longmaxi Formation shale induced by varying burial depths and may further fail to reflect the random micro-fracture distribution observed in actual logging data. A key direction for future research will be to integrate core data from different well depths with synthetic data to optimize the petrophysical model; we will further test the S-BiLSTM model on reservoirs with different lithologies to verify its generalization capability across diverse geological settings and plan to combine this model with real-time logging or seismic data to enhance its applicability in dynamic reservoir evaluation processes. The S-BiLSTM model’s generalization capability stems from its powerful feature learning mechanisms. These mechanisms include the stacked bidirectional LSTM structure and the attention mechanism, which enable the model to capture complex patterns and relationships in data. This advantage further makes the model show promising effectiveness on other datasets. To further enhance this generalization capability, more diverse datasets can be explored, and the model’s architecture and hyperparameters can be continuously optimized based on the features of new data.

Conclusions

The stacked bidirectional LSTM neural network prediction method based on petrophysical driving proposed in this paper offers a novel approach for predicting reservoir physical property parameters. Validated in the oilfield application in southwest China, it supports operational decisions in drilling by helping identify areas with more favorable reservoir conditions and thus optimizes target selection. The S-BiLSTM model achieves a porosity prediction accuracy of 92.19% which is 7.81% higher than that of the LSTM model and 14.06% higher than that of the RNN model. It maintains high accuracy under noisy data with 82.81% accuracy at a signal-to-noise ratio of 10dB and 76.12% accuracy at a signal-to-noise ratio of 1dB. Compared with the cross-plot method it reduces the mean absolute error by 0.0032 and improves predictive accuracy by 8.44% and compared with the support vector machine it reduces the mean absolute error by 0.0016 and improves predictive accuracy by 5.37%. It demonstrates good applicability and also shows broad prospects.