Lithology identification method and system based on neural network

By using a neural network-based method to fill in missing values ​​in well logging data and perform sample equalization and hyperparameter optimization, the problems of missing data, sample imbalance, and hyperparameter selection in lithology identification are solved, thereby improving the accuracy of lithology identification and model performance.

CN121995534APending Publication Date: 2026-05-08EAST CHINA UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
EAST CHINA UNIV OF TECH
Filing Date
2026-01-28
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Existing lithology identification methods suffer from problems such as low identification accuracy, model training bias towards the majority class, and low efficiency in hyperparameter selection when faced with missing well logging data, imbalanced samples, and hyperparameter optimization.

Method used

A neural network-based approach was adopted, which filled in missing values ​​in well logging data through temporal convolutional networks, bidirectional gated recurrent units, and attention mechanisms. The whale optimization algorithm was combined for sample equalization and hyperparameter optimization, and the Kmeans++SMOTE algorithm was used for sample oversampling to optimize the hyperparameter configuration of the classification model.

Benefits of technology

It improved the accuracy of lithology identification, achieved accurate filling of missing data values, optimized the scientific nature of sample equalization and model performance, and enhanced the accuracy of lithology identification and classification performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121995534A_ABST
    Figure CN121995534A_ABST
Patent Text Reader

Abstract

The invention discloses a lithology identification method based on a neural network, and the method comprises the steps: obtaining a logging curve, recognizing a missing value in the logging curve, taking the parameter data in the logging curve as sequence data, inputting the sequence data into an established neural network model, carrying out the prediction through the neural network model, obtaining the complementation data corresponding to the missing value, and obtaining the lithology of the logging curve. Filling missing values in the logging curve by using the completion data to obtain a complete logging data set, namely a first data set; based on the first data set, performing equalization processing on lithology classification samples in the first data set to obtain an equalization logging data set, namely a second data set; a whale optimization algorithm is adopted to optimize hyper-parameters of the classification model, target hyper-parameter configuration is obtained, and the classification model is configured; and inputting the second data set into the classification model, and identifying and outputting the lithology category. The method is high in missing value filling precision, excellent in sample equalization effect, remarkable in model performance optimization and high in system practicability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of oil and gas exploration and development technology, and in particular to a lithology identification method and system based on neural networks. Background Technology

[0002] Lithology identification is fundamental to reservoir characterization and mineral resource exploration, and is of great significance to geological work. Currently, lithology identification methods are mainly divided into two categories: one is traditional lithology identification methods, such as cross-plotting, probabilistic statistics, and cluster analysis. These methods rely on the experience and knowledge of geologists, are time-consuming, and have low accuracy when processing complex lithology data. The other category is artificial intelligence methods, including machine learning and deep learning models (such as Bayesian, Support Vector Machine, Backpropagation Neural Network, LSTM Neural Network, XGBoost, GBDT, DNN, BiGRU, GNN, etc.). These models have achieved some success in lithology identification, but still have significant limitations.

[0003] The core problems of existing technologies are mainly reflected in three aspects: First, well logging data is affected by objective factors such as the complexity of the geological environment and the failure of well logging instruments, resulting in missing values ​​for some parameters. Directly discarding missing data will lead to the loss of feature information, thereby reducing the accuracy of lithology identification. Second, the sample distribution of different lithologies is uneven, with the majority class samples accounting for too high a proportion and the minority class samples accounting for an extremely low proportion. This causes the model training to be biased towards the majority class, making it difficult to accurately identify minority class lithologies. Third, the selection of hyperparameters for classification models lacks scientific and effective optimization methods. Traditional trial-and-error methods are inefficient and it is difficult to obtain the optimal hyperparameter configuration, which limits the classification performance of the model.

[0004] To address the aforementioned issues, existing technologies have not yet formed a complete solution. There is an urgent need for a lithology identification technology that can simultaneously solve data gaps, sample imbalances, and hyperparameter optimization, in order to improve the accuracy of lithology identification in complex scenarios. Summary of the Invention

[0005] To address the aforementioned shortcomings in existing technologies, this invention provides a lithology identification method and system based on neural networks. This addresses the issues of well logging data being affected by objective factors such as the complexity of the geological environment and well logging instrument malfunctions, resulting in missing values ​​for some parameters. Directly discarding missing data leads to the loss of feature information, thereby reducing the accuracy of lithology identification. Furthermore, the uneven distribution of samples across different lithologies, with a high proportion of majority class samples and an extremely low proportion of minority class samples, causes model training to favor the majority class, making it difficult to accurately identify minority lithologies. Finally, the lack of scientifically effective optimization methods for hyperparameter selection in classification models, coupled with the inefficiency of traditional trial-and-error methods, makes it difficult to obtain optimal hyperparameter configurations, thus limiting the model's classification performance.

[0006] To achieve the above-mentioned objectives, the technical solution adopted by this invention is as follows: A lithology identification method based on neural networks includes the following steps: Acquire well logging curves and identify missing values ​​in the well logging curves. Input the parameter data in the well logging curves as sequence data into a neural network model. Predict the corresponding missing value completion data through the neural network model. Use the completion data to fill in the missing values ​​in the well logging curves to obtain a complete well logging dataset, i.e., the first dataset. Based on the first dataset, the lithology classification samples in it are equalized to obtain a balanced logging dataset, namely the second dataset. The whale optimization algorithm is used to optimize the hyperparameters of the classification model to obtain the target hyperparameter configuration, and then the classification model is configured. The second dataset is input into the classification model to identify and output lithology categories.

[0007] As a preferred technical solution, the neural network model includes a temporal convolutional network, a bidirectional gated recurrent unit, and an attention mechanism; The temporal convolutional network consists of a causal convolutional layer, a dilated convolutional layer, and residual connections. The causal convolutional layer is used to extract temporal features from the well logging curve, the dilated convolutional layer is used to obtain long-sequence dependencies in the well logging curve, and the residual connections are used to superimpose and transmit the original input information of the causal convolutional layer and the processed output features of the dilated convolutional layer. The bidirectional gated loop unit is used to comprehensively extract the sequence features of the logging curve samples; An attention mechanism is used to assign weights to different parameters in the well logging curve.

[0008] As a preferred technical solution, based on the first dataset, the lithological classification samples are subjected to equalization processing, the steps of which are as follows: Step 1: From the sample set A sample point is randomly selected as the initial cluster center. Step 2: Calculate the shortest distance D(x) between each sample and the initial cluster center, and calculate the probability that each sample will be selected as the next cluster center based on the shortest distance D(x). The probability is the ratio of the square of the sample's D(x) to the sum of the squares of all samples' D(x). ; Step 3: Use the roulette wheel method to select the next cluster center; Step 4: According to the principle of minimum Euclidean distance, assign all samples to the class containing the nearest cluster center; Step 5: Calculate the mean of all sample points in each class, and use it as the cluster center for the next iteration. Use the sum of squared errors formula as the objective function. ; Where Ci represents the cluster center of the i-th cluster, k represents the k clusters, and x represents the Euclidean distance of the corresponding cluster. Step 6: Repeat Step 4 and Step 5 until the clustering results converge.

[0009] As a preferred technical solution, based on the first dataset, the lithology classification samples are subjected to equalization processing, including: using the Kmeans++SMOTE oversampling algorithm, which combines the Kmeans++ clustering algorithm and the SMOTE algorithm, to equalize the lithology classification samples in the dataset. The first dataset is clustered using the Kmeans++ clustering algorithm, which assigns each sample to the nearest cluster center and iteratively updates to obtain the locally optimal k clusters. Clusters with a minority class sample ratio that meet a preset threshold are selected as oversampling target clusters. The number of new samples generated is allocated according to the sparsity of minority class samples in the target cluster. The more sparse the minority class samples are, the more new samples are generated. In each target cluster, the SMOTE algorithm is used to generate new minority class samples to achieve a balance between majority and minority class samples.

[0010] As a preferred technical solution, the whale optimization algorithm is used to optimize the hyperparameters of the classification model, including: The hyperparameter combination obtained from the current optimization is used as the target solution vector X. The target solution vector is approximated by updating the position vectors of each search individual. The position update formula is as follows: X(n+1) = X(n) - (2a・ra)・D1; Where D1 = |2r・X (n)-X(t)|, where X is the distance between the whale and the target. Let be the position vector of the current optimal solution, a be the control parameter, r be a random vector between [0,1], n be the number of iterations, X(n) be the position vector of the search individual in the nth iteration, X(n+1) be the updated position vector of the search individual in the (n+1)th iteration, and t be the current number of iterations. Simultaneously execute the shrinking encirclement strategy and the spiral position update strategy. Update the position vector of each search individual through the spiral function model to approximate the target solution vector. ; Where D2 is the distance between the individual whale and the target, b is a constant used to control the spiral shape, and 1 is a random number between [-1, 1]. Select one of the search individuals contained within itself as a reference individual, and update the position vectors of other search individuals based on the position vector of the reference individual to expand the search range of hyperparameter optimization and realize the global search for the target hyperparameter.

[0011] As a preferred technical solution, the hyperparameters include learning rate, tree depth, number of leaves, and number of iterations; The hyperparameter range obtained after optimization by the whale optimization algorithm includes: learning rate of 0.1-0.2, tree depth of 8-12, number of leaves of 80-120, and number of iterations of 250-300.

[0012] As a preferred technical solution, the logging curve parameters include natural gamma, well diameter, shallow resistivity, middle resistivity, deep resistivity, lithological density, neutron porosity, mechanical rotation speed, P-wave transit time, and density correction value.

[0013] As a preferred technical solution, data preprocessing is also included: the raw logging data in the logging curve is processed using the standard deviation normalization method, and the normalization formula is: x'=(xᵢ-μ) / σ; Where xᵢ is the sample value before normalization, μ is the sample mean, and σ is the sample standard deviation.

[0014] As a preferred technical solution, after identifying the missing values ​​in the logging curve, the method further includes: evaluating the missing value filling effect using root mean square error, mean absolute error, and coefficient of determination, requiring root mean square error RMSE ≤ 0.12, mean absolute error MAE ≤ 0.09, and coefficient of determination R-Square ≥ 0.82.

[0015] The present invention also provides a lithology identification system based on a neural network, comprising: The missing value imputation module acquires well logging curves and identifies missing values ​​in the well logging curves. It inputs the parameter data in the well logging curves as sequence data into a neural network model, predicts the imputation data corresponding to the missing values ​​through the neural network model, and uses the imputation data to fill the missing values ​​in the well logging curves to obtain a complete well logging dataset, i.e., the first dataset. The sample equalization module is used to equalize the lithology classification samples in the first dataset to obtain a balanced logging dataset, i.e., the second dataset. The hyperparameter optimization module is used to optimize the hyperparameters of the classification model using the whale optimization algorithm to obtain the optimal hyperparameter configuration and configure the classification model. The lithology identification module is used to load the classification model with the target hyperparameter configuration, receive the second dataset, identify and output the lithology category.

[0016] The beneficial effects of this invention are as follows: High accuracy in missing value imputation: By adopting a neural network model, combining the strong temporal feature extraction capability of temporal convolutional networks, the full sequence feature capture capability of bidirectional gated recurrent units, and the key feature enhancement effect of attention mechanisms, the system can accurately predict and imput missing values ​​in well logging data. The imputation effect meets the requirements of engineering applications and avoids the loss of feature information caused by missing data.

[0017] Excellent sample equalization effect: The proposed oversampling algorithm ensures the rationality of cluster centers through clustering, selects safe regions for oversampling, and dynamically allocates the number of new samples generated by combining the sparsity of minority class samples. This effectively solves the problem that traditional algorithms tend to generate samples in noisy regions, improves the scientificity and effectiveness of sample equalization, and provides a high-quality data foundation for model training.

[0018] Significant model performance optimization: The whale optimization algorithm is used to globally optimize the hyperparameters of the classification model, avoiding the blindness of traditional trial and error methods and obtaining the optimal hyperparameter configuration, which optimizes the model in terms of training speed, memory consumption and classification accuracy. The lithology identification accuracy of the method of this invention reaches 92.94%, which is significantly improved in classification performance compared with existing models (such as KNN, decision tree, random forest and XGBoost).

[0019] The system is highly practical: each module and method step of the lithology identification system corresponds one-to-one, realizing the fully automated processing of data preprocessing, missing value imputation, sample balancing, hyperparameter optimization, and lithology identification. It is applicable to various lithology identification scenarios in oil and gas exploration and development, and has significant advantages in well logging data processing under complex geological conditions, providing reliable technical support for geological work. Attached Figure Description

[0020] Figure 1 This is a schematic diagram of the dilated convolutional layer of the present invention; Figure 2 This is a schematic diagram of the residual connections of the temporal convolutional network of the present invention; Figure 3 This is a schematic diagram of the gated loop unit structure of the present invention; Figure 4 This is a schematic diagram of the bidirectional gated loop unit of the present invention; Figure 5 This is a schematic diagram illustrating the steps of the Kmeans++SMOTE oversampling algorithm used in this invention; Figure 6This is a schematic flowchart of the lithology identification method of the present invention; Figure 7 This is a schematic diagram showing the distribution of eight lithological samples in the Beihai area according to the present invention. Figure 8 This is a schematic diagram showing the proportion of missing logging parameters in this invention; Figure 9 This is a schematic diagram comparing the predicted and actual values ​​of lithological density according to the present invention. Figure 10 This is a schematic diagram comparing the results of unsampled samples, SMOTE sampling, and Kmeans++SMOTE sampling in this invention; Figure 11 The bar chart shows the evaluation indexes of the lithology identification model of the present invention. Figure 12 This is a schematic diagram of the prediction result matrix of the Kmeans++SMOTE post-sampling classification model of the present invention; Figure 13 This is a schematic diagram showing the lithological stratification identification results of different models of the present invention. Detailed Implementation

[0021] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0022] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0023] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.

[0024] In one implementation, such as Figures 1-13 This paper provides a lithology identification method based on neural networks, which includes the following steps: Step S1: Obtain well logging curves and identify missing values ​​in the well logging curves. Input the parameter data in the well logging curves as sequence data into the established neural network model. Predict the corresponding missing value completion data through the neural network model. Use the completion data to fill in the missing values ​​in the well logging curves to obtain a complete well logging dataset, i.e., the first dataset.

[0025] As a preferred technical solution, data preprocessing is also included: the raw logging data in the logging curve is processed using the standard deviation normalization method, and the normalization formula is: x'=(xᵢ-μ) / σ; Where xᵢ is the sample value before normalization, μ is the sample mean, σ is the sample standard deviation, and x' is the sample value after normalization (output value), used to eliminate the dimensional differences of logging parameters.

[0026] It should be explained that xᵢ is the i-th original logging sample value before normalization, which can correspond to any one of the 10 logging parameters such as natural gamma and wellbore diameter. μ is the mean of all original samples of a certain logging parameter (e.g., the average of all natural gamma data), reflecting the overall level of the parameter. σ is the standard deviation of all original samples of a certain logging parameter, reflecting the degree of numerical dispersion of the parameter (e.g., the fluctuation range of natural gamma data).

[0027] The preprocessed data conforms to a normal distribution, providing standardized input for subsequent model training.

[0028] Standard deviation normalization is the process of transforming parameter data from different ranges to the same scale.

[0029] Furthermore, the neural network model includes a temporal convolutional network, a bidirectional gated recurrent unit, and an attention mechanism; The temporal convolutional network consists of a causal convolutional layer, a dilated convolutional layer, and residual connections. The causal convolutional layer is used to extract temporal features from the well logging curve, the dilated convolutional layer is used to obtain long-sequence dependencies in the well logging curve, and the residual connections are used to superimpose and transmit the original input information of the causal convolutional layer and the processed output features of the dilated convolutional layer. The bidirectional gated loop unit is used to comprehensively extract the sequence features of the logging curve samples; An attention mechanism is used to assign weights to different parameters in the well logging curve.

[0030] The output formula for the dilated convolutional layer is as follows: ; X is the input sequence, k is the kernel size, Xs−di is the input of the current state and the previous state, and d is the dilation coefficient.

[0031] F(s) is the output feature value after dilated convolution (the output at the s-th position), used to extract long-sequence dependency features of the well logging curve. X is the input well logging sequence data (vector), arranged in depth order (e.g., the natural gamma sequence of a formation). fd is the convolution kernel with dilation coefficient d, the core tool for feature extraction; d determines the "field of view" of the convolution (the larger d is, the greater the depth span covered). k is the size of the convolution kernel (i.e., the number of elements contained in the convolution kernel), for example, k=3 means the convolution kernel consists of 3 weight values. f(i) is the weight value at the i-th position of the convolution kernel, used to perform weighted calculation on the corresponding position of the input sequence. s is the position index of the output sequence (corresponding to the depth position of the well logging curve). Xs−di is the sample value at the (s−d×i)-th position in the input sequence, reflecting the correlation extraction of historical data "at intervals of d positions" by dilated convolution.

[0032] Residual connections can avoid gradient explosion or vanishing problems in deep networks, improving model stability and generalization.

[0033] The bidirectional gated loop unit adds a backpropagation layer to the gated loop unit, enabling comprehensive extraction of the sequence features of logging curve samples. Its calculation process includes dynamic adjustment of the update gate and reset gate, as shown in the following formula: zt=σ(W(z)xt+U(z)ht−1); rt=σ(W(r)xt+U(r)ht−1); ht=zt⋅tanh(rt⋅U(r)ht−1+wtxt)+(1−zt)⋅ht−1; zt is the update gate, rt is the reset gate, σ and tanh are the activation functions, W(z) and U(z) are the update gate weights, W(r) and U(r) are the reset gate weights, wt is the neuron weight at time t, xt is the input at time t, and ht−1 is the hidden state at time t−1.

[0034] Specifically, zt is the update gate output value at time t (range [0,1]), used to control the retention ratio of historical hidden states (the closer the value is to 1, the more historical information is retained). σ is the sigmoid activation function, used to map the calculation result to the interval [0,1], achieving a "gating" effect. W(z) is the weight matrix from the input layer to the update gate (dimension is "update gate output dimension × number of logging parameters"), used to weight the current input xt. xt is the input vector at time t (containing the current depth sample values ​​of 10 logging parameters). U(z) is the weight matrix from the hidden layer to the update gate (dimension is "update gate output dimension × hidden layer dimension"), used to weight the historical hidden state ht−1. ht−1 is the hidden layer state vector at time t−1, storing the logging feature information of the previous depth position.

[0035] rt is the reset gate output value at time t (range [0,1]), used to control the "forgotten" ratio of historical hidden states (the closer the value is to 0, the more historical information is forgotten). W(r) is the weight matrix from the input layer to the reset gate (dimension consistent with W(z)), weighted by the current input xt. U(r) is the weight matrix from the hidden layer to the reset gate (dimension consistent with U(z)), weighted by the historical hidden state ht−1. σ, xt, and ht−1 have the same meaning as the update gate formula, maintaining consistency.

[0036] ht is the updated hidden layer state vector at time t, which integrates the current input features and historical state features, and is used for subsequent missing value prediction. tanh is the hyperbolic tangent activation function, used to perform a nonlinear transformation on the fused features (value range [−1,1]). wt is the weight vector corresponding to the input vector xt at time t (dimension is "hidden layer dimension × number of logging parameters"), specifically used for weighting the current input features. rt∙U(r)ht−1 is the historical features after being filtered by the reset gate (only key historical information is retained). zt∙[...] is the current feature weight part controlled by the update gate; (1−zt)∙ht−1 is the historical feature weight part controlled by the update gate. The weighted sum of the two yields the final hidden state.

[0037] Attention mechanisms can highlight the contribution of key features to the prediction of missing values, thereby improving the accuracy of data completion.

[0038] Step S2: Based on the first dataset, perform equalization processing on the lithology classification samples to obtain an equalized logging dataset, i.e., the second dataset.

[0039] Step S3: Use the whale optimization algorithm to optimize the hyperparameters of the classification model, obtain the target hyperparameter configuration, and configure the classification model.

[0040] The classification model can use the LightGBM algorithm. The basic principle of LightGBM (Light Gradient Boosting Machine) is to fuse extreme gradient boosting tree (GBoost), histogram algorithm, one-sided gradient sampling (GOSS) algorithm, and xclusive feature binding (EFB) algorithm.

[0041] The histogram algorithm discretizes continuous floating-point feature values ​​into n integers and constructs a histogram of width n. While traversing the data, it accumulates statistics in the histogram using the discretized values ​​as indices, and finally finds the optimal decision tree split point.

[0042] The purpose of the one-sided gradient sampling algorithm is to discard some samples that do not help in calculating information gain, and use only the remaining samples to calculate information gain. This algorithm aims to reduce the amount of data while maintaining accuracy.

[0043] The core of the mutual exclusion feature binding algorithm is to reduce the number of features used to construct the histogram when the features contain a large number of sparse features, thereby reducing the computational complexity.

[0044] Compared to traditional decision tree algorithms, LightGBM uses a Leaf-Wise strategy instead of a Level-Wise strategy to generate binary trees. Specifically, when partitioning a node, it finds the leaf with the largest splitting gain from all current leaves and splits it, then repeats this process until a complete tree is generated. This method is more efficient.

[0045] LightGBM makes many improvements to XGBoost, resulting in faster training speed, lower memory consumption, and higher accuracy with the same amount of data.

[0046] Step S4: Input the second dataset into the classification model to identify and output the lithology category.

[0047] Furthermore, after identifying the missing values ​​in the logging curve, the method further includes: using root mean square error, mean absolute error, and coefficient of determination to evaluate the effect of missing value filling.

[0048] The requirements are: root mean square error (RMSE) ≤ 0.12, mean absolute error (MAE) ≤ 0.09, and coefficient of determination (R-Square) ≥ 0.82.

[0049] The smaller the RMSE (mean deviation) between the predicted value (the missing value filled) and the true value (the actual measurement assuming no missing values), the more accurate the filling. The smaller the MAE (mean absolute deviation) between the predicted value and the true value, the more stable the filling effect.

[0050] The closer the R-squared value is to 1, the better the trend of the predicted and actual values ​​is.

[0051] The formulas for calculating the evaluation indicators are as follows: ; ; Where yi is the true value of the i-th data point, y^i is the predicted value of the i-th data point, yˉ is the mean of the true values, and n is the total number of data points.

[0052] It should be noted that in existing technologies, the RMSE of filling missing values ​​in well logging data is usually between 0.1 and 0.2. The threshold of this scheme is set to ≤0.12 to ensure that the deviation of the filled value is within an acceptable range and will not affect subsequent lithology identification.

[0053] MAE is usually smaller than RMSE. The threshold of this scheme matches RMSE, indicating that the filling effect is both accurate and stable, avoiding the situation where "most predictions are accurate but a few predictions have extremely large deviations".

[0054] An R-squared value of ≥0.8 indicates a "good fit," and this scheme sets it to ≥0.82, meaning that the predicted value can follow the trend of the actual value well—for example, when the actual value increases with depth, the predicted value can also increase synchronously, ensuring the logic of filling in the data.

[0055] The logging parameters include natural gamma (GR), caliber (CALI), shallow resistivity (RSHA), medium resistivity (RMED), deep resistivity (RDEP), lithological density (RHOB), neutron porosity (NPHI), mechanical rotation speed (ROP), longitudinal wave transit time (DTC), and density correction value (DRHO).

[0056] Furthermore, based on the first dataset, the lithological classification samples are subjected to equalization processing, the steps of which are as follows: Step 1: From the sample set A sample point is randomly selected as the initial cluster center. Step 2: Calculate the shortest distance D(x) between each sample and the initial cluster center, and calculate the probability that each sample will be selected as the next cluster center based on the shortest distance D(x). The probability is the ratio of the square of the sample's D(x) to the sum of the squares of all samples' D(x). ; Step 3: Use the roulette wheel method to select the next cluster center; Step 4: According to the principle of minimum Euclidean distance, assign all samples to the class containing the nearest cluster center; The Euclidean distance formula is: ; in , Given two samples, n is the number of features. `dist(X,Y)` is the Euclidean distance between samples X and Y, used to measure the similarity between the two logging samples (the smaller the distance, the higher the similarity). X is the feature vector of the first logging sample (containing 10 logging parameters, i.e., n=10), such as X=(GR1, CALI1, ..., DRHO1). Y is the feature vector of the second logging sample, with the same structure as X, such as Y=(GR2, CALI2, ..., DRHO2). `xj` is the j-th logging parameter value of sample X (j=1 to 10, corresponding to the 10 parameters). `yj` is the j-th logging parameter value of sample Y. `n` is the feature dimension, i.e., the number of parameters in the logging curve (fixed at 10).

[0057] Step 5: Calculate the mean of all sample points in each class, and use it as the cluster center for the next iteration. Use the sum of squared errors (SSE) formula as the objective function. ; Where Ci represents the cluster center of the i-th cluster, k represents the k clusters, and x represents the Euclidean distance to the corresponding cluster. SSE is the sum of squared errors from all samples to their respective cluster centers, used to evaluate the clustering effect. Ci is the center vector of the i-th cluster, composed of the mean values ​​of all parameters of all samples in the cluster, such as Ci = (GRavg, CALIavg, ..., DRHOavg). x is the feature vector of a well logging sample belonging to the i-th cluster (with the same structure as Ci). (Ci−x)2 is the sum of squared differences of the parameters between sample x and cluster center Ci (i.e., the square of the Euclidean distance).

[0058] Step 6: Repeat Step 4 and Step 5 until the clustering results converge.

[0059] Furthermore, based on the first dataset, the lithology classification samples are subjected to equalization processing, including: using the Kmeans++SMOTE oversampling algorithm, which combines the Kmeans++ clustering algorithm and the SMOTE algorithm, to equalize the lithology classification samples in the dataset. The first dataset is clustered using the Kmeans++ clustering algorithm, which assigns each sample to the nearest cluster center and iteratively updates to obtain the locally optimal k clusters. Clusters with a minority class sample ratio that meet a preset threshold are selected as oversampling target clusters. The number of new samples generated is allocated according to the sparsity of minority class samples in the target cluster. The more sparse the minority class samples are, the more new samples are generated. In each target cluster, the SMOTE algorithm is used to generate new minority class samples, achieving a balance between majority and minority class samples. This avoids overfitting caused by generating samples in noisy regions.

[0060] Furthermore, the hyperparameters of the classification model are optimized using the whale optimization algorithm, including: Surrounding the prey phase: The combination of hyperparameters obtained from the current optimization is used as the target solution vector X. The target solution vector is approximated by updating the position vectors of each search individual. The position update formula is as follows: X(n+1) = X(n) - (2a・ra)・D1; Where D1 = |2r・X (n)-X(t)|, where X is the distance between the whale and the target. Let be the position vector of the current optimal solution, a be the control parameter, r be a random vector between [0,1], n be the number of iterations, X(n) be the position vector of the search individual in the nth iteration, X(n+1) be the updated position vector of the search individual in the (n+1)th iteration, and t be the current number of iterations. The control parameter 'a' is large in the early stage of iteration, resulting in a large search step size; 'a' is small in the later stage of iteration, resulting in a small search step size, achieving "global search to local fine-tuning optimization". (2a⋅r−a) is the search step size adjustment factor (range [−a,a]), which controls the magnitude of position updates.

[0061] Bubble web attack phase: Simultaneously execute the shrinking encirclement strategy and the spiral position update strategy. Update the position vector of each search individual through the spiral function model to approximate the target solution vector. ; Where D2 is the distance between the individual whale and the target, b is a constant used to control the spiral shape, and l is a random number between [-1, 1]. X(t+1) is the updated position vector of the search individual at the (t+1)th iteration (one of the two strategies is randomly selected for execution). D2 is the Euclidean distance between the current search individual and the optimal solution X∗(n) (calculated in the same way as D1, only the sign is unified to D2 to distinguish the stages).

[0062] b is the helical shape control constant (fixed at 1, an industry standard setting) to ensure the stability of the helical trajectory. l controls the direction (positive / negative) and step size of the helical trajectory (the larger the absolute value, the larger the step size). ebl is an exponential function used to control the stretching of the helical trajectory (the larger bl is, the larger the helical radius). cos(2πl) is a cosine function used to generate the periodic variation of the helical trajectory (value range [−1, 1]).

[0063] Prey search phase: Select one of the search individuals contained within itself as a reference individual, and update the position vectors of other search individuals based on the position vector of the reference individual to expand the search range of hyperparameter optimization and realize the global search of the target hyperparameter.

[0064] As a preferred technical solution, the hyperparameters include learning rate, tree depth, number of leaves, and number of iterations; The hyperparameter range obtained after optimization by the whale optimization algorithm includes: learning rate of 0.1-0.2, tree depth of 8-12, number of leaves of 80-120, and number of iterations of 250-300.

[0065] Explanation of terms in the above embodiments: Well logging curves: During oil exploration, well logging instruments are lowered into the well to measure the physical properties of the formation (such as radioactivity, resistivity, etc.), and the measurement results are plotted as a continuous curve, which is equivalent to the formation's "health check report".

[0066] Missing values: During the logging process, due to instrument malfunction, complex formations, or other reasons, some measurement data may be missing (for example, the "lithological density" at a certain depth may not be measured).

[0067] Sequence data: Well logging data is recorded in depth order, and the data before and after the data are logically related (such as the stratigraphic properties at a depth of 1000 meters and the correlation at a depth of 1001 meters). This type of data arranged in sequence is called sequence data.

[0068] Neural network model: A computer model that mimics the workings of neurons in the human brain and can automatically learn patterns from data (such as learning "which combinations of logging parameters correspond to sandstone").

[0069] Sample equalization: The number of measurement samples varies greatly among different lithologies (for example, shale samples account for 40%, while tuff only accounts for 2%). The model will "favor" the lithology with more samples. Equalization is to make the number of samples of various lithologies relatively balanced.

[0070] Whale Optimization Algorithm: An intelligent algorithm that mimics the hunting behavior of humpback whales to automatically find the optimal parameters for a model.

[0071] Classification model: The core tool ultimately used to determine lithology (e.g., inputting well logging data and outputting "sandstone" or "shale").

[0072] One embodiment of the present invention also provides a lithology identification system based on a neural network, comprising the following modules: The missing value imputation module acquires well logging curves and identifies missing values ​​in the well logging curves. It inputs the parameter data in the well logging curves as sequence data into a neural network model, predicts the imputation data corresponding to the missing values ​​through the neural network model, and uses the imputation data to fill the missing values ​​in the well logging curves to obtain a complete well logging dataset, i.e., the first dataset.

[0073] The sample equalization module is used to equalize the lithology classification samples in the first dataset to obtain a balanced logging dataset, i.e., the second dataset.

[0074] The hyperparameter optimization module is used to optimize the hyperparameters of the classification model using the whale optimization algorithm to obtain the optimal hyperparameter configuration and configure the classification model.

[0075] The lithology identification module is used to load the classification model with the target hyperparameter configuration, receive the second dataset, identify and output the lithology category.

[0076] Its main connection relationship is as follows: the missing value filling module of the original logging curve input system repairs the data and obtains complete data; the complete data is input into the sample balancing module to balance the number of samples of various lithologies and obtain balanced data; the hyperparameter optimization module automatically adjusts the classification model parameters to obtain the optimal model; the balanced data is input into the optimal model lithology identification module to output the lithology results.

[0077] Dataset analysis in one embodiment of the present invention This study area is located in the North Sea, in the Southern Viking Graben region near Norway, and includes 20 wells from this area. Each dataset contains 10 feature variables and 1 lithofacies label. The dataset includes eight lithologies: sandstone, sandy shale, shale, marl, limestone, chalk, salt rock, and tuff. Their distribution in the dataset is shown below. Figure 2 As shown, compared to other lithologies, shale accounts for the largest share, reaching 40%, while tuff accounts for the smallest share, only 2%, showing an extremely uneven distribution of lithologies.

[0078] Tables 1 and 2 provide detailed information on well logging curve characteristics, lithology types, and corresponding labels, respectively.

[0079] Table 1 Characteristics of Well Logging Curves Table 2 Lithological Types and Corresponding Labels Dataset selection First, complete data from one well, totaling 7886 data sets, was extracted as a blind well. This blind well was used to verify the lithology classification ability of the proposed Kmeans++SMOTE-WOA-LightGBM classification algorithm. The remaining 19 wells were divided into training and testing sets in a 7:3 ratio for training the model of this invention. Table 3 shows the data partitioning of the blind wells and the remaining wells.

[0080] Table 3 Dataset Partitioning Data preprocessing Because the dimensions of the parameters in the well logging data are inconsistent, and there are also large numerical differences between the values ​​of the same well logging parameter, this invention uses standard deviation normalization to preprocess the dataset to improve the prediction accuracy.

[0081] Evaluation indicators To evaluate the predictive performance of the neural network model on well logging parameters (errors), mean square error (RMSE), mean absolute error (MAE), mean absolute percentage error (MAPE), and coefficient of determination (R-Square) were selected.

[0082] In order to evaluate the classification ability of each machine learning method after K-means++SMOTE oversampling, this invention uses a confusion matrix as the basis, and the evaluation metrics used include accuracy, precision, recall, and F1 score.

[0083] The confusion matrix, also known as the error matrix, is used to represent accuracy evaluation. Table 4 shows an example (the classification confusion matrix is ​​as follows:). From the confusion matrix, we know that a true positive instance represents a sample that is actually positive, but the model predicts it as negative (TP); a true negative instance represents a sample that is actually negative, but the model also predicts it as negative (TN); correspondingly, a false positive instance represents a sample that is actually negative but is predicted as positive (FP); a false negative instance represents a sample that is actually negative and is also predicted as negative (FN). Therefore, TP and TN represent the correctly predicted parts, while FN and FP represent the incorrectly predicted parts.

[0084] Accuracy is used to represent the precision of a model. The higher the model's accuracy, the better its performance. The formula is: Precision represents the proportion of samples that the model identifies as positive, but which are actually positive. The formula is: Recall, also known as recall, reflects how many positive samples a classifier can predict. The formula is: F1 score is a weighted average of precision and recall, calculated as follows: Lithology identification based on Kmeans++SMOTE-WOA-LightGBM; Fill in missing values ​​using the TCN-BiGRU-Attention model; In actual well logging operations, the complex formation conditions and potential malfunctions of logging instruments can lead to missing or outlier values ​​for certain parameters in the logging curves. When analyzing and evaluating the logging data in such cases, the missing data poses a significant challenge to geological work. Directly discarding certain parameters may decrease the accuracy of lithology identification. The missing values ​​in the dataset used in this experiment are as follows: Figure 8 As shown.

[0085] according to Figure 8 The missing value histogram shows that lithological density (RHOB) has a large number of missing values ​​in this dataset, with approximately 22% (29,000 data points) missing, mainly concentrated in a few wells. Therefore, this invention first uses the TCN-BIGRU-Attention model to impute the missing values ​​in the RHOB logging curves. The complete data for each parameter in the logging curves is used as the dataset for the neural network model, and it is divided into training, validation, and test sets in a 6:2:2 ratio. Figure 9 This is to compare the predicted values ​​with the actual values ​​in the test set data.

[0086] As shown in the image, the predicted values ​​of RHOB are generally close to the actual values. Table 5 shows the evaluation metrics for the predicted values; both RMSE and MAE values ​​are relatively small, and the closer the R-squared value is to 1, the higher the fit. Therefore, it is evident that the neural network model of this invention is effective in filling in missing values.

[0087] Table 5 Evaluation Indicators for RHOB Predicted Values Based on Kmeans++SMOTE oversampling logging data After the missing values ​​were filled, the Kmeans++SMOTE oversampling technique was used to resample the data except for the blind wells. Figure 10 Using the cross plot of lithological density and natural gamma as an example, the effects of two oversampling techniques, SMOTE and Kmeans++SMOTE, are demonstrated.

[0088] The newly generated lithological samples are indicated by crosses. (a) shows the original data samples, where shale is the most numerous and is the majority class, while other lithological types are the minority classes. Since SMOTE performs random sampling around the minority classes, although it generates a large number of new minority class samples, it may also generate samples or duplicate data in noisy areas, as shown in Figure (b). After SMOTE sampling, samples were generated in noisy areas of sandstone, limestone, and marl, which may affect the overall lithological identification. Figure (c) shows the data after Kmeans++SMOTE sampling, which mainly generates new samples in minority class clusters, effectively avoiding the introduction of noisy data while generating new samples. After resampling, the lithological data of each dataset, excluding blind wells, are shown in Table 6.

[0089] Table 6. Number of lithologies after SMOTE and Kmenas++SMOTE sampling. The SMOTE algorithm increases the number of minority lithologies to the same level as the number of majority lithologies, while Kmeans++SMOTE selectively generates the number of minority lithologies for each type of lithology cluster.

[0090] LightGBM Hyperparameter Optimization Based on Whale Optimization Algorithm After processing the data using the above steps, balanced lithological data was obtained. Based on this data, the whale optimization algorithm was used to optimize several important hyperparameters in the LightGBM model, including the learning rate, tree depth, number of leaves, and number of iterations (n_estimators). The optimization results after multiple experiments are shown in Table 7 below. Table 7. Hyperparameter optimization of LightGBM based on the whale optimization algorithm. Comparison Experiment of Different Models To verify the effectiveness of the model, we compared the performance of KNN, Random Forest, Decision Tree, and XGBoost models on blind well lithology classification after no oversampling, SMOTE sampling, and Kmeans++SMOTE sampling. Figure 11 The graph compares the evaluation metrics of the five models. As shown in the figure, the three metrics of decision tree, KNN and random forest models are improved after using SMOTE and Kmeans++SMOTE. However, the accuracy of XGBoost and LightGBM actually decreased after using SMOTE sampling. The possible reason is that the SMOTE algorithm generates a large amount of data in noisy regions, which leads to a decrease in the model recognition accuracy.

[0091] Table 8. Accuracy of each model before and after sampling. Depend on Figure 12 The confusion matrix shows that, after using Kmeans++SMOTE combined with the whale optimization algorithm, the LightGBM model achieved the best overall classification performance. Among the eight lithologies—sandstone, sandy shale, shale, marl, limestone, chalk, salt rock, and tuff—the accuracies were 100%, 99.52%, 97.14%, 100%, 60.62%, 94.44%, 100%, and 32.97%, respectively. Table 8 shows the accuracy and processing time of each model after combining Kmeans++SMOTE. The decision tree model showed the largest accuracy improvement of 17.05%, XGBoost had the highest accuracy before sampling, while LightGBM achieved an accuracy of 92.94% after sampling, and also had the shortest processing time.

[0092] The combined lithology identification accuracies of the five models—KNN, Decision Tree, Random Forest, XGBoost, and LightGBM—were 69.59%, 62.97%, 72.52%, 84.36%, and 92.94%, respectively. Figure 13 The results of blind well identification for each model show that, due to the relatively concentrated distribution of salt rock in the dataset, the identification rates of each model are relatively high. The XGBoost model is poor in identifying sandstone and shale at a depth of 2100m to 2300m. Overall, the LightGBM model achieves the highest identification rate of 92.94%, and its identification results for different lithologies are basically consistent with the actual lithology of the formation. Therefore, the Kmeans++SMOTE-WOA-LightGBM proposed in this invention has better comprehensive performance and classification ability compared to other models.

[0093] This invention proposes a lithology identification method based on Kmeans++SMOTE-WOA-LightGBM, which achieves accurate identification of eight lithologies—sandstone, sandy shale, shale, marl, limestone, chalk, salt rock, and tuff—from well logging data.

[0094] This invention first uses the TCN-BIGRU-ATTENTION model to predict and fill in missing data in well logging data. The features of the temporal convolutional network are stronger than those of CNN. Then, it is combined with bidirectional gated recurrent units to predict missing values. The results show that the prediction effect is good, which provides a foundation for further research. For lithology with uneven distribution in the dataset, Kmeans++SMOTE was used for resampling, and the classification model was then optimized using the whale optimization algorithm for hyperparameters. Based on this, the classification ability of each model was significantly improved compared to before the unsampled optimization, with LightGBM achieving a final accuracy of 92.94%.

[0095] It is important to note that the constructions and arrangements of this application shown in several different exemplary embodiments are merely illustrative. Although only a few embodiments are described in detail in this disclosure, those who consult this disclosure will readily understand that many modifications are possible (e.g., changes in the size, dimensions, structure, shape, and proportions of various elements, as well as parameter values ​​(e.g., temperature, pressure, etc.), mounting arrangements, use of materials, color, orientation, etc.) without substantially departing from the novel teachings and advantages of the subject matter described in this application). For example, an element shown as integrally formed may be composed of multiple parts or elements, the position of elements may be inverted or otherwise altered, and the nature or number or position of discrete elements may be changed or altered. Therefore, all such modifications are intended to be included within the scope of the invention. The order or sequence of any process or method steps may be changed or rearranged according to alternative embodiments. In the claims, any "device plus function" clause is intended to cover the structure described herein that performs the function, and not only structurally equivalent but also equivalent in structure. Other substitutions, modifications, alterations, and omissions may be made in the design, operation, and arrangement of the exemplary embodiments without departing from the scope of the invention. Therefore, the present invention is not limited to the specific embodiments, but extends to various modifications that still fall within the scope of the appended claims.

[0096] Furthermore, in order to provide a concise description of exemplary embodiments, not all features of actual embodiments (i.e., those features that are not relevant to the currently considered best mode for carrying out the invention, or those features that are not relevant to implementing the invention) may be omitted.

[0097] It should be understood that numerous specific implementation decisions can be made during the development of any practical implementation, such as in any engineering or design project. Such development efforts may be complex and time-consuming, but for those skilled in the art who benefit from this disclosure, the development effort will be a routine work of design, manufacturing, and production without requiring much experimentation.

[0098] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A lithology identification method based on neural networks, characterized in that, Includes the following steps: Acquire well logging curves and identify missing values ​​in the well logging curves. Input the parameter data in the well logging curves as sequence data into a neural network model. Predict the corresponding missing value completion data through the neural network model. Use the completion data to fill in the missing values ​​in the well logging curves to obtain a complete well logging dataset, i.e., the first dataset. Based on the first dataset, the lithology classification samples in it are equalized to obtain a balanced logging dataset, namely the second dataset. The whale optimization algorithm is used to optimize the hyperparameters of the classification model to obtain the target hyperparameter configuration, and then the classification model is configured. The second dataset is input into the classification model to identify and output lithology categories.

2. The lithology identification method based on neural networks according to claim 1, characterized in that: The neural network model includes a temporal convolutional network, a bidirectional gated recurrent unit, and an attention mechanism; The temporal convolutional network consists of a causal convolutional layer, a dilated convolutional layer, and residual connections. The causal convolutional layer is used to extract temporal features from the well logging curve, the dilated convolutional layer is used to obtain long-sequence dependencies in the well logging curve, and the residual connections are used to superimpose and transmit the original input information of the causal convolutional layer and the processed output features of the dilated convolutional layer. The bidirectional gated loop unit is used to comprehensively extract the sequence features of the logging curve samples; An attention mechanism is used to assign weights to different parameters in the well logging curve.

3. The lithology identification method based on neural networks according to claim 1, characterized in that: Based on the first dataset, the lithology classification samples are subjected to equalization processing, the steps of which are as follows: Step 1: From the sample set A sample point is randomly selected as the initial cluster center. Step 2: Calculate the shortest distance D(x) between each sample and the initial cluster center, and calculate the probability that each sample will be selected as the next cluster center based on the shortest distance D(x). The probability is the ratio of the square of the sample's D(x) to the sum of the squares of all samples' D(x). ; Step 3: Use the roulette wheel method to select the next cluster center; Step 4: According to the principle of minimum Euclidean distance, assign all samples to the class containing the nearest cluster center; Step 5: Calculate the mean of all sample points in each class, and use it as the cluster center for the next iteration. Use the sum of squared errors formula as the objective function. ; Where Ci represents the cluster center of the i-th cluster, k represents the k clusters, and x represents the Euclidean distance of the corresponding cluster. Step 6: Repeat Step 4 and Step 5 until the clustering results converge.

4. The lithology identification method based on neural networks according to claim 1, characterized in that: Based on the first dataset, the lithology classification samples are subjected to equalization processing, including: using the Kmeans++SMOTE oversampling algorithm, which combines the Kmeans++ clustering algorithm and the SMOTE algorithm, to equalize the lithology classification samples in the dataset. The first dataset is clustered using the Kmeans++ clustering algorithm, which assigns each sample to the nearest cluster center and iteratively updates to obtain the locally optimal k clusters. Clusters with a minority class sample ratio that meet a preset threshold are selected as oversampling target clusters. The number of new samples generated is allocated according to the sparsity of minority class samples in the target cluster. The more sparse the minority class samples are, the more new samples are generated. In each target cluster, the SMOTE algorithm is used to generate new minority class samples to achieve a balance between majority and minority class samples.

5. The lithology identification method based on neural networks according to claim 1, characterized in that: The whale optimization algorithm is used to optimize the hyperparameters of the classification model, including: The hyperparameter combination obtained from the current optimization is used as the target solution vector X. The target solution vector is approximated by updating the position vectors of each search individual. The position update formula is as follows: X(n+1) = X(n) - (2a・ra)・D1; Where D1 = |2r・X (n)-X(t)|, where X is the distance between the whale and the target. Let be the position vector of the current optimal solution, a be the control parameter, r be a random vector between [0,1], n be the number of iterations, X(n) be the position vector of the search individual in the nth iteration, X(n+1) be the updated position vector of the search individual in the (n+1)th iteration, and t be the current number of iterations. Simultaneously execute the shrinking encirclement strategy and the spiral position update strategy. Update the position vector of each search individual through the spiral function model to approximate the target solution vector. ; Where D2 is the distance between the individual whale and the target, b is a constant used to control the spiral shape, and l is a random number between [-1, 1]. Select one of the search individuals contained within itself as a reference individual, and update the position vectors of other search individuals based on the position vector of the reference individual to expand the search range of hyperparameter optimization and realize the global search for the target hyperparameter.

6. The lithology identification method based on neural networks according to claim 1, characterized in that: The hyperparameters include learning rate, tree depth, number of leaves, and number of iterations; The hyperparameter range obtained after optimization by the whale optimization algorithm includes: learning rate of 0.1-0.2, tree depth of 8-12, number of leaves of 80-120, and number of iterations of 250-300.

7. The lithology identification method based on neural networks according to claim 1, characterized in that: The logging curve parameters include natural gamma, well diameter, shallow resistivity, middle resistivity, deep resistivity, lithological density, neutron porosity, mechanical rotation speed, P-wave transit time, and density correction value.

8. The lithology identification method based on neural networks according to claim 1, characterized in that: This also includes data preprocessing: the raw logging data in the logging curves is processed using the standard deviation normalization method. The normalization formula is: x'=(xᵢ-μ) / σ; Where xᵢ is the sample value before normalization, μ is the sample mean, and σ is the sample standard deviation.

9. The lithology identification method based on neural networks according to claim 1, characterized in that: After identifying the missing values ​​in the logging curve, the method further includes: evaluating the missing value filling effect using root mean square error, mean absolute error, and coefficient of determination, requiring root mean square error RMSE ≤ 0.12, mean absolute error MAE ≤ 0.09, and coefficient of determination R-Square ≥ 0.

82.

10. A lithology identification system based on neural networks, characterized in that, include: The missing value imputation module acquires well logging curves and identifies missing values ​​in the well logging curves. It inputs the parameter data in the well logging curves as sequence data into a neural network model, predicts the imputation data corresponding to the missing values ​​through the neural network model, and uses the imputation data to fill the missing values ​​in the well logging curves to obtain a complete well logging dataset, i.e., the first dataset. The sample equalization module is used to equalize the lithology classification samples in the first dataset to obtain a balanced logging dataset, i.e., the second dataset. The hyperparameter optimization module is used to optimize the hyperparameters of the classification model using the whale optimization algorithm to obtain the optimal hyperparameter configuration and configure the classification model. The lithology identification module is used to load the classification model with the target hyperparameter configuration, receive the second dataset, identify and output the lithology category.